|
@@ -22,29 +22,29 @@
|
|
|
</FlexCol>
|
|
</FlexCol>
|
|
|
|
|
|
|
|
<FlexCol gap="gap.md">
|
|
<FlexCol gap="gap.md">
|
|
|
- <BoxMid
|
|
|
|
|
- direction="row"
|
|
|
|
|
- justify="space-between"
|
|
|
|
|
- align="center"
|
|
|
|
|
- gap="gap.md"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <BoxMid direction="row" justify="space-between" align="center" gap="gap.md">
|
|
|
<FlexCol width="74%">
|
|
<FlexCol width="74%">
|
|
|
<Text text="在线支付" fontConfig="lightImportantTitle" :fontSize="42" />
|
|
<Text text="在线支付" fontConfig="lightImportantTitle" :fontSize="42" />
|
|
|
<Text text="推荐使用微信线支付方式,方便快捷,立即生效" fontConfig="lightGoldTitle" :fontSize="30" />
|
|
<Text text="推荐使用微信线支付方式,方便快捷,立即生效" fontConfig="lightGoldTitle" :fontSize="30" />
|
|
|
</FlexCol>
|
|
</FlexCol>
|
|
|
- <FrameButton primary text="选择" @click="handleDirectPay(1)" />
|
|
|
|
|
|
|
+ <FrameButton primary text="选择" @click="handleDirectPay(1, 1)" />
|
|
|
</BoxMid>
|
|
</BoxMid>
|
|
|
- <BoxMid
|
|
|
|
|
- direction="row"
|
|
|
|
|
- justify="space-between"
|
|
|
|
|
- align="center"
|
|
|
|
|
- gap="gap.md"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <BoxMid direction="row" justify="space-between" align="center" gap="gap.md">
|
|
|
|
|
+ <FlexCol width="74%">
|
|
|
|
|
+ <FlexRow align="center" gap="gap.md">
|
|
|
|
|
+ <Icon icon="https://xy.wenlvti.net/app_static/images/village/IconFruit.png" size="40" />
|
|
|
|
|
+ <Text text="乡源果支付" fontConfig="lightImportantTitle" :fontSize="42" />
|
|
|
|
|
+ </FlexRow>
|
|
|
|
|
+ <Text :text="`余额 ${0} 乡源果`" fontConfig="lightGoldTitle" :fontSize="30" />
|
|
|
|
|
+ </FlexCol>
|
|
|
|
|
+ <FrameButton primary text="选择" @click="handleDirectPay(1, 3)" />
|
|
|
|
|
+ </BoxMid>
|
|
|
|
|
+ <BoxMid direction="row" justify="space-between" align="center" gap="gap.md">
|
|
|
<FlexCol width="74%">
|
|
<FlexCol width="74%">
|
|
|
<Text text="测试" fontConfig="lightImportantTitle" :fontSize="42" />
|
|
<Text text="测试" fontConfig="lightImportantTitle" :fontSize="42" />
|
|
|
<Text text="¥ 0.01" fontConfig="lightGoldTitle" :fontSize="30" />
|
|
<Text text="¥ 0.01" fontConfig="lightGoldTitle" :fontSize="30" />
|
|
|
</FlexCol>
|
|
</FlexCol>
|
|
|
- <FrameButton primary text="选择" @click="handleDirectPay(2)" />
|
|
|
|
|
|
|
+ <FrameButton primary text="选择" @click="handleDirectPay(2, 1)" />
|
|
|
</BoxMid>
|
|
</BoxMid>
|
|
|
</FlexCol>
|
|
</FlexCol>
|
|
|
</FlexCol>
|
|
</FlexCol>
|
|
@@ -68,6 +68,8 @@ import Text from '@/components/basic/Text.vue';
|
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
|
import OfficialApi from '@/api/light/OfficialApi';
|
|
import OfficialApi from '@/api/light/OfficialApi';
|
|
|
import UpgradeManagementSuccessDialog from './dialogs/UpgradeManagementSuccess.vue';
|
|
import UpgradeManagementSuccessDialog from './dialogs/UpgradeManagementSuccess.vue';
|
|
|
|
|
+import FlexRow from '@/components/layout/FlexRow.vue';
|
|
|
|
|
+import Icon from '@/components/basic/Icon.vue';
|
|
|
|
|
|
|
|
const upgradeManagementSuccessDialog = ref<InstanceType<typeof UpgradeManagementSuccessDialog>>();
|
|
const upgradeManagementSuccessDialog = ref<InstanceType<typeof UpgradeManagementSuccessDialog>>();
|
|
|
|
|
|
|
@@ -93,7 +95,7 @@ async function handleMyOrders() {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-async function handleDirectPay(levelType: number) {
|
|
|
|
|
|
|
+async function handleDirectPay(levelType: number, payType: 1 | 3) {
|
|
|
if (!requireLoginAsync('登录后为村社升级,做出你的贡献哦'))
|
|
if (!requireLoginAsync('登录后为村社升级,做出你的贡献哦'))
|
|
|
return;
|
|
return;
|
|
|
try {
|
|
try {
|
|
@@ -101,8 +103,11 @@ async function handleDirectPay(levelType: number) {
|
|
|
const { order: orderInfo, pay: payInfo } = await OfficialApi.upgradeStaff(
|
|
const { order: orderInfo, pay: payInfo } = await OfficialApi.upgradeStaff(
|
|
|
querys.value.villageId,
|
|
querys.value.villageId,
|
|
|
levelType,
|
|
levelType,
|
|
|
|
|
+ payType,
|
|
|
);
|
|
);
|
|
|
- if (payInfo) {
|
|
|
|
|
|
|
+ if (payType === 1) {
|
|
|
|
|
+ if (!payInfo)
|
|
|
|
|
+ throw new Error('支付信息不存在');
|
|
|
uni.requestPayment({
|
|
uni.requestPayment({
|
|
|
provider: 'wxpay',
|
|
provider: 'wxpay',
|
|
|
appId: payInfo.appId,
|
|
appId: payInfo.appId,
|
|
@@ -118,6 +123,8 @@ async function handleDirectPay(levelType: number) {
|
|
|
showError(`支付失败: ${err.errMsg}`);
|
|
showError(`支付失败: ${err.errMsg}`);
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
|
|
+ } else if (payType === 3) {
|
|
|
|
|
+ upgradeManagementSuccessDialog.value?.open();
|
|
|
}
|
|
}
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
showError(e);
|
|
showError(e);
|