fix(custom):
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-05-27 17:48:20 +08:00
parent 0816707bdd
commit e6173319d9
11 changed files with 243 additions and 100 deletions

View File

@@ -4,13 +4,9 @@
>交易剩余时间{{ tStr }}
</view>
<view class="flex items-center mt-5 mb-5">
<nut-price :price="orderData.price" size="large" />
<nut-price :price="a" size="large" />
<view class="line"></view>
<nut-price
position="after"
symbol="积分"
:price="orderData.exchange"
size="large" />
<nut-price position="after" symbol="积分" :price="b" size="large" />
</view>
<nut-radio-group class="w-[95%]" v-model="payVal">
<nut-cell-group class="w-full">
@@ -132,12 +128,15 @@ const visible2 = ref(false);
const opt = ref<any>({});
Taro.useLoad(e => {
const {oid, bid} = e;
const {oid, bid, OrderType} = e;
opt.value = e;
getData(oid, bid);
getData(oid, bid, OrderType);
});
const getData = async (oid: string, bid: string) => {
const a = ref(0);
const b = ref(0);
const getData = async (oid: string, bid: string, OrderType: number) => {
const user_info = Taro.getStorageSync('userInfo');
const data = await getUserPoint({
phone: user_info.data.phone,
@@ -145,12 +144,26 @@ const getData = async (oid: string, bid: string) => {
});
const res = await getActiveOrderDetail({
oid,
OrderType: Number(OrderType),
});
// let a = 0;
// let b = 0;
orderData.value = {
...res.data.data,
...res.data.data[0],
...data.data,
};
a.value = 0;
b.value = 0;
res.data.data.forEach(item => {
a.value += item.price;
b.value += item.exchange;
});
console.log(orderData.value);
if (!orderData.value.oid)
return Taro.showToast({
title: '未获取到订单信息~',
@@ -201,8 +214,9 @@ const shortComplete = async value => {
const confirmPay = async () => {
try {
const res = await payOrder({
// oid: opt.value.oid.map(item => item.oid),
oid: opt.value.oid,
OrderType: orderData.value.pay_type,
OrderType: payVal.value,
PayType: payVal.value,
});
switch (payVal.value) {
@@ -227,8 +241,11 @@ const confirmPay = async () => {
});
},
complete: function () {
// Taro.redirectTo({
// url: `/pages/users/order_list_detail/index?orderId=${opt.value.oid}&OrderType=1`,
// });
Taro.redirectTo({
url: `/pages/users/order_list_detail/index?orderId=${opt.value.oid}`,
url: `/pages/users/order_list/index?type=0`,
});
},
});
@@ -245,8 +262,11 @@ const confirmPay = async () => {
icon: 'none',
});
setTimeout(() => {
// Taro.redirectTo({
// url: `/pages/users/order_list_detail/index?orderId=${opt.value.oid}&OrderType=1`,
// });
Taro.redirectTo({
url: `/pages/users/order_list_detail/index?orderId=${opt.value.oid}`,
url: `/pages/users/order_list/index?type=0`,
});
}, 2000);
break;