From bf588ca7fbbbb119a38d0a3b630b24eaead1ae78 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Wed, 9 Oct 2024 17:33:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=99=BB=E5=BD=95=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/login/index.vue | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/pages/login/index.vue b/pages/login/index.vue index 674e8a7..2c08245 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -13,8 +13,21 @@ - + + + + + @@ -159,6 +172,15 @@ login, getCodeImg } from '@/http/yskApi/login.js'; + + const accountType=reactive({ + list:[ + {label:'商户',value:'merchant'}, + {label:'员工',value:'staff'}, + ], + sel:0 + }) + const loginFormRef = ref() const envChangeTipsRef = ref() const refAgr = ref() @@ -169,6 +191,9 @@ } from "@/commons/utils/pushmsg/wxTextToSpeach.js" // #endif const rules = { + merchantName:{ + rules: [formUtil.rules.requiredInputShowToast('商户号')], + }, username: { rules: [formUtil.rules.requiredInputShowToast('用户名')], }, @@ -223,6 +248,14 @@ vdata.formData.pwd = 'qwer1234' // #endif + function accountTypeChange(e){ + // #ifdef H5 + if(e==1){ + vdata.formData.merchantName = '18049104914' + vdata.formData.username = '13666666666' + } + // #endif + } const getCode = () => { getCodeImg().then(res => { @@ -268,7 +301,7 @@ code: vdata.formData.code, uuid: vdata.formData.uuid, merchantName: vdata.formData.merchantName, - loginType: vdata.formData.loginType + loginType: accountType.list[accountType.sel].value }) } else if (vdata.loginType == 'sms') { // 短信验证码登录 @@ -308,11 +341,12 @@ } // 封装登录成功后的操作 async function loginFinishFunc(loginBizData) { - + // 保存 token storageManage.setLogin(loginBizData) storageManage.token(loginBizData.token) storageManage.shopId(loginBizData.shopId) + storageManage.shopUserId(loginBizData.user.user.id) storageManage.userInfo(loginBizData) // 跳转到首页 go.to("PAGES_INDEX", {