feat: 支付完成

This commit is contained in:
zc 2025-12-08 00:09:59 +08:00
parent f7f14e59cb
commit ca7506f903
5 changed files with 15 additions and 7 deletions

View File

@ -923,7 +923,7 @@
if (that.amountType === 0) {
return n.toFixed(2);
} else {
return (n / 100).toFixed(2);
return (n).toFixed(2);
}
},
pushGoodsCache(goodsInfo) {

View File

@ -3,10 +3,10 @@
<!-- 订单信息 -->
<view class="order-info">
<!-- 支付剩余时间 -->
<view v-if="order.showExpiration" class="order-countdown">
<!-- <view v-if="order.showExpiration" class="order-countdown">
<text class="m-r-6">剩余时间</text>
<count-down :date="order.expirationTime" separator="zh" theme="text" textColor="#666666" customNumColor="#666666" />
</view>
</view> -->
<!-- 付款金额 -->
<view class="order-amount">
<text class="unit"></text>

View File

@ -361,8 +361,16 @@ import storage from '@/utils/storage'
app.showToast(result.message, 1500)
setTimeout(() => app.$goPageByToken('pages/order/index', {}, 'redirectTo'), 1500)
} else {
// :
setTimeout(() => app.$goPageByToken('pages/checkout/cashier/index', res.data, 'redirectTo'), 100)
uni.requestPayment({
...res.data,
success: (res) => {
setTimeout(() => app.$goPageByToken('pages/order/index', {}, 'redirectTo'), 1500)
resolve(res);
},
fail: (err) => {
reject(err);
},
});
}
}).finally(() => setTimeout(() => app.disabled = false, 1600))
},

View File

@ -80,7 +80,7 @@
goods_id: id,
goods_name: title,
image: item.imageUrl ? item.imageUrl : mainImageUrl,
price: item.promotionPrice * 100,
price: item.promotionPrice,
stock: item.stock,
spec_value_ids: item.vvSkuPropertyValueList.map(item => item.id).join('_'),
sku_name_arr: item.vvSkuPropertyValueList.map(item => item.productPropertyValue)

View File

@ -47,7 +47,7 @@ export default {
app.items = await this.handleGetHomeData().finally(() => callback && callback());
},
async handleGetHomeData() {
const res = await apiGetCommodityList({});
const res = await apiGetCommodityList({ page: 1, pageSize: 1000 });
return mockData.map(item => {
if (item.type === 'goods') {
item.data = res.data.rows