Commit 02378e58 by 李伟康

commit 提交登录

1 parent a2efaf69
.sprite-icon { background-image: url(@/assets/images/sprite.png);background-size: 1434rpx 668rpx;}
.icon-arrow-right { width: 32rpx; height: 32rpx; background-position: -1392rpx -464rpx;}
.icon-back { width: 128rpx; height: 50rpx; background-position: -1146rpx -464rpx;}
.icon-change-account { width: 32rpx; height: 32rpx; background-position: -1146rpx -524rpx;}
.sprite-icon { background-image: url(@/assets/images/sprite.png);background-size: 1434rpx 774rpx;}
.icon-arrow-right { width: 32rpx; height: 32rpx; background-position: -352rpx -588rpx;}
.icon-back { width: 128rpx; height: 50rpx; background-position: -106rpx -588rpx;}
.icon-change-account { width: 32rpx; height: 32rpx; background-position: -394rpx -588rpx;}
.icon-face-error-active { width: 96rpx; height: 96rpx; background-position: -722rpx -464rpx;}
.icon-face-error { width: 96rpx; height: 96rpx; background-position: -828rpx -464rpx;}
.icon-face-success-active { width: 96rpx; height: 96rpx; background-position: -934rpx -464rpx;}
.icon-face-success { width: 96rpx; height: 96rpx; background-position: -1040rpx -464rpx;}
.icon-feedback { width: 32rpx; height: 32rpx; background-position: -1188rpx -524rpx;}
.icon-home-active { width: 80rpx; height: 80rpx; background-position: 0rpx -588rpx;}
.icon-home { width: 80rpx; height: 80rpx; background-position: -90rpx -588rpx;}
.icon-icon-addr { width: 32rpx; height: 32rpx; background-position: -1230rpx -524rpx;}
.icon-feedback { width: 32rpx; height: 32rpx; background-position: -436rpx -588rpx;}
.icon-home-active { width: 80rpx; height: 80rpx; background-position: 0rpx -694rpx;}
.icon-home { width: 80rpx; height: 80rpx; background-position: -90rpx -694rpx;}
.icon-icon-addr { width: 32rpx; height: 32rpx; background-position: -478rpx -588rpx;}
.icon-icon-avatar { width: 112rpx; height: 112rpx; background-position: -1290rpx -294rpx;}
.icon-icon-female { width: 32rpx; height: 32rpx; background-position: -1272rpx -524rpx;}
.icon-icon-handshake { width: 72rpx; height: 72rpx; background-position: -360rpx -588rpx;}
.icon-icon-male { width: 32rpx; height: 32rpx; background-position: -1314rpx -524rpx;}
.icon-icon-shop { width: 32rpx; height: 32rpx; background-position: -1356rpx -524rpx;}
.icon-icon-female { width: 32rpx; height: 32rpx; background-position: -520rpx -588rpx;}
.icon-icon-handshake { width: 72rpx; height: 72rpx; background-position: -1358rpx -464rpx;}
.icon-icon-male { width: 32rpx; height: 32rpx; background-position: -562rpx -588rpx;}
.icon-icon-shop { width: 32rpx; height: 32rpx; background-position: -604rpx -588rpx;}
.icon-icon-upload { width: 128rpx; height: 128rpx; background-position: -892rpx -294rpx;}
.icon-icon-weixin { width: 32rpx; height: 32rpx; background-position: -1398rpx -524rpx;}
.icon-kf-0 { width: 32rpx; height: 32rpx; background-position: -652rpx -588rpx;}
.icon-kf-1 { width: 32rpx; height: 32rpx; background-position: -694rpx -588rpx;}
.icon-kf-2 { width: 32rpx; height: 32rpx; background-position: -736rpx -588rpx;}
.icon-kf-3 { width: 32rpx; height: 32rpx; background-position: -778rpx -588rpx;}
.icon-icon-weixin { width: 32rpx; height: 32rpx; background-position: -646rpx -588rpx;}
.icon-kf-0 { width: 32rpx; height: 32rpx; background-position: -688rpx -588rpx;}
.icon-kf-1 { width: 32rpx; height: 32rpx; background-position: -730rpx -588rpx;}
.icon-kf-2 { width: 32rpx; height: 32rpx; background-position: -772rpx -588rpx;}
.icon-kf-3 { width: 32rpx; height: 32rpx; background-position: -814rpx -588rpx;}
.icon-logo { width: 160rpx; height: 160rpx; background-position: -722rpx -294rpx;}
.icon-pen-active { width: 120rpx; height: 120rpx; background-position: -1030rpx -294rpx;}
.icon-pen { width: 120rpx; height: 120rpx; background-position: -1160rpx -294rpx;}
.icon-qw { width: 48rpx; height: 48rpx; background-position: -1284rpx -464rpx;}
.icon-record-active { width: 80rpx; height: 80rpx; background-position: -180rpx -588rpx;}
.icon-qw { width: 48rpx; height: 48rpx; background-position: -244rpx -588rpx;}
.icon-record-active { width: 80rpx; height: 80rpx; background-position: -180rpx -694rpx;}
.icon-record-day { width: 712rpx; height: 284rpx; background-position: 0rpx 0rpx;}
.icon-record-month { width: 712rpx; height: 284rpx; background-position: 0rpx -294rpx;}
.icon-record-week { width: 712rpx; height: 284rpx; background-position: -722rpx 0rpx;}
.icon-record { width: 80rpx; height: 80rpx; background-position: -270rpx -588rpx;}
.icon-setting { width: 32rpx; height: 32rpx; background-position: -820rpx -588rpx;}
.icon-tool-file { width: 60rpx; height: 60rpx; background-position: -442rpx -588rpx;}
.icon-tool-finish { width: 60rpx; height: 60rpx; background-position: -512rpx -588rpx;}
.icon-tool-pay { width: 60rpx; height: 60rpx; background-position: -582rpx -588rpx;}
.icon-search { width: 40rpx; height: 40rpx; background-position: -1342rpx -464rpx;}
\ No newline at end of file
.icon-record { width: 80rpx; height: 80rpx; background-position: -270rpx -694rpx;}
.icon-setting { width: 32rpx; height: 32rpx; background-position: -856rpx -588rpx;}
.icon-tool-file { width: 60rpx; height: 60rpx; background-position: -360rpx -694rpx;}
.icon-tool-finish { width: 60rpx; height: 60rpx; background-position: -430rpx -694rpx;}
.icon-tool-pay { width: 60rpx; height: 60rpx; background-position: -500rpx -694rpx;}
.icon-search { width: 40rpx; height: 40rpx; background-position: -302rpx -588rpx;}
.icon-store { width: 96rpx; height: 96rpx; background-position: -1146rpx -464rpx;}
.icon-scene-0 { width: 96rpx; height: 96rpx; background-position: -1252rpx -464rpx;}
.icon-scene-1 { width: 96rpx; height: 96rpx; background-position: 0rpx -588rpx;}
\ No newline at end of file

