增加登录类型
This commit is contained in:
parent
fbfcfc4d82
commit
bf588ca7fb
|
|
@ -13,8 +13,21 @@
|
||||||
|
|
||||||
<!-- 不需要label, 需要修改: label-width="0" -->
|
<!-- 不需要label, 需要修改: label-width="0" -->
|
||||||
<uni-forms ref="loginFormRef" label-width="0" :model="vdata.formData" :rules="rules">
|
<uni-forms ref="loginFormRef" label-width="0" :model="vdata.formData" :rules="rules">
|
||||||
|
<view class="u-p-b-30">
|
||||||
|
<my-tabs size="large" @change="accountTypeChange" v-model="accountType.sel" :list="accountType.list" textKey="label"></my-tabs>
|
||||||
|
</view>
|
||||||
<view v-if="vdata.loginType == 'pwd' ">
|
<view v-if="vdata.loginType == 'pwd' ">
|
||||||
|
<template v-if="accountType.sel==1">
|
||||||
|
<uni-forms-item name="merchantName">
|
||||||
|
<uni-easyinput class='jeepay-easyinput' placeholder="请输入商户号"
|
||||||
|
v-model="vdata.formData.merchantName" :clearable="false">
|
||||||
|
<template #prefixIcon>
|
||||||
|
<image src="@/static/login/icon-user.svg" class="input-icon" />
|
||||||
|
</template>
|
||||||
|
</uni-easyinput>
|
||||||
|
</uni-forms-item>
|
||||||
|
</template>
|
||||||
|
|
||||||
<uni-forms-item name="username">
|
<uni-forms-item name="username">
|
||||||
<uni-easyinput class='jeepay-easyinput' placeholder="请输入登录名/手机号"
|
<uni-easyinput class='jeepay-easyinput' placeholder="请输入登录名/手机号"
|
||||||
v-model="vdata.formData.username" :clearable="false">
|
v-model="vdata.formData.username" :clearable="false">
|
||||||
|
|
@ -159,6 +172,15 @@
|
||||||
login,
|
login,
|
||||||
getCodeImg
|
getCodeImg
|
||||||
} from '@/http/yskApi/login.js';
|
} from '@/http/yskApi/login.js';
|
||||||
|
|
||||||
|
const accountType=reactive({
|
||||||
|
list:[
|
||||||
|
{label:'商户',value:'merchant'},
|
||||||
|
{label:'员工',value:'staff'},
|
||||||
|
],
|
||||||
|
sel:0
|
||||||
|
})
|
||||||
|
|
||||||
const loginFormRef = ref()
|
const loginFormRef = ref()
|
||||||
const envChangeTipsRef = ref()
|
const envChangeTipsRef = ref()
|
||||||
const refAgr = ref()
|
const refAgr = ref()
|
||||||
|
|
@ -169,6 +191,9 @@
|
||||||
} from "@/commons/utils/pushmsg/wxTextToSpeach.js"
|
} from "@/commons/utils/pushmsg/wxTextToSpeach.js"
|
||||||
// #endif
|
// #endif
|
||||||
const rules = {
|
const rules = {
|
||||||
|
merchantName:{
|
||||||
|
rules: [formUtil.rules.requiredInputShowToast('商户号')],
|
||||||
|
},
|
||||||
username: {
|
username: {
|
||||||
rules: [formUtil.rules.requiredInputShowToast('用户名')],
|
rules: [formUtil.rules.requiredInputShowToast('用户名')],
|
||||||
},
|
},
|
||||||
|
|
@ -223,6 +248,14 @@
|
||||||
vdata.formData.pwd = 'qwer1234'
|
vdata.formData.pwd = 'qwer1234'
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
function accountTypeChange(e){
|
||||||
|
// #ifdef H5
|
||||||
|
if(e==1){
|
||||||
|
vdata.formData.merchantName = '18049104914'
|
||||||
|
vdata.formData.username = '13666666666'
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
|
||||||
const getCode = () => {
|
const getCode = () => {
|
||||||
getCodeImg().then(res => {
|
getCodeImg().then(res => {
|
||||||
|
|
@ -268,7 +301,7 @@
|
||||||
code: vdata.formData.code,
|
code: vdata.formData.code,
|
||||||
uuid: vdata.formData.uuid,
|
uuid: vdata.formData.uuid,
|
||||||
merchantName: vdata.formData.merchantName,
|
merchantName: vdata.formData.merchantName,
|
||||||
loginType: vdata.formData.loginType
|
loginType: accountType.list[accountType.sel].value
|
||||||
})
|
})
|
||||||
|
|
||||||
} else if (vdata.loginType == 'sms') { // 短信验证码登录
|
} else if (vdata.loginType == 'sms') { // 短信验证码登录
|
||||||
|
|
@ -313,6 +346,7 @@
|
||||||
storageManage.setLogin(loginBizData)
|
storageManage.setLogin(loginBizData)
|
||||||
storageManage.token(loginBizData.token)
|
storageManage.token(loginBizData.token)
|
||||||
storageManage.shopId(loginBizData.shopId)
|
storageManage.shopId(loginBizData.shopId)
|
||||||
|
storageManage.shopUserId(loginBizData.user.user.id)
|
||||||
storageManage.userInfo(loginBizData)
|
storageManage.userInfo(loginBizData)
|
||||||
// 跳转到首页
|
// 跳转到首页
|
||||||
go.to("PAGES_INDEX", {
|
go.to("PAGES_INDEX", {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue