fix(custom): 修复积分支付成功不跳转

This commit is contained in:
2023-11-29 23:07:30 +08:00
parent 092366903a
commit 36cae90d74
2 changed files with 17 additions and 13 deletions

View File

@@ -111,9 +111,9 @@ const goPay = async (type: number) => {
OrderType: prop.OrderType, OrderType: prop.OrderType,
PayType: type, PayType: type,
}); });
if (data.data) {
// 1微信支付 2积分支付 // 1微信支付 2积分支付
if (type === 1) { if (type === 1) {
if (data.data) {
Taro.requestPayment({ Taro.requestPayment({
timeStamp: data.data.timeStamp, timeStamp: data.data.timeStamp,
nonceStr: data.data.nonceStr, nonceStr: data.data.nonceStr,
@@ -137,6 +137,13 @@ const goPay = async (type: number) => {
emit("closePay", false); emit("closePay", false);
}, },
}); });
} else {
Taro.showToast({
title: "未知异常",
icon: "none",
});
emit("closePay", false);
}
} else { } else {
Taro.showToast({ Taro.showToast({
title: "支付成功", title: "支付成功",
@@ -145,19 +152,12 @@ const goPay = async (type: number) => {
}); });
emit("successPay", false); emit("successPay", false);
} }
} else {
Taro.showToast({
title: "未知异常",
icon: "none",
});
emit("closePay", false);
}
} catch (e) { } catch (e) {
Taro.showToast({ Taro.showToast({
title: e.msg, title: e.msg,
icon: "none", icon: "none",
}); });
// emit("closePay", false); emit("closePay", false);
throw e; throw e;
} }
}; };

View File

@@ -147,7 +147,8 @@ const countInfo = ref<{
C?: number; C?: number;
D?: number; D?: number;
F?: number; F?: number;
Total?: number; ExchangeTotal?: number;
PriceTotal?: number;
}>({}); }>({});
const getTj = async () => { const getTj = async () => {
@@ -176,7 +177,10 @@ const getTj = async () => {
<view> <view>
<view style="font-weight: bold">订单信息</view> <view style="font-weight: bold">订单信息</view>
<view style="font-size: 15px" <view style="font-size: 15px"
>总消费积分{{ countInfo.Total || 0 }} >总消费积分{{ countInfo.ExchangeTotal || 0 }}
</view>
<view style="font-size: 15px"
>总消费金额{{ countInfo.PriceTotal || 0 }}
</view> </view>
</view> </view>
<image src="../static/user/order_list_top.png" /> <image src="../static/user/order_list_top.png" />