feat: 订单加贡献值

This commit is contained in:
2026-09-11 19:13:31 +08:00
parent 75bbbf9089
commit 9b09d6469d
9 changed files with 808 additions and 364 deletions
@@ -60,7 +60,7 @@
<view class="content_right_total">
<view>¥<text style="font-size: 36rpx">{{
pItem.totalPrice
}}</text></view>
}}</text></view>
<view>每件到手价¥{{ pItem.unitPrice }}</view>
</view>
<view class="shopping_info_quantity">
@@ -84,7 +84,7 @@
<view class="content_right_total">
<view>¥<text style="font-size: 36rpx">{{
pItem.totalPrice
}}</text></view>
}}</text></view>
<view>每件到手价¥{{ pItem.unitPrice }}</view>
</view>
<view class="shopping_info_quantity">
@@ -108,7 +108,7 @@
<view class="order_freight_item">
<view>运费<text style="color: #c0c3c6; margin-left: 20rpx">{{
getValue(PRODUCT_DELIVERY_TIME, addItem.deliveryTime)
}}</text></view>
}}</text></view>
<view class="value_">
{{ orderInfo.postage ? "¥" + orderInfo.postage : "包邮" }}
</view>
@@ -207,6 +207,17 @@
</view>
</view>
<view class="order_way_warp_two">
<view class="price-view">
<text class="text-32 text-zu">预估获得贡献值</text>
<text class="text-32 text-zu text-bold">
<image class="uni-image" src="https://static.tbmall.xin/static/mine-purse/vcoin_1.png"></image>{{
orderInfo.expendNum
}}
</text>
</view>
</view>
<view class="order_way_warp_two">
<text class="text-32 text-zu">支付方式</text>
<up-radio-group v-model="orderInfo.paymentMethod" placement="column">
@@ -1069,13 +1080,20 @@ export default {
if (this.selectedCoupon) {
params["couponUserId"] = this.getCouponUserId(this.selectedCoupon);
}
console.log("秦星星----2", params);
resp = await settle(params);
}
console.log("getWayOption", resp);
// 提交订单成功,就唤起支付
// 临时缓存订单提交结果(写入前先清空)
uni.removeStorageSync("order_submit_temp");
if (resp) {
uni.setStorageSync("order_submit_temp", {
expendNum:
resp?.data?.expendNum || 0
});
}
if (resp && resp.bizcode === 100) {
console.log("提交订单成功", resp.data);
const item = resp.data;
@@ -1086,13 +1104,13 @@ export default {
if (item.douyin) {
await appDypayFun(item);
} else if (item.wechat && Object.keys(item.wechat).length !== 0) {
this.appWxpay(item.wechat, item.orderId, item.orderNum);
this.appWxpay(item.wechat, item.orderId, item.orderNum, item);
} else if (
item.alipay &&
Object.keys(item.alipay).length !== 0 &&
item.alipay
) {
this.zfbPay(item.alipay, item.orderId, item.orderNum);
this.zfbPay(item.alipay, item.orderId, item.orderNum, item);
} else {
this.$refs.uToastRef.show({
type: "error",
@@ -1110,9 +1128,9 @@ export default {
} finally { this._paySubmitting = false; }
},
// app 微信支付
async appWxpay(alipay, orderId, orderNum) {
async appWxpay(alipay, orderId, orderNum, item) {
try {
const result = await appWxpayFun(alipay, orderId, orderNum);
const result = await appWxpayFun(alipay, orderId, orderNum, item);
console.log("支付成功", result);
// 处理支付成功后的逻辑,如更新订单状态等
} catch (error) {
@@ -1121,9 +1139,9 @@ export default {
}
},
// 支付宝支付
async zfbPay(alipay, orderId, orderNum) {
async zfbPay(alipay, orderId, orderNum, item) {
try {
const result = await zfbPayFun(alipay, orderId, orderNum);
const result = await zfbPayFun(alipay, orderId, orderNum, item);
console.log("支付成功", result);
// 处理支付成功后的逻辑,如更新订单状态等
} catch (error) {
@@ -1321,6 +1339,13 @@ export default {
padding: 4rpx 12rpx;
margin-right: 8rpx;
}
.uni-image {
width: 36rpx;
height: 36rpx;
margin-right: 10rpx;
vertical-align: middle;
}
}
.way-option {