|
@@ -24,7 +24,7 @@
|
|
|
取货码
|
|
|
</view>
|
|
|
<view class="w3">
|
|
|
- <button v-if="orderDetail.orderState == 1">
|
|
|
+ <button v-if="orderDetail.orderState == 1" @click="goPay(orderDetail)">
|
|
|
去支付
|
|
|
</button>
|
|
|
<button v-if="orderDetail.orderState == 2">
|
|
@@ -246,6 +246,10 @@
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
+
|
|
|
+ <payment :payMode="payMode" :pay_close="pay_close" @onChangeFun="onChangeFun" :order_id="pay_order_id"
|
|
|
+ :totalPrice="totalPrice"></payment>
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -279,6 +283,17 @@ export default {
|
|
|
mixins: [colors],
|
|
|
data () {
|
|
|
return {
|
|
|
+ pay_orderId: '',
|
|
|
+ totalPrice: '0',
|
|
|
+ pay_order_id: '',
|
|
|
+ pay_close: false,
|
|
|
+ payMode: [{
|
|
|
+ name: this.$t(`微信支付`),
|
|
|
+ icon: 'icon-weixinzhifu',
|
|
|
+ value: 'weixin',
|
|
|
+ title: this.$t(`使用微信快捷支付`),
|
|
|
+ payStatus: true
|
|
|
+ }],
|
|
|
selfTakeShow: false,
|
|
|
RefundShow: false,
|
|
|
confirm: '', //自定义留言
|
|
@@ -289,7 +304,8 @@ export default {
|
|
|
canvasStatus: false,
|
|
|
newImg: [],
|
|
|
orderDetail: {},
|
|
|
- selfTakeList: []
|
|
|
+ selfTakeList: [],
|
|
|
+ orderId:''
|
|
|
}
|
|
|
},
|
|
|
computed: mapGetters(['isLogin']),
|
|
@@ -304,8 +320,8 @@ export default {
|
|
|
onLoad (options) {
|
|
|
this.from = 'routine'
|
|
|
console.log(options);
|
|
|
- let orderId = options.orderId;
|
|
|
- this.getOrderDetail(orderId)
|
|
|
+ this.orderId = options.orderId;
|
|
|
+ this.getOrderDetail(this.orderId )
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
@@ -321,6 +337,49 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 打开支付组件
|
|
|
+ *
|
|
|
+ */
|
|
|
+ goPay: function (item) {
|
|
|
+ this.$set(this, 'pay_close', true);
|
|
|
+ this.$set(this, 'pay_order_id', item.orderNo);
|
|
|
+ this.$set(this, 'pay_orderId', item.orderId);
|
|
|
+ this.$set(this, 'totalPrice', item.paymentAmount);
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 支付成功回调
|
|
|
+ *
|
|
|
+ */
|
|
|
+ pay_complete: function () {
|
|
|
+ console.log("+++++++++++++++++++++支付成功回调++++++++++++++++++++++++++++++")
|
|
|
+ this.pay_close = false;
|
|
|
+ this.pay_order_id = '';
|
|
|
+ this.pay_orderId = '';
|
|
|
+ this.getOrderDetail(this.orderId)
|
|
|
+ uni.$u.toast("支付成功")
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 支付失败回调
|
|
|
+ *
|
|
|
+ */
|
|
|
+ pay_fail: function () {
|
|
|
+ console.log("+++++++++++++++++++++支付失败回调++++++++++++++++++++++++++++++")
|
|
|
+ this.pay_close = false;
|
|
|
+ this.pay_order_id = '';
|
|
|
+ this.pay_orderId = '';
|
|
|
+ uni.$u.toast("支付失败")
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 事件回调
|
|
|
+ *
|
|
|
+ */
|
|
|
+ onChangeFun: function (e) {
|
|
|
+ console.log(e)
|
|
|
+ this.pay_close = false;
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
clickSelfTake(item){
|
|
|
this.selfTakeShow =false;
|