shish hace 1 año
padre
commit
7cc7acc81e

+ 8 - 19
ghsApp/src/admin/home/login.vue

@@ -8,18 +8,6 @@
 				</view>
 				<view style="color:#666666;text-align:center;margin-bottom:50upx;font-size:35upx;">销花宝</view>
 
-				<template v-if="showAccountLogin">
-					<view>
-						<input @focus="mobile=''" v-model="mobile" class="experInput" placeholder="手机号" type="number" />
-					</view>
-					<view>
-						<input @focus="password=''" v-model="password" class="experInput" placeholder="密码" type="password" />
-					</view>
-					<view style="margin-top:40upx;">
-						<button class="admin-button-com small blue buttonText" @click="loginFun">登陆</button>
-					</view>
-				</template>
-
 				<!-- #ifdef MP-WEIXIN -->
 				<view style="margin-top:35upx;">
 					<view style="color:black;font-size:30upx;margin-top:20upx;">这是门店的管理后台,需获取你的手机号登录后</view>
@@ -49,8 +37,9 @@
 					</checkbox-group>
 				</view>
 				<!-- #endif -->
-				<view style="margin-top:80upx;color:#999999;width:86vw;font-size:35upx;">
-					<text style="float:right;margin-right:35upx;" @click="useAccount()">使用账号密码登录</text>
+				<view style="margin-top:80upx;color:#999999;width:100%;font-size:35upx;text-align:center;">
+					<text @click="useSms()">使用短信方式登录</text>
+					<text @click="useAccount()" style="margin-left:30upx;">使用账号密码登录</text>
 				</view>
 			</view>
 			</view>
