|
@@ -157,9 +157,14 @@
|
|
|
<br>
|
|
|
|
|
|
</view>
|
|
|
+
|
|
|
+ <view v-if="selection_card.discount">
|
|
|
+ <text class="text-sm text-gray">折扣 {{ selection_card.discount }}</text>
|
|
|
+ <br>
|
|
|
+ </view>
|
|
|
<view class="order_price_container">
|
|
|
<text class="text-sm text-gray">实付(元) </text>
|
|
|
- <text class="mine_min">{{ selection_card.price }}</text>
|
|
|
+ <text class="mine_min">{{ selection_card.price * selection_card.discount }}</text>
|
|
|
</view>
|
|
|
<button class="cu-btn bg-primary lg text-white recharge_button" @click="success_pay">立即充值</button>
|
|
|
</div>
|
|
@@ -198,7 +203,7 @@
|
|
|
<div class="button_group flex justify-around">
|
|
|
<!-- <button class="cu-btn bg-gray text-white lg" @click="close_success_pop">以后再填</button>-->
|
|
|
<!-- <button class="cu-btn bg-primary text-white lg" @click="to_write_address">填写地址</button>-->
|
|
|
- <button class="cu-btn bg-primary text-white lg" @click="to_index">充值成功</button>
|
|
|
+ <button class="cu-btn bg-primary text-white lg" @click="to_orderlist">充值成功</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</van-popup>
|
|
@@ -228,7 +233,9 @@ export default {
|
|
|
//用户信息
|
|
|
userinfo: {},
|
|
|
// 选中的充值卡
|
|
|
- selection_card: {}
|
|
|
+ selection_card: {},
|
|
|
+ //支付信息
|
|
|
+ payment_info: {}
|
|
|
}
|
|
|
},
|
|
|
watch: {},
|
|
@@ -260,10 +267,31 @@ export default {
|
|
|
},
|
|
|
//再次付款
|
|
|
repay() {
|
|
|
-
|
|
|
+ let $payment = $this.payment_info
|
|
|
+ wx.requestPayment({
|
|
|
+ timeStamp: $payment.timeStamp,
|
|
|
+ nonceStr: $payment.nonceStr,
|
|
|
+ package: $payment.package,
|
|
|
+ signType: $payment.signType,
|
|
|
+ paySign: $payment.sign,
|
|
|
+ success(res) {
|
|
|
+ //支付成功
|
|
|
+ console.log('success', res)
|
|
|
+ //关闭确认订单窗口
|
|
|
+ $this.close_order_confirm()
|
|
|
+ $this.close_success_pop()
|
|
|
+ //打开成功充值窗口
|
|
|
+ $this.open_success_window()
|
|
|
+ },
|
|
|
+ fail(res) {
|
|
|
+ console.log('fail', res)
|
|
|
+ $this.close_order_confirm()
|
|
|
+ $this.err_show = true
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
to_index() {
|
|
|
- mpvue.navigateTo({
|
|
|
+ mpvue.reLaunch({
|
|
|
url: "/pages/index/main"
|
|
|
})
|
|
|
},
|
|
@@ -275,29 +303,35 @@ export default {
|
|
|
buy_num: 1
|
|
|
}
|
|
|
createOrder($params).then((res) => {
|
|
|
- let $data = res.data
|
|
|
- let $payment = $data.data
|
|
|
- wx.requestPayment({
|
|
|
- timeStamp: $payment.timeStamp,
|
|
|
- nonceStr: $payment.nonceStr,
|
|
|
- package: $payment.package,
|
|
|
- signType: $payment.signType,
|
|
|
- paySign: $payment.sign,
|
|
|
- success(res) {
|
|
|
- //支付成功
|
|
|
- console.log('success', res)
|
|
|
- //关闭确认订单窗口
|
|
|
- $this.close_order_confirm()
|
|
|
- //打开成功充值窗口
|
|
|
- $this.open_success_window()
|
|
|
- },
|
|
|
- fail(res) {
|
|
|
- console.log('fail', res)
|
|
|
- $this.close_order_confirm()
|
|
|
- $this.err_show = true
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
+ let $data = res.data
|
|
|
+ let $payment = $data.data
|
|
|
+ $this.payment_info = $payment
|
|
|
+ wx.requestPayment({
|
|
|
+ timeStamp: $payment.timeStamp,
|
|
|
+ nonceStr: $payment.nonceStr,
|
|
|
+ package: $payment.package,
|
|
|
+ signType: $payment.signType,
|
|
|
+ paySign: $payment.sign,
|
|
|
+ success(res) {
|
|
|
+ //支付成功
|
|
|
+ console.log('success', res)
|
|
|
+ //关闭确认订单窗口
|
|
|
+ $this.close_order_confirm()
|
|
|
+ $this.close_success_pop()
|
|
|
+ //打开成功充值窗口
|
|
|
+ $this.open_success_window()
|
|
|
+ },
|
|
|
+ fail(res) {
|
|
|
+ console.log('fail', res)
|
|
|
+ $this.close_order_confirm()
|
|
|
+ $this.err_show = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log(err)
|
|
|
+ }
|
|
|
+ )
|
|
|
// 接收回调方法后弹出支付成功
|
|
|
},
|
|
|
//跳转填写地址
|
|
@@ -323,9 +357,9 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- to_orderlist(){
|
|
|
+ to_orderlist() {
|
|
|
mpvue.navigateTo({
|
|
|
- url:"/pages/user_center/orders/main"
|
|
|
+ url: "/pages/user_center/orders/main"
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -338,6 +372,9 @@ export default {
|
|
|
$this = this;
|
|
|
},
|
|
|
onLoad() {
|
|
|
+ },
|
|
|
+ onUnload() {
|
|
|
+ $this.close_success_pop()
|
|
|
}
|
|
|
}
|
|
|
</script>
|