浏览代码

修复bug

chenxiong 3 年之前
父节点
当前提交
ed5e7f2a1d
共有 3 个文件被更改,包括 35 次插入5 次删除
  1. 1 1
      pages/shopping/shoppingCart.vue
  2. 10 2
      pages2/order/confirm_list.vue
  3. 24 2
      pages2/order/confirm_pay.vue

+ 1 - 1
pages/shopping/shoppingCart.vue

@@ -438,7 +438,7 @@ export default {
 				}
 			}
 			this.$store.commit('setShoppingCartList', { shoppingCartList: checkGoodsList });
-			this.$navTo.togo('/pages2/order/confirm_pay');
+			this.$navTo.togo('/pages2/order/confirm_pay?fromCart=true');
 		},
 		checkboxChange(n) {
 			console.log('change', n);

+ 10 - 2
pages2/order/confirm_list.vue

@@ -147,6 +147,7 @@ export default {
 				applyAreasJson:null,
 				examDateJson:null
 			},
+			fromCart:'',
 			isBK:'',//是不是补考商品
 		};
 	},
@@ -155,6 +156,10 @@ export default {
 	onLoad(option) {
 		this.id = option.id;
 		this.isBK = option.isBK
+		if(option.fromCart) {
+			this.fromCart = option.fromCart
+		}
+		
 		this.getDetail()
 	},
 	onShow() {
@@ -332,10 +337,13 @@ export default {
 			this.$store.commit('setShoppingCartList', {shoppingCartList  :checkGoodsList});
 			if(this.isBK == '1'){
 				this.$navTo.togo('/pages2/order/confirm_pay',{
-					isBK : '1'
+					isBK : '1',
+					fromCart:this.fromCart
 				});
 			}else{
-				this.$navTo.togo('/pages2/order/confirm_pay');
+				this.$navTo.togo('/pages2/order/confirm_pay',{
+					fromCart:this.fromCart
+				});
 			}
 		},
 		getDetail() {

+ 24 - 2
pages2/order/confirm_pay.vue

@@ -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;
 				}
 			});