@@ -73,8 +62,7 @@ export default {
 			mobile:'',
 			password: '',
 			hasMobileNet:false,
-			agree:0,
-			showAccountLogin:false
+			agree:0
 		}
 	},
 	computed: {
@@ -120,10 +108,11 @@ export default {
 		goBack(){
 			uni.navigateBack({})
 		},
+		useSms(){
+			this.$util.pageTo({url: "/admin/home/smsLogin",type:2})
+		},
 		useAccount(){
-			this.showAccountLogin = true
-			this.agree = 0
-			this.$forceUpdate()
+			this.$util.pageTo({url: "/admin/home/pwdLogin",type:2})
 		},
 		goToService(){
 			plus.runtime.openURL('http://www.wixhb.com/main/xhb-register')

+ 431 - 0
ghsApp/src/admin/home/pwdLogin.vue

@@ -0,0 +1,431 @@
+<template>
+	<view class="app-main app-content">
+		<view class="model">
+			<view class="experFrame">
+			<view>
+				<view style="text-align:center;margin-bottom:10upx;">
+				<image :src="`${constant.imgUrl}/logo3.png`" class="logo" mode="widthFix"></image> 
+				</view>
+				<view style="color:#666666;text-align:center;margin-bottom:50upx;font-size:35upx;">销花宝</view>
+
+				<template>
+					<view>
+						<input @focus="mobile=''" v-model="mobile" class="experInput" placeholder="手机号" type="number" />
+					</view>
+					<view>
+						<input @focus="password=''" v-model="password" class="experInput" placeholder="密码" type="password" />
+					</view>
+					<view style="margin-top:40upx;">
+						<CaptchaVerify 
+							ref="captchaVerify"
+							@verify-success="onVerifySuccess"
+						/>
+					</view>
+					<view style="margin-top:40upx;display:flex;justify-content:center;">
+						<button class="admin-button-com big" :class="[verified== true ? 'blue' : 'default']" style="width:75%;" @click="loginFun">登陆</button>
+					</view>
+				</template>
+
+				<!-- #ifdef MP-WEIXIN -->
+				<view style="margin-top:35upx;">
+					<view style="color:black;font-size:30upx;margin-top:20upx;">这是门店的管理后台,需获取你的手机号登录后</view>
+					<view style="color:black;font-size:30upx;margin-top:15upx;">才能使用相应功能,请谅解</view>
+					<view style="color:black;font-size:30upx;margin-top:15upx;margin-bottom:30upx;">如不需要,可以点击<text style="color:#3385FF;font-size:36upx;font-weight:bold;margin-left:8upx;" @click="goBack()">拒绝使用</text></view>
+				</view>
+				<!-- #endif -->
+				<!-- #ifdef APP-PLUS -->
+				<view style="color:#999999;font-size:25upx;margin-top:55upx;">
+					<checkbox-group @change="agreeItem">
+						<label>
+							<checkbox value="1" style="transform:scale(0.8)" :checked="agree == 1" />
+							<text>
+								我已阅读并同意
+								<text style="font-weight:bold;color:#666666;" @click.stop="goToService">《服务协议》</text>
+								和
+								<text style="font-weight:bold;color:#666666;" @click.stop="goToPrivacy">《隐私政策》</text>
+							</text>
+						</label>
+					</checkbox-group>
+				</view>
+				<!-- #endif -->
+			</view>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+import { mapActions } from "vuex";
+import { getShopInfo} from "@/utils/auth";
+import {appLogin} from '@/api/common'
+import { getDictionaries,postWxCode } from '@/api/mini'
+import { replaceClientId } from '@/api/admin'
+import { phoneLogin,wxMobileLogin } from "@/api/auth";
+import CaptchaVerify from "@/components/CaptchaVerify.vue";
+
+export default {
+	name: "login",
+	components: {
+		CaptchaVerify
+	},
+	mixins: [],
+	data() {
+		return {
+			mobile:'',
+			password: '',
+			hasMobileNet:false,
+			agree:0,
+			showAccountLogin:false,
+
+			verified: false // 是否已通过验证
+		}
+	},
+	computed: {
+	},
+	onLoad(){
+		let that = this
+		uni.getNetworkType({
+			success: function (res) {
+				that.dealLogin(res)
+			}
+		})
+		uni.onNetworkStatusChange(this.dealLogin)
+
+		// #ifdef MP-WEIXIN
+		//如果登录状态失效了,重新登录一次,更新session_key,这样session_key才有效,微信手机号登录才会成功
+		uni.checkSession({
+			success(){
+				console.log('checkSession success')
+			},
+			fail(){
+				uni.login({
+					provider: 'weixin',
+					success: res => {
+						uni.setStorageSync('code', res.code)
+						postWxCode({ code: res.code }).then(subRes => {
+							if(subRes.data.currentMiniOpenId){
+								let currentMiniOpenId = subRes.data.currentMiniOpenId
+								uni.setStorageSync('currentMiniOpenId', currentMiniOpenId)
+							}
+						 })
+					}
+				})
+			}  
+		})
+		// #endif
+
+	},
+	onUnload(){
+		uni.offNetworkStatusChange(this.dealLogin)
+	},
+	methods: {
+		...mapActions(['setUserShopAll']),
+		goBack(){
+			uni.navigateBack({})
+		},
+		// 验证成功回调
+		onVerifySuccess() {
+			this.verified = true;
+			this.$msg ? this.$msg('验证成功') : uni.showToast({ title: '验证成功', icon: 'success' });
+		},
+		useSms(){
+			this.$util.pageTo({url: "/admin/home/smsLogin",type:2})
+		},
+		useAccount(){
+			this.showAccountLogin = true
+			this.agree = 0
+			this.$forceUpdate()
+		},
+		goToService(){
+			plus.runtime.openURL('http://www.wixhb.com/main/xhb-register')
+		},
+		goToPrivacy(){
+			plus.runtime.openURL('http://www.wixhb.com/main/xhb-privacy')
+		},
+		agreeItem(e){
+			let arr = e.target.value
+			if (this.$util.isEmpty(arr)) {
+				this.agree = 0
+			}else{
+				this.agree = 1
+			}
+		},
+		dealLogin(res){
+			let that = this
+			console.log(res)
+			switch(res.networkType){
+				case '2g':
+					that.hasMobileNet = true
+					break;
+				case '3g':
+					that.hasMobileNet = true
+					break;
+				case '4g':
+					that.hasMobileNet = true
+					break;
+				case '5g':
+					that.hasMobileNet = true
+					break;
+				default:
+					that.hasMobileNet = false
+			}
+		},
+		wxPhoneLogin(e){
+			let that = this
+			let currentMiniOpenId = uni.getStorageSync('currentMiniOpenId')
+			if (e.detail.errMsg === "getPhoneNumber:ok") {
+				wxMobileLogin({ iv: e.detail.iv, encryptedData: e.detail.encryptedData,miniOpenId:currentMiniOpenId }).then(subRes => {
+					uni.hideLoading()
+					if(subRes.data && subRes.data.hasNoOpenId && subRes.data.hasNoOpenId ==1){
+						that.$util.confirmModal({content:'网络异常,请重新操作'},() => {
+							// #ifdef MP-WEIXIN
+							uni.clearStorage()
+							that.$store.commit("setLoginInfo", {})
+							that.$util.pageTo({url: "/admin/home/workbench",type: 3})
+							// #endif
+							// #ifdef APP-PLUS
+							uni.clearStorage()
+							that.$store.commit("setLoginInfo", {})
+							plus.runtime.restart()
+							// #endif
+						})
+						return false
+					}
+					let token = subRes.data.token || ''
+					if (that.$util.isEmpty(token)) {
+						that.$msg('请先注册')
+						return false
+					}
+					//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
+					if(subRes.code == 1){
+						if (that.$util.isEmpty(subRes)) {
+							return false
+						}
+						uni.setStorageSync('token', subRes.data.token)
+						uni.setStorageSync('shopId', subRes.data.admin.currentGhsShopId)
+						getDictionaries({ token: subRes.data.token }).then(res => {
+							if (that.$util.isEmpty(res)) {
+								return false
+							}
+							that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
+							that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
+						})
+						that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
+						getShopInfo(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
+						that.setUserShopAll()
+
+						uni.navigateBack()
+					}
+				});
+			} else {
+				this.$msg("登录失败");
+			}
+		},
+		mobileLogin(){
+			let that = this
+
+			// #ifdef APP-PLUS
+			if(this.agree == 0){
+				this.$msg('请同意并勾选服务协议和隐私政策')
+				return false				
+			}
+			// #endif
+
+			uni.showLoading({mask:true})
+			uni.preLogin({
+				provider: 'univerify',
+				success:()=>{
+					uni.hideLoading() 
+					uni.login({
+						provider: 'univerify',
+						// 自定义登录框样式
+						univerifyStyle: {
+							"fullScreen": true,
+							"privacyTerms": {  
+								"defaultCheckBoxState":false,
+								"checkBoxSize":18
+							}
+						},
+						// 登录成功
+						success:(res)=>{
+							let openid = res.authResult.openid
+							let access_token = res.authResult.access_token
+							phoneLogin({openid,access_token}).then(subRes=>{
+								let token = subRes.data.token || ''
+								if (that.$util.isEmpty(token)) {
+									that.$msg('请先注册')
+									return false
+								}
+								//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
+								if(subRes.code == 1){
+									if (that.$util.isEmpty(subRes)) {
+										return false
+									}
+									uni.setStorageSync('token', subRes.data.token)
+									uni.setStorageSync('shopId', subRes.data.admin.currentGhsShopId)
+									getDictionaries({ token: subRes.data.token }).then(res => {
+										if (that.$util.isEmpty(res)) {
+											return false
+										}
+										that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
+										that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
+									})
+									that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
+									getShopInfo(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
+									that.setUserShopAll()
+									uni.navigateBack()
+								}
+							})
+						},
+						fail(res){
+							uni.showToast({title:'已取消', duration: 3000, icon:'none'})
+							//关闭一键登录弹出窗口
+							uni.closeAuthView()
+							console.log(res)
+						},
+						complete: (res) => {
+							uni.hideLoading()
+							uni.closeAuthView()
+						}
+					})
+				},
+				fail(res){  
+					//如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭,都有可能造成预登录校验失败
+					if (res.code == 30005) {
+						uni.showToast({title: '请关闭WIFI,打开移动流量', duration: 3000, icon:'none'})
+					} else if(res.code == 1000) {
+						uni.showToast({title: '即将开通', duration: 3000, icon:'none'})
+					} else if(res.code == 40004) {
+						uni.showToast({title: '即将开通...', duration: 3000, icon:'none'})
+					} else {
+						uni.showToast({title: '登录失败...', duration: 3000, icon:'none'})
+					}
+					console.log(res)
+				}
+			})
+		},
+		loginFun(){
+			let that = this
+			let mobile = this.mobile
+			let password = this.password
+			// #ifdef APP-PLUS
+			if(that.agree == 0){
+				this.$msg('请同意并勾选服务协议和隐私政策')
+				return false				
+			}
+			// #endif
+			if (that.$util.isEmpty(mobile)) {
+				this.$msg('请输入手机号')
+				return false
+			}
+			if(this.$util.checkMobile(mobile) == false){
+				this.$msg('请输入正确手机号')
+				return false
+			}
+			if (that.$util.isEmpty(password)) {
+				this.$msg('请输入密码')
+				return false
+			}
+			// 检查是否已通过验证码验证
+			if (!this.verified) {
+				this.$msg('请先完成验证')
+				return false
+			}
+			uni.showLoading({mask:true})
+			//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
+			appLogin({mobile, password}).then(subRes=>{
+				uni.hideLoading()
+				if(subRes.code == 1){
+					if (that.$util.isEmpty(subRes)) {
+						return false
+					}
+					uni.setStorageSync('token', subRes.data.token)
+					uni.setStorageSync('shopId', subRes.data.admin.currentGhsShopId)
+					getDictionaries({ token: subRes.data.token }).then(res => {
+						if (that.$util.isEmpty(res)) {
+							return false
+						}
+						that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
+						that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
+					})
+					that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
+					getShopInfo(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
+					that.setUserShopAll()
+					uni.navigateBack()
+				}
+			})
+
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.model {
+  position: fixed;
+  z-index: 9999;
+  top: 0;
+  left: 0;
+  width: 100vw;
+  height: 100vh;
+  color: #fff;
+  overflow: hidden;
+  text-align: center;
+  & > .noData_img {
+    width: 318upx;
+    height: 318upx;
+    margin: 332upx auto 0;
+  }
+  & > .no_data_text {
+    font-size: 32upx;
+    color: #ffffff;
+    text-align: center;
+    margin: 50upx 0;
+  }
+  & > .freeApply {
+    width: 376upx;
+    height: 88upx;
+    line-height: 88upx;
+    background: linear-gradient(90deg, #3385ff, #33b0ff);
+    border-radius: 44upx;
+    margin: 0 auto;
+    font-size: 32upx;
+    color: #ffffff;
+    text-align: center;
+  }
+  &>.experience{
+    margin-top: 40upx;
+    color: #fff;
+    font-size: 30upx;
+  }
+  &>.experFrame{
+      margin-top:20upx;
+      height: 50upx;
+      .experInput{
+        height: 80upx;
+        width: 550upx;
+        margin-bottom:38upx;
+        display: inline-block;
+        vertical-align: middle;
+        background-color: #f5f5f5;
+        border:none;
+        border-bottom: 1px solid #CCCCCC;
+        color: #666;
+        padding-left: 20upx;
+        box-sizing: border-box;
+        text-align: left;
+      }
+      .buttonText{
+        display: inline-block;
+        line-height:92upx;
+        padding: 0 20upx;
+        vertical-align: middle;
+        font-size: 32upx;
+        width: 550upx;
+        height:90upx;
+      }
+      .logo{
+        width:180upx;
+        margin:0 auto;
+      }
+  }
+}
+</style>

+ 428 - 0
ghsApp/src/admin/home/smsLogin.vue

@@ -0,0 +1,428 @@
+<template>
+	<view class="app-main app-content">
+		<view class="model">
+			<view class="experFrame">
+			<view>
+				<view style="text-align:center;margin-bottom:10upx;">
+				<image :src="`${constant.imgUrl}/logo3.png`" class="logo" mode="widthFix"></image> 
+				</view>
+				<view style="color:#666666;text-align:center;margin-bottom:50upx;font-size:35upx;">销花宝</view>
+
+				<template>
+					<view>
+						<input @focus="mobile=''" v-model="mobile" class="experInput" placeholder="手机号" type="number" />
+					</view>
+					<view>
+						<input @focus="password=''" v-model="password" class="experInput" placeholder="密码" type="password" />
+					</view>
+					<view style="margin-top:40upx;">
+						<CaptchaVerify 
+							ref="captchaVerify"
+							@verify-success="onVerifySuccess"
+						/>
+					</view>
+					<view style="margin-top:40upx;display:flex;justify-content:center;">
+						<button class="admin-button-com big" :class="[verified== true ? 'blue' : 'default']" style="width:75%;" @click="loginFun">登陆</button>
+					</view>
+				</template>
+
+				<!-- #ifdef MP-WEIXIN -->
+				<view style="margin-top:35upx;">
+					<view style="color:black;font-size:30upx;margin-top:20upx;">这是门店的管理后台,需获取你的手机号登录后</view>
+					<view style="color:black;font-size:30upx;margin-top:15upx;">才能使用相应功能,请谅解</view>
+					<view style="color:black;font-size:30upx;margin-top:15upx;margin-bottom:30upx;">如不需要,可以点击<text style="color:#3385FF;font-size:36upx;font-weight:bold;margin-left:8upx;" @click="goBack()">拒绝使用</text></view>
+				</view>
+				<!-- #endif -->
+				<!-- #ifdef APP-PLUS -->
+				<view style="color:#999999;font-size:25upx;margin-top:55upx;">
+					<checkbox-group @change="agreeItem">
+						<label>
+							<checkbox value="1" style="transform:scale(0.8)" :checked="agree == 1" />
+							<text>
+								我已阅读并同意
+								<text style="font-weight:bold;color:#666666;" @click.stop="goToService">《服务协议》</text>
+								和
+								<text style="font-weight:bold;color:#666666;" @click.stop="goToPrivacy">《隐私政策》</text>
+							</text>
+						</label>
+					</checkbox-group>
+				</view>
+				<!-- #endif -->
+			</view>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+import { mapActions } from "vuex";
+import { getShopInfo} from "@/utils/auth";
+import {appLogin} from '@/api/common'
+import { getDictionaries,postWxCode } from '@/api/mini'
+import { replaceClientId } from '@/api/admin'
+import { phoneLogin,wxMobileLogin } from "@/api/auth";
+import CaptchaVerify from "@/components/CaptchaVerify.vue";
+
+export default {
+	name: "login",
+	components: {
+		CaptchaVerify
+	},
+	mixins: [],
+	data() {
+		return {
+			mobile:'',
+			password: '',
+			hasMobileNet:false,
+			agree:0,
+			showAccountLogin:false,
+
+			verified: false // 是否已通过验证
+		}
+	},
+	computed: {
+	},
+	onLoad(){
+		let that = this
+		uni.getNetworkType({
+			success: function (res) {
+				that.dealLogin(res)
+			}
+		})
+		uni.onNetworkStatusChange(this.dealLogin)
+
+		// #ifdef MP-WEIXIN
+		//如果登录状态失效了,重新登录一次,更新session_key,这样session_key才有效,微信手机号登录才会成功
+		uni.checkSession({
+			success(){
+				console.log('checkSession success')
+			},
+			fail(){
+				uni.login({
+					provider: 'weixin',
+					success: res => {
+						uni.setStorageSync('code', res.code)
+						postWxCode({ code: res.code }).then(subRes => {
+							if(subRes.data.currentMiniOpenId){
+								let currentMiniOpenId = subRes.data.currentMiniOpenId
+								uni.setStorageSync('currentMiniOpenId', currentMiniOpenId)
+							}
+						 })
+					}
+				})
+			}  
+		})
+		// #endif
+
+	},
+	onUnload(){
+		uni.offNetworkStatusChange(this.dealLogin)
+	},
+	methods: {
+		...mapActions(['setUserShopAll']),
+		goBack(){
+			uni.navigateBack({})
+		},
+		// 验证成功回调
+		onVerifySuccess() {
+			this.verified = true;
+			this.$msg ? this.$msg('验证成功') : uni.showToast({ title: '验证成功', icon: 'success' });
+		},
+		useAccount(){
+			this.showAccountLogin = true
+			this.agree = 0
+			this.$forceUpdate()
+		},
+		goToService(){
+			plus.runtime.openURL('http://www.wixhb.com/main/xhb-register')
+		},
+		goToPrivacy(){
+			plus.runtime.openURL('http://www.wixhb.com/main/xhb-privacy')
+		},
+		agreeItem(e){
+			let arr = e.target.value
+			if (this.$util.isEmpty(arr)) {
+				this.agree = 0
+			}else{
+				this.agree = 1
+			}
+		},
+		dealLogin(res){
+			let that = this
+			console.log(res)
+			switch(res.networkType){
+				case '2g':
+					that.hasMobileNet = true
+					break;
+				case '3g':
+					that.hasMobileNet = true
+					break;
+				case '4g':
+					that.hasMobileNet = true
+					break;
+				case '5g':
+					that.hasMobileNet = true
+					break;
+				default:
+					that.hasMobileNet = false
+			}
+		},
+		wxPhoneLogin(e){
+			let that = this
+			let currentMiniOpenId = uni.getStorageSync('currentMiniOpenId')
+			if (e.detail.errMsg === "getPhoneNumber:ok") {
+				wxMobileLogin({ iv: e.detail.iv, encryptedData: e.detail.encryptedData,miniOpenId:currentMiniOpenId }).then(subRes => {
+					uni.hideLoading()
+					if(subRes.data && subRes.data.hasNoOpenId && subRes.data.hasNoOpenId ==1){
+						that.$util.confirmModal({content:'网络异常,请重新操作'},() => {
+							// #ifdef MP-WEIXIN
+							uni.clearStorage()
+							that.$store.commit("setLoginInfo", {})
+							that.$util.pageTo({url: "/admin/home/workbench",type: 3})
+							// #endif
+							// #ifdef APP-PLUS
+							uni.clearStorage()
+							that.$store.commit("setLoginInfo", {})
+							plus.runtime.restart()
+							// #endif
+						})
+						return false
+					}
+					let token = subRes.data.token || ''
+					if (that.$util.isEmpty(token)) {
+						that.$msg('请先注册')
+						return false
+					}
+					//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
+					if(subRes.code == 1){
+						if (that.$util.isEmpty(subRes)) {
+							return false
+						}
+						uni.setStorageSync('token', subRes.data.token)
+						uni.setStorageSync('shopId', subRes.data.admin.currentGhsShopId)
+						getDictionaries({ token: subRes.data.token }).then(res => {
+							if (that.$util.isEmpty(res)) {
+								return false
+							}
+							that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
+							that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
+						})
+						that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
+						getShopInfo(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
+						that.setUserShopAll()
+
+						uni.navigateBack()
+					}
+				});
+			} else {
+				this.$msg("登录失败");
+			}
+		},
+		mobileLogin(){
+			let that = this
+
+			// #ifdef APP-PLUS
+			if(this.agree == 0){
+				this.$msg('请同意并勾选服务协议和隐私政策')
+				return false				
+			}
+			// #endif
+
+			uni.showLoading({mask:true})
+			uni.preLogin({
+				provider: 'univerify',
+				success:()=>{
+					uni.hideLoading() 
+					uni.login({
+						provider: 'univerify',
+						// 自定义登录框样式
+						univerifyStyle: {
+							"fullScreen": true,
+							"privacyTerms": {  
+								"defaultCheckBoxState":false,
+								"checkBoxSize":18
+							}
+						},
+						// 登录成功
+						success:(res)=>{
+							let openid = res.authResult.openid
+							let access_token = res.authResult.access_token
+							phoneLogin({openid,access_token}).then(subRes=>{
+								let token = subRes.data.token || ''
+								if (that.$util.isEmpty(token)) {
+									that.$msg('请先注册')
+									return false
+								}
+								//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
+								if(subRes.code == 1){
+									if (that.$util.isEmpty(subRes)) {
+										return false
+									}
+									uni.setStorageSync('token', subRes.data.token)
+									uni.setStorageSync('shopId', subRes.data.admin.currentGhsShopId)
+									getDictionaries({ token: subRes.data.token }).then(res => {
+										if (that.$util.isEmpty(res)) {
+											return false
+										}
+										that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
+										that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
+									})
+									that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
+									getShopInfo(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
+									that.setUserShopAll()
+									uni.navigateBack()
+								}
+							})
+						},
+						fail(res){
+							uni.showToast({title:'已取消', duration: 3000, icon:'none'})
+							//关闭一键登录弹出窗口
+							uni.closeAuthView()
+							console.log(res)
+						},
+						complete: (res) => {
+							uni.hideLoading()
+							uni.closeAuthView()
+						}
+					})
+				},
+				fail(res){  
+					//如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭,都有可能造成预登录校验失败
+					if (res.code == 30005) {
+						uni.showToast({title: '请关闭WIFI,打开移动流量', duration: 3000, icon:'none'})
+					} else if(res.code == 1000) {
+						uni.showToast({title: '即将开通', duration: 3000, icon:'none'})
+					} else if(res.code == 40004) {
+						uni.showToast({title: '即将开通...', duration: 3000, icon:'none'})
+					} else {
+						uni.showToast({title: '登录失败...', duration: 3000, icon:'none'})
+					}
+					console.log(res)
+				}
+			})
+		},
+		loginFun(){
+			let that = this
+			let mobile = this.mobile
+			let password = this.password
+			// #ifdef APP-PLUS
+			if(that.agree == 0){
+				this.$msg('请同意并勾选服务协议和隐私政策')
+				return false				
+			}
+			// #endif
+			if (that.$util.isEmpty(mobile)) {
+				this.$msg('请输入手机号')
+				return false
+			}
+			if(this.$util.checkMobile(mobile) == false){
+				this.$msg('请输入正确手机号')
+				return false
+			}
+			if (that.$util.isEmpty(password)) {
+				this.$msg('请输入密码')
+				return false
+			}
+			// 检查是否已通过验证码验证
+			if (!this.verified) {
+				this.$msg('请先完成验证')
+				return false
+			}
+			uni.showLoading({mask:true})
+			//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
+			appLogin({mobile, password}).then(subRes=>{
+				uni.hideLoading()
+				if(subRes.code == 1){
+					if (that.$util.isEmpty(subRes)) {
+						return false
+					}
+					uni.setStorageSync('token', subRes.data.token)
+					uni.setStorageSync('shopId', subRes.data.admin.currentGhsShopId)
+					getDictionaries({ token: subRes.data.token }).then(res => {
+						if (that.$util.isEmpty(res)) {
+							return false
+						}
+						that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
+						that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
+					})
+					that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
+					getShopInfo(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
+					that.setUserShopAll()
+					uni.navigateBack()
+				}
+			})
+
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.model {
+  position: fixed;
+  z-index: 9999;
+  top: 0;
+  left: 0;
+  width: 100vw;
+  height: 100vh;
+  color: #fff;
+  overflow: hidden;
+  text-align: center;
+  & > .noData_img {
+    width: 318upx;
+    height: 318upx;
+    margin: 332upx auto 0;
+  }
+  & > .no_data_text {
+    font-size: 32upx;
+    color: #ffffff;
+    text-align: center;
+    margin: 50upx 0;
+  }
+  & > .freeApply {
+    width: 376upx;
+    height: 88upx;
+    line-height: 88upx;
+    background: linear-gradient(90deg, #3385ff, #33b0ff);
+    border-radius: 44upx;
+    margin: 0 auto;
+    font-size: 32upx;
+    color: #ffffff;
+    text-align: center;
+  }
+  &>.experience{
+    margin-top: 40upx;
+    color: #fff;
+    font-size: 30upx;
+  }
+  &>.experFrame{
+      margin-top:20upx;
+      height: 50upx;
+      .experInput{
+        height: 80upx;
+        width: 550upx;
+        margin-bottom:38upx;
+        display: inline-block;
+        vertical-align: middle;
+        background-color: #f5f5f5;
+        border:none;
+        border-bottom: 1px solid #CCCCCC;
+        color: #666;
+        padding-left: 20upx;
+        box-sizing: border-box;
+        text-align: left;
+      }
+      .buttonText{
+        display: inline-block;
+        line-height:92upx;
+        padding: 0 20upx;
+        vertical-align: middle;
+        font-size: 32upx;
+        width: 550upx;
+        height:90upx;
+      }
+      .logo{
+        width:180upx;
+        margin:0 auto;
+      }
+  }
+}
+</style>

+ 163 - 0
ghsApp/src/components/CaptchaVerify.vue

@@ -0,0 +1,163 @@
+<template>
+  <view class="captcha-verify-container">
+    <!-- 滑动验证 -->
+    <view class="slide-verify">
+      <view class="slide-track">
+        <view 
+          class="slide-thumb" 
+          :class="{ 'success': verified }"
+          :style="{ left: thumbPosition + 'px' }"
+          @touchstart="touchStartHandler"
+          @touchmove="touchMoveHandler"
+          @touchend="touchEndHandler"
+        >
+          <view class="slide-icon">
+            <text v-if="verified">✓</text>
+            <text v-else>→</text>
+          </view>
+        </view>
+        <view class="slide-text">{{ verified ? '验证通过' : '向右滑动完成验证' }}</view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  name: 'CaptchaVerify',
+  data() {
+    return {
+      // 滑动验证相关
+      verified: false,
+      thumbPosition: 0,
+      startX: 0,
+      trackWidth: 0,
+      thumbWidth: 0
+    }
+  },
+  mounted() {
+    this.initVerify();
+  },
+  methods: {
+    // 初始化验证
+    initVerify() {
+      this.initSlideVerify();
+    },
+    
+    // 滑动验证初始化
+    initSlideVerify() {
+      const query = uni.createSelectorQuery().in(this);
+      query.select('.slide-track').boundingClientRect(data => {
+        this.trackWidth = data.width;
+      }).exec();
+      
+      query.select('.slide-thumb').boundingClientRect(data => {
+        this.thumbWidth = data.width;
+      }).exec();
+      
+      this.thumbPosition = 0;
+      this.verified = false;
+    },
+    
+    // 滑动开始
+    touchStartHandler(e) {
+      if (this.verified) return;
+      this.startX = e.changedTouches[0].clientX;
+    },
+    
+    // 滑动中
+    touchMoveHandler(e) {
+      if (this.verified) return;
+      
+      let currentX = e.changedTouches[0].clientX;
+      let moveX = currentX - this.startX;
+      
+      // 限制滑块在轨道内
+      if (moveX < 0) {
+        moveX = 0;
+      } else if (moveX > this.trackWidth - this.thumbWidth) {
+        moveX = this.trackWidth - this.thumbWidth;
+      }
+      
+      this.thumbPosition = moveX;
+    },
+    
+    // 滑动结束
+    touchEndHandler() {
+      if (this.verified) return;
+      
+      // 验证是否滑动到末端
+      if (this.thumbPosition >= this.trackWidth - this.thumbWidth - 5) {
+        this.verified = true;
+        this.$emit('verify-success');
+      } else {
+        // 未滑到末端,复位
+        this.thumbPosition = 0;
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.captcha-verify-container {
+  width: 75%; /* 减小六分之一 */
+  padding: 15rpx;
+  box-sizing: border-box;
+  margin: 0 auto; /* 水平居中 */
+  
+  // 滑动验证样式
+  .slide-verify {
+    width: 100%;
+    height: 90rpx; /* 再增高五分之一 */
+    position: relative;
+    
+    .slide-track {
+      width: 100%;
+      height: 90rpx; /* 增高到90rpx */
+      background-color: #E8F1FF; /* 浅蓝色背景 */
+      border-radius: 45rpx; /* 更新圆角 */
+      position: relative;
+      box-shadow: 0 2rpx 8rpx rgba(51, 133, 255, 0.2); /* 添加蓝色阴影 */
+      border: 1rpx solid #BBDEFB; /* 添加边框 */
+      
+      .slide-thumb {
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 90rpx; /* 调整宽度与高度一致 */
+        height: 90rpx; /* 增高到90rpx */
+        border-radius: 45rpx; /* 更新圆角 */
+        background: linear-gradient(90deg, #4285F4, #3385ff); /* 更亮丽的蓝色渐变 */
+        z-index: 2;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        transition: background 0.3s;
+        box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.2); /* 添加滑块阴影 */
+        
+        &.success {
+          background: linear-gradient(90deg, #5CB85C, #4CAF50); /* 更亮丽的绿色渐变 */
+        }
+        
+        .slide-icon {
+          color: #fff;
+          font-size: 36rpx; /* 调整字体 */
+        }
+      }
+      
+      .slide-text {
+        position: absolute;
+        width: 100%;
+        height: 100%;
+        line-height: 90rpx; /* 调整行高 */
+        text-align: center;
+        color: #5E91E5; /* 蓝色文字 */
+        font-size: 28rpx; /* 调整字体大小 */
+        z-index: 1;
+        font-weight: 500; /* 稍微加粗文字 */
+      }
+    }
+  }
+}
+</style> 

+ 3 - 0
ghsApp/src/pages.json

@@ -2,6 +2,9 @@
 	"pages": [
 		{"path": "admin/home/workbench","style": {"navigationBarTitleText": "店铺","enablePullDownRefresh": true}},
 		{"path": "admin/home/login","style": {"navigationBarTitleText": "","enablePullDownRefresh": false}},
+		{"path": "admin/home/smsLogin","style": {"navigationBarTitleText": "","enablePullDownRefresh": false}},
+		{"path": "admin/home/pwdLogin","style": {"navigationBarTitleText": "","enablePullDownRefresh": false}},
+		{"path": "pages/captcha-demo","style": {"navigationBarTitleText": "验证码演示","enablePullDownRefresh": false}},
 		{"path": "admin/home/result","style": {"navigationBarTitleText": "","enablePullDownRefresh": true}},
 		{"path": "admin/home/callback","style": {"navigationBarTitleText": "","enablePullDownRefresh": true}},
 		{"path": "admin/home/console","style": {"navigationBarTitleText": ""}},

+ 63 - 0
ghsApp/src/pages/captcha-demo.vue

@@ -0,0 +1,63 @@
+<template>
+  <view class="captcha-demo-container">
+    <view class="page-title">验证码演示</view>
+    
+    <view class="section">
+      <view class="section-title">滑动验证</view>
+      <CaptchaVerify 
+        @verify-success="onVerifySuccess('slide')"
+      />
+    </view>
+  </view>
+</template>
+
+<script>
+import CaptchaVerify from '@/components/CaptchaVerify.vue';
+
+export default {
+  components: {
+    CaptchaVerify
+  },
+  data() {
+    return {
+      verifyResults: {
+        slide: false,
+        image: false,
+        click: false
+      }
+    };
+  },
+  methods: {
+    onVerifySuccess(type) {
+      this.verifyResults[type] = true;
+      this.$msg ? this.$msg(`${type}验证成功`) : uni.showToast({ title: `${type}验证成功`, icon: 'success' });
+      
+      // 在实际应用中,可以在这里执行后续的操作,如提交表单、继续注册流程等
+      console.log('验证成功,类型:', type);
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.captcha-demo-container {
+  padding: 30rpx;
+  
+  .page-title {
+    font-size: 36rpx;
+    font-weight: bold;
+    text-align: center;
+    margin-bottom: 40rpx;
+  }
+  
+  .section {
+    margin-bottom: 50rpx;
+    
+    .section-title {
+      font-size: 32rpx;
+      margin-bottom: 20rpx;
+      color: #333;
+    }
+  }
+}
+</style>