Commit 4b8d90f3 by 李伟康

commit

1 parent 37c340e4
......@@ -27,4 +27,22 @@ module.exports = {
...data,
})
},
/**获取帐号列表 */
getListSelectAccount (data = {}) {
data.projectName = 'boutique'
return http.fetch('dj.api.smartcarlife.workWechat.listSelectAccount', data)
},
/**选择帐号登陆 */
selectAccountLogin (data) {
data.projectName = 'boutique'
return http.fetch('dj.api.smartcarlife.workWechat.selectAccountLogin', data)
},
// 获取园区店开通的场景入口
getYqMerchantSceneConfigAPI(data) {
data.projectName = 'boutique'
return http.post({
method: 'dj.api.smartcarlife.select.openScene.info',
...data,
})
},
}
\ No newline at end of file
<template>
<view class="color" :class="{'color-show': colorShow}">
<view class="color-section">
<view @click="colorPickAction(item)" :style="{backgroundColor: item.color}" v-for="(item, index) in colorArr" :key="index" class="color-item">
<text class="color-title">{{item.index}}</text>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
colorShow: {
type: Boolean,
default () {
return false;
}
}
},
data () {
return {
colorArr: [
{
color: '#7f2a3f',
index: '01'
}, {
color: '#e24187',
index: '03'
}, {
color: '#f5305d',
index: '04'
}, {
color: '#de4156',
index: '05'
}, {
color: '#fe42cd',
index: '06'
}, {
color: '#f48b9a',
index: '07'
}, {
color: '#ec8191',
index: '08'
}, {
color: '#f9aeb5',
index: '09'
}, {
color: '#f21d5f',
index: '10'
}, {
color: '#cc3739',
index: '11'
}, {
color: '#dd5047',
index: '12'
}, {
color: '#e24187',
index: '13'
}, {
color: '#fa6449',
index: '14'
}, {
color: '#e8495b',
index: '15'
}, {
color: '#fb7162',
index: '16'
}, {
color: '#f6afd1',
index: '17'
}, {
color: '#fbb6b9',
index: '18'
}, {
color: '#db6f27',
index: '21'
}, {
color: '#ed702e',
index: '22'
}, {
color: '#f99627',
index: '23'
}, {
color: '#eb8926',
index: '24'
}, {
color: '#edc3aa',
index: '25'
}, {
color: '#e1d8cf',
index: '26'
}, {
color: '#deebc5',
index: '27'
}, {
color: '#fccdc7',
index: '28'
}, {
color: '#dbbdd2',
index: '29'
}, {
color: '#e8a321',
index: '31'
}, {
color: '#db6f27',
index: '32'
}, {
color: '#edb74b',
index: '33'
}, {
color: '#e8b741',
index: '34'
}, {
color: '#fef052',
index: '35'
}, {
color: '#ffd684',
index: '36'
}, {
color: '#e2d958',
index: '37'
}, {
color: '#e2e5d0',
index: '38'
}, {
color: '#ba9431',
index: '41'
}, {
color: '#797f5d',
index: '42'
}, {
color: '#536d50',
index: '43'
}, {
color: '#d8b53f',
index: '44'
}, {
color: '#d4c172',
index: '45'
}, {
color: '#32b75c',
index: '46'
}, {
color: '#90D15B',
index: '47'
}, {
color: '#c5d52a',
index: '48'
}, {
color: '#e8e098',
index: '49'
}, {
color: '#1b6661',
index: '50'
}, {
color: '#3b4f4d',
index: '51'
}, {
color: '#336559',
index: '52'
}, {
color: '#01776e',
index: '53'
}, {
color: '#2e7662',
index: '54'
}, {
color: '#439877',
index: '55'
}, {
color: '#0ba066',
index: '56'
}, {
color: '#318488',
index: '57'
}, {
color: '#6fd3c9',
index: '58'
}, {
color: '#b9d3ac',
index: '59'
}, {
color: '#0e898e',
index: '61'
}, {
color: '#317194',
index: '62'
}, {
color: '#029bc7',
index: '63'
}, {
color: '#2a8ec9',
index: '64'
}, {
color: '#57c9d3',
index: '65'
}, {
color: '#65b3df',
index: '67'
}, {
color: '#8bd0d7',
index: '68'
}, {
color: '#4B4881',
index: '69'
}, {
color: '#77A1CB',
index: '70'
}, {
color: '#3051BB',
index: '71'
}, {
color: '#2E41A7',
index: '72'
}, {
color: '#704CAE',
index: '73'
}, {
color: '#385BD1',
index: '74'
}, {
color: '#E0DFED',
index: '75'
}, {
color: '#A6BDE9',
index: '76'
}, {
color: '#B3B9DD',
index: '77'
}, {
color: '#7942A8',
index: '81'
}, {
color: '#8F52BA',
index: '82'
}, {
color: '#9680C0',
index: '83'
}, {
color: '#CD82BB',
index: '84'
}, {
color: '#8E2A80',
index: '85'
}, {
color: '#E24CB0',
index: '86'
}, {
color: '#CC2A75',
index: '87'
}, {
color: '#ED89D2',
index: '88'
}, {
color: '#F562B6',
index: '89'
}, {
color: '#8B3B32',
index: '91'
}, {
color: '#593A35',
index: '92'
}, {
color: '#7A3C2D',
index: '93'
}, {
color: '#7D2E21',
index: '94'
}, {
color: '#935A47',
index: '95'
}, {
color: '#A05047',
index: '96'
}, {
color: '#E39476',
index: '97'
}, {
color: '#4E3F3C',
index: '98'
}, {
color: '#5A4939',
index: '99'
}, {
color: '#EDE8EC',
index: '100'
}, {
color: '#C0813A',
index: '101'
}, {
color: '#77432E',
index: '102'
}, {
color: '#C17748',
index: '103'
}, {
color: '#C7AC39',
index: '104'
}, {
color: '#DBA179',
index: '107'
}, {
color: '#D8D3D0',
index: '109'
}, {
color: '#091A22',
index: '120'
}, {
color: '#CA3A32',
index: '121'
}, {
color: '#FAAB60',
index: '122'
}, {
color: '#CADEAD',
index: '123'
}, {
color: '#C7D858',
index: '124'
}, {
color: '#F264D0',
index: '125'
}, {
color: '#F77ADC',
index: '126'
}, {
color: '#FAE7D9',
index: '131'
}, {
color: '#E6D9D1',
index: '132'
}, {
color: '#EBCDB1',
index: '133'
}, {
color: '#E2DCCC',
index: '134'
}, {
color: '#FAD9D2',
index: '135'
}, {
color: '#E1C2BD',
index: '136'
}, {
color: '#E5BBCF',
index: '137'
}, {
color: '#F7BACC',
index: '138'
}, {
color: '#E9CBC1',
index: '139'
}, {
color: '#EBB89F',
index: '140'
}, {
color: '#E6D09E',
index: '141'
}, {
color: '#E2B78D',
index: '142'
}, {
color: '#D1E4EB',
index: '143'
}, {
color: '#B9D9EE',
index: '144'
}, {
color: '#CFD0E2',
index: '145'
}, {
color: '#CECFF0',
index: '146'
}, {
color: '#D6C3E3',
index: '147'
}, {
color: '#E3F0C5',
index: '163'
}, {
color: '#DAD792',
index: '164'
}, {
color: '#D4D4BC',
index: '166'
}, {
color: '#C0D0AB',
index: '167'
}, {
color: '#D7C6A8',
index: '169'
}, {
color: '#D9E9E8',
index: '171'
}, {
color: '#B4E0C7',
index: '172'
}, {
color: '#D6E2BA',
index: '173'
}, {
color: '#E3E5D0',
index: '174'
}, {
color: '#C1D39A',
index: '175'
}, {
color: '#AFE4E6',
index: '178'
}, {
color: '#92DDE2',
index: '179'
}, {
color: '#DBE0E6',
index: '182'
}, {
color: '#8FBFF0',
index: '183'
}, {
color: '#9DCDE1',
index: '185'
}, {
color: '#BBC4BF',
index: '196'
}, {
color: '#E484A9',
index: '198'
}, {
color: '#BBC4BF',
index: 'GG3'
}, {
color: '#494A4C',
index: 'CG9'
}, {
color: '#C2CEDA',
index: 'BG1'
}, {
color: '#C1C3D3',
index: 'BG3'
}, {
color: '#8696A3',
index: 'BG5'
}, {
color: '#646A76',
index: 'BG7'
}, {
color: '#415361',
index: 'BG9'
}, {
color: '#DFDEE3',
index: 'WG.5'
}, {
color: '#CBC6CC',
index: 'WG1'
}, {
color: '#B6B0B2',
index: 'WG2'
}, {
color: '#C5BBBA',
index: 'WG3'
}, {
color: '#958A92',
index: 'WG4'
}, {
color: '#837477',
index: 'WG5'
}, {
color: '#8A7E7E',
index: 'WG6'
}, {
color: '#4D4342',
index: 'WG9'
}
]
}
},
methods: {
colorPickAction (color) {
this.$emit('colorPickTap', color);
}
}
}
</script>
<style lang="scss">
.color {
position: absolute;
left: 0;
bottom: 0;
right: 0;
// top: 8rem;
display: none;
z-index: 10;
width: 100vw;
.color-section {
display: flex;
flex-wrap: wrap;
.color-item {
width: 10%;
aspect-ratio: 1;
display: flex;
justify-content: center;
align-items: center;
.color-title {
color: #fff;
font-size: $uni-font-size-sm;
}
}
}
}
.color-show {
background-color: rgba(0, 0, 0, .6);
display: block;
}
</style>
const target = ["ip", "dev", "uat", "prod", "preRelease"];
const index = 2;
const index = 1;
/**
*
0本地
......
import loginMixin from './loginMixin'
module.exports = {
loginMixin
}
export default {
methods: {
// 获取园区店下4s店数据
get4SStoreList (loginUserObj) {
let { merchantId, isSuper, uuid } = loginUserObj
uni.$api.userApi.getSceneMerchantRefStoreList({
merchantId: isSuper ? undefined : merchantId,
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: {
merchantId: merchantId,
merchantName: merchantName
},
default4SStoreInfo_crowdFunding: {
merchantId: merchantId,
merchantName: merchantName
},
default4SStoreInfo_newCarConversion: {
merchantId: merchantId,
merchantName: merchantName
}
})
uni.redirectTo({
url: '/pages/home/home'
})
} else if (!result?.length) {
return uni.showToast({
title: '园区店关联的4s店商户账号无效,请联系总部管理员',
icon: 'none',
})
} else uni.navigateTo({
url: '/pages/common/merchantList'
})
})
},
}
}
\ No newline at end of file
<template>
<div>
</div>
<view class="layout">
<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>
<image class="icon"></image>
请输入门店名称/商户号搜索
</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>
<scroll-view
class="list"
scroll-y
:key="selectedUuid"
>
<!-- height: calc(100% - {{copyLoginUserInfoList && copyLoginUserInfoList.length >= 10 ? 120 : 50}}rpx); -->
<template v-if="flag">
<template v-if="loginUserInfoList">
<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>
// style="height: calc(100vh - {{isFullSucreen ? '159' :'125'}}px)"
<view
class="list-not"
@click="getListSelectAccount"
>
点击刷新
</view>
</template>
</template>
<view class="scrollSpase"></view>
</scroll-view>
<view class="content" style="width:100%;height:800px;">
<!-- <wnCanvas
saveImageType="3"
@saveImage="saveImage"
:drawImage="drawImage"
:isUnderBkg="true"
@dowmloadErr='dowmloadErr'
@dowmloadSuc="dowmloadSuc"
></wnCanvas> -->
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
import { loginMixin } from '@/mixin'
import wnCanvas from '../../components/Canvas/wn-canvas.vue'
export default {
mixins: [loginMixin],
components: {
wnCanvas
},
name: '',
data () {
return {
searchValue: '',
edit: false,
copyLoginUserInfoList: [],
loginRole: {
1: '超管',
2: '商户号',
3: '区域督导',
4: '驻店负责人'
},
selectedUuid: '',
requestFlag: false,
loginUserInfoList: [],
flag: false
}
},
onLoad () {
this.getListSelectAccount()
},
mounted () {
},
methods: {
getListSelectAccount () {
uni.showLoading()
uni.$api.userApi.getListSelectAccount().then(res => {
uni.hideLoading()
let { code, data, message } = res
if (code == 0) {
let { loginUserInfoList, sessionId } = data
uni.$storage.set('sessionId', sessionId);
this.loginUserInfoList = loginUserInfoList
this.copyLoginUserInfoList = loginUserInfoList
} else uni.showToast({
title: message,
icon: 'none',
});
this.flag = true
})
},
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
loginUserInfoList.map(e => {
if (e.active) id = e.uuid
})
if (!id) {
uni.showToast({
title: '请选择账号',
icon: 'none',
});
return
}
// 清空4s店数据
// app.globalData.storeListRange = []
this.selectAccountLogin(id)
},
selectAccountLogin (id) {
if (this.requestFlag) return
this.requestFlag = true
uni.showLoading()
uni.$api.userApi.selectAccountLogin({ id }).then(res => {
uni.hideLoading()
this.requestFlag = false
let { data, message } = res,
[userInfo] = data.loginUserInfoList
if (data){
uni.$storage.set('userInfo', userInfo);
this.get4SStoreList(userInfo)
}
else uni.showToast({
title: message,
icon: 'none',
});
})
},
search () {
this.edit = false
this.searchEvent()
},
// 搜索过滤
searchEvent () {
let { searchValue, 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
},
mounted () {
open () {
this.edit = true
this.inputFocus = true
},
methods: {
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')
},
saveImage (url) {
//画板返回的图片地址
console.log(url);
},
dowmloadErr (err) {
//下载图片失败时的回调
console.log(err);
},
dowmloadSuc (res) {
//下载图片成功时的回调
console.log(res);
}
}
}
</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 {
.search-input {
width: 100%;
height: 72rpx;
background: #fff;
border-radius: 38rpx;
padding-left: 24rpx;
box-sizing: border-box;
margin-bottom: 32rpx;
color: #333;
.input {
display: flex;
align-items: center;
height: 100%;
width: 100%;
}
.icon {
width: 28rpx;
height: 28rpx;
margin-right: 10rpx;
}
.placeholder {
color: #c8c9cc;
}
}
}
.list {
height: calc(100% - 50rpx);
.scrollSpase {
height: 70rpx;
}
}
.items {
width: 100%;
height: 160rpx;
background: #ffffff;
border-radius: 16rpx;
margin-top: 32rpx;
padding: 32rpx;
display: flex;
align-items: center;
box-sizing: border-box;
border: 6rpx solid #fff;
.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: 28rpx;
color: #181a1f;
}
.shop_no {
font-weight: 400;
font-size: 24rpx;
margin-top: 16rpx;
color: #999ea8;
}
}
.right {
flex-shrink: 0;
display: flex;
align-items: center;
.midle {
font-size: 28rpx;
font-weight: 600;
width: 96rpx;
height: 96rpx;
border-radius: 8rpx;
margin-right: 30rpx;
display: flex;
align-items: center;
justify-content: center;
}
.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: 6rpx solid #347bff;
}
}
</style>
\ No newline at end of file
......@@ -45,8 +45,10 @@
</icon>
</view>
</template>
<!-- :class="['code-btn', { 'code-disabled': count }]" -->
<view @click="getSmsCode">{{ count ? `重新发送(${count}s)` : '获取验证码' }}</view>
<view
:class="['code-btn', `${count? 'code-disabled' :''}`]"
@click="getSmsCode"
>{{ count ? `重新发送(${count}s)` : '获取验证码' }}</view>
</view>
<button
class="btn"
......@@ -153,61 +155,7 @@ export default {
url: '/pages/common/accountItems'
})
},
// 获取园区店下4s店数据
get4SStoreList (loginUserObj) {
let { merchantId, isSuper, uuid } = loginUserObj
uni.$api.userApi.getSceneMerchantRefStoreList({
merchantId: isSuper ? undefined : merchantId,
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: {
merchantId: merchantId,
merchantName: merchantName
},
default4SStoreInfo_crowdFunding: {
merchantId: merchantId,
merchantName: merchantName
},
default4SStoreInfo_newCarConversion: {
merchantId: merchantId,
merchantName: merchantName
}
})
uni.redirectTo({
url: '/pages/home/home'
})
} else if (!result?.length) {
return uni.showToast({
title: '园区店关联的4s店商户账号无效,请联系总部管理员',
icon: 'none',
})
} else uni.navigateTo({
url: '/pages/common/merchantList'
})
})
},
},
};
</script>
......
import { setToken, getToken, removeToken } from '@/utils/token';;
// import { setToken, getToken, removeToken } from '@/utils/token';;
export default {
namespaced: true,
state() {
return {
userData: {},
token: getToken(),
// token: getToken(),
};
},
mutations: {
......
......@@ -11,7 +11,8 @@ export const DEFAULT_GET_STORAGEKEY = ['sessionId', 'merchantId', 'userInfo']
// 缓存get方法key的对应才映射值
export const STORAGE_OBJECTkEY = {
DEFAULT_GET_STORAGEKEY,
mock_data: 'mock_data'
mock_data: 'mock_data',
userInfo: 'userInfo'
}
// export const IMG_VERSION = async () => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!