|
@@ -44,7 +44,7 @@
|
|
|
</view>
|
|
|
<button class="bottomBtn" @click="pay()" :disabled="btnNo">确认支付</button>
|
|
|
|
|
|
- <u-modal v-model="showModal" confirm-text="返回购物车" cancel-text="知道了" cancel-color="#666666" confirm-color="rgba(0, 122, 255, 1);" :show-confirm-button="true" :show-cancel-button="true" :content="modalMsg" @cancel="modalCancel()" @confirm="modalConfirm()" ref="uModal" ></u-modal>
|
|
|
+ <u-modal v-model="showModal" confirm-text="返回购物车" cancel-text="知道了" cancel-color="#666666" confirm-color="rgba(0, 122, 255, 1);" :show-confirm-button="showConfirmButton" :show-cancel-button="true" :content="modalMsg" @cancel="modalCancel()" @confirm="modalConfirm()" ref="uModal" ></u-modal>
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
@@ -74,6 +74,9 @@ export default {
|
|
|
value:'wepay',
|
|
|
btnNo:false,
|
|
|
isBK:'',
|
|
|
+ fromCart:'',
|
|
|
+ hasPaying:false,
|
|
|
+ showConfirmButton:false,
|
|
|
totalPrice:0
|
|
|
};
|
|
|
},
|
|
@@ -81,6 +84,7 @@ export default {
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
let self = this
|
|
|
+ this.fromCart = option.fromCart;
|
|
|
console.log(self.shoppingCartList,6)
|
|
|
let list = self.shoppingCartList
|
|
|
this.isBK = option.isBK
|
|
@@ -143,9 +147,27 @@ export default {
|
|
|
console.log('fail:' + JSON.stringify(err));
|
|
|
}
|
|
|
});
|
|
|
- }else{
|
|
|
+ }else if(res.data.code == 510){ //有未支付订单
|
|
|
+ self.hasPaying = true;
|
|
|
self.btnNo = false
|
|
|
this.modalMsg = res.data.msg;
|
|
|
+ this.showConfirmButton = true;
|
|
|
+ this.confirmText = "跳转到【我的订单】\n查看未支付订单";
|
|
|
+ } else if(res.data.code == 511) { //511 重复购买
|
|
|
+ self.btnNo = false
|
|
|
+ this.modalMsg = res.data.msg;
|
|
|
+ this.showConfirmButton = true;
|
|
|
+
|
|
|
+ if(this.fromCart) {
|
|
|
+ this.confirmText = "返回购物车";
|
|
|
+ } else {
|
|
|
+ this.confirmText = "继续选课";
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ self.btnNo = false
|
|
|
+ this.showConfirmButton = false;
|
|
|
+ this.modalMsg = res.data.msg;
|
|
|
this.showModal = true;
|
|
|
}
|
|
|
});
|