feat: 订单加贡献值
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -1,65 +1,203 @@
|
||||
<template>
|
||||
<view class="order_sumbit_ok_warp">
|
||||
<Header leftTitle="" left-path-type="switchTab" left-path="/pages/mine/mine" />
|
||||
<view class="order_sumbit_ok_content_warp">
|
||||
<view class="ok_img">
|
||||
<up-image src="https://static.tbmall.xin/static/ok.png" width="120" height="120"
|
||||
bgColor="#f1f6ff00"></up-image>
|
||||
<view class="ok_img_msg">支付成功</view>
|
||||
</view>
|
||||
<view class="ok_but" @click="jumpHome">确认</view>
|
||||
</view>
|
||||
<qiaobao-assistant page-key="pages/order_package/order_submit_ok/order_submit_ok" title="订单状态与支付" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Header from '@/components/header.vue';
|
||||
|
||||
export default {
|
||||
components: { Header },
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
jumpHome() {
|
||||
uni.switchTab({
|
||||
url: '/pages/home/home',
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.order_sumbit_ok_warp {
|
||||
height: calc(100vh - 80rpx);
|
||||
text-align: center;
|
||||
|
||||
.order_sumbit_ok_content_warp {
|
||||
padding: 40rpx;
|
||||
}
|
||||
|
||||
.ok_img {
|
||||
display: grid;
|
||||
|
||||
.ok_img_msg {
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: $app-bt-bj;
|
||||
}
|
||||
}
|
||||
|
||||
.ok_but {
|
||||
margin-top: 100rpx;
|
||||
background: $app-bt-bj;
|
||||
border-radius: 16rpx;
|
||||
text-align: center;
|
||||
padding: 20rpx 0;
|
||||
height: 46rpx;
|
||||
color: #FFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="order_sumbit_ok_warp">
|
||||
<Header leftTitle="" left-path-type="switchTab" left-path="/pages/mine/mine" />
|
||||
<view class="order_sumbit_ok_content_warp">
|
||||
<!-- 支付成功图标与标题 -->
|
||||
<view class="success_header">
|
||||
<image class="success_icon_img" src="https://static.tbmall.xin/static/mine-purse/icon_arrow_black_3.png"
|
||||
mode="aspectFit"></image>
|
||||
<view class="success_title">支付成功</view>
|
||||
</view>
|
||||
|
||||
<!-- 贡献值卡片 -->
|
||||
<view class="contribution_card" v-if="expendNum">
|
||||
<view class="card_subtitle">本单预计获得</view>
|
||||
<view class="card_value_row">
|
||||
<image class="coin_icon" src="https://static.tbmall.xin/static/mine-purse/vcoin_1.png"
|
||||
mode="aspectFit"></image>
|
||||
<text class="value_num">{{ expendNum }}</text>
|
||||
<text class="value_unit">贡献值</text>
|
||||
</view>
|
||||
<view class="card_tips">退款或售后将按平台规则调整</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部确定按钮 -->
|
||||
<view class="bottom_btn_wrap">
|
||||
<view class="confirm_btn" @click="jumpHome">确定</view>
|
||||
</view>
|
||||
|
||||
<qiaobao-assistant page-key="pages/order_package/order_submit_ok/order_submit_ok" title="订单状态与支付" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Header from '@/components/header.vue';
|
||||
|
||||
export default {
|
||||
components: { Header },
|
||||
data() {
|
||||
return {
|
||||
expendNum: 0, // 贡献值字段
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options && options.expendNum !== undefined) {
|
||||
this.expendNum = options.expendNum;
|
||||
}
|
||||
// 获取临时缓存并更新 expendNum,获取完成后清空缓存
|
||||
const cache = uni.getStorageSync('order_submit_temp');
|
||||
if (cache !== '' && cache !== null && cache !== undefined) {
|
||||
let expendNum = 0;
|
||||
|
||||
if (typeof cache === 'object') {
|
||||
expendNum = cache.expendNum !== undefined
|
||||
? cache.expendNum
|
||||
: (cache.data?.expendNum !== undefined ? cache.data.expendNum : cache.data?.contribution);
|
||||
} else {
|
||||
expendNum = cache;
|
||||
}
|
||||
|
||||
if (expendNum !== undefined && expendNum !== null && expendNum !== '') {
|
||||
this.expendNum = expendNum;
|
||||
}
|
||||
uni.removeStorageSync('order_submit_temp');
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
jumpHome() {
|
||||
uni.switchTab({
|
||||
url: '/pages/home/home',
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.order_sumbit_ok_warp {
|
||||
min-height: 100vh;
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: calc(140rpx + env(safe-area-inset-bottom));
|
||||
|
||||
.order_sumbit_ok_content_warp {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 48rpx 36rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.success_header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.success_icon_img {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
.success_title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #111111;
|
||||
margin-top: 24rpx;
|
||||
line-height: 1.4;
|
||||
}
|
||||
}
|
||||
|
||||
.contribution_card {
|
||||
width: 100%;
|
||||
background: #f8f5fe;
|
||||
border-radius: 24rpx;
|
||||
padding: 40rpx 32rpx;
|
||||
margin-top: 56rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.card_subtitle {
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.card_value_row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 18rpx;
|
||||
|
||||
.coin_icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 10rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.value_num {
|
||||
font-size: 44rpx;
|
||||
font-weight: bold;
|
||||
color: #7934f6;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.value_unit {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #7934f6;
|
||||
margin-left: 4rpx;
|
||||
line-height: 1.2;
|
||||
}
|
||||
}
|
||||
|
||||
.card_tips {
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
margin-top: 24rpx;
|
||||
line-height: 1.4;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom_btn_wrap {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 20rpx 36rpx;
|
||||
padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
|
||||
background: #ffffff;
|
||||
box-sizing: border-box;
|
||||
z-index: 99;
|
||||
|
||||
.confirm_btn {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
background: #7934f6;
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: opacity 0.15s ease;
|
||||
|
||||
&:active {
|
||||
opacity: 0.85;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user