Commit 53eb1073 by 李伟康

```plaintext

feat(pages): 移除账号选择相关页面及组件

移除了以下文件:
- pages/common/accountItems.vue(账号选择主页面)
- pages/common/components/AccountList.vue(账号列表组件)
- pages/common/components/MerchantList.vue(商户列表组件)
- pages/common/components/Scene.vue(场景选择组件)

同时从 pages.json 中移除了 accountItems 页面的路由配置。

此外,调整了登录和加载页面逻辑:
- login.vue 改用 web-view 嵌入外部登录链接,并添加消息处理机制
- loading.vue 固定跳转至权益首页 `/pages/equity/index`
```
1 parent 672f8099
...@@ -29,13 +29,6 @@ ...@@ -29,13 +29,6 @@
} }
}, },
{ {
"path": "pages/common/accountItems",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "选择账号"
}
},
{
"path": "pages/common/imgPreview", "path": "pages/common/imgPreview",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
......
<template>
<view class="layout">
<view class="bg"></view>
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
</view>
<view class="step-box">
<template v-for="(i,index) in stepList">
<view
:class="['step-item',{'active-item':stepIndex >= index}]"
:key="index"
@click="setStep(index)"
>
<view class="num">
<view class="border"></view>
<view class="text">{{index + 1}}</view>
</view>{{i}}
</view>
</template>
</view>
<view class="content-box">
<template v-if="stepIndex != 2">
<view class="search-box">
<view class="search-input">
<template v-if="!edit">
<view
:class="['input', `${searchValue ? '' : 'placeholder'}`]"
@click="open"
>
<template v-if="searchValue">
{{searchValue}}
</template>
<template v-else>
请输入门店名称/商户号搜索
<view class="sprite-icon icon-search"></view>
</template>
</view>
</template>
<template v-else>
<input
type="text"
class="input"
v-model="searchValue"
:focus='inputFocus'
confirm-type="search"
@blur="search"
@confirm="search"
/>
</template>
</view>
<template v-if="searchValue">
<view
class="clear"
@click="clear"
>
<uni-icons
type="closeempty"
:size="16"
color="#1A1A1A"
></uni-icons>
</view>
</template>
</view>
</template>
<scroll-view
class="list"
scroll-y
enable-flex
:show-scrollbar="true"
>
<account-list
v-show="stepIndex == 0"
ref="account"
@chooseAccount="chooseAccount"
/>
<merchant-list
v-show="stepIndex == 1"
ref="merchant"
@chooseMerchant="chooseMerchant"
/>
<scene
v-show="stepIndex == 2"
ref="scene"
/>
</scroll-view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import AccountList from './components/AccountList.vue'
import MerchantList from './components/MerchantList.vue'
import Scene from './components/Scene.vue'
export default {
name: 'accountItem',
components: { AccountList, MerchantList, Scene },
data () {
return {
stepList: ['选择账号', '选择4S店', '选择场景'],
stepIndex: 0,
searchValue: '',
edit: false,
}
},
onLoad (options) {
if (options.stepIndex == 1) {
this.$nextTick(() => {
this.$refs.account.getListSelectAccount(true)
})
}
},
mounted () {
},
methods: {
search () {
this.edit = false
const { stepIndex } = this
this.$refs[{
0: 'account',
1: 'merchant'
}[stepIndex]]?.searchEvent(this.searchValue)
},
open () {
this.edit = true
this.inputFocus = true
},
back () {
uni.navigateBack()
},
chooseAccount (userInfo) {
this.stepIndex = 1
this.searchValue = ''
this.$nextTick(() => {
this.$refs.merchant.init(userInfo)
})
},
chooseMerchant (userInfo) {
this.stepIndex = 2
this.searchValue = ''
this.$refs.scene.init(userInfo)
},
setStep (index) {
let { stepIndex } = this
if (index == 2) return
if (stepIndex > index) this.stepIndex = index
},
clear () {
this.searchValue = ''
this.search()
}
}
}
</script>
<style scoped lang='scss'>
.layout {
padding-top: toRpx(144);
font-size: toRpx(28);
color: #333;
letter-spacing: 0;
background: #f7f8fa;
box-sizing: border-box;
height: 100%;
.bg {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-image: url('../../assets/images/login/account-bg.webp');
background-size: 100% 100%;
}
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 9;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
}
.step-box {
position: relative;
z-index: 2;
display: flex;
align-items: center;
justify-content: center;
gap: 0 toRpx(166);
.step-item {
display: flex;
align-items: center;
font-weight: 500;
font-size: toRpx(36);
color: #999999;
.num {
width: toRpx(56);
height: toRpx(56);
position: relative;
padding: toRpx(4);
color: #ffffff;
box-sizing: border-box;
margin-right: toRpx(10);
&::after {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
border: toRpx(2) solid #b1b1b1;
content: '';
border-radius: 100%;
}
.text {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-weight: 700;
font-size: toRpx(32);
background: #b1b1b1;
border-radius: 100%;
}
}
}
.active-item {
color: #4673ff;
.num {
&::after {
border-color: #4673ff;
}
.text {
background: #4673ff;
}
}
}
}
.content-box {
width: 81.84%;
height: calc(100vh - #{toRpx(404)});
position: relative;
margin: toRpx(48) auto 0;
box-sizing: border-box;
padding-top: toRpx(48);
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border-radius: toRpx(48);
background: #ffffff59;
&::after {
position: absolute;
content: '';
left: 0;
top: 0;
width: 100%;
height: 100%;
background: #ffffff59;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border-radius: toRpx(48);
filter: blur(toRpx(8));
}
}
.search-box {
margin: 0 toRpx(48) toRpx(48);
position: relative;
z-index: 2;
.search-input {
width: 100%;
height: toRpx(80);
background: #ffffff;
border: toRpx(3) solid #a8c1ff;
border-radius: toRpx(16);
box-sizing: border-box;
color: #333;
padding: 0 toRpx(24);
font-size: toRpx(28);
position: relative;
.input {
display: flex;
align-items: center;
height: 100%;
width: 100%;
justify-content: center;
text-align: center;
font-size: toRpx(28);
}
.icon-search {
margin-left: toRpx(16);
}
.placeholder {
font-size: toRpx(28);
color: #999999;
}
}
.clear {
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
padding: 0 toRpx(32);
height: 100%;
display: flex;
align-items: center;
}
}
.list {
position: relative;
z-index: 2;
height: calc(100% - #{toRpx(176)});
& ::-webkit-scrollbar {
background-color: #ffffff59 !important;
}
& ::-webkit-scrollbar-thumb {
width: toRpx(8);
background-color: #fff !important;
border-radius: toRpx(4);
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="box" :key="selectedUuid" v-if="flag">
<template v-if="loginUserInfoList.length">
<template v-for="(item, index) in loginUserInfoList">
<view :key="index" :class="['items', `${item.active ? 'active' : ''}`]" @click="chooseAccount(item)">
<view class="right">
<view :class="['midle', midle(item)]">
{{ item.isSuper == true ? '超管' : item.userType == 1 ? '商户' : item.loginRole == 3 ? '督导' : item.loginRole == 4 ? '驻店' : '员工' }}
</view>
</view>
<view class="left">
<view class="name">
{{ item.merchantName }}
</view>
<view class="shop_no">商户号:{{ item.merchantId }}</view>
</view>
</view>
</template>
</template>
<template v-else>
<no-data />
</template>
</view>
</template>
<script type="text/ecmascript-6">
import { loginMixin } from '@/mixin/index'
import NoData from './NoData.vue'
export default {
mixins: [loginMixin],
components: {
NoData
},
data () {
return {
copyLoginUserInfoList: [],
loginRole: {
1: '超管',
2: '商户号',
3: '区域督导',
4: '驻店负责人'
},
selectedUuid: '',
loginUserInfoList: [],
flag: false
}
},
mounted () {
this.getListSelectAccount()
uni.$logger.local.info(`进入选择账号页面!`)
},
methods: {
getListSelectAccount (autoLogin = false) {
uni.showLoading({
mask: true
})
uni.$api.userApi.getListSelectAccount().then(res => {
uni.hideLoading()
let { code, data, message } = res
if (code == 21) uni.reLaunch({
url: "/pages/common/login",
})
else {
if (code == 0) {
let { loginUserInfoList, sessionId } = data
uni.$storage.set('sessionId', sessionId);
this.loginUserInfoList = loginUserInfoList
this.copyLoginUserInfoList = loginUserInfoList
const yqMerchantIdList = loginUserInfoList.map(item => item.merchantId)
// const _res = {
// directSaleAuth: false,
// hmzxAuth: true,
// authorizedBusinessList: [1,2]
// }
// uni.$storage.set('studyCenterPermission', _res)
uni.$api.commonApi.getStudyCenterPermission({yqMerchantIdList}).then(res => {
uni.$storage.set('studyCenterPermission', res)
console.log(res,'res')
})
if (autoLogin) this.chooseAccount(loginUserInfoList[0])
} else uni.showToast({
title: message,
icon: 'none',
});
this.flag = true
}
}).catch(() => {
uni.hideLoading()
})
},
chooseAccount (item) {
let { loginUserInfoList } = this
loginUserInfoList.map(i => {
i.active = false
if (i.uuid == item?.uuid) i.active = true
return i
})
this.loginUserInfoList = loginUserInfoList
this.selectedUuid = item.uuid
this.choiceAccountLogin()
},
async choiceAccountLogin () {
let { loginUserInfoList } = this,
id = null,
merchantName = null
console.log(loginUserInfoList,'loginUserInfoList')
loginUserInfoList.map(e => {
if (e.active) {
id = e.uuid
merchantName = e.merchantName
}
})
if (!id) {
uni.showToast({
title: '请选择账号',
icon: 'none',
});
return
}
// 清空4s店数据
// app.globalData.storeListRange = []
this.selectAccountLogin(id,merchantName)
},
selectAccountLogin (id,merchantName) {
uni.$logger.local.info(`选择账号${merchantName}登录!`)
uni.showLoading({
mask: true
})
uni.$api.userApi.selectAccountLogin({ id }).then(data => {
uni.hideLoading()
let [userInfo] = data.loginUserInfoList
if (data && userInfo) this.get4SStoreList(userInfo)
else uni.showToast({
title: '获取4S店列表失败',
icon: 'none',
})
}).catch((err) => {
uni.$logger.local.error(`获取4S店列表失败${err}!`)
uni.hideLoading()
})
},
// 搜索过滤
searchEvent (searchValue) {
let { copyLoginUserInfoList, selectedUuid } = this
copyLoginUserInfoList.map(val => {
val.active = false
if (val.uuid == selectedUuid) val.active = true
return val
})
let filterArr = copyLoginUserInfoList.filter(val => val.merchantName.includes(searchValue) || val.merchantId == searchValue) || []
this.loginUserInfoList = filterArr
if (!searchValue) this.loginUserInfoList = copyLoginUserInfoList
},
midle (item) {
return item.isSuper == true ? 'midle_1' : item.userType == 1 ? 'midle_2' : (item.loginRole == 3 ? 'midle_3' : item.loginRole == 4 ? 'midle_4' : 'midle_5')
},
}
}
</script>
<style scoped lang="scss">
.box {
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 0 toRpx(48);
gap: toRpx(48);
.items {
width: calc(50% - #{toRpx(24)});
height: toRpx(160);
background: #ffffff;
border-radius: toRpx(16);
padding: toRpx(32);
display: flex;
align-items: center;
box-sizing: border-box;
border: toRpx(4) solid transparent;
.left {
width: 65%;
display: flex;
flex-flow: column;
justify-content: center;
.name {
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: toRpx(32);
color: #181a1f;
}
.shop_no {
font-weight: 400;
font-size: toRpx(28);
margin-top: toRpx(12);
color: #999ea8;
}
}
.right {
flex-shrink: 0;
display: flex;
align-items: center;
.midle {
font-size: toRpx(28);
font-weight: 700;
width: toRpx(96);
height: toRpx(96);
border-radius: toRpx(8);
margin-right: toRpx(28);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.midle_1 {
color: #f24724;
background-color: #f247241a;
}
.midle_2 {
color: #ff9d0a;
/* border: var(--fontSize2) solid #FF9D0A; */
background-color: #ff9d0a1a;
}
.midle_3 {
color: #347bff;
/* border: var(--fontSize2) solid #347BFF; */
background-color: #347bff1a;
}
.midle_4 {
color: #35c376;
/* border: var(--fontSize2) solid #35C376; */
background-color: #35c3761a;
}
.midle_5 {
color: #35c376;
/* border: var(--fontSize2) solid #35C376; */
background-color: #35c3761a;
}
.icon {
width: toRpx(40);
height: toRpx(40);
}
}
}
.active {
border: toRpx(4) solid #347bff;
}
}
</style>
<template>
<view
class="box"
:key="selectMerchantId"
>
<template v-if="flag">
<template v-if="loginUserInfoList.length">
<template v-for="(item, index) in loginUserInfoList">
<view
:key="index"
:class="['items', { active: item.active }]"
@click="chooseAccount(item)"
>
<view class="right">
<view class="sprite-icon icon-store"></view>
</view>
<view class="left">
<view class="text_box">
<view class="name">{{ item.merchantName }}</view>
<view class="text_no">商户号:{{ item.merchantId }}</view>
</view>
</view>
</view>
</template>
</template>
<template v-else>
<no-data />
</template>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import NoData from './NoData.vue'
export default {
name: 'MerchantList',
data () {
return {
loginUserInfoList: [],
copyLoginUserInfoList: [],
showSelect: false,
flag: false,
userInfo: {},
selectMerchantId: ''
}
},
components: {
NoData
},
methods: {
init (userInfo) {
uni.$logger.info(`进入选择4s店页面!`)
this.userInfo = userInfo
this.getMerchantList()
// this.getSceneArr()
},
async getSceneArr (merchantId = '') {
return new Promise(async resolve => {
let { userInfo } = this,
openSceneArr = []
// 获取4s店关联场景数据
const result = await uni.$api.userApi.getYqMerchantSceneConfigAPI({
yqMerchantId: userInfo?.subLoginUser?.merchantId,
merchantId
})
result.map(val => {
if (val.sceneOpenFlag == 0) openSceneArr.push(val.scene)
})
resolve(openSceneArr)
})
},
getMerchantList () {
this.loginUserInfoList = []
this.copyLoginUserInfoList = []
this.flag = false
uni.showLoading({
mask: true
})
let { userInfo } = this
let params = {
merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId,
staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid
}
uni.$api.userApi.getSceneMerchantRefStoreList(params).then(result => {
uni.hideLoading()
this.loginUserInfoList = result
this.copyLoginUserInfoList = result
this.flag = true
if (result && result.length == 1) this.chooseAccount(result[0])
}).catch(err => {
uni.hideLoading()
})
},
async chooseAccount (item) {
uni.$logger.info(`选择4s店${item.merchantName}!`)
uni.showLoading({
mask: true
})
let { loginUserInfoList } = this
let listArr = loginUserInfoList
listArr.map(i => {
i.active = false
if (i.merchantId == item?.merchantId) {
i.active = true
}
return i
})
let openSceneArr = await this.getSceneArr(item.merchantId)
this.loginUserInfoList = listArr
this.selectMerchantId = item.merchantId
this.jumpPage(item, openSceneArr)
},
async jumpPage (item, openSceneArr) {
let { merchantName: shopMerchantName, merchantId: shopMerchantId } = item,
{ userInfo } = this
const usedCarSceneType = 7
if (!openSceneArr?.length && !userInfo?.isSuper) {
uni.hideLoading()
uni.showToast({
title: '暂无开通业务,请联系总部管理员',
icon: 'none'
})
return
}
if (userInfo.isSuper) openSceneArr = [1, 0, usedCarSceneType] //超管默认开通全部场景
userInfo = {
...userInfo,
openSceneArr,
shopMerchantName,
shopMerchantId,
default4SStoreInfo: {
merchantId: shopMerchantId,
merchantName: shopMerchantName
},
default4SStoreInfo_crowdFunding: {
merchantId: shopMerchantId,
merchantName: shopMerchantName
},
default4SStoreInfo_newCarConversion: {
merchantId: shopMerchantId,
merchantName: shopMerchantName
}
}
if (openSceneArr.length == 1 && openSceneArr[0] == usedCarSceneType) {
const data = await uni.$api.userApi.selectMerchantScene({
merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName,
sceneType: usedCarSceneType
})
uni.$logger.local.info(`商户只有二手车场景时自动跳转进入二手车首页!`)
if (data) userInfo.loginRoleOnSelectMerchant = data?.loginRoleOnSelectMerchant
userInfo.sceneType = usedCarSceneType
uni.$storage.set('userInfo', userInfo)
uni.reLaunch({
url: '/pages/usedCar/index'
})
return
}
this.$emit('chooseMerchant', userInfo)
uni.hideLoading()
},
searchEvent (searchValue) {
let { copyLoginUserInfoList, selectMerchantId } = this
copyLoginUserInfoList.map(val => {
val.active = false
if (val.merchantId == selectMerchantId) val.active = true
return val
})
let filterArr = copyLoginUserInfoList.filter(val => val.merchantName.includes(searchValue) || val.merchantId == searchValue) || []
this.loginUserInfoList = filterArr
if (!searchValue) this.loginUserInfoList = copyLoginUserInfoList
},
}
}
</script>
<style scoped lang="scss">
.box {
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 0 toRpx(48);
gap: toRpx(48);
.items {
width: calc(50% - #{toRpx(24)});
height: toRpx(160);
background: #ffffff;
border-radius: toRpx(16);
padding: toRpx(32);
display: flex;
align-items: center;
box-sizing: border-box;
border: toRpx(4) solid transparent;
.right {
margin-right: toRpx(28);
flex-shrink: 0;
}
.left {
flex: 1;
.name {
font-weight: 500;
font-size: toRpx(32);
color: #181a1f;
margin-bottom: toRpx(12);
}
.text_no {
font-size: toRpx(28);
color: #999ea8;
}
}
}
.active {
border: toRpx(4) solid #347bff;
}
}
</style>
<template>
<view class="box">
<template v-for="(item, index) in sceneList">
<view
:key="index"
:class="['items', `${item.actived ? 'active' : ''}`]"
@click="selectScene(item, index)"
>
<view class="left">
<view :class="['sprite-icon', `icon-scene-${item.sceneType}`]"></view>
</view>
<view class="right">
<view class="name">
{{ item.sceneName }}
</view>
<view class="shop_no">
{{ item.sceneDesc }}
</view>
</view>
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import utils from '@/utils/utils.js'
export default {
name: '',
data () {
return {
sceneList: [
{
sceneName: '轻改',
sceneDesc: '太阳膜升级转化',
sceneType: 1,
actived: false
},
{
sceneName: '会员权益/升级',
sceneDesc: '权益、延保',
sceneType: 0,
actived: false
},
{
sceneName: '二手车',
sceneDesc: '二手车业务',
sceneType: 7,
actived: false
},
],
userInfo: {},
}
},
mounted () {
},
methods: {
init (userInfo) {
this.userInfo = userInfo
uni.$logger.local.info(`进入选择场景页!`)
},
// 选择场景
async selectScene ({ sceneType }, index) {
uni.$logger.local.info(`选择场景${sceneType}!`)
let { sceneList, userInfo, userInfo: { openSceneArr } } = this
try {
if (!openSceneArr.includes(sceneType) && !userInfo?.isSuper) return uni.showToast({
title: '暂未开通此场景',
icon: 'none'
})
sceneList.map(i => (i.actived = false))
sceneList[index].actived = true
this.sceneList = sceneList
userInfo.sceneType = sceneType
uni.showLoading({
mask: true
})
if (userInfo?.isSuper) this.jump(userInfo)
else {
const data = await uni.$api.userApi.selectMerchantScene({
merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName,
sceneType
})
if (data) this.jump(userInfo, data)
else {
uni.$logger.local.error(`选择场景异常:merchantId:${userInfo.shopMerchantId},merchantName:${userInfo.shopMerchantName},sceneType:${sceneType},接口返回:${JSON.stringify(data || '')}`)
}
}
} catch (error) {
uni.hideLoading()
uni.showToast({
title: typeof error == "string" ? error : error.toString(),
icon: 'none'
})
uni.$logger.local.error(`选择场景异常:merchantId:${userInfo?.shopMerchantId},merchantName:${userInfo?.shopMerchantName},sceneType:${sceneType},失败原因:${typeof error == "string" ? error : error.toString()}`)
}
},
jump: utils.throttle(async function (userInfo, data) {
uni.$logger.local.info(`跳转进入首页!`)
try {
uni.hideLoading()
if (data) userInfo.loginRoleOnSelectMerchant = data?.loginRoleOnSelectMerchant
let { shopMerchantId } = userInfo
//调接口获取门店主营品牌
uni.showLoading({
mask: true
})
const res = await uni.$api.userApi.getMerchantBrand({
merchantId: shopMerchantId
})
uni.hideLoading()
userInfo.channelType = res.channelType || 1 // 默认1 1问界 2 比亚迪 3 其他
// userInfo.channelType = 2
uni.$storage.set('userInfo', userInfo)
let url = {
1: '/pages/boutique/index',
0: '/pages/equity/index',
7: '/pages/usedCar/index'
}[userInfo.sceneType]
uni.reLaunch({
url
})
} catch (error) {
uni.$logger.local.error(`选择场景后跳转异常:${error}!`)
uni.hideLoading()
uni.showToast({
title: error,
icon: 'none'
})
}
}, 3000)
}
}
</script>
<style scoped lang="scss">
.box {
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 0 toRpx(48);
gap: toRpx(48);
.items {
width: calc(50% - #{toRpx(24)});
height: toRpx(160);
background: #ffffff;
border-radius: toRpx(16);
padding: toRpx(32);
display: flex;
align-items: center;
box-sizing: border-box;
border: toRpx(4) solid transparent;
.left {
margin-right: toRpx(28);
flex-shrink: 0;
}
.right {
flex: 1;
.name {
font-weight: 500;
font-size: toRpx(32);
color: #181a1f;
margin-bottom: toRpx(12);
}
.shop_no {
font-size: toRpx(28);
color: #999ea8;
}
}
}
.active {
border: toRpx(4) solid #347bff;
}
}
</style>
...@@ -18,13 +18,8 @@ export default { ...@@ -18,13 +18,8 @@ export default {
uni.hideLoading() uni.hideLoading()
setTimeout(() => { setTimeout(() => {
if (res.code == 0) { if (res.code == 0) {
let url = {
1: '/pages/boutique/index',
0: '/pages/equity/index',
7: '/pages/usedCar/index'
}[userInfo.sceneType]
uni.reLaunch({ uni.reLaunch({
url url: '/pages/equity/index'
}) })
} }
else this.toLogin() else this.toLogin()
......
<template> <template>
<view class="layout"> <view class="layout">
<view class="bg"></view> <!-- <view class="bg"></view>
<view class="login"> <view class="login">
<view class="title">登录</view> <view class="title">登录</view>
<view class="sub-title">手机号码登录</view> <view class="sub-title">手机号码登录</view>
...@@ -90,8 +90,11 @@ ...@@ -90,8 +90,11 @@
class="sprite-icon icon-clone" class="sprite-icon icon-clone"
@click="copyText" @click="copyText"
></view> ></view>
</view> </view> -->
<update-box /> <web-view
:src="loginUrl"
@message="handlerMessage"
/>
</view> </view>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
...@@ -108,7 +111,8 @@ export default { ...@@ -108,7 +111,8 @@ export default {
dateKey: { dateKey: {
mobile: 0, mobile: 0,
code: 0 code: 0
} },
loginUrl: 'https://scrm.dev.glsx.com.cn/dj-scrm-wx-work-lwk/#/',
}; };
}, },
watch: { watch: {
...@@ -128,6 +132,7 @@ export default { ...@@ -128,6 +132,7 @@ export default {
} }
}, },
onLoad (options) { onLoad (options) {
this.loginUrl = `${this.loginUrl}?corpId=wwa55ffac1225eb25e&agentId=1000016&customLogin=1`
uni.$signHttp = new Request(uni.signHttpConfig) //重新登录重置请求参数 uni.$signHttp = new Request(uni.signHttpConfig) //重新登录重置请求参数
if (options.mobile) this.mobile = options.mobile if (options.mobile) this.mobile = options.mobile
const noSignInUuid = uni.$storage.get('noSignInUuid') const noSignInUuid = uni.$storage.get('noSignInUuid')
...@@ -136,12 +141,25 @@ export default { ...@@ -136,12 +141,25 @@ export default {
deviceId deviceId
} = uni.getDeviceInfo() } = uni.getDeviceInfo()
this.deviceId = deviceId this.deviceId = deviceId
plus.navigator.setUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 Edg/136.0.0.0')
}, },
methods: { methods: {
autoLoginByMobile () { autoLoginByMobile () {
let { mobile, code } = this let { mobile, code } = this
if (code && mobile && code.length == 4 && phoneRex.test(mobile)) this.login() if (code && mobile && code.length == 4 && phoneRex.test(mobile)) this.login()
}, },
handlerMessage ({ detail }) {
let { code } = detail.data[0]
uni.showLoading({
mask: true
})
setTimeout(() => {
uni.reLaunch({
url: '/pages/equity/index',
})
}, 2e3)
console.log(code, '=================')
},
copyText () { copyText () {
uni.setClipboardData({ uni.setClipboardData({
data: this.deviceId, data: this.deviceId,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!