This commit is contained in:
Gdpao
2020-08-03 19:51:05 +08:00
parent 51cd6f8261
commit 38f92c6766
6 changed files with 113 additions and 32 deletions

View File

@@ -253,8 +253,10 @@ export default {
type: 'redirect',
url: '/pageC/cart/cashier',
params: {
ifcart: params.ifcart,
pay_sn: res.data.pay_sn,
price: res.data.order_total_amount,
order_id: res.data.order_list[0].order_id,
}
})
} else {

View File

@@ -11,8 +11,8 @@
<image :src="item.icon"></image>
<text class="name">{{ item.pay_way }}</text>
</view>
<view class="radio-view" :class="pay_way == item.name ? 'active' : 'default'">
<u-radio :name="item.name" active-color="#FF780F" :disabled="item.disabled"></u-radio>
<view class="" :class="pay_way == item.name ? 'active' : 'default'">
<u-radio class="radio-view" shape="circle" :name="item.name" active-color="#FF780F" :disabled="item.disabled"></u-radio>
</view>
</view>
</u-radio-group>
@@ -39,13 +39,18 @@ export default {
}
],
pay_way: 'wxpay_app',
pay_sn: '',
price: '',
pay_sn: '',
ifcart: '',
order_id: '',
}
},
onLoad(option) {
this.pay_sn = option.pay_sn;
console.log(option);
this.ifcart = option.ifcart;
this.price = option.price;
this.pay_sn = option.pay_sn;
this.order_id = option.order_id;
},
methods: {
radioGroupChange(e) {
@@ -55,14 +60,43 @@ export default {
// uni.getProvider({service: 'payment'})
// },
payOrder(provider, orderInfo) {
let me = this;
uni.requestPayment({
provider: provider,
orderInfo: orderInfo, //订单数据
success: function (res) {
success: (res) => {
console.log('success:' + JSON.stringify(res));
this.$u.toast("支付成功!");
setTimeout(function(){
if (Boolean(parseInt(me.ifcart))) {
me.$u.route({
type: 'redirect',
url: '/pageE/order/Index',
})
} else {
me.$u.route({
type: 'redirect',
url: '/pageE/order/Details?oid=' + me.order_id,
})
}
},2000)
},
fail: function (err) {
fail: (err) => {
console.log('fail:' + JSON.stringify(err));
this.$u.toast("支付失败,支付已取消!");
setTimeout(function(){
if (Boolean(parseInt(me.ifcart))) {
me.$u.route({
type: 'redirect',
url: '/pageE/order/Index',
})
} else {
me.$u.route({
type: 'redirect',
url: '/pageE/order/Details?oid=' + me.order_id,
})
}
},2000)
}
});
},
@@ -115,15 +149,18 @@ export default {
/deep/ .u-radio-group {
width: 100%;
flex-direction: column;
.u-radio__icon-wrap {
width: 30rpx !important;
height: 30rpx !important;
padding: 4rpx;
border: 1px solid #FF780F;
}
.active {
}
.default {
}
.radio-view {
padding: 6rpx;
border-radius: 50%;
}
.active {
border: 2rpx solid rgba(255,120,15,1);
}
.default {
border: 2rpx solid rgba(219,219,219,1);
}
.u-radio {
.u-icon {
@@ -135,13 +172,13 @@ export default {
}
}
.pay-item {
height: 98rpx;
background: rgba(255,255,255,1);
padding: 24rpx 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
height: 98rpx;
padding: 24rpx 30rpx;
margin-bottom: 2rpx;
background: rgba(255,255,255,1);
.pay-way {
display: flex;
align-items: center;