瀏覽代碼

bug 修复

lilei 4 年之前
父節點
當前提交
3741095300
共有 4 個文件被更改,包括 50 次插入16 次删除
  1. 7 0
      pages/cart/cart.vue
  2. 15 6
      pages/goods/goodsDetail.vue
  3. 18 9
      pages/index/index.vue
  4. 10 1
      pages/order/order.vue

+ 7 - 0
pages/cart/cart.vue

@@ -334,6 +334,13 @@
 			},
 			// 立即下单
 			toOrder(){
+				if(this.userData.state == 0){
+					uni.showToast({
+						icon:"none",
+						title:"账户已被禁用,无法使用乐豆"
+					})
+					return
+				}
 				let goods = this.getCheckGoods(1)
 				console.log(goods)
 				if(this.userData.currentGold >= this.totalPrice){

+ 15 - 6
pages/goods/goodsDetail.vue

@@ -83,11 +83,13 @@
 				goodContent: null,
 				goldLimit: 0,
 				dragPic: '/static/cart.png',  //  购物车图标
+				userData: null
 			};
 		},
 		onLoad(opts) {
 			console.log(opts)
 			this.id = opts.id
+			this.userData = this.$store.state.vuex_userData
 			this.getDetail()
 		},
 		methods: {
@@ -142,15 +144,22 @@
 			// 立即下单
 			toOrder(){
 				// console.log(this.goodContent,this.id,'pppppppp')
-				if(this.goodContent.sellGold * this.nums >= this.goldLimit){
-					this.$u.vuex("vuex_toOrderList",[{id:this.id,buyQty:this.nums,goodsNo:this.goodContent.goodsNo,goods:this.goodContent}])
-					uni.redirectTo({
-						url:"/pages/toOrder/index?orderForm=ORDER_NOW"
-					})
+				if(this.userData.state == 1){
+					if(this.goodContent.sellGold * this.nums >= this.goldLimit){
+						this.$u.vuex("vuex_toOrderList",[{id:this.id,buyQty:this.nums,goodsNo:this.goodContent.goodsNo,goods:this.goodContent}])
+						uni.redirectTo({
+							url:"/pages/toOrder/index?orderForm=ORDER_NOW"
+						})
+					}else{
+						uni.showToast({
+							icon:"none",
+							title:"此类商品需要满" +this.goldLimit+ "乐豆才可购买"
+						})
+					}
 				}else{
 					uni.showToast({
 						icon:"none",
-						title:"此类商品需要满" +this.goldLimit+ "乐豆才可购买"
+						title:"账户已被禁用,无法使用乐豆"
 					})
 				}
 			}

+ 18 - 9
pages/index/index.vue

@@ -80,7 +80,8 @@
 			return {
 				imageTopList: [],
 				stationDataList: [] ,//  附近网点列表
-				hasLogin: false
+				hasLogin: false,
+				userData: null
 			}
 		},
 		onLoad() {
@@ -153,6 +154,7 @@
 				getUserInfo().then(res => {
 					if(res.status == 200){
 						this.$u.vuex("vuex_userData",res.data)
+						this.userData = res.data
 					}
 				})
 			},
@@ -299,14 +301,21 @@
 			},
 			// 扫商户码,获取商户信息
 			getStoreData(params) {
-				sellerFindByPartnerNo({officialPartnerNo: params}).then(res => {
-					if(res.status == 200){
-						let store = res.data
-						uni.navigateTo({
-							url: '/pages/checkOut/checkOut?store='+encodeURIComponent(JSON.stringify(store))
-						})
-					} 
-				})
+				if(this.userData.state == 1){
+					sellerFindByPartnerNo({officialPartnerNo: params}).then(res => {
+						if(res.status == 200){
+							let store = res.data
+							uni.navigateTo({
+								url: '/pages/checkOut/checkOut?store='+encodeURIComponent(JSON.stringify(store))
+							})
+						} 
+					})
+				}else{
+					uni.showToast({
+						icon:"none",
+						title:"账户已被禁用,无法使用乐豆"
+					})
+				}
 			},
 			// 开箱
 			openDevice(data){

+ 10 - 1
pages/order/order.vue

@@ -186,10 +186,12 @@
 				showSetPswModal: false,  // 设置支付密码弹窗
 				showInputPsw: false, // 打开输入密码弹窗
 				showLeavePsw: false, // 打开确定放弃弹窗
-				payFinish: false  // 是否支付成功
+				payFinish: false  ,// 是否支付成功
+				userData: null
 			}
 		},
 		onLoad() {
+			this.userData = this.$store.state.vuex_userData
 			// 监听设置密码是否成功
 			uni.$once('setPswSuccess', this.setPsw)
 			// 监听页面刷新事件 在详情支付成功后或在物流确认收货后刷新列表
@@ -358,6 +360,13 @@
 			},
 			// 支付 判断用户是否设置过支付密码
 			toPay(item) {
+				if(this.userData.state == 0){
+					uni.showToast({
+						icon:"none",
+						title:"账户已被禁用,无法使用乐豆"
+					})
+					return
+				}
 				this.orderId = item.id
 				this.totalPrice = item.originalGold
 				this.payFinish = false