shizhongqi 4 лет назад
Родитель
Сommit
2a29cf1079

+ 3 - 3
ghsApp/src/admin/home/login.vue

@@ -268,9 +268,9 @@ export default {
 					//如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭
 					//如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭
 					//都有可能造成预登录校验失败
 					//都有可能造成预登录校验失败
 					console.log(res)
 					console.log(res)
-					if (res.code == 3005) {
-						that.$msg(res.metadata.resultMsg)
-						return false
+					if (res.code == 30005) {
+						//that.$msg('登录失败,请打开流量,再登录')
+						uni.showToast({title: '登录失败,请打开流量,或安装上手机卡', duration: 3000, icon:'none'})
 					}
 					}
 				}
 				}
 			})
 			})

+ 25 - 21
ghsApp/src/admin/item/components/ItemStock.vue

@@ -67,31 +67,35 @@ export default {
 
 
 			// #ifdef APP-PLUS
 			// #ifdef APP-PLUS
 			//this.$msg('请在小程序上打开分享')
 			//this.$msg('请在小程序上打开分享')
+			var sweixin
+
+			plus.share.getServices(function(s){
+				for (var i = 0; i < s.length; i++) {
+					var t = s[i];
+					if (t.id == 'weixin') {
+							sweixin = t;
+					}
+				}
+			}, function(e){
+				console.log("获取微信失败:" + e.message);
+			});
+
+			if (!(sweixin && sweixin.nativeClient)) {
+				this.$msg('请安装微信');
+				return false;
+			}
+
 			uni.login({
 			uni.login({
 				provider: 'weixin',
 				provider: 'weixin',
 				success: function (loginRes) {
 				success: function (loginRes) {
-					var sweixin
-
-					plus.share.getServices(function(s){
-						for (var i = 0; i < s.length; i++) {
-							var t = s[i];
-							if (t.id == 'weixin') {
-									sweixin = t;
-							}
-						}
-
-						if (sweixin && sweixin.nativeClient) {
-							sweixin.launchMiniProgram({
-								id: 'gh_73b8b357d19a',
-								path: 'admin/item/list',
-								type: 0
-							});
-						} else {
-							console.log('请确认是否安装微信');
-						}
-					}, function(e){
-						console.log("获取微信失败:" + e.message);
+					sweixin.launchMiniProgram({
+						id: 'gh_73b8b357d19a',
+						path: 'admin/item/list',
+						type: 0
 					});
 					});
+				},
+				fail: function (res) {
+					console.log(res)
 				}
 				}
 			});
 			});
 			// #endif
 			// #endif

+ 15 - 11
hdApp/src/admin/home/login.vue

@@ -4,7 +4,7 @@
 			<view class="experFrame">
 			<view class="experFrame">
 			<view>
 			<view>
 				<view style="text-align:center;margin-bottom:20upx;">
 				<view style="text-align:center;margin-bottom:20upx;">
-				<image :src="`${constant.imgUrl}/logo4.png`" class="logo" mode="widthFix"></image> 
+				<image :src="`${constant.imgUrl}/logo4.png`" class="logo" mode="widthFix"></image>
 				</view>
 				</view>
 				<view style="color:#666666;text-align:center;margin-bottom:50upx;font-size:35upx;">花掌柜</view>
 				<view style="color:#666666;text-align:center;margin-bottom:50upx;font-size:35upx;">花掌柜</view>
 				<view>
 				<view>
@@ -18,7 +18,7 @@
 				</view>
 				</view>
 				<!-- #ifdef MP-WEIXIN -->
 				<!-- #ifdef MP-WEIXIN -->
 				<view style="margin-top:55upx;">
 				<view style="margin-top:55upx;">
-				<button class="admin-button-com small buttonText" style="background-color:#2BA245;border-color:#2BA245;color:white;" 
+				<button class="admin-button-com small buttonText" style="background-color:#2BA245;border-color:#2BA245;color:white;"
 				open-type="getPhoneNumber" @getphonenumber="wxPhoneLogin">微信手机号一键登录</button>
 				open-type="getPhoneNumber" @getphonenumber="wxPhoneLogin">微信手机号一键登录</button>
 				</view>
 				</view>
 				<!-- #endif -->
 				<!-- #endif -->
@@ -58,7 +58,7 @@ import { phoneLogin,wxMobileLogin } from "@/api/auth";
 export default {
 export default {
 	name: "login",
 	name: "login",
 	components: {
 	components: {
-		
+
 	},
 	},
 	mixins: [],
 	mixins: [],
 	data() {
 	data() {
@@ -191,10 +191,10 @@ export default {
 
 
 			if(this.agree == 0){
 			if(this.agree == 0){
 				this.$msg('请同意并勾选服务协议和隐私政策')
 				this.$msg('请同意并勾选服务协议和隐私政策')
-				return false				
+				return false
 			}
 			}
 
 
-			uni.showLoading({mask:true})
+			//uni.showLoading({mask:true})
 			uni.preLogin({
 			uni.preLogin({
 				provider: 'univerify',
 				provider: 'univerify',
 				success:()=>{
 				success:()=>{
@@ -203,7 +203,7 @@ export default {
 						// 自定义登录框样式
 						// 自定义登录框样式
 						univerifyStyle: {
 						univerifyStyle: {
 							"fullScreen": true,
 							"fullScreen": true,
-							"privacyTerms": {  
+							"privacyTerms": {
 								"defaultCheckBoxState":false,
 								"defaultCheckBoxState":false,
 								"checkBoxSize":18
 								"checkBoxSize":18
 							}
 							}
@@ -214,7 +214,7 @@ export default {
 							let access_token = res.authResult.access_token
 							let access_token = res.authResult.access_token
 							phoneLogin({openid,access_token}).then(subRes=>{
 							phoneLogin({openid,access_token}).then(subRes=>{
 								let token = subRes.data.token || ''
 								let token = subRes.data.token || ''
-								uni.hideLoading()
+								//uni.hideLoading()
 								if (that.$util.isEmpty(token)) {
 								if (that.$util.isEmpty(token)) {
 									that.$msg('请先注册')
 									that.$msg('请先注册')
 									return false
 									return false
@@ -254,7 +254,7 @@ export default {
 							// 登录失败
 							// 登录失败
 							//关闭一键登录弹出窗口
 							//关闭一键登录弹出窗口
 							uni.closeAuthView()
 							uni.closeAuthView()
-							uni.hideLoading()
+							//uni.hideLoading()
 							setTimeout(function(){
 							setTimeout(function(){
 								//uni.showToast({ title: '登录失败,请打开流量,关闭wifi,再登录', duration: 3000, icon:'none' })
 								//uni.showToast({ title: '登录失败,请打开流量,关闭wifi,再登录', duration: 3000, icon:'none' })
 							},1000)
 							},1000)
@@ -262,7 +262,7 @@ export default {
 						complete: (res) => {
 						complete: (res) => {
 							console.log(res)
 							console.log(res)
 							uni.closeAuthView()
 							uni.closeAuthView()
-							uni.hideLoading()
+							//uni.hideLoading()
 						}
 						}
 					})
 					})
 				},
 				},
@@ -271,6 +271,10 @@ export default {
 					// 预登录失败
 					// 预登录失败
 					//如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭
 					//如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭
 					//都有可能造成预登录校验失败
 					//都有可能造成预登录校验失败
+					if (res.code == 30005) {
+						//that.$msg('登录失败,请打开流量,再登录')
+						uni.showToast({title: '登录失败,请打开流量,或安装上手机卡', duration: 3000, icon:'none'})
+					}
 				}
 				}
 			})
 			})
 		},
 		},
@@ -280,7 +284,7 @@ export default {
 			let password = this.password
 			let password = this.password
 			if(that.agree == 0){
 			if(that.agree == 0){
 				this.$msg('请同意并勾选服务协议和隐私政策')
 				this.$msg('请同意并勾选服务协议和隐私政策')
-				return false				
+				return false
 			}
 			}
 			if (that.$util.isEmpty(mobile)) {
 			if (that.$util.isEmpty(mobile)) {
 				this.$msg('请输入手机号')
 				this.$msg('请输入手机号')
@@ -401,4 +405,4 @@ export default {
       }
       }
   }
   }
 }
 }
-</style>
+</style>

+ 36 - 0
hdApp/src/admin/home/workbench.vue

@@ -149,7 +149,43 @@ export default {
       this.$util.pageTo({url:'/admin/order/addOrder'})
       this.$util.pageTo({url:'/admin/order/addOrder'})
     },
     },
     goCg(){
     goCg(){
+      // #ifdef MP-WEIXIN
       this.$util.pageTo({url:'/pagesPurchase/order'})
       this.$util.pageTo({url:'/pagesPurchase/order'})
+      // #endif
+
+      // #ifdef APP-PLUS
+      var sweixin
+
+			plus.share.getServices(function(s){
+				for (var i = 0; i < s.length; i++) {
+					var t = s[i];
+					if (t.id == 'weixin') {
+							sweixin = t;
+					}
+				}
+			}, function(e){
+				console.log("获取微信失败:" + e.message);
+			});
+
+			if (!(sweixin && sweixin.nativeClient)) {
+				this.$msg('请安装微信');
+				return false;
+			}
+
+			uni.login({
+				provider: 'weixin',
+				success: function (loginRes) {
+          sweixin.launchMiniProgram({
+            id: 'gh_73b8b357d19a',
+            path: '/pagesPurchase/order',
+            type: 0
+          });
+				},
+        fail: function (res) {
+					console.log(res)
+				}
+			});
+			// #endif
     },
     },
     goPage (item) {
     goPage (item) {
       if (item.url === '/admin/billing/priceChange') {
       if (item.url === '/admin/billing/priceChange') {