Bladeren bron

bug 修复

lilei 4 jaren geleden
bovenliggende
commit
acd768f290
3 gewijzigde bestanden met toevoegingen van 15 en 15 verwijderingen
  1. 2 2
      App.vue
  2. 5 6
      pages/goods/goodsDetail.vue
  3. 8 7
      pages/index/index.vue

+ 2 - 2
App.vue

@@ -1,6 +1,6 @@
 <script>
-	// const uat_domain = 'https://lese.test.sxzxyj.net' // 预发布
-	const uat_domain = 'http://192.168.16.103:8302' // 本地
+	const uat_domain = 'https://lese.test.sxzxyj.net' // 预发布
+	// const uat_domain = 'http://192.168.16.103:8302' // 本地
 	const pro_domain = 'https://lese.sxzxyj.net' // 生产
 	const uat_URL = uat_domain+'/gc-shop/' // 预发布
 	const pro_URL = pro_domain+'/gc-shop/'  // 生产

+ 5 - 6
pages/goods/goodsDetail.vue

@@ -143,8 +143,12 @@
 			},
 			// 立即下单
 			toOrder(){
-				// console.log(this.goodContent,this.id,'pppppppp')
 				if(this.userData.customerRole == 9){
+					uni.showToast({
+						icon:"none",
+						title:"抱歉,您目前无法使用乐豆"
+					})
+				}else{
 					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({
@@ -156,11 +160,6 @@
 							title:"此类商品需要满" +this.goldLimit+ "乐豆才可购买"
 						})
 					}
-				}else{
-					uni.showToast({
-						icon:"none",
-						title:"抱歉,您目前无法使用乐豆"
-					})
 				}
 			}
 		},

+ 8 - 7
pages/index/index.vue

@@ -152,9 +152,9 @@
 			// 获取用户信息
 			getUserInfo(){
 				getUserInfo().then(res => {
+					console.log('getUserInfo',res.data)
 					if(res.status == 200){
 						this.$u.vuex("vuex_userData",res.data)
-						this.userData = res.data
 					}
 				})
 			},
@@ -301,7 +301,13 @@
 			},
 			// 扫商户码,获取商户信息
 			getStoreData(params) {
-				if(this.userData.customerRole == 9){
+				let userData = this.$store.state.vuex_userData
+				if(userData.customerRole == 9){
+					uni.showToast({
+						icon:"none",
+						title:"抱歉,您目前无法使用乐豆"
+					})
+				}else{
 					sellerFindByPartnerNo({officialPartnerNo: params}).then(res => {
 						if(res.status == 200){
 							let store = res.data
@@ -310,11 +316,6 @@
 							})
 						} 
 					})
-				}else{
-					uni.showToast({
-						icon:"none",
-						title:"抱歉,您目前无法使用乐豆"
-					})
 				}
 			},
 			// 开箱