Browse Source

判断是否处于分销

gcz 3 days ago
parent
commit
ae386e8afa
2 changed files with 15 additions and 6 deletions
  1. 5 1
      common/apiurl.js
  2. 10 5
      pages/index/index.vue

+ 5 - 1
common/apiurl.js

@@ -272,7 +272,11 @@ const apiurl = {
 		url: '/member/memberInfo/getOrderCoupon',
 		type: 'post'
 	},
-	
+	// 是否处于分销 
+	checkRetail: {
+		url: '/member/memberInfo/checkRetail',
+		type: 'get'
+	},
 	
 	/**
 	 * @author ygh

+ 10 - 5
pages/index/index.vue

@@ -242,15 +242,20 @@
 				}
 			},
 			async bookticket(item){
-				let retailId = null;
+				let retailValid = null;
 				try {
-					const res = await uni.getStorage({ key: 'retailId' });
-					retailId = res.data;
+					const res = await this.$u.api.checkRetail();
+					retailValid = res.data.retailValid;//是否处于分销 1-是 0-否
 				} catch (error) {
-					
+					console.log('error',error)
+					// if(error.code==401){
+					// 	return
+					// }
+					return
 				}
 				// console.log('bookticket',item);
-				if(retailId){
+				// console.log('retailValid',retailValid)
+				if(retailValid===1){
 					uni.$u.route('pages/ticketlist',{id:item.id})
 				}else{
 					// https://blog.csdn.net/qq_42961150/article/details/121136346