1.03 MB | W: | H:

1.17 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -6,11 +6,7 @@ export default {
try {
let { merchantId, isSuper, uuid } = loginUserObj
if (isSuper) {
uni.$storage.set('userInfo', loginUserObj)
// uni.navigateTo({
// url: '/pages/common/merchantList'
// })
this.$emit('chooseAccount')
this.$emit('chooseAccount', loginUserObj)
return
}
uni.$api.userApi.getSceneMerchantRefStoreList({
......@@ -20,7 +16,7 @@ export default {
// 仅一家4s店
if (result?.length == 1) {
let { merchantName, merchantId } = result[0]
uni.$storage.set('userInfo', {
this.$emit('chooseAccount', {
...loginUserObj,
shopMerchantName: merchantName,
shopMerchantId: merchantId,
......@@ -37,17 +33,13 @@ export default {
merchantName: merchantName
}
})
uni.redirectTo({
url: '/pages/home/home'
})
} else if (!result?.length) {
return uni.showToast({
title: '园区店关联的4s店商户账号无效,请联系总部管理员',
icon: 'none',
})
} else {
uni.$storage.set('userInfo', loginUserObj)
this.$emit('chooseAccount')
this.$emit('chooseAccount', loginUserObj)
}
})
} catch (error) {
......
<template>
<view></view>
<view>123</view>
</template>
<script type='text/ecmascript-6'>
......
......@@ -15,7 +15,7 @@
<view class="step-box">
<template v-for="(i,index) in stepList">
<view
:class="['step-item',{'active-item':stepIndex == index}]"
:class="['step-item',{'active-item':stepIndex >= index}]"
:key="index"
>
<view class="num">
......@@ -26,35 +26,37 @@
</template>
</view>
<view class="content-box">
<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>
<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>
</view>
</view>
</template>
<scroll-view
class="list"
scroll-y
......@@ -63,14 +65,17 @@
<account-list
v-show="stepIndex == 0"
ref="account"
@chooseAccount="stepIndex = 1"
@chooseAccount="chooseAccount"
/>
<merchant-list
v-show="stepIndex == 1"
ref="merchant"
@chooseMerchant="stepIndex = 2"
@chooseMerchant="chooseMerchant"
/>
<scene
v-show="stepIndex == 2"
ref="scene"
/>
<view class="scrollSpase"></view>
</scroll-view>
</view>
</view>
......@@ -79,9 +84,10 @@
<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 },
components: { AccountList, MerchantList, Scene },
data () {
return {
stepList: ['选择帐号', '选择4S店', '选择场景'],
......@@ -102,6 +108,7 @@ export default {
const { stepIndex } = this
this.$refs[{
0: 'account',
1: 'merchant'
}[stepIndex]]?.searchEvent(this.searchValue)
},
open () {
......@@ -111,6 +118,16 @@ export default {
back () {
uni.navigateBack()
},
chooseAccount (userInfo) {
this.stepIndex = 1
this.$nextTick(() => {
this.$refs.merchant.init(userInfo)
})
},
chooseMerchant (userInfo) {
this.stepIndex = 2
this.$refs.scene.init(userInfo)
}
}
}
</script>
......@@ -264,9 +281,6 @@ export default {
position: relative;
z-index: 2;
height: calc(100% - 176rpx);
.scrollSpase {
height: 70rpx;
}
}
}
</style>
\ No newline at end of file
......@@ -153,88 +153,90 @@ export default {
flex-wrap: wrap;
padding: 0 48rpx;
gap: 48rpx;
}
.items {
width: calc(50% - 24rpx);
height: 160rpx;
background: #ffffff;
border-radius: 16rpx;
padding: 32rpx;
display: flex;
align-items: center;
box-sizing: border-box;
border: 4rpx 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: 32rpx;
color: #181a1f;
}
.shop_no {
font-weight: 400;
font-size: 28rpx;
margin-top: 12rpx;
color: #999ea8;
}
}
.right {
flex-shrink: 0;
.items {
width: calc(50% - 24rpx);
height: 160rpx;
background: #ffffff;
border-radius: 16rpx;
padding: 32rpx;
display: flex;
align-items: center;
.midle {
font-size: 28rpx;
font-weight: 700;
width: 96rpx;
height: 96rpx;
border-radius: 8rpx;
margin-right: 28rpx;
box-sizing: border-box;
border: 4rpx solid transparent;
.left {
width: 65%;
display: flex;
align-items: center;
flex-flow: column;
justify-content: center;
.name {
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 32rpx;
color: #181a1f;
}
.shop_no {
font-weight: 400;
font-size: 28rpx;
margin-top: 12rpx;
color: #999ea8;
}
}
.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: 40rpx;
height: 40rpx;
.right {
flex-shrink: 0;
display: flex;
align-items: center;
.midle {
font-size: 28rpx;
font-weight: 700;
width: 96rpx;
height: 96rpx;
border-radius: 8rpx;
margin-right: 28rpx;
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: 40rpx;
height: 40rpx;
}
}
}
}
.active {
border: 4rpx solid #347bff;
}
.list-not {
font-size: 28rpx;
color: #999999;
margin: auto;
.active {
border: 4rpx solid #347bff;
}
.list-not {
font-size: 28rpx;
color: #999999;
margin: auto;
}
}
</style>
\ No newline at end of file
<template>
<view class="box">
<view
class="box"
:key="selectMerchantId"
>
<template v-if="flag">
<template v-for="(item,index) in loginUserInfoList">
<view
:key="index"
:class="['items' ,{active:item.active}]"
@click="chooseAccount(item)"
>
<view class="left">
<view class="text_box">
<view class="name"></view>{{item.merchantName}}
<view class="text_no">商户号:{{item.merchantId}}</view>
<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>
<view class="list-not">
暂无内容
</view>
</template>
</template>
......@@ -21,23 +35,29 @@
<script type='text/ecmascript-6'>
export default {
name: '',
name: 'MerchantList',
data () {
return {
loginUserInfoList: [],
copyLoginUserInfoList: [],
showSelect: false,
jumpPageFlag: false,
openSceneArr: []
openSceneArr: [],
flag: false,
userInfo: {},
selectMerchantId:''
}
},
onLoad () {
// this.getMerchantList()
// this.getSceneArr()
},
methods: {
init (userInfo) {
this.userInfo = userInfo
this.getMerchantList()
this.getSceneArr()
},
getSceneArr () {
let userInfo = uni.$storage.get('userInfo')
let { userInfo } = this
// 超管开通全部场景
if (userInfo?.isSuper) return
// 获取4s店关联场景数据
......@@ -51,7 +71,7 @@ export default {
},
getMerchantList () {
uni.showLoading()
let userInfo = uni.$storage.get('userInfo')
let { userInfo } = this
let params = {
merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId,
staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid
......@@ -67,8 +87,7 @@ export default {
})
},
chooseAccount (item) {
if (this.jumpPageFlag) return
this.jumpPageFlag = true
uni.showLoading()
let { loginUserInfoList } = this
let listArr = loginUserInfoList
listArr.map(i => {
......@@ -79,18 +98,18 @@ export default {
return i
})
this.loginUserInfoList = listArr
this.selectMerchantId = item.merchantId
this.jumpPage(item)
},
async jumpPage (item) {
console.log(item)
let { openSceneArr } = this,
{ merchantName: shopMerchantName, merchantId: shopMerchantId } = item,
userInfo = uni.$storage.get('userInfo')
{ userInfo } = this
if (!openSceneArr?.length && !userInfo?.isSuper) return uni.showToast({
title: '暂无开通业务,请联系总部管理员',
icon: 'none'
})
uni.$storage.set('userInfo', {
this.$emit('chooseMerchant',{
...userInfo,
shopMerchantName,
shopMerchantId,
......@@ -107,194 +126,66 @@ export default {
merchantName: shopMerchantName
}
})
this.jumpPageFlag = false
const res = await uni.$api.userApi.selectMerchantScene({
merchantId: shopMerchantId,
merchantName: shopMerchantName,
sceneType: 0
})
uni.reLaunch({
url: '/pages/home/home'
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'>
.layout {
padding: 32rpx 24rpx 0;
font-size: 28rpx;
color: #333;
letter-spacing: 0;
background: #f7f8fa;
box-sizing: border-box;
height: 100vh;
.search-box {
width: 100%;
height: 72rpx;
padding-left: 24rpx;
box-sizing: border-box;
margin-bottom: 32rpx;
color: #333;
.box {
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 0 48rpx;
gap: 48rpx;
.items {
width: calc(50% - 24rpx);
height: 160rpx;
background: #ffffff;
border-radius: 16rpx;
padding: 32rpx;
display: flex;
position: sticky;
top: 0;
left: 0;
z-index: 1009;
align-items: center;
box-sizing: border-box;
.select_box {
width: 200rpx;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: #999999;
.select {
width: 140rpx;
display: flex;
align-items: center;
.select_text {
font-size: 28rpx;
color: #181a1f;
}
.select_img {
transform: rotate(-90deg);
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
margin-left: 6rpx;
}
.select_img_rotate {
transform: rotate(90deg);
}
}
.option_box {
position: absolute;
z-index: 200;
top: 100rpx;
left: 32rpx;
width: 194rpx;
box-sizing: border-box;
background: #ffffff;
box-shadow: 0 6rpx 12rpx 0 #0000000d;
height: 176rpx;
border-radius: 16rpx;
.option {
display: block;
height: 88rpx;
line-height: 88rpx;
text-align: center;
color: #333333;
overflow: hidden;
&:first-child {
border-radius: 16rpx 16rpx 0 0;
}
&:last-child {
border-radius: 0 0 16rpx 16rpx;
}
}
.active {
background: #347bff1a;
color: #347bff;
}
&::after {
height: 0;
width: 0;
content: "";
position: absolute;
border: 14rpx solid transparent;
border-right: 14rpx solid #ffffff;
top: calc(-1 * 24rpx);
left: 88rpx;
z-index: -1;
transform: rotate(90deg);
}
&::before {
height: 0;
width: 0;
content: "";
position: absolute;
border: 14rpx solid transparent;
border-right: 14rpx solid #ffffff;
top: calc(-1 * 24rpx);
left: 88rpx;
z-index: -1;
transform: rotate(90deg);
}
}
border: 4rpx solid transparent;
.right {
margin-right: 28rpx;
flex-shrink: 0;
}
.search-input {
width: 100%;
height: 72rpx;
display: flex;
align-items: center;
background: #ffffff;
border-radius: var(--fontSize38);
.search-icon {
width: 28rpx;
height: 28rpx;
margin: 0 var(--fontSize10) 0 var(--fontSize26);
.left {
flex: 1;
.name {
font-weight: 500;
font-size: 32rpx;
color: #181a1f;
margin-bottom: 12rpx;
}
.search-clear {
width: var(--fontSize36);
height: var(--fontSize36);
padding: var(--fontSize10);
margin: 0 var(--fontSize26) 0 var(--fontSize10);
}
.input {
.text_no {
font-size: 28rpx;
width: calc(100% - var(--fontSize136));
height: 28rpx;
}
.input-placeholder {
color: rgba(200, 201, 204, 0.89);
}
}
.search {
width: var(--fontSize144);
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 24rpx;
.text-center {
font-size: 24rpx;
/* background-color: #f7f7f7; */
border-radius: 12rpx;
width: 100%;
height: 50rpx;
color: #888;
.search-filter {
margin-left: 6rpx;
width: 24rpx;
height: 24rpx;
}
color: #999ea8;
}
}
}
.list {
.scrollSpase {
height: 70rpx;
}
.items {
width: 100%;
background: #ffffff;
border-radius: 16rpx;
margin-top: 32rpx;
padding: 32rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
&:first-child {
margin-top: 0;
}
}
.active {
border: 4rpx solid #347bff;
}
.list-not {
font-size: 28rpx;
color: #999999;
margin: auto;
}
}
</style>
\ No newline at end of file
<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'>
export default {
name: '',
data () {
return {
sceneList: [
{
sceneName: '轻改',
sceneDesc: '太阳膜升级转化下单',
sceneType: 1,
actived: false
},
{
sceneName: '延保',
sceneDesc: '延保升级下单',
sceneType: 0,
actived: false
},
],
userInfo: {},
openSceneArr: []
}
},
mounted () {
},
methods: {
init (userInfo) {
this.userInfo = userInfo
this.getSceneArr()
},
getSceneArr () {
uni.showLoading()
// 超管默认开通全部场景
let { userInfo } = this
if (userInfo?.isSuper) return
// 获取4s店关联场景数据
uni.$api.userApi.getYqMerchantSceneConfigAPI({
yqMerchantId: userInfo?.subLoginUser?.merchantId,
merchantId: userInfo?.shopMerchantId
}).then(result => {
uni.hideLoading()
this.openSceneArr = result.map(val => { if (val.sceneOpenFlag == 0) return val.scene }) || []
})
},
// 选择场景
async selectScene ({ sceneType }, index) {
let { sceneList, openSceneArr, userInfo } = this
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
if (userInfo?.isSuper) this.jump(userInfo)
else {
try {
const { message, data, code } = await uni.$api.userApi.selectMerchantScene({
merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName,
sceneType
})
if (code == 0) this.jump(userInfo, data)
else throw message
} catch (error) {
uni.showToast({
title: error,
icon: 'none'
})
}
}
},
jump (userInfo, data) {
if (data) userInfo.loginRoleOnSelectMerchant = data?.loginRoleOnSelectMerchant
uni.$storage.set('userInfo', userInfo)
let url = {
1: '/pages/boutique/index',
0: '/pages/home/home'
}[userInfo.sceneType]
uni.reLaunch({
url
})
}
}
}
</script>
<style scoped lang='scss'>
.box {
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 0 48rpx;
gap: 48rpx;
.items {
width: calc(50% - 24rpx);
height: 160rpx;
background: #ffffff;
border-radius: 16rpx;
padding: 32rpx;
display: flex;
align-items: center;
box-sizing: border-box;
border: 4rpx solid transparent;
.left {
margin-right: 28rpx;
flex-shrink: 0;
}
.right {
flex: 1;
.name {
font-weight: 500;
font-size: 32rpx;
color: #181a1f;
margin-bottom: 12rpx;
}
.shop_no {
font-size: 28rpx;
color: #999ea8;
}
}
}
.active {
border: 4rpx solid #347bff;
}
}
</style>
\ No newline at end of file
......@@ -14,9 +14,15 @@ export default {
uni.$api.userApi.getListSelectAccount().then(res => {
uni.hideLoading()
setTimeout(() => {
if (res.code == 0 && userInfo) uni.reLaunch({
url: '/pages/home/home'
})
if (res.code == 0 && userInfo) {
let url = {
1: '/pages/boutique/index',
0: '/pages/home/home'
}[userInfo.sceneType]
uni.reLaunch({
url
})
}
else uni.reLaunch({
url: '/pages/common/login'
})
......
......@@ -70,7 +70,7 @@ export default {
code: '1',
count: '',
noSignIn: true,
readingStatus:false,
readingStatus:true,
dateKey:null
};
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!