Commit 02378e58 by 李伟康

commit 提交登录

1 parent a2efaf69
.sprite-icon { background-image: url(@/assets/images/sprite.png);background-size: 1434rpx 668rpx;} .sprite-icon { background-image: url(@/assets/images/sprite.png);background-size: 1434rpx 774rpx;}
.icon-arrow-right { width: 32rpx; height: 32rpx; background-position: -1392rpx -464rpx;} .icon-arrow-right { width: 32rpx; height: 32rpx; background-position: -352rpx -588rpx;}
.icon-back { width: 128rpx; height: 50rpx; background-position: -1146rpx -464rpx;} .icon-back { width: 128rpx; height: 50rpx; background-position: -106rpx -588rpx;}
.icon-change-account { width: 32rpx; height: 32rpx; background-position: -1146rpx -524rpx;} .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-active { width: 96rpx; height: 96rpx; background-position: -722rpx -464rpx;}
.icon-face-error { width: 96rpx; height: 96rpx; background-position: -828rpx -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-active { width: 96rpx; height: 96rpx; background-position: -934rpx -464rpx;}
.icon-face-success { width: 96rpx; height: 96rpx; background-position: -1040rpx -464rpx;} .icon-face-success { width: 96rpx; height: 96rpx; background-position: -1040rpx -464rpx;}
.icon-feedback { width: 32rpx; height: 32rpx; background-position: -1188rpx -524rpx;} .icon-feedback { width: 32rpx; height: 32rpx; background-position: -436rpx -588rpx;}
.icon-home-active { width: 80rpx; height: 80rpx; background-position: 0rpx -588rpx;} .icon-home-active { width: 80rpx; height: 80rpx; background-position: 0rpx -694rpx;}
.icon-home { width: 80rpx; height: 80rpx; background-position: -90rpx -588rpx;} .icon-home { width: 80rpx; height: 80rpx; background-position: -90rpx -694rpx;}
.icon-icon-addr { width: 32rpx; height: 32rpx; background-position: -1230rpx -524rpx;} .icon-icon-addr { width: 32rpx; height: 32rpx; background-position: -478rpx -588rpx;}
.icon-icon-avatar { width: 112rpx; height: 112rpx; background-position: -1290rpx -294rpx;} .icon-icon-avatar { width: 112rpx; height: 112rpx; background-position: -1290rpx -294rpx;}
.icon-icon-female { width: 32rpx; height: 32rpx; background-position: -1272rpx -524rpx;} .icon-icon-female { width: 32rpx; height: 32rpx; background-position: -520rpx -588rpx;}
.icon-icon-handshake { width: 72rpx; height: 72rpx; background-position: -360rpx -588rpx;} .icon-icon-handshake { width: 72rpx; height: 72rpx; background-position: -1358rpx -464rpx;}
.icon-icon-male { width: 32rpx; height: 32rpx; background-position: -1314rpx -524rpx;} .icon-icon-male { width: 32rpx; height: 32rpx; background-position: -562rpx -588rpx;}
.icon-icon-shop { width: 32rpx; height: 32rpx; background-position: -1356rpx -524rpx;} .icon-icon-shop { width: 32rpx; height: 32rpx; background-position: -604rpx -588rpx;}
.icon-icon-upload { width: 128rpx; height: 128rpx; background-position: -892rpx -294rpx;} .icon-icon-upload { width: 128rpx; height: 128rpx; background-position: -892rpx -294rpx;}
.icon-icon-weixin { width: 32rpx; height: 32rpx; background-position: -1398rpx -524rpx;} .icon-icon-weixin { width: 32rpx; height: 32rpx; background-position: -646rpx -588rpx;}
.icon-kf-0 { width: 32rpx; height: 32rpx; background-position: -652rpx -588rpx;} .icon-kf-0 { width: 32rpx; height: 32rpx; background-position: -688rpx -588rpx;}
.icon-kf-1 { width: 32rpx; height: 32rpx; background-position: -694rpx -588rpx;} .icon-kf-1 { width: 32rpx; height: 32rpx; background-position: -730rpx -588rpx;}
.icon-kf-2 { width: 32rpx; height: 32rpx; background-position: -736rpx -588rpx;} .icon-kf-2 { width: 32rpx; height: 32rpx; background-position: -772rpx -588rpx;}
.icon-kf-3 { width: 32rpx; height: 32rpx; background-position: -778rpx -588rpx;} .icon-kf-3 { width: 32rpx; height: 32rpx; background-position: -814rpx -588rpx;}
.icon-logo { width: 160rpx; height: 160rpx; background-position: -722rpx -294rpx;} .icon-logo { width: 160rpx; height: 160rpx; background-position: -722rpx -294rpx;}
.icon-pen-active { width: 120rpx; height: 120rpx; background-position: -1030rpx -294rpx;} .icon-pen-active { width: 120rpx; height: 120rpx; background-position: -1030rpx -294rpx;}
.icon-pen { width: 120rpx; height: 120rpx; background-position: -1160rpx -294rpx;} .icon-pen { width: 120rpx; height: 120rpx; background-position: -1160rpx -294rpx;}
.icon-qw { width: 48rpx; height: 48rpx; background-position: -1284rpx -464rpx;} .icon-qw { width: 48rpx; height: 48rpx; background-position: -244rpx -588rpx;}
.icon-record-active { width: 80rpx; height: 80rpx; background-position: -180rpx -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-day { width: 712rpx; height: 284rpx; background-position: 0rpx 0rpx;}
.icon-record-month { width: 712rpx; height: 284rpx; background-position: 0rpx -294rpx;} .icon-record-month { width: 712rpx; height: 284rpx; background-position: 0rpx -294rpx;}
.icon-record-week { width: 712rpx; height: 284rpx; background-position: -722rpx 0rpx;} .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 \ 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 \ 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 { ...@@ -6,11 +6,7 @@ export default {
try { try {
let { merchantId, isSuper, uuid } = loginUserObj let { merchantId, isSuper, uuid } = loginUserObj
if (isSuper) { if (isSuper) {
uni.$storage.set('userInfo', loginUserObj) this.$emit('chooseAccount', loginUserObj)
// uni.navigateTo({
// url: '/pages/common/merchantList'
// })
this.$emit('chooseAccount')
return return
} }
uni.$api.userApi.getSceneMerchantRefStoreList({ uni.$api.userApi.getSceneMerchantRefStoreList({
...@@ -20,7 +16,7 @@ export default { ...@@ -20,7 +16,7 @@ export default {
// 仅一家4s店 // 仅一家4s店
if (result?.length == 1) { if (result?.length == 1) {
let { merchantName, merchantId } = result[0] let { merchantName, merchantId } = result[0]
uni.$storage.set('userInfo', { this.$emit('chooseAccount', {
...loginUserObj, ...loginUserObj,
shopMerchantName: merchantName, shopMerchantName: merchantName,
shopMerchantId: merchantId, shopMerchantId: merchantId,
...@@ -37,17 +33,13 @@ export default { ...@@ -37,17 +33,13 @@ export default {
merchantName: merchantName merchantName: merchantName
} }
}) })
uni.redirectTo({
url: '/pages/home/home'
})
} else if (!result?.length) { } else if (!result?.length) {
return uni.showToast({ return uni.showToast({
title: '园区店关联的4s店商户账号无效,请联系总部管理员', title: '园区店关联的4s店商户账号无效,请联系总部管理员',
icon: 'none', icon: 'none',
}) })
} else { } else {
uni.$storage.set('userInfo', loginUserObj) this.$emit('chooseAccount', loginUserObj)
this.$emit('chooseAccount')
} }
}) })
} catch (error) { } catch (error) {
......
<template> <template>
<view></view> <view>123</view>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<view class="step-box"> <view class="step-box">
<template v-for="(i,index) in stepList"> <template v-for="(i,index) in stepList">
<view <view
:class="['step-item',{'active-item':stepIndex == index}]" :class="['step-item',{'active-item':stepIndex >= index}]"
:key="index" :key="index"
> >
<view class="num"> <view class="num">
...@@ -26,35 +26,37 @@ ...@@ -26,35 +26,37 @@
</template> </template>
</view> </view>
<view class="content-box"> <view class="content-box">
<view class="search-box"> <template v-if="stepIndex != 2">
<view class="search-input"> <view class="search-box">
<template v-if="!edit"> <view class="search-input">
<view <template v-if="!edit">
:class="['input', `${searchValue ? '' : 'placeholder'}`]" <view
@click="open" :class="['input', `${searchValue ? '' : 'placeholder'}`]"
> @click="open"
<template v-if="searchValue"> >
{{searchValue}} <template v-if="searchValue">
</template> {{searchValue}}
<template v-else> </template>
请输入门店名称/商户号搜索 <template v-else>
<view class="sprite-icon icon-search"></view> 请输入门店名称/商户号搜索
</template> <view class="sprite-icon icon-search"></view>
</view> </template>
</template> </view>
<template v-else> </template>
<input <template v-else>
type="text" <input
class="input" type="text"
v-model="searchValue" class="input"
:focus='inputFocus' v-model="searchValue"
confirm-type="search" :focus='inputFocus'
@blur="search" confirm-type="search"
@confirm="search" @blur="search"
/> @confirm="search"
</template> />
</template>
</view>
</view> </view>
</view> </template>
<scroll-view <scroll-view
class="list" class="list"
scroll-y scroll-y
...@@ -63,14 +65,17 @@ ...@@ -63,14 +65,17 @@
<account-list <account-list
v-show="stepIndex == 0" v-show="stepIndex == 0"
ref="account" ref="account"
@chooseAccount="stepIndex = 1" @chooseAccount="chooseAccount"
/> />
<merchant-list <merchant-list
v-show="stepIndex == 1" v-show="stepIndex == 1"
ref="merchant" ref="merchant"
@chooseMerchant="stepIndex = 2" @chooseMerchant="chooseMerchant"
/>
<scene
v-show="stepIndex == 2"
ref="scene"
/> />
<view class="scrollSpase"></view>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
...@@ -79,9 +84,10 @@ ...@@ -79,9 +84,10 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import AccountList from './components/AccountList.vue' import AccountList from './components/AccountList.vue'
import MerchantList from './components/MerchantList.vue' import MerchantList from './components/MerchantList.vue'
import Scene from './components/Scene.vue'
export default { export default {
name: 'accountItem', name: 'accountItem',
components: { AccountList, MerchantList }, components: { AccountList, MerchantList, Scene },
data () { data () {
return { return {
stepList: ['选择帐号', '选择4S店', '选择场景'], stepList: ['选择帐号', '选择4S店', '选择场景'],
...@@ -102,6 +108,7 @@ export default { ...@@ -102,6 +108,7 @@ export default {
const { stepIndex } = this const { stepIndex } = this
this.$refs[{ this.$refs[{
0: 'account', 0: 'account',
1: 'merchant'
}[stepIndex]]?.searchEvent(this.searchValue) }[stepIndex]]?.searchEvent(this.searchValue)
}, },
open () { open () {
...@@ -111,6 +118,16 @@ export default { ...@@ -111,6 +118,16 @@ export default {
back () { back () {
uni.navigateBack() 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> </script>
...@@ -264,9 +281,6 @@ export default { ...@@ -264,9 +281,6 @@ export default {
position: relative; position: relative;
z-index: 2; z-index: 2;
height: calc(100% - 176rpx); height: calc(100% - 176rpx);
.scrollSpase {
height: 70rpx;
}
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -153,88 +153,90 @@ export default { ...@@ -153,88 +153,90 @@ export default {
flex-wrap: wrap; flex-wrap: wrap;
padding: 0 48rpx; padding: 0 48rpx;
gap: 48rpx; gap: 48rpx;
}
.items { .items {
width: calc(50% - 24rpx); width: calc(50% - 24rpx);
height: 160rpx; height: 160rpx;
background: #ffffff; background: #ffffff;
border-radius: 16rpx; border-radius: 16rpx;
padding: 32rpx; 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;
display: flex; display: flex;
align-items: center; align-items: center;
.midle { box-sizing: border-box;
font-size: 28rpx; border: 4rpx solid transparent;
font-weight: 700; .left {
width: 96rpx; width: 65%;
height: 96rpx;
border-radius: 8rpx;
margin-right: 28rpx;
display: flex; display: flex;
align-items: center; flex-flow: column;
justify-content: center; 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 { .right {
color: #f24724; flex-shrink: 0;
background-color: #f247241a; display: flex;
} align-items: center;
.midle_2 { .midle {
color: #ff9d0a; font-size: 28rpx;
/* border: var(--fontSize2) solid #FF9D0A; */ font-weight: 700;
background-color: #ff9d0a1a; width: 96rpx;
} height: 96rpx;
.midle_3 { border-radius: 8rpx;
color: #347bff; margin-right: 28rpx;
/* border: var(--fontSize2) solid #347BFF; */ display: flex;
background-color: #347bff1a; align-items: center;
} justify-content: center;
.midle_4 { flex-shrink: 0;
color: #35c376; }
/* border: var(--fontSize2) solid #35C376; */ .midle_1 {
background-color: #35c3761a; color: #f24724;
} background-color: #f247241a;
.midle_5 { }
color: #35c376; .midle_2 {
/* border: var(--fontSize2) solid #35C376; */ color: #ff9d0a;
background-color: #35c3761a; /* border: var(--fontSize2) solid #FF9D0A; */
} background-color: #ff9d0a1a;
.icon { }
width: 40rpx; .midle_3 {
height: 40rpx; 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 {
.active { border: 4rpx solid #347bff;
border: 4rpx solid #347bff; }
} .list-not {
.list-not { font-size: 28rpx;
font-size: 28rpx; color: #999999;
color: #999999; margin: auto;
margin: auto; }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<view class="box"> <view
class="box"
:key="selectMerchantId"
>
<template v-if="flag"> <template v-if="flag">
<template v-for="(item,index) in loginUserInfoList"> <template v-if="loginUserInfoList.length">
<view <template v-for="(item,index) in loginUserInfoList">
:key="index" <view
:class="['items' ,{active:item.active}]" :key="index"
@click="chooseAccount(item)" :class="['items' ,{active:item.active}]"
> @click="chooseAccount(item)"
<view class="left"> >
<view class="text_box"> <view class="right">
<view class="name"></view>{{item.merchantName}} <view class="sprite-icon icon-store"></view>
<view class="text_no">商户号:{{item.merchantId}}</view>
</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> </view>
</template>
</template>
<template v-else>
<view class="list-not">
暂无内容
</view> </view>
</template> </template>
</template> </template>
...@@ -21,23 +35,29 @@ ...@@ -21,23 +35,29 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
export default { export default {
name: '', name: 'MerchantList',
data () { data () {
return { return {
loginUserInfoList: [], loginUserInfoList: [],
copyLoginUserInfoList: [], copyLoginUserInfoList: [],
showSelect: false, showSelect: false,
jumpPageFlag: false, openSceneArr: [],
openSceneArr: [] flag: false,
userInfo: {},
selectMerchantId:''
} }
}, },
onLoad () { onLoad () {
// this.getMerchantList()
// this.getSceneArr()
}, },
methods: { methods: {
init (userInfo) {
this.userInfo = userInfo
this.getMerchantList()
this.getSceneArr()
},
getSceneArr () { getSceneArr () {
let userInfo = uni.$storage.get('userInfo') let { userInfo } = this
// 超管开通全部场景 // 超管开通全部场景
if (userInfo?.isSuper) return if (userInfo?.isSuper) return
// 获取4s店关联场景数据 // 获取4s店关联场景数据
...@@ -51,7 +71,7 @@ export default { ...@@ -51,7 +71,7 @@ export default {
}, },
getMerchantList () { getMerchantList () {
uni.showLoading() uni.showLoading()
let userInfo = uni.$storage.get('userInfo') let { userInfo } = this
let params = { let params = {
merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId, merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId,
staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid
...@@ -67,8 +87,7 @@ export default { ...@@ -67,8 +87,7 @@ export default {
}) })
}, },
chooseAccount (item) { chooseAccount (item) {
if (this.jumpPageFlag) return uni.showLoading()
this.jumpPageFlag = true
let { loginUserInfoList } = this let { loginUserInfoList } = this
let listArr = loginUserInfoList let listArr = loginUserInfoList
listArr.map(i => { listArr.map(i => {
...@@ -79,18 +98,18 @@ export default { ...@@ -79,18 +98,18 @@ export default {
return i return i
}) })
this.loginUserInfoList = listArr this.loginUserInfoList = listArr
this.selectMerchantId = item.merchantId
this.jumpPage(item) this.jumpPage(item)
}, },
async jumpPage (item) { async jumpPage (item) {
console.log(item)
let { openSceneArr } = this, let { openSceneArr } = this,
{ merchantName: shopMerchantName, merchantId: shopMerchantId } = item, { merchantName: shopMerchantName, merchantId: shopMerchantId } = item,
userInfo = uni.$storage.get('userInfo') { userInfo } = this
if (!openSceneArr?.length && !userInfo?.isSuper) return uni.showToast({ if (!openSceneArr?.length && !userInfo?.isSuper) return uni.showToast({
title: '暂无开通业务,请联系总部管理员', title: '暂无开通业务,请联系总部管理员',
icon: 'none' icon: 'none'
}) })
uni.$storage.set('userInfo', { this.$emit('chooseMerchant',{
...userInfo, ...userInfo,
shopMerchantName, shopMerchantName,
shopMerchantId, shopMerchantId,
...@@ -107,194 +126,66 @@ export default { ...@@ -107,194 +126,66 @@ export default {
merchantName: shopMerchantName merchantName: shopMerchantName
} }
}) })
this.jumpPageFlag = false uni.hideLoading()
},
searchEvent (searchValue) {
let { copyLoginUserInfoList, selectMerchantId } = this
const res = await uni.$api.userApi.selectMerchantScene({ copyLoginUserInfoList.map(val => {
merchantId: shopMerchantId, val.active = false
merchantName: shopMerchantName, if (val.merchantId == selectMerchantId) val.active = true
sceneType: 0 return val
})
uni.reLaunch({
url: '/pages/home/home'
}) })
let filterArr = copyLoginUserInfoList.filter(val => val.merchantName.includes(searchValue) || val.merchantId == searchValue) || []
this.loginUserInfoList = filterArr
if (!searchValue) this.loginUserInfoList = copyLoginUserInfoList
}, },
} }
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.layout { .box {
padding: 32rpx 24rpx 0; display: flex;
font-size: 28rpx; align-items: center;
color: #333; flex-wrap: wrap;
letter-spacing: 0; padding: 0 48rpx;
background: #f7f8fa; gap: 48rpx;
box-sizing: border-box; .items {
height: 100vh; width: calc(50% - 24rpx);
.search-box { height: 160rpx;
width: 100%; background: #ffffff;
height: 72rpx; border-radius: 16rpx;
padding-left: 24rpx; padding: 32rpx;
box-sizing: border-box;
margin-bottom: 32rpx;
color: #333;
display: flex; display: flex;
position: sticky; align-items: center;
top: 0;
left: 0;
z-index: 1009;
box-sizing: border-box; box-sizing: border-box;
.select_box { border: 4rpx solid transparent;
width: 200rpx; .right {
display: flex; margin-right: 28rpx;
flex-flow: column; flex-shrink: 0;
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);
}
}
} }
.search-input { .left {
width: 100%; flex: 1;
height: 72rpx; .name {
display: flex; font-weight: 500;
align-items: center; font-size: 32rpx;
background: #ffffff; color: #181a1f;
border-radius: var(--fontSize38); margin-bottom: 12rpx;
.search-icon {
width: 28rpx;
height: 28rpx;
margin: 0 var(--fontSize10) 0 var(--fontSize26);
} }
.search-clear { .text_no {
width: var(--fontSize36);
height: var(--fontSize36);
padding: var(--fontSize10);
margin: 0 var(--fontSize26) 0 var(--fontSize10);
}
.input {
font-size: 28rpx; font-size: 28rpx;
width: calc(100% - var(--fontSize136)); color: #999ea8;
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;
}
} }
} }
} }
.list { .active {
.scrollSpase { border: 4rpx solid #347bff;
height: 70rpx; }
} .list-not {
.items { font-size: 28rpx;
width: 100%; color: #999999;
background: #ffffff; margin: auto;
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;
}
}
} }
} }
</style> </style>
\ No newline at end of file \ 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 \ No newline at end of file
...@@ -14,9 +14,15 @@ export default { ...@@ -14,9 +14,15 @@ export default {
uni.$api.userApi.getListSelectAccount().then(res => { uni.$api.userApi.getListSelectAccount().then(res => {
uni.hideLoading() uni.hideLoading()
setTimeout(() => { setTimeout(() => {
if (res.code == 0 && userInfo) uni.reLaunch({ if (res.code == 0 && userInfo) {
url: '/pages/home/home' let url = {
}) 1: '/pages/boutique/index',
0: '/pages/home/home'
}[userInfo.sceneType]
uni.reLaunch({
url
})
}
else uni.reLaunch({ else uni.reLaunch({
url: '/pages/common/login' url: '/pages/common/login'
}) })
......
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
code: '1', code: '1',
count: '', count: '',
noSignIn: true, noSignIn: true,
readingStatus:false, readingStatus:true,
dateKey:null dateKey:null
}; };
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!