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", {