Commit f4737deb by 李伟康

commit

1 parent 28d87042
...@@ -16,6 +16,15 @@ module.exports = { ...@@ -16,6 +16,15 @@ module.exports = {
/**获取当前登录账号能查看的园区店列表 */ /**获取当前登录账号能查看的园区店列表 */
getYQList () { getYQList () {
data.projectName = 'boutique'
return http.fetch('dj.api.smartcarlife.serviceMerchant.curYqList') return http.fetch('dj.api.smartcarlife.serviceMerchant.curYqList')
}, },
// 获取园区店下的4s店
getSceneMerchantRefStoreList (data) {
data.projectName = 'boutique'
return http.post({
method: 'dj.api.scenemerchantref.query4SRefByYqShopByLogin',
...data,
})
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -4,13 +4,6 @@ ...@@ -4,13 +4,6 @@
}, },
"pages": [ "pages": [
{ {
"path": "pages/home/home",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "pages/common/login", "path": "pages/common/login",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
...@@ -29,6 +22,24 @@ ...@@ -29,6 +22,24 @@
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path": "pages/common/nothing",
"style": {
"navigationBarTitleText": "提示"
}
},
{
"path": "pages/common/accountItems",
"style": {
"navigationBarTitleText": "选择账号"
}
},
{
"path": "pages/common/merchantList",
"style": {
"navigationBarTitleText": "选择4S店"
}
} }
], ],
"globalStyle": { "globalStyle": {
......
<template>
<div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ No newline at end of file
...@@ -46,10 +46,7 @@ ...@@ -46,10 +46,7 @@
</view> </view>
</template> </template>
<!-- :class="['code-btn', { 'code-disabled': count }]" --> <!-- :class="['code-btn', { 'code-disabled': count }]" -->
<view <view @click="getSmsCode">{{ count ? `重新发送(${count}s)` : '获取验证码' }}</view>
@click="getSmsCode"
>{{ count ? `重新发送(${count}s)` : '获取验证码' }}</view>
</view> </view>
<button <button
class="btn" class="btn"
...@@ -126,34 +123,13 @@ export default { ...@@ -126,34 +123,13 @@ export default {
let { let {
loginUserInfoList, loginUserInfoList,
sessionId, sessionId,
noSignInUuid,
needSelectAccount,
} = data; } = data;
if (loginUserInfoList.length) { if (loginUserInfoList.length) {
const loginUserObj =
loginUserInfoList.filter(
(val) =>
val.subLoginUser && Object.keys(val.subLoginUser)?.length
)[0] || {};
uni.$storage.set('sessionId', sessionId); uni.$storage.set('sessionId', sessionId);
this.getAccountLoginList(loginUserInfoList)
console.log(loginUserObj) } else uni.reLaunch({
// getYQList(); url: '/pages/common/nothing'
// noSignInUuid ? setNoSignInUuid(noSignInUuid) : rmNoSignInUuid(); });
// 记录登录信息 已选园区店、4s店和场景
if (!needSelectAccount && Object.keys(loginUserObj)?.length && loginUserObj?.shopMerchantId && !((loginUserObj?.sceneType ?? '') === '')) {
this.getYqMerchantSceneConfig(loginUserObj, 0);
} else if (!needSelectAccount && Object.keys(loginUserObj)?.length && loginUserObj?.shopMerchantId && (loginUserObj?.sceneType ?? '') === '') {
// 已选园区店、4s店
this.getYqMerchantSceneConfig(loginUserObj, 1);
} else if (!needSelectAccount) {
// 仅选择园区店
this.getYqMerchantSceneConfig(loginUserObj, 2);
} else {
// 未记录到登录信息
this.getAccountLoginList(loginUserInfoList);
}
} else wx.$router.reLaunch('pages.nothing');
} else } else
uni.showModal({ uni.showModal({
title: '温馨提示', title: '温馨提示',
...@@ -170,48 +146,74 @@ export default { ...@@ -170,48 +146,74 @@ export default {
}); });
} }
}, },
async getYqMerchantSceneConfig (loginUserObj, num) { // 获取登录账号下园区店列表
// let checkAgreeClient = await this.checkAgreeClient(loginUserObj) getAccountLoginList (loginUserInfoList) {
// if (!checkAgreeClient) return wx.$router.go('pages.accountItems') if (loginUserInfoList?.length == 1) this.get4SStoreList(loginUserObj)
// num 0已选园区店、4s店和场景 1已选园区店、4s店 2仅选择园区店 else uni.navigateTo({
let pageUrl = ['pages.loading', 'pages.sceneIndex', 'pages.merchantList'] url: '/pages/common/accountItems'
let { shopMerchantId, shopMerchantName } = loginUserObj })
wx.$util.setUserInfo(loginUserObj) },
if (num == 2) { // 获取园区店下4s店数据
this.get4SStoreList(loginUserObj, pageUrl[num]) get4SStoreList (loginUserObj) {
} else { let { merchantId, isSuper, uuid } = loginUserObj
// 兼容除精品升级外场景 已选门店数据 uni.$api.userApi.getSceneMerchantRefStoreList({
wx.$util.setUserInfo({ merchantId: isSuper ? undefined : merchantId,
...wx.$util.getUserInfo(), staffUUID: isSuper ? undefined : uuid
}).then(result => {
// 超管跳过选择4s店
let userInfo = uni.$storage.get('userInfo') || {}
if (isSuper) {
let { merchantName, merchantId } = result[0]
uni.$storage.set('userInfo', {
...userInfo,
shopMerchantName: merchantName,
shopMerchantId: merchantId
})
uni.redirectTo({
url: '/pages/home/home'
})
return
}
// 仅一家4s店
if (result?.length == 1) {
let { merchantName, merchantId } = result[0]
uni.$storage.set('userInfo', {
...userInfo,
shopMerchantName: merchantName,
shopMerchantId: merchantId,
default4SStoreInfo: { default4SStoreInfo: {
merchantId: shopMerchantId, merchantId: merchantId,
merchantName: shopMerchantName merchantName: merchantName
}, },
default4SStoreInfo_crowdFunding: { default4SStoreInfo_crowdFunding: {
merchantId: shopMerchantId, merchantId: merchantId,
merchantName: shopMerchantName merchantName: merchantName
}, },
default4SStoreInfo_newCarConversion: { default4SStoreInfo_newCarConversion: {
merchantId: shopMerchantId, merchantId: merchantId,
merchantName: shopMerchantName merchantName: merchantName
} }
}) })
if (num == 0) wx.$router.reLaunch(pageUrl[num]) uni.redirectTo({
else wx.$router.go(pageUrl[num]) url: '/pages/home/home'
this.setData({ jumpPageFlag: false }) })
} } else if (!result?.length) {
}, return uni.showToast({
// 获取登录账号下园区店列表 title: '园区店关联的4s店商户账号无效,请联系总部管理员',
getAccountLoginList (loginUserInfoList) { icon: 'none',
if (loginUserInfoList?.length == 1) this.getYqMerchantSceneConfig(loginUserInfoList[0], 2) })
else wx.$router.go('pages.accountItems') } else uni.navigateTo({
url: '/pages/common/merchantList'
})
})
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.a{ .a {
width: 500px; width: 500px;
height: 200px; height: 200px;
} }
......
<template>
<div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ No newline at end of file
import modules from './modules' // import modules from './modules'
import Vue from 'vue' // import Vue from 'vue'
import Router from '@/plugin/uni-simple-router/index.js' // import Router from '@/plugin/uni-simple-router/index.js'
Vue.use(Router) // Vue.use(Router)
//初始化 // //初始化
const router = new Router({ // const router = new Router({
encodeURI:true, // encodeURI:true,
routes: [...modules]//路由表 // routes: [...modules]//路由表
}); // });
const whiteList = ['/pages/common/login']
//全局路由前置守卫
router.beforeEach((to, from, next) => {
next()
})
// 全局路由后置守卫
router.afterEach((to, from) => {
console.log("afterEach")
});
\ No newline at end of file \ No newline at end of file
// const whiteList = ['/pages/common/login']
// //全局路由前置守卫
// router.beforeEach((to, from, next) => {
// next()
// })
// // 全局路由后置守卫
// router.afterEach((to, from) => {
// console.log("afterEach")
// });
\ No newline at end of file \ No newline at end of file
...@@ -6,5 +6,33 @@ const routes = [ ...@@ -6,5 +6,33 @@ const routes = [
title: '登录', title: '登录',
}, },
}, },
{
path: "/pages/common/nothing",
name: 'login',
meta: {
title: '提示',
},
},
{
path: "/pages/common/accountItems",
name: 'login',
meta: {
title: '选择账号',
},
},
{
path: "/pages/common/merchantList",
name: 'login',
meta: {
title: '选择4S店',
},
},
{
path: "/pages/home/home",
name: 'login',
meta: {
title: '首页',
},
},
] ]
export default routes export default routes
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!