|
|
@@ -47,16 +47,16 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="as-layout-vertical as-gravity-center" @click=" |
|
|
|
state.loginType === 'pwd' |
|
|
|
? (state.loginType = 'code') |
|
|
|
: (state.loginType = 'pwd') |
|
|
|
"> |
|
|
|
state.loginType === 'pwd' |
|
|
|
? (state.loginType = 'code') |
|
|
|
: (state.loginType = 'pwd') |
|
|
|
"> |
|
|
|
<view class="bg orange as-gravity-center"> |
|
|
|
<image :src="`${$imgUrl}login/icon_code.png`" class="img" mode="aspectFill" /> |
|
|
|
</view> |
|
|
|
<view class="label">{{ |
|
|
|
state.loginType === "pwd" ? "验证码登录" : "密码登录" |
|
|
|
}}</view> |
|
|
|
state.loginType === "pwd" ? "验证码登录" : "密码登录" |
|
|
|
}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="as-layout-vertical as-gravity-center" @click="navTo('/login/forget-pwd-step1')"> |
|
|
@@ -77,8 +77,10 @@ |
|
|
|
import { requestNew} from "@/utils/network/request.js"; |
|
|
|
import { useUserStore } from "@/stores/user"; |
|
|
|
import { setItem,getItem } from "@/utils/storage"; |
|
|
|
import { customerQuery, userInfoIndex } from "@/utils/network/api.js"; |
|
|
|
|
|
|
|
const userStore = useUserStore(); |
|
|
|
const { fetchToken } = userStore; |
|
|
|
const { fetchToken, saveUserInfo } = userStore; |
|
|
|
|
|
|
|
const state = reactive({ |
|
|
|
checked: false, //是否勾选协议 |
|
|
@@ -180,6 +182,32 @@ |
|
|
|
setItem('mobile', state.username) |
|
|
|
subscribeMessages(); |
|
|
|
msg("登录成功!"); |
|
|
|
|
|
|
|
let getUserInfo = requestNew(userInfoIndex, { |
|
|
|
type: 2, |
|
|
|
data: {}, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
|
}); |
|
|
|
let getEtcAccounts = requestNew(customerQuery, { |
|
|
|
type: 2, |
|
|
|
data: {}, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
|
}) |
|
|
|
Promise.all([getUserInfo, getEtcAccounts]).then(reses => { |
|
|
|
let userInfoRes = reses[0]; |
|
|
|
if (userInfoRes.mobile) { |
|
|
|
saveUserInfo(userInfoRes); |
|
|
|
} |
|
|
|
let userCustomerId = userInfoRes.customerId || ''; |
|
|
|
|
|
|
|
let etcAccounts = reses[1]; |
|
|
|
let customerObj = etcAccounts.find(val => val.customerId == userCustomerId); |
|
|
|
if(customerObj) { |
|
|
|
setItem('customerObj', customerObj); |
|
|
|
} |
|
|
|
}) |
|
|
|
uni.$emit("refreshOrder"); |
|
|
|
if (state.back == 1) { |
|
|
|
uni.navigateBack({ |