Browse Source

支付页

master
tianyi 4 weeks ago
parent
commit
7144fcb89c
  1. 79
      package1/buyFood/buyFood.vue

79
package1/buyFood/buyFood.vue

@ -221,6 +221,41 @@
<img v-if="warnPopup == 'psy'" @tap="$refs.warnPopup.close()" src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/e10ad77ca478413a9c53918750ecb932.png" alt="指定配送员" style="width:300px;height:370px;" />
</view>
</uni-popup>
<!-- 支付弹出层 -->
<uni-popup ref="payPopup" background-color="#fff">
<view class="pay-popup">
<view class="content">
<view class="box1">
<view style="height: 35px;line-height: 35px;text-align: center;">
支付剩余时间 59:09
</view>
<view style="height: 45px;line-height: 45px;text-align: center;font-weight: 700;font-size: 15px;">
<text style="font-size: 30px;">449.96</text>
</view>
<view style="height: 20px;text-align: center;color: red;">
若拼团失败将会为您自动退款
</view>
</view>
<view class="box1" style="display: flex;padding: 20px;">
<view style="flex: 1;">
<view style="height: 21px;line-height: 21px;display: flex;">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/4c8e0cc311db4d38ab43e019673c4b8c.png" alt="" style="width: 21px;height: 21px;margin-right: 10px;" />
<text style="font-size: 15px;font-weight: 700;">微信支付</text>
</view>
<view style="text-align: right;margin-left: 30px;color: #777;width: 73px;">
使用微信支付
</view>
</view>
<view style="width: 18px;padding-top: 10px;">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/02bff7edc4e04caaa1868955ff684f1f.png" alt="" style="width: 18px;height: 18px;" />
</view>
</view>
<view class="btn" @tap="wxPayment">
确认付款
</view>
</view>
</view>
</uni-popup>
<delivery-time-op @timeCallback="timeCallback" :dodge="true" ref='model'
:content="content" :barHidth='600' title="选择送达时间">
> </delivery-time-op>
@ -376,6 +411,7 @@
return arr.join(',');
},
submitPay(){
this.$refs.payPopup.open('bottom');
if(this.isPaotui && !this.formData.address) {
this.warnPopup = 'shdz';
this.$refs.warnPopup.open();
@ -495,6 +531,35 @@
this.assignedWorker = null;
}
},
//
wxPayment() {
let that = this;
this.tui.request("/api/wechat/pay/unified-order", "POST", {
openid: uni.getStorageSync('miniProgramOpenid'),
amount: 1, //
description: '拼团订单',
outTradeNo: 'ORDER_' + Date.now()
}, false, false).then((res) => {
if (res.code == 200) {
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.timeStamp,
nonceStr: res.nonceStr,
package: res.package,
signType: res.signType,
paySign: res.paySign,
success: function(res2) {
console.log('success:' + JSON.stringify(res2));
},
fail: function(err) {
console.log('fail:' + JSON.stringify(err));
}
});
} else {
this.tui.toast(res.message)
}
})
},
//
generateDeliveryTimes() {
const now = new Date();
@ -743,6 +808,17 @@
border-radius: 50px;
margin: 10px auto;
}
.btn {
width: 95%;
height: 50px;
font-size: 16px;
font-weight: 700;
background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));
border-radius: 50px;
line-height: 50px;
text-align: center;
margin: 20px auto 0;
}
.ziqu-box{
background: #eee;
width: 90%;
@ -801,4 +877,7 @@
padding: 10px;
overflow: scroll;
}
.vue-ref{
border-radius: 10px !important;
}
</style>

Loading…
Cancel
Save