订单逻辑修改,支付宝兼容

This commit is contained in:
GaoHao
2024-09-27 10:12:32 +08:00
parent 1e420a9c2a
commit a77a7ab716
7 changed files with 103 additions and 45 deletions

View File

@@ -6,7 +6,7 @@
<u-radio-group v-model="radiovalue" iconPlacement="right" @change="groupChange" :size="28"
placement="column">
<block v-for="(item,index) in paymentMethodList" :key="index">
<view class="method_list" @click="groupChange(index+1)">
<view class="method_list" @click="groupChange(item.type,item.name)">
<view class="method_list_top">
<view class="method_list_top_left">
<image class="icon" :src="item.url" mode="aspectFill"/>
@@ -18,7 +18,7 @@
</view>
</view>
</view>
<u-radio activeColor="#E8AD7B" icon-size="36" size="36" :name="index+1">
<u-radio activeColor="#E8AD7B" icon-size="36" size="36" :name="item.type">
</u-radio>
</view>
@@ -36,12 +36,12 @@
data() {
return {
paymentMethodList:[
{ name: "余额支付", type: "1", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"},
{ name: "余额支付", type: 1, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"},
// #ifdef MP-WEIXIN
{ name: "微信支付", type: "2", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"},
{ name: "微信支付", type: 2, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"},
// #endif
// #ifdef MP-ALIPAY
{ name: "支付宝支付", type: "3", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png"},
{ name: "支付宝支付", type: 3, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png"},
// #endif
],
radiovalue: 1, // 支付方式
@@ -61,11 +61,11 @@
methods: {
/**
* 监听支付方式切换
* @param {Object} n
* @param {Object}
*/
groupChange(n) {
this.radiovalue = n;
this.$emit("groupChange",n)
groupChange(type,name) {
this.radiovalue = type;
this.$emit("groupChange",{type:type ,name:name })
},