小程序端页面调整

This commit is contained in:
2024-03-21 10:29:45 +08:00
parent ab338be7a9
commit 06b494b438
23 changed files with 1200 additions and 125 deletions

View File

@@ -9,11 +9,11 @@
<scroll-view class="gg-cart-sv-container" scroll-y="true">
<!-- 提货点 -->
<u-card :padding="10" :show-head="true">
<view slot="head" class="u-m-10">提货人联系方式</view>
<view slot="head" class="u-m-10">联系方式</view>
<view slot="body" class="u-m-10">
<view class="u-p-20">收货人员{{ order.receiverName }}</view>
<view class="u-p-20">姓名{{ order.receiverName }}</view>
<view class="u-p-20">联系方式{{ order.receiverPhone }}</view>
<view class="u-p-20">提货地点{{ order.receiverAddress }}</view>
<view class="u-p-20">地点{{ order.receiverAddress }}</view>
</view>
</u-card>
@@ -28,8 +28,11 @@
<view class="u-font-xl">{{ orderItem.skuName }}</view>
<view>单价{{ orderItem.skuPrice }}</view>
<view>数量{{ orderItem.skuNum }}</view>
<view v-if="orderItem.splitActivityAmount > 0">活动金额:{{ orderItem.splitActivityAmount }}</view>
<view v-if="orderItem.splitCouponAmount > 0">优惠券:{{ orderItem.splitCouponAmount }}</view>
<view v-if="orderItem.splitActivityAmount > 0">
活动金:{{ orderItem.splitActivityAmount }}
</view>
<view v-if="orderItem.splitCouponAmount > 0">优惠券额:{{ orderItem.splitCouponAmount }}
</view>
<view>
小计
<text class="u-type-error">{{ orderItem.splitTotalAmount }}</text>
@@ -69,7 +72,8 @@
<view class="gg-navigation">
<view class="navigation">
<view class="buy btn u-line-1" @click="payOrder">支付订单</view>
<view class="buy btn u-line-1" @click="payWxOrder">微信支付订单</view>
<view class="buy btn u-line-1" @click="payAliOrder">支付宝支付订单</view>
</view>
</view>
</view>
@@ -91,7 +95,9 @@ export default {
},
methods: {
async getOrderInfoById(orderId) {
const result = await this.$u.api.getOrderInfo({orderId});
const result = await this.$u.api.getOrderInfo({
orderId
});
this.order = result;
},
copyOrderNo() {
@@ -106,8 +112,10 @@ export default {
}
});
},
async payOrder() {
const result = await this.$u.api.getWxPayment({orderNo: this.order.orderNo});
async payWxOrder() {
const result = await this.$u.api.getWxPayment({
orderNo: this.order.orderNo
});
wx.requestPayment({
timeStamp: result.timeStamp,
nonceStr: result.nonceStr,
@@ -115,7 +123,9 @@ export default {
signType: 'MD5',
paySign: result.paySign,
success: res => {
this.$u.api.getOrderStatus({orderNo: this.order.orderNo});
this.$u.api.getOrderStatus({
orderNo: this.order.orderNo
});
uni.showToast({
title: '支付成功',
icon: 'none'
@@ -131,7 +141,46 @@ export default {
});
}
});
},
async payAliOrder() {
try {
const result = await this.$u.api.getAliPayment({
orderNo: this.order.orderNo
});
my.tradePay({
tradeNO: result.tradeNO,
success: res => {
if (res.resultCode === '9000') {
this.$u.api.getOrderStatus({
orderNo: this.order.orderNo
});
uni.showToast({
title: '支付成功',
icon: 'none'
});
uni.switchTab({
url: '/pages/index/index'
});
} else {
throw new Error('支付失败');
}
},
fail: err => {
uni.showToast({
icon: 'none',
title: err.errorMessage || '支付失败'
});
}
});
} catch (error) {
uni.showToast({
icon: 'none',
title: error.message || '支付失败'
});
}
}
},
mounted() {
this.getOrderInfoById(this.orderId);