Przeglądaj źródła

commit -m 修改微信授权

zhengjinyi 4 lat temu
rodzic
commit
844fee2b98

+ 15 - 6
App.vue

@@ -90,12 +90,21 @@
 			refresh(){
 				let TIME = (20*60)*1000;
 				setInterval(()=>{
-					if(uni.getStorageSync('_WX_State')){
-						this.getWxAuthorize()
-					}else{
-						console.log(new Date +'用户未授权微信信息')
-						this.$api.navigateTo('/pages/authorization/authorization')
-					}	
+					authorize.getSetting().then(res =>{
+						console.log('用户是否授权过',res)
+						if(res == 1){
+							this.getWxAuthorize()
+						}else{
+							console.log(new Date +'用户未授权微信信息')
+							this.$api.navigateTo('/pages/authorization/authorization')
+						}
+					})
+					// if(uni.getStorageSync('_WX_State')){
+					// 	this.getWxAuthorize()
+					// }else{
+					// 	console.log(new Date +'用户未授权微信信息')
+					// 	this.$api.navigateTo('/pages/authorization/authorization')
+					// }	
 				},TIME)
 			},
 			diffTime(t){

+ 0 - 1
common/config/wxLogin.js

@@ -29,7 +29,6 @@ const wxLoginAuthorize = async function(){
 const wxLoginQuick = async function(){// 根据微信的code获取用户登录状态:1已登录过 -1未登录过跳转
 		const wechatCode = await authorize.getCode('weixin');// 根据微信的code获取用户登录状态:1已登录过 -1未登录过
 		const getUserInfo = await authorize.getUserInfo('weixin');
-		const params = 
 		newUserService.UserLoginAuthApplets({ 
 			code:wechatCode,
 			encryptedData:getUserInfo.encryptedData,

+ 15 - 6
h5/pages/activity/activity_mid.vue

@@ -239,12 +239,21 @@
 				this.$api.navigateTo(`/pages/goods/product?id=${item.productID}&path=activity`)
 			},
 			navigator(){
-				if(uni.getStorageSync('_WX_State')){
-					this.$store.commit('setLoginType',9)
-					this.$api.navigateTo('/pages/login/login?type=0')
-				}else{
-					this.$api.navigateTo('/pages/authorization/authorization?type=1')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						this.$store.commit('setLoginType',9)
+						this.$api.navigateTo('/pages/login/login?type=0')
+					}else{
+						this.$api.navigateTo('/pages/authorization/authorization?type=1')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	this.$store.commit('setLoginType',9)
+				// 	this.$api.navigateTo('/pages/login/login?type=0')
+				// }else{
+				// 	this.$api.navigateTo('/pages/authorization/authorization?type=1')
+				// }	
 			},	
 			toFixedFn(text){//处理小数点后两位数
 				return Number(text).toFixed(2);

+ 15 - 6
pages/goods/cart.vue

@@ -236,12 +236,21 @@
 				})	
 			},
 			initLogin(){
-				if(uni.getStorageSync('_WX_State')){
-					this.$api.redirectTo('/pages/login/login?type=4')
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization?type=0')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						this.$api.redirectTo('/pages/login/login?type=4')
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo('/pages/authorization/authorization?type=0')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	this.$api.redirectTo('/pages/login/login?type=4')
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization?type=0')
+				// }	
 			},
 			clickPopupShow(pros,type){
 				this.popupShow = true;

+ 13 - 5
pages/goods/good-floor.vue

@@ -54,11 +54,19 @@
 		},
 		onLoad(option) {
 			if(option.type =='share'){
-				if(uni.getStorageSync('_WX_State')){
-					wxLogin.wxLoginAuthorize()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						wxLogin.wxLoginAuthorize()
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	wxLogin.wxLoginAuthorize()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// }	
 			}
 			this.pageId = option.linkId
 			this.$api.getComStorage('userInfo').then((resolve) =>{

+ 14 - 6
pages/goods/goods-classify.vue

@@ -241,12 +241,20 @@
 		onLoad(option) {
 			console.log(option)
 			if(option.type =='share'){
-				if(uni.getStorageSync('_WX_State')){
-					wxLogin.wxLoginAuthorize()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						wxLogin.wxLoginAuthorize()
+					}else{
+						this.$api.navigateTo('/pages/authorization/authorization')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	wxLogin.wxLoginAuthorize()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization')
+				// }	
 			}
 			this.SetScrollHeight()
 			this.InitOption(option)

+ 14 - 6
pages/goods/instrument-details.vue

@@ -206,12 +206,20 @@
 				this.backPage = option.page
 			}
 			if(this.isShareType =='share'){
-				if(uni.getStorageSync('_WX_State')){
-					wxLogin.wxLoginAuthorize()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						wxLogin.wxLoginAuthorize()
+					}else{
+						this.$api.navigateTo('/pages/authorization/authorization')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	wxLogin.wxLoginAuthorize()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization')
+				// }	
 			}
 		},
 		methods:{

+ 74 - 32
pages/goods/product.vue

@@ -369,12 +369,20 @@
 				this.backPage = option.page
 			}
 			if(this.isShareType =='share'){
-				if(uni.getStorageSync('_WX_State')){
-					wxLogin.wxLoginAuthorize()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						wxLogin.wxLoginAuthorize()
+					}else{
+						this.$api.navigateTo('/pages/authorization/authorization')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	wxLogin.wxLoginAuthorize()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization')
+				// }	
 			}
 			this.getWinHeight()
 		},
@@ -490,28 +498,52 @@
 				console.log(e.detail.query)
 			},
 			buyProductCart(){//底部购物车按钮点击
-				if(uni.getStorageSync('_WX_State')){
-					if(this.hasLogin){
-						this.$api.navigateTo('/pages/goods/cart')
-					}else{					
-						this.$api.navigateTo('/pages/login/login?type=1')
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						if(this.hasLogin){
+							this.$api.navigateTo('/pages/goods/cart')
+						}else{					
+							this.$api.navigateTo('/pages/login/login?type=1')
+						}
+					}else{
+						this.$api.navigateTo('/pages/authorization/authorization?type=1')
 					}
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization?type=1')
-				}	
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	if(this.hasLogin){
+				// 		this.$api.navigateTo('/pages/goods/cart')
+				// 	}else{					
+				// 		this.$api.navigateTo('/pages/login/login?type=1')
+				// 	}
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization?type=1')
+				// }	
 			},
 			btnGetConfirm(type){//加入购物车&&立即购买点击
-				if(uni.getStorageSync('_WX_State')){
-					if(this.hasLogin){
-						this.showSpec(type);
-					}else{					
-						this.$api.navigateTo('/pages/login/login?type=1')
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						if(this.hasLogin){
+							this.showSpec(type);
+						}else{					
+							this.$api.navigateTo('/pages/login/login?type=1')
+						}
+					}else{
+						this.$api.navigateTo('/pages/authorization/authorization?type=1')
 					}
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization?type=1')
-				}	
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	if(this.hasLogin){
+				// 		this.showSpec(type);
+				// 	}else{					
+				// 		this.$api.navigateTo('/pages/login/login?type=1')
+				// 	}
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization?type=1')
+				// }	
 			},	
 			changeCountAdd(){//popup弹窗数量增加按钮
 				if(this.buyRetailPriceStep == 2){
@@ -606,14 +638,24 @@
 				})
 			},
 			navToLogin(){
-				if(uni.getStorageSync('_WX_State')){
-					this.$store.commit('setLoginType',8)
-					this.$store.commit('setLoginProductId',this.productID)
-					this.$api.navigateTo(`/pages/login/login?id=${this.productID}`)
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization?type=1')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						this.$store.commit('setLoginType',8)
+						this.$store.commit('setLoginProductId',this.productID)
+						this.$api.navigateTo(`/pages/login/login?id=${this.productID}`)
+					}else{
+						this.$api.navigateTo('/pages/authorization/authorization?type=1')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	this.$store.commit('setLoginType',8)
+				// 	this.$store.commit('setLoginProductId',this.productID)
+				// 	this.$api.navigateTo(`/pages/login/login?id=${this.productID}`)
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization?type=1')
+				// }	
 			},
 			setHeaderBtnPosi(){
 				// 获得胶囊按钮位置信息

+ 32 - 13
pages/login/bindOperator.vue

@@ -104,13 +104,23 @@
 			console.log(option)
 			uni.setStorageSync('bind_id', option.userID);
 			this.getVerificationCode()
-			if(uni.getStorageSync('_WX_State')){
-				this.getWxAuthorize()
-			}else{
-				console.log(new Date +'用户未授权微信信息')
-				this.$api.navigateTo('/pages/authorization/authorization?type=0')
-				this.isUserInfo = true
-			}	
+			authorize.getSetting().then(res =>{
+				console.log('用户是否授权过',res)
+				if(res == 1){
+					this.getWxAuthorize()
+				}else{
+					console.log(new Date +'用户未授权微信信息')
+					this.$api.navigateTo('/pages/authorization/authorization?type=0')
+					this.isUserInfo = true
+				}
+			})	
+			// if(uni.getStorageSync('_WX_State')){
+			// 	this.getWxAuthorize()
+			// }else{
+			// 	console.log(new Date +'用户未授权微信信息')
+			// 	this.$api.navigateTo('/pages/authorization/authorization?type=0')
+			// 	this.isUserInfo = true
+			// }	
 		},
 		methods:{
 			...mapMutations(['login','logout']),
@@ -167,12 +177,21 @@
 					this.$util.msg('验证码格式不正确',2000)
 					return
 				}
-				if(uni.getStorageSync('_WX_State')){
-					this.bindingWechatLogin()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						this.bindingWechatLogin()
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo('/pages/authorization/authorization')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	this.bindingWechatLogin()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization')
+				// }	
 			},
 			getVerificationCode(){//图形验证
 				this.PublicService.GetImgVerifyCode().then(res => {

+ 15 - 6
pages/login/binding.vue

@@ -243,12 +243,21 @@
 			}
 		},
 		onShow() {
-			if(uni.getStorageSync('_WX_State')){
-				this.getWxAuthorize()
-			}else{
-				console.log(new Date +'用户未授权微信信息')
-				this.$api.navigateTo('/pages/authorization/authorization')
-			}	
+			authorize.getSetting().then(res =>{
+				console.log('用户是否授权过',res)
+				if(res == 1){
+					this.getWxAuthorize()
+				}else{
+					console.log(new Date +'用户未授权微信信息')
+					this.$api.navigateTo('/pages/authorization/authorization')
+				}
+			})
+			// if(uni.getStorageSync('_WX_State')){
+			// 	this.getWxAuthorize()
+			// }else{
+			// 	console.log(new Date +'用户未授权微信信息')
+			// 	this.$api.navigateTo('/pages/authorization/authorization')
+			// }	
 		}
 	}
 </script>

+ 30 - 12
pages/login/login.vue

@@ -63,12 +63,21 @@
 					this.$util.msg('请输入密码',2000)
 					return
 				}
-				if(uni.getStorageSync('_WX_State')){
-					this.AorganizationLogin()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization?type=0')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						this.AorganizationLogin()
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo('/pages/authorization/authorization?type=0')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	this.AorganizationLogin()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization?type=0')
+				// }	
 			},
 			AorganizationLogin(){
 				this.UserService.AorganizationLogin(this.params)
@@ -95,12 +104,21 @@
 				this.isShowEye = !this.isShowEye;
 			},
 			async InitAuthorize(){ //是否已授权 0:为取消授权 1:为已授权 2:为未操作
-				if(uni.getStorageSync('_WX_State')){
-					wxLogin.wxLoginQuick()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization?type=0')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						wxLogin.wxLoginQuick()
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo('/pages/authorization/authorization?type=0')
+					}
+				})	
+				// if(uni.getStorageSync('_WX_State')){
+				// 	wxLogin.wxLoginQuick()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization?type=0')
+				// }	
 			}
 		},
 		onShow() {

+ 9 - 3
pages/login/logincode.vue

@@ -80,9 +80,15 @@
 				})
 			},
 			InitAuthorize(){ //是否已授权 0:为取消授权 1:为已授权 2:为未操作
-				if(uni.getStorageSync('_WX_State')){
-					wxLogin.wxLoginQuick()
-				}
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						wxLogin.wxLoginQuick()
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	wxLogin.wxLoginQuick()
+				// }
 			}
 		},
 		onShow() {

+ 15 - 6
pages/login/register-supplier.vue

@@ -645,12 +645,21 @@
 			}
 		},
 		onShow() {
-			if(uni.getStorageSync('_WX_State')){
-				wxLogin.wxLoginQuick()
-			}else{
-				console.log(new Date +'用户未授权微信信息')
-				this.$api.navigateTo('/pages/authorization/authorization?type=0')
-			}	
+			authorize.getSetting().then(res =>{
+				console.log('用户是否授权过',res)
+				if(res == 1){
+					wxLogin.wxLoginQuick()
+				}else{
+					console.log(new Date +'用户未授权微信信息')
+					this.$api.navigateTo('/pages/authorization/authorization?type=0')
+				}
+			})
+			// if(uni.getStorageSync('_WX_State')){
+			// 	wxLogin.wxLoginQuick()
+			// }else{
+			// 	console.log(new Date +'用户未授权微信信息')
+			// 	this.$api.navigateTo('/pages/authorization/authorization?type=0')
+			// }	
 		}
 	}
 </script>

+ 15 - 6
pages/login/register.vue

@@ -230,12 +230,21 @@
 				}
 			},
 			async InitAuthorize(){ //是否已授权 0:为取消授权 1:为已授权 2:为未操作
-				if(uni.getStorageSync('_WX_State')){
-					wxLogin.wxLoginQuick()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization?type=0')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						wxLogin.wxLoginQuick()
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo('/pages/authorization/authorization?type=0')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	wxLogin.wxLoginQuick()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization?type=0')
+				// }	
 			}
 		},
 		onShow() {

+ 15 - 6
pages/tabBar/cart/cart.vue

@@ -224,12 +224,21 @@
 				})	
 			},
 			initLogin(){
-				if(uni.getStorageSync('_WX_State')){
-					this.$api.redirectTo('/pages/login/login?type=4')
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization?type=0')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						this.$api.redirectTo('/pages/login/login?type=4')
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo('/pages/authorization/authorization?type=0')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	this.$api.redirectTo('/pages/login/login?type=4')
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization?type=0')
+				// }	
 			},
 			clickPopupShow(pros,type){
 				this.popupShow = true;

+ 23 - 10
pages/tabBar/home/index.vue

@@ -170,16 +170,29 @@
 				uni.setStorageSync('isActivityStatus',true)	
 			},
 			InitAuthorize(){ //是否已授权 
-				if(uni.getStorageSync('_WX_State')){
-					this.GetWxAuthorize()
-				}else{
-					this.$api.getComStorage('userInfo').then((resolve) =>{
-						this.userID = resolve.userId ? resolve.userId :0;
-						this.getHomeInformation()
-					}).catch(error =>{
-						this.getHomeInformation()
-					})
-				}
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						this.GetWxAuthorize()
+					}else{
+						this.$api.getComStorage('userInfo').then((resolve) =>{
+							this.userID = resolve.userId ? resolve.userId :0;
+							this.getHomeInformation()
+						}).catch(error =>{
+							this.getHomeInformation()
+						})
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	this.GetWxAuthorize()
+				// }else{
+				// 	this.$api.getComStorage('userInfo').then((resolve) =>{
+				// 		this.userID = resolve.userId ? resolve.userId :0;
+				// 		this.getHomeInformation()
+				// 	}).catch(error =>{
+				// 		this.getHomeInformation()
+				// 	})
+				// }
 			}
 		},
 		onPageScroll(e){//实时获取到滚动的值

+ 39 - 15
pages/tabBar/user/user.vue

@@ -277,27 +277,51 @@
 				})
 			},
 			navigator(url){
-				if(uni.getStorageSync('_WX_State')){
-					if(this.hasLogin){
-						this.$api.navigateTo(url)
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						if(this.hasLogin){
+							this.$api.navigateTo(url)
+						}else{
+							this.$api.navigateTo('/pages/login/login?type=0')
+						}
 					}else{
-						this.$api.navigateTo('/pages/login/login?type=0')
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo('/pages/authorization/authorization?type=1')
 					}
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization?type=1')
-				}	
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	if(this.hasLogin){
+				// 		this.$api.navigateTo(url)
+				// 	}else{
+				// 		this.$api.navigateTo('/pages/login/login?type=0')
+				// 	}
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization?type=1')
+				// }	
 			},	
 			navigatorNex(url,type){
 				console.log(this.isWxAuthorize)
-				if(uni.getStorageSync('_WX_State')){
-					if(!this.hasLogin){
-						this.$api.navigateTo(url)
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						if(!this.hasLogin){
+							this.$api.navigateTo(url)
+						}
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo(`/pages/authorization/authorization?type=${type}`)
 					}
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo(`/pages/authorization/authorization?type=${type}`)
-				}	
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	if(!this.hasLogin){
+				// 		this.$api.navigateTo(url)
+				// 	}
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo(`/pages/authorization/authorization?type=${type}`)
+				// }	
 			},		
 			showBadge(n){
 				let num ='';

+ 15 - 6
search/pages/search/search-instrument.vue

@@ -74,12 +74,21 @@
 		},
 		onLoad(option){
 			if(option.type =='share'){
-				if(uni.getStorageSync('_WX_State')){
-					wxLogin.wxLoginAuthorize()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						wxLogin.wxLoginAuthorize()
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo('/pages/authorization/authorization')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	wxLogin.wxLoginAuthorize()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization')
+				// }	
 			}
 			if(option.keyWord){
 				this.listQuery.keyword = option.keyWord

+ 15 - 6
search/pages/search/search-supplier.vue

@@ -113,12 +113,21 @@
 		},
 		onLoad(option){
 			if(option.type =='share'){
-				if(uni.getStorageSync('_WX_State')){
-					wxLogin.wxLoginAuthorize()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						wxLogin.wxLoginAuthorize()
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo('/pages/authorization/authorization')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	wxLogin.wxLoginAuthorize()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization')
+				// }	
 			}
 			if(option.keyWord){
 				console.log(option.keyWord)

+ 15 - 6
search/pages/search/search.vue

@@ -215,12 +215,21 @@
 		onLoad(option) {
 			console.log(option)
 			if(option.type =='share'){
-				if(uni.getStorageSync('_WX_State')){
-					wxLogin.wxLoginAuthorize()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						wxLogin.wxLoginAuthorize()
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo('/pages/authorization/authorization')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	wxLogin.wxLoginAuthorize()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization')
+				// }	
 			}
 			this.$api.getStorage().then((resolve) =>{
 				this.userID = resolve.userId ? resolve.userId : 0;

+ 34 - 14
second/pages/product/product-details.vue

@@ -223,12 +223,21 @@
 				this.backPage = option.page
 			}
 			if(this.isShareType =='share'){
-				if(uni.getStorageSync('_WX_State')){
-					wxLogin.wxLoginAuthorize()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						wxLogin.wxLoginAuthorize()
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo('/pages/authorization/authorization')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	wxLogin.wxLoginAuthorize()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization')
+				// }	
 			}
 		},
 		methods:{
@@ -283,14 +292,25 @@
 
 			},
 			navToLogin(){
-				if(uni.getStorageSync('_WX_State')){
-					this.$store.commit('setLoginType',8)
-					this.$store.commit('setLoginProductId',this.productID)
-					this.$api.navigateTo(`/pages/login/login?id=${this.productID}`)
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization?type=1')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						this.$store.commit('setLoginType',8)
+						this.$store.commit('setLoginProductId',this.productID)
+						this.$api.navigateTo(`/pages/login/login?id=${this.productID}`)
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo('/pages/authorization/authorization?type=1')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	this.$store.commit('setLoginType',8)
+				// 	this.$store.commit('setLoginProductId',this.productID)
+				// 	this.$api.navigateTo(`/pages/login/login?id=${this.productID}`)
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization?type=1')
+				// }	
 			},
 			setHeaderBtnPosi(){
 				// 获得胶囊按钮位置信息

+ 13 - 5
second/pages/product/product-list.vue

@@ -152,11 +152,19 @@
 		},
 		onLoad(option) {
 			if(option.type =='share'){
-				if(uni.getStorageSync('_WX_State')){
-					wxLogin.wxLoginAuthorize()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-				}
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						wxLogin.wxLoginAuthorize()
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	wxLogin.wxLoginAuthorize()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// }
 			}
 		},
 		methods:{

+ 30 - 12
seller/pages/login/login.vue

@@ -95,12 +95,21 @@
 					this.$util.msg('请输入密码',2000)
 					return
 				}
-				if(uni.getStorageSync('_WX_State')){
-					this.SellerLogin()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization?type=1')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						this.SellerLogin()
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo('/pages/authorization/authorization?type=1')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	this.SellerLogin()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization?type=1')
+				// }	
 			},
 			SellerLogin(){
 				this.SellerService.SellerLogin(this.params)
@@ -135,12 +144,21 @@
 			},
 		},
 		onShow() {
-			if(uni.getStorageSync('_WX_State')){
-				this.getWxAuthorize()
-			}else{
-				this.$api.navigateTo('/pages/authorization/authorization')
-				this.isSeller= true
-			}	
+			authorize.getSetting().then(res =>{
+				console.log('用户是否授权过',res)
+				if(res == 1){
+					this.SellerLogin()
+				}else{
+					console.log(new Date +'用户未授权微信信息')
+					this.$api.navigateTo('/pages/authorization/authorization?type=1')
+				}
+			})
+			// if(uni.getStorageSync('_WX_State')){
+			// 	this.getWxAuthorize()
+			// }else{
+			// 	this.$api.navigateTo('/pages/authorization/authorization')
+			// 	this.isSeller= true
+			// }	
 		}
 	}
 </script>

+ 2 - 2
services/ajax.env.js

@@ -5,8 +5,8 @@ if(process.env.NODE_ENV === 'development'){
 	// URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.2.81:8008'
 	// URL_CONFIG = 'http://192.168.2.75:8008'	 //超超联调地址
-    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
-	// URL_CONFIG = 'https://spi.caimei365.com'
+    // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+	URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境
 	// URL_CONFIG = 'https://spi-b.caimei365.com'

+ 2 - 2
services/config.env.js

@@ -4,8 +4,8 @@ if(process.env.NODE_ENV === 'development'){
     // URL_CONFIG = 'http://192.168.2.75:18002'	 //采美测试地址
 	// URL_CONFIG = 'http://192.168.2.67:18002'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.2.68:8008'
-	URL_CONFIG = 'https://core-b.caimei365.com'
-	// URL_CONFIG = 'https://core.caimei365.com'
+	// URL_CONFIG = 'https://core-b.caimei365.com'
+	URL_CONFIG = 'https://core.caimei365.com'
 }else{
     // 生产环境
 	// URL_CONFIG = 'https://core-b.caimei365.com'

+ 36 - 15
supplier/pages/login/share-info.vue

@@ -39,14 +39,25 @@
 					this.source = 3
 				}
 			}
-			if(uni.getStorageSync('_WX_State')){
-				this.infoMiniShipments();
-			}else{
-				this.$api.navigateTo('/pages/authorization/authorization?type=4')
-				setTimeout(()=>{
-					this.isRequest = true
-				},2000)
-			}	
+			authorize.getSetting().then(res =>{
+				console.log('用户是否授权过',res)
+				if(res == 1){
+					this.infoMiniShipments();
+				}else{
+					this.$api.navigateTo('/pages/authorization/authorization?type=4')
+					setTimeout(()=>{
+						this.isRequest = true
+					},2000)
+				}
+			})
+			// if(uni.getStorageSync('_WX_State')){
+			// 	this.infoMiniShipments();
+			// }else{
+			// 	this.$api.navigateTo('/pages/authorization/authorization?type=4')
+			// 	setTimeout(()=>{
+			// 		this.isRequest = true
+			// 	},2000)
+			// }	
 		},
 		methods:{
 			infoMiniShipments(){
@@ -90,13 +101,23 @@
 			}
 		},
 		onShow() {
-			if(uni.getStorageSync('_WX_State')){
-				this.isRequest = false;
-				this.infoMiniShipments();
-			}else{
-				console.log(new Date +'用户未授权微信信息')
-				this.$api.navigateTo('/pages/authorization/authorization')
-			}	
+			authorize.getSetting().then(res =>{
+				console.log('用户是否授权过',res)
+				if(res == 1){
+					this.isRequest = false;
+					this.infoMiniShipments();
+				}else{
+					console.log(new Date +'用户未授权微信信息')
+					this.$api.navigateTo('/pages/authorization/authorization')
+				}
+			})
+			// if(uni.getStorageSync('_WX_State')){
+			// 	this.isRequest = false;
+			// 	this.infoMiniShipments();
+			// }else{
+			// 	console.log(new Date +'用户未授权微信信息')
+			// 	this.$api.navigateTo('/pages/authorization/authorization')
+			// }	
 		}
 	}
 </script>

+ 15 - 6
supplier/pages/user/my-shop.vue

@@ -275,12 +275,21 @@
 		
 		onLoad(option) {
 			if(option.type =='share'){
-				if(uni.getStorageSync('_WX_State')){
-					wxLogin.wxLoginAuthorize()
-				}else{
-					console.log(new Date +'用户未授权微信信息')
-					this.$api.navigateTo('/pages/authorization/authorization')
-				}	
+				authorize.getSetting().then(res =>{
+					console.log('用户是否授权过',res)
+					if(res == 1){
+						wxLogin.wxLoginAuthorize()
+					}else{
+						console.log(new Date +'用户未授权微信信息')
+						this.$api.navigateTo('/pages/authorization/authorization')
+					}
+				})
+				// if(uni.getStorageSync('_WX_State')){
+				// 	wxLogin.wxLoginAuthorize()
+				// }else{
+				// 	console.log(new Date +'用户未授权微信信息')
+				// 	this.$api.navigateTo('/pages/authorization/authorization')
+				// }	
 			}
 			this.listQuery.id = this.supplierId = option.shopId
 			this.$api.getStorage().then((resolve) =>{