Commit 51d8e590 by zhangxw

联调修改

1 parent 3ad4e24a
// components/SideSelectPopup/SideSelectPopup.js // components/SideSelectPopup/SideSelectPopup.js
import constantData from '../../pages/constant/data'
import api from '~/api/api' import api from '~/api/api'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat'
Component({ Component({
...@@ -17,6 +16,7 @@ Component({ ...@@ -17,6 +16,7 @@ Component({
let { storeList, subIndex } = this.data let { storeList, subIndex } = this.data
storeList?.map((val, index) => { storeList?.map((val, index) => {
val.actived = false val.actived = false
val.index = index
if (userInfo?.sceneType == 1) { if (userInfo?.sceneType == 1) {
// 切换园区店 // 切换园区店
if (userInfo?.isSuper && index == subIndex) val.actived = true if (userInfo?.isSuper && index == subIndex) val.actived = true
...@@ -28,17 +28,11 @@ Component({ ...@@ -28,17 +28,11 @@ Component({
}) })
this.setData({ this.setData({
userInfo, userInfo,
storeList copyStoreList: storeList,
searchValue: '',
edit: false,
showSearchInput: false
}) })
// let storagesceneType = userInfo.sceneType
// this.setData({storagesceneType})
// let { sceneList } = this.data
// let openSceneArr = userInfo?.openSceneArr || []
// // 获取开通业务场景
// let arr = sceneList.filter(v => openSceneArr.includes(v.sceneType))
// this.setData({
// sceneList: arr
// })
} }
} }
}, },
...@@ -62,7 +56,12 @@ Component({ ...@@ -62,7 +56,12 @@ Component({
data: { data: {
storagesceneType: '', storagesceneType: '',
IMG_URL, IMG_URL,
userInfo: {} userInfo: {},
showSearchInput: false,
inputFocus: false,
searchValue: '',
copyStoreList: [],
selectedMerchantId: ''
}, },
/** /**
...@@ -74,6 +73,80 @@ Component({ ...@@ -74,6 +73,80 @@ Component({
show:false show:false
}) })
}, },
open() {
if (this.data.disabled) return
this.setData({
edit: true,
inputFocus: true
})
},
setValue(value) {
if (this.properties.filterEmoji) {
if (wx.$util.haveEmoji(value)) value = wx.$util.replaceEmoji(value)
}
this.setData({
searchValue: value
})
},
input(e) {
let { value } = e.detail
this.setValue(value)
this.triggerEvent('input', {
value
})
},
inputConfifm(e) {
this.emit(e)
},
emit(e) {
let {
detail: { value },
type
} = e
this.setData({
edit: false
})
this.setValue(value)
this.searchEvent()
},
clearInputText() {
this.setData({
searchValue: '',
edit: false
})
this.searchEvent()
},
showSearch() {
this.setData({
showSearchInput: !this.data.showSearchInput
})
},
searchEvent() {
let { searchValue, selectedMerchantId } = this.data
let { storeList } = wx.$util.deepClone(this.data)
if (!searchValue) {
storeList.map(i => {
i.active = false
if (i.merchantId == selectedMerchantId) i.active = true
return i
})
this.setData({
copyStoreList: storeList
})
} else {
let arr = []
storeList.map(i => {
i.active = false
if (i.merchantId == selectedMerchantId) i.active = true
if (i.merchantName.indexOf(searchValue) != -1 || i.merchantId == searchValue) {
arr.push(i)
}
})
this.setData({
copyStoreList: arr
})
}
},
showTabBar() { showTabBar() {
if (this.data.hasTabBar) wx.showTabBar({animation: true}) if (this.data.hasTabBar) wx.showTabBar({animation: true})
}, },
...@@ -82,12 +155,12 @@ Component({ ...@@ -82,12 +155,12 @@ Component({
}, },
selectStore(e) { selectStore(e) {
const thisPage = wx.$router.getPageInstance() const thisPage = wx.$router.getPageInstance()
let { item, selectindex } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
let { userInfo, storeList, subIndex } = this.data let { userInfo, storeList, subIndex } = this.data
// 精品升级场景 // 精品升级场景
if (userInfo?.sceneType == 1) { if (userInfo?.sceneType == 1) {
// 超管切换园区店 // 超管切换园区店
if (userInfo?.isSuper && selectindex == subIndex) this.closeMenu() if (userInfo?.isSuper && item.index == subIndex) this.closeMenu()
else if (!userInfo?.isSuper && item?.merchantId == userInfo?.shopMerchantId)return this.closeMenu() else if (!userInfo?.isSuper && item?.merchantId == userInfo?.shopMerchantId)return this.closeMenu()
} else { // 其它场景 } else { // 其它场景
if (item?.merchantId == userInfo?.shopMerchantId) return this.closeMenu() if (item?.merchantId == userInfo?.shopMerchantId) return this.closeMenu()
...@@ -96,12 +169,13 @@ Component({ ...@@ -96,12 +169,13 @@ Component({
val.actived = false val.actived = false
if (userInfo?.sceneType == 1) { if (userInfo?.sceneType == 1) {
// 切换园区店 // 切换园区店
if (userInfo?.isSuper && selectindex == index) val.actived = true if (userInfo?.isSuper && item.index == index) val.actived = true
else if (!userInfo?.isSuper && val.merchantId == userInfo?.shopMerchantId) val.actived = true else if (!userInfo?.isSuper && val.merchantId == userInfo?.shopMerchantId) val.actived = true
} else { } else {
// 切换4s店 // 切换4s店
if (val.merchantId == userInfo?.shopMerchantId) val.actived = true if (val.merchantId == userInfo?.shopMerchantId) val.actived = true
} }
if (val.actived) this.setData({selectedMerchantId: val.merchantId})
return val return val
}) })
this.setData({ this.setData({
...@@ -110,7 +184,7 @@ Component({ ...@@ -110,7 +184,7 @@ Component({
// 精品升级场景 超管切换 // 精品升级场景 超管切换
if (userInfo?.isSuper && userInfo?.sceneType == 1) { if (userInfo?.isSuper && userInfo?.sceneType == 1) {
this.closeMenu() this.closeMenu()
thisPage.changePicker && thisPage.changePicker(storeList[selectindex], selectindex) thisPage.changePicker && thisPage.changePicker(storeList[item.index], item.index)
return return
} }
// 切换4s店 // 切换4s店
......
<!--components/SideSelectPopup/SideSelectPopup.wxml--> <!--components/SideSelectPopup/SideSelectPopup.wxml-->
<van-popup custom-style="height: 100%;width:70%;" z-index="999999" custom-class="popclass" bind:click-overlay="closeMenu" position="left" bind:before-enter="hideTabBar" bind:after-leave="showTabBar" show="{{ show }}"> <van-popup custom-style="height: 100%;width:560rpx;" z-index="999999" custom-class="popclass" bind:click-overlay="closeMenu" position="left" bind:before-enter="hideTabBar" bind:after-leave="showTabBar" show="{{ show }}">
<view class="wrapper"> <view class="wrapper">
<view class="title">店面列表</view> <view class="title_box">
<view class="title" wx:if="{{!showSearchInput}}">店面列表</view>
<view class="search_box">
<image wx:if="{{!showSearchInput}}" src="/images/search.png" bindtap="showSearch" mode=""/>
<view wx:else>
<view class="search-input">
<block wx:if="{{ !edit }}">
<view class="input {{ searchValue?'':'placeholder' }}" bindtap="open">
<block wx:if="{{ searchValue }}">{{searchValue}}</block>
<block wx:else>
<image src="/images/search.png" class="icon"></image>
{{'请输入门店名称/商户号搜索'}}
</block>
</view>
</block>
<block wx:else>
<view class="input_box">
<input
type="text"
class="input"
value="{{ searchValue }}"
focus="{{ inputFocus }}"
confirm-type="search"
bindinput="input"
bindblur="inputBlur"
bindconfirm="inputConfifm"
/>
<image src="/images/clear.png" bindtap="clearInputText" mode=""/>
</view>
</block>
</view>
</view>
</view>
</view>
<scroll-view scroll-y style="height: calc(100vh - 264rpx);" enhanced="{{true}}" show-scrollbar="{{false}}"> <scroll-view scroll-y style="height: calc(100vh - 264rpx);" enhanced="{{true}}" show-scrollbar="{{false}}">
<block wx:for="{{storeList}}" wx:key="index" wx:for-index="index"> <block wx:for="{{copyStoreList}}" wx:key="index" wx:for-index="index">
<view catch:tap="selectStore" data-item="{{item}}" data-selectindex="{{index}}" class="element {{item.actived ? 'active' : ''}}"> <view catch:tap="selectStore" data-item="{{item}}" class="element {{item.actived ? 'active' : ''}}">
<view><image src="{{IMG_URL}}/store_icon_nobg.png"></image></view> <view><image src="{{IMG_URL}}/store_icon_nobg.png"></image></view>
<view class="text_box"> <view class="text_box">
<view class="label">{{item.merchantName}}</view> <view class="label">{{item.merchantName}}</view>
......
...@@ -6,14 +6,60 @@ ...@@ -6,14 +6,60 @@
box-sizing: border-box; box-sizing: border-box;
padding: 88rpx 16rpx; padding: 88rpx 16rpx;
} }
.wrapper .title{
height: 88rpx; .wrapper .title_box{
line-height: 88rpx; height: 60rpx;
line-height: 60rpx;
margin-bottom: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.wrapper .title_box .title{
padding-left: 16rpx; padding-left: 16rpx;
font-weight: 600; font-weight: 600;
font-size: 28rpx; font-size: 28rpx;
color: #FFFFFF80; color: #FFFFFF80;
} }
.wrapper .title_box .search_box{
display: flex;
align-items: center;
font-size: 28rpx;
}
.wrapper .title_box .search_box image{
width: 32rpx;
height: 32rpx;
}
.wrapper .title_box .search_box .search-input {
width: 528rpx;
height: 60rpx;
background: #FFFFFF;
border-radius: 38px;
padding: 0 16rpx;
box-sizing: border-box;
}
.wrapper .title_box .search_box .search-input .input{
display: flex;
align-items: center;
height: 100%;
}
.wrapper .title_box .search_box .search-input .input_box{
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.wrapper .title_box .search_box .search-input .placeholder{
color: #C8C9CC;
}
.wrapper .element{ .wrapper .element{
position: relative; position: relative;
padding: 32rpx 0; padding: 32rpx 0;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import api from '../../tabMine/api' import api from '../../tabMine/api'
const app = getApp() const app = getApp()
import constantData from '../../pages/constant/data' import constantData from '../../pages/constant/data'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/mine/'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -17,6 +18,7 @@ Component({ ...@@ -17,6 +18,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
IMG_URL,
isYqdSuper: '', isYqdSuper: '',
selectedSceneName: '', selectedSceneName: '',
userInfo: {} userInfo: {}
......
...@@ -59,10 +59,12 @@ ...@@ -59,10 +59,12 @@
<view class="set_item item_3" bindtap="changeScene"> <view class="set_item item_3" bindtap="changeScene">
<view class="title">场景切换<image class="arrow_icon" src="/tabMine/images/arrow_icon.png" mode=""/></view> <view class="title">场景切换<image class="arrow_icon" src="/tabMine/images/arrow_icon.png" mode=""/></view>
<view class="set_tips">{{selectedSceneName}}</view> <view class="set_tips">{{selectedSceneName}}</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_3.png" mode=""/>
</view> </view>
<view class="set_item item_4" bindtap="goVersionPage"> <view class="set_item item_4" bindtap="goVersionPage">
<view class="title">更新日志<image class="arrow_icon" src="/tabMine/images/arrow_icon.png" mode=""/></view> <view class="title">更新日志<image class="arrow_icon" src="/tabMine/images/arrow_icon.png" mode=""/></view>
<view class="set_tips">最新{{versionData.version}}版</view> <view class="set_tips">最新{{versionData.version}}版</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_1.png" mode=""/>
</view> </view>
</view> </view>
<!-- <view class="version_box" bindtap="goVersionPage"> <!-- <view class="version_box" bindtap="goVersionPage">
......
...@@ -42,6 +42,10 @@ ...@@ -42,6 +42,10 @@
font-size: 40rpx; font-size: 40rpx;
color: #323436; color: #323436;
font-weight: 600; font-weight: 600;
max-width: 400rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.change_btn{ .change_btn{
width: 134rpx; width: 134rpx;
...@@ -152,6 +156,15 @@ ...@@ -152,6 +156,15 @@
justify-content: center; justify-content: center;
padding: 32rpx; padding: 32rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
position: relative;
}
.set_box .set_item .icon_image{
width: 120rpx;
height: 120rpx;
position: absolute;
right: 0;
bottom: 0;
} }
.set_box .set_item .title .arrow_icon{ .set_box .set_item .title .arrow_icon{
......
...@@ -48,7 +48,8 @@ Page({ ...@@ -48,7 +48,8 @@ Page({
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
let params = { let params = {
merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId, merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId,
staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid,
scene: 3
} }
get4SStoreList(params).then(result => { get4SStoreList(params).then(result => {
this.setData({ this.setData({
......
<!-- packageCrowdFunding/pages/balanceNote/balanceNote.wxml --> <!-- packageCrowdFunding/pages/balanceNote/balanceNote.wxml -->
<wxs src="../balanceNote/index.wxs" module="filter" /> <wxs src="../balanceNote/index.wxs" module="filter" />
<wxs src="../../index.wxs" module="filter2" /> <wxs src="/packageCrowdFunding/index.wxs" module="filter2" />
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy> <glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<view class="big-img page-box isFullSucreen"> <view class="big-img page-box isFullSucreen">
<view class="titleBox"> <view class="titleBox">
......
<wxs src="../../index.wxs" module="filter" /> <wxs src="/packageCrowdFunding/index.wxs" module="filter" />
<view class="orderInfoCom"> <view class="orderInfoCom">
<view class="title">订单信息</view> <view class="title">订单信息</view>
<view class="info"> <view class="info">
......
...@@ -133,7 +133,8 @@ Page({ ...@@ -133,7 +133,8 @@ Page({
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
let params = { let params = {
merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId, merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId,
staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid,
scene: 0
} }
get4SStoreList(params).then(result => { get4SStoreList(params).then(result => {
this.setData({ this.setData({
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import api from '~/api/api' import api from '~/api/api'
const app = getApp() const app = getApp()
import { getYQorderInfo, get4SStoreList } from '~/store/index' import { getYQorderInfo, get4SStoreList } from '~/store/index'
import constantData from '../constant/data' import { getShopSceneConfig } from '~/store/index'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -25,13 +25,17 @@ Page({ ...@@ -25,13 +25,17 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options)
// let { noLogin } = options
let id = decodeURIComponent(options.scene).split('=')[1] let id = decodeURIComponent(options.scene).split('=')[1]
// noLogin
// console.log(id)
id ? this.qrCodeScene(id) : this.getListSelectAccount() id ? this.qrCodeScene(id) : this.getListSelectAccount()
// this.getListSelectAccount() },
getSceneArr(yqMerchantId, loginUserObj) {
// 超管开通全部场景
if (loginUserObj?.isSuper) return
// 获取4s店关联场景数据
getShopSceneConfig({yqMerchantId}).then(result => {
if (!result?.length) return wx.$util.showToast('暂无开通业务,请联系总部管理员')
this.get4SStoreList(loginUserObj)
})
}, },
open() { open() {
this.setData({ this.setData({
...@@ -43,7 +47,6 @@ Page({ ...@@ -43,7 +47,6 @@ Page({
if (this.properties.filterEmoji) { if (this.properties.filterEmoji) {
if (wx.$util.haveEmoji(value)) value = wx.$util.replaceEmoji(value) if (wx.$util.haveEmoji(value)) value = wx.$util.replaceEmoji(value)
} }
console.log(value)
this.setData({ this.setData({
searchValue: value searchValue: value
}) })
...@@ -101,7 +104,6 @@ Page({ ...@@ -101,7 +104,6 @@ Page({
.then(res => { .then(res => {
// debugger // debugger
// res => { // res => {
console.log(res)
let { code, data } = res let { code, data } = res
let op = {} let op = {}
if (code == '0') { if (code == '0') {
...@@ -118,7 +120,6 @@ Page({ ...@@ -118,7 +120,6 @@ Page({
this.noLoginFn() this.noLoginFn()
} }
) )
console.log(op)
} }
} }
// } // }
...@@ -178,7 +179,6 @@ Page({ ...@@ -178,7 +179,6 @@ Page({
wx.$util.showLoading('加载中...') wx.$util.showLoading('加载中...')
api.getListSelectAccount().then(res => { api.getListSelectAccount().then(res => {
wx.hideLoading() wx.hideLoading()
// console.log(res)
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
let { loginUserInfoList, sessionId } = data let { loginUserInfoList, sessionId } = data
...@@ -196,7 +196,7 @@ Page({ ...@@ -196,7 +196,7 @@ Page({
}) })
}, },
chooseAccount(e) { chooseAccount(e) {
let { index, item } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
let { loginUserInfoList } = this.data let { loginUserInfoList } = this.data
loginUserInfoList.map(i => { loginUserInfoList.map(i => {
i.active = false i.active = false
...@@ -215,13 +215,9 @@ Page({ ...@@ -215,13 +215,9 @@ Page({
sceneHandle() { sceneHandle() {
const SCENE = wx.$SCENE const SCENE = wx.$SCENE
let { path, query } = SCENE let { path, query } = SCENE
console.log(path, 'path')
let { target, name } = wx.$util.getSceneId(path) let { target, name } = wx.$util.getSceneId(path)
// console.log(query)
// console.log(target,name);
wx.$router.reLaunch(`${target}.${name}`, query) wx.$router.reLaunch(`${target}.${name}`, query)
wx.$SCENE = null wx.$SCENE = null
// console.log(SCENE, 'SCENE')
// debugger 兼容扫码优惠券进来和免登录逻辑冲突问题 // debugger 兼容扫码优惠券进来和免登录逻辑冲突问题
// if (SCENE && SCENE.path != 'pages/accountItems/accountItems') { // if (SCENE && SCENE.path != 'pages/accountItems/accountItems') {
}, },
...@@ -258,94 +254,48 @@ Page({ ...@@ -258,94 +254,48 @@ Page({
}) })
}) })
}, },
async getYqMerchantSceneConfig(yqMerchantId, isSuper, result, loginInfo) { // 获取园区店下4s店数据
// 先取消掉 get4SStoreList(loginUserObj) {
// let checkAgree = await this.checkAgree() let { merchantId, isSuper, uuid } = loginUserObj
// if (!checkAgree) return false get4SStoreList({merchantId: isSuper ? undefined : merchantId, staffUUID: uuid}).then(result => {
// 超管和督导默认开通所有场景 // 超管/仅一家4s店
if (isSuper) { let obj = (result && result[0]) || {}
// 0 会员权益/升级 1 精品升级 // 超管跳过选择4s店页面
let openSceneArr = constantData.sceneList.map(val => { if (isSuper) {
return val?.sceneType this.setShopMerchantObj(obj)
}) wx.$router.reLaunch('pages.sceneIndex')
let {merchantId, merchantName} = result[0] return
wx.$util.setUserInfo({ }
...wx.$util.getUserInfo(), // 仅一家4s店
openSceneArr, if (result?.length == 1) {
shopMerchantName: merchantName, this.setShopMerchantObj(obj)
shopMerchantId: merchantId, wx.$router.reLaunch('pages.sceneIndex')
default4SStoreInfo: {
merchantId: merchantId,
merchantName: merchantName
},
default4SStoreInfo_crowdFunding: {
merchantId: merchantId,
merchantName: merchantName
},
default4SStoreInfo_newCarConversion: {
merchantId: merchantId,
merchantName: merchantName
}
})
wx.$router.reLaunch('pages.sceneIndex')
return
}
// 获取开通的业务场景
api.getYqMerchantSceneConfigAPI({ yqMerchantId: yqMerchantId }).then(res => {
let { data, message, code } = res
if (code == 0) {
let openSceneArr = []
data?.forEach(v => {
if (v.sceneOpenFlag === 0) openSceneArr.push(v.scene)
})
if (!openSceneArr.length) {
wx.$util.showToast('暂无开通业务,请联系总部管理员')
} else {
if (loginInfo?.shopMerchantId && !((loginInfo?.sceneType ?? '') === '')) { // 记录上次登录选择的4s店和场景
let { shopMerchantId, shopMerchantName, sceneType } = loginInfo
this.jumpPage(openSceneArr, {merchantId: shopMerchantId, merchantName: shopMerchantName, sceneType})
}
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), openSceneArr })
if (result?.length == 1) this.jumpPage(openSceneArr, result[0])
else wx.$router.reLaunch('pages.merchantList')
}
} else { } else {
wx.$util.showToast(message) wx.$router.reLaunch('pages.merchantList')
} }
}) })
}, },
// 仅一家4s店
jumpPage(openSceneArr, merchantSceneItem) { setShopMerchantObj(data) {
// 存储4s店信息 let { merchantName: shopMerchantName, merchantId: shopMerchantId } = data
let {merchantId, merchantName, sceneType} = merchantSceneItem
wx.$util.setUserInfo({ wx.$util.setUserInfo({
...wx.$util.getUserInfo(), ...wx.$util.getUserInfo(),
shopMerchantName: merchantName, shopMerchantName: shopMerchantName,
shopMerchantId: merchantId, shopMerchantId: shopMerchantId,
sceneType: sceneType || '', sceneType: sceneType,
default4SStoreInfo: { default4SStoreInfo: {
merchantId: merchantId, merchantId: shopMerchantId,
merchantName: merchantName merchantName: shopMerchantName
}, },
default4SStoreInfo_crowdFunding: { default4SStoreInfo_crowdFunding: {
merchantId: merchantId, merchantId: shopMerchantId,
merchantName: merchantName merchantName: shopMerchantName
}, },
default4SStoreInfo_newCarConversion: { default4SStoreInfo_newCarConversion: {
merchantId: merchantId, merchantId: shopMerchantId,
merchantName: merchantName merchantName: shopMerchantName
} }
}) })
// 记录到有选择场景直接进入对应场景
if (!((loginInfo?.sceneType ?? '') === '')) return wx.$router.reLaunch('pages.loading')
// 只开通一个场景直接跳转页面
if (openSceneArr.length === 1) {
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), sceneType: openSceneArr[0] })
let pageUrl = constantData?.pageUrl
wx.$router.reLaunch(pageUrl[openSceneArr[0]])
} else if (openSceneArr.length > 1) {
wx.$router.reLaunch('pages.sceneIndex')
}
}, },
async choiceAccountLogin() { async choiceAccountLogin() {
...@@ -357,7 +307,6 @@ Page({ ...@@ -357,7 +307,6 @@ Page({
if (e.active) { if (e.active) {
yqMerchantId = e.merchantId yqMerchantId = e.merchantId
id = e.uuid id = e.uuid
// 超管 和 督导都认为开通所有场景
isSuper = e.isSuper || e.loginRole ==3 isSuper = e.isSuper || e.loginRole ==3
} }
}) })
...@@ -369,15 +318,10 @@ Page({ ...@@ -369,15 +318,10 @@ Page({
// 清空4s店数据 // 清空4s店数据
app.globalData.storeListRange = [] app.globalData.storeListRange = []
wx.$util.showLoading() wx.$util.showLoading()
this.get4SStoreList(yqMerchantId, id, isSuper) this.selectAccountLogin(id, yqMerchantId)
},
get4SStoreList(yqMerchantId, id, isSuper) {
get4SStoreList({merchantId: isSuper ? undefined : yqMerchantId, staffUUID: id}).then(result => {
this.selectAccountLogin(yqMerchantId, id, result, isSuper)
})
}, },
selectAccountLogin(yqMerchantId, id, result, isSuper) { selectAccountLogin(id, yqMerchantId) {
api api
.selectAccountLogin({ .selectAccountLogin({
id id
...@@ -392,13 +336,16 @@ Page({ ...@@ -392,13 +336,16 @@ Page({
wx.$util.setUserInfo(data.loginUserInfoList[0]) wx.$util.setUserInfo(data.loginUserInfoList[0])
app.gobalCheckYqdSuper(data.loginUserInfoList[0]) app.gobalCheckYqdSuper(data.loginUserInfoList[0])
// checkYqdSuper(app, data.loginUserInfoList[0])
// console.log(data.loginUserInfoList[0])
getYQorderInfo() getYQorderInfo()
// 超管跳过选择4s店
if (data.loginUserInfoList[0] && data.loginUserInfoList[0].isSuper) {
this.get4SStoreList(data.loginUserInfoList[0])
return
}
const SCENE = wx.$SCENE const SCENE = wx.$SCENE
// debugger // debugger
// 有场景信息就跳转对应页面 没有就登录场景 // 有场景信息就跳转对应页面 没有就登录场景
SCENE && SCENE.path != 'pages/accountItems/accountItems' ? this.sceneHandle() : this.getYqMerchantSceneConfig(yqMerchantId, isSuper, result, data.loginUserInfoList[0]) SCENE && SCENE.path != 'pages/accountItems/accountItems' ? this.sceneHandle() : this.getSceneArr(yqMerchantId, data.loginUserInfoList[0])
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
} }
......
<!-- style="padding-bottom:{{isFullSucreen?'224rpx':'160rpx'}}" --> <!-- style="padding-bottom:{{isFullSucreen?'224rpx':'160rpx'}}" -->
<view class="layout"> <view class="layout">
<!-- <view class="title">请选择登录的账号</view> --> <!-- <view class="title">请选择登录的账号</view> -->
<view class="search-box" wx:if="{{copyLoginUserInfoList && copyLoginUserInfoList.length >= 10}}"> <view class="search-box">
<view class="search-input"> <view class="search-input">
<block wx:if="{{!edit}}"> <block wx:if="{{!edit}}">
<view class="input {{searchValue?'':'placeholder'}}" bindtap="open"> <view class="input {{searchValue?'':'placeholder'}}" bindtap="open">
......
// pages/sceneIndex/sceneIndex.js // pages/sceneIndex/sceneIndex.js
import logOutAPI from '../../tabMine/api'
import constantData from '../constant/data' import constantData from '../constant/data'
import api from '~/api/api' import api from '~/api/api'
const app = getApp() import { getShopSceneConfig } from '~/store/index'
const userInfo = wx.$util.getUserInfo()
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
timeState: '',
sceneList: constantData.sceneList, sceneList: constantData.sceneList,
isShow: false, openSceneArr: []
userBoxHeight: 0
}, },
// 选择场景 // 选择场景
selectScene(e) { selectScene(e) {
let { scene, index } = e.currentTarget.dataset let { scene, index } = e.currentTarget.dataset
let { sceneList } = this.data let { sceneList, openSceneArr } = this.data
const userInfo = wx.$util.getUserInfo() if (!openSceneArr.includes(scene) && !userInfo?.isSuper) return wx.$util.showToast('暂未开通此场景')
sceneList.map(i => (i.actived = false)) sceneList.map(i => (i.actived = false))
sceneList[index].actived = true sceneList[index].actived = true
api.selectMerchantScene({ api.selectMerchantScene({
...@@ -46,59 +43,18 @@ Page({ ...@@ -46,59 +43,18 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
let { sceneList } = this.data
let userInfo = wx.$util.getUserInfo() || {}
let openSceneArr = userInfo?.openSceneArr || []
this.setData({
timeState: wx.$util.getTimeState()
})
wx.hideHomeButton({ wx.hideHomeButton({
success: res => {} success: res => {}
}) })
// 获取开通业务场景 this.getSceneArr()
let arr = sceneList.filter(v => openSceneArr.includes(v.sceneType))
this.setData({
isShow: Object.keys(userInfo).length,
sceneList: arr
})
wx.$util.getViewInfo('.user-box', res => {
this.setData({
userBoxHeight: res?.height
})
},)
}, },
// 切换账号 getSceneArr() {
changeAccount() { // 超管默认开通全部场景
wx.$router.reLaunch('pages.accountItems') if (userInfo?.isSuper) return
}, // 获取4s店关联场景数据
getShopSceneConfig({yqMerchantId: userInfo?.subLoginUser?.merchantId, merchantId: userInfo?.shopMerchantId}).then(result => {
// 退出账号 this.setData({openSceneArr: result.map(val => { return val.scene }) || []})
logout() {
let _this = this
wx.showModal({
title: '温馨提示',
content: '是否退出当前账号?',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
_this.setData({
flag: true
})
_this.showLoading()
logOutAPI.logout().then(_res_ => {
let { code, message } = _res_
if (code == 0) {
app.login(false)
} else {
_this.setData({
flag: false
})
_this.showToast(message)
}
})
}
}
}) })
}, },
...@@ -113,15 +69,14 @@ Page({ ...@@ -113,15 +69,14 @@ Page({
onShow() { onShow() {
let { sceneList } = this.data let { sceneList } = this.data
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
let openSceneArr = userInfo?.openSceneArr || [] sceneList.map(i => {
openSceneArr.includes(userInfo?.sceneType) && i.actived = false
sceneList.map(i => { if (i.sceneType == userInfo?.sceneType) {
i.actived = false i.actived = true
if (i.sceneType == userInfo?.sceneType) { }
i.actived = true return i
} })
return i console.log(sceneList, userInfo)
})
this.setData({ sceneList }) this.setData({ sceneList })
}, },
......
<!-- pages/sceneIndex/sceneIndex.wxml --> <!-- pages/sceneIndex/sceneIndex.wxml -->
<view class="layout" wx:if="{{isShow}}"> <view class="layout">
<scroll-view class="scene-box" scroll-y style="height: calc(100vh - 140rpx - {{userBoxHeight}}px - {{isFullSucreen ? 34 : 0}}px - 60rpx);"> <scroll-view class="scene-box" scroll-y style="height: calc(100vh - 140rpx - {{isFullSucreen ? 34 : 0}}px - 60rpx);">
<block wx:for="{{sceneList}}" wx:key="index"> <block wx:for="{{sceneList}}" wx:key="index">
<view class="scene-item {{item.actived ? 'active' : ''}}" bindtap="selectScene" data-scene="{{item.sceneType}}" data-index="{{index}}"> <view class="scene-item {{item.actived ? 'active' : ''}}" bindtap="selectScene" data-scene="{{item.sceneType}}" data-index="{{index}}">
<view class="left"> <view class="left">
...@@ -11,14 +11,10 @@ ...@@ -11,14 +11,10 @@
</view> </view>
</view> </view>
<view class="right"> <view class="right">
<image wx:if='{{!item.actived}}' src="/images/arrow-right.png" /> <view class="selected-class" wx:if="{{item.actived}}">当前场景</view>
<view class="selected-class" wx:else>当前场景</view>
</view> </view>
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
<!-- <view class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="logout text-center" bindtap="logout">退出账号</view>
</view> -->
</view> </view>
...@@ -49,11 +49,11 @@ Page({ ...@@ -49,11 +49,11 @@ Page({
init() { init() {
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
wx.nextTick(() => { wx.nextTick(() => {
// 没有登录信息 或无开通场景 退出登录 // 没有登录信息 退出登录
if (!userInfo || !Object.keys(userInfo).length || !userInfo.openSceneArr?.length) { if (!userInfo || !Object.keys(userInfo).length) {
return app.login(false,'请重新登录') return app.login(false,'请重新登录')
} }
// 未选择4s店 // 未选择4s店 或未开通场景
if ((userInfo?.shopMerchantId ?? '') === '') return wx.$router.reLaunch('pages.accountItems') if ((userInfo?.shopMerchantId ?? '') === '') return wx.$router.reLaunch('pages.accountItems')
// 未选择场景 // 未选择场景
if ((userInfo?.sceneType ?? '') === '') return wx.$router.reLaunch('pages.sceneIndex') if ((userInfo?.sceneType ?? '') === '') return wx.$router.reLaunch('pages.sceneIndex')
......
// pages/accountItems/accountItems.js // pages/accountItems/accountItems.js
import api from '~/api/api'
import { get4SStoreList } from '~/store/index' import { get4SStoreList } from '~/store/index'
import constantData from '../constant/data'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
import { getShopSceneConfig } from '~/store/index'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -14,7 +13,8 @@ Page({ ...@@ -14,7 +13,8 @@ Page({
loginUserInfoList: [], loginUserInfoList: [],
shopMerchantId: '', shopMerchantId: '',
shopMerchantName: '', shopMerchantName: '',
IMG_URL IMG_URL,
openSceneArr: []
}, },
/** /**
...@@ -22,6 +22,7 @@ Page({ ...@@ -22,6 +22,7 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
this.getMerchantList() this.getMerchantList()
this.getSceneArr()
}, },
open() { open() {
this.setData({ this.setData({
...@@ -29,6 +30,16 @@ Page({ ...@@ -29,6 +30,16 @@ Page({
inputFocus: true inputFocus: true
}) })
}, },
getSceneArr() {
let userInfo = wx.$util.getUserInfo()
// 超管开通全部场景
if (userInfo?.isSuper) return
// 获取4s店关联场景数据
getShopSceneConfig({yqMerchantId: userInfo?.subLoginUser?.merchantId, merchantId: userInfo?.shopMerchantId}).then(result => {
this.setData({openSceneArr: result.map(val => { return val.scene }) || []})
})
},
getMerchantList(e) { getMerchantList(e) {
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
let params = { let params = {
...@@ -46,9 +57,8 @@ Page({ ...@@ -46,9 +57,8 @@ Page({
.catch(err => {}) .catch(err => {})
}, },
jumpPage() { jumpPage() {
let userInfo = wx.$util.getUserInfo() let { shopMerchantName, shopMerchantId, openSceneArr } = this.data
let openSceneArr = userInfo?.openSceneArr || [] if (!openSceneArr?.length && !wx.$util.getUserInfo()?.isSuper) return wx.$util.showToast('暂无开通业务,请联系总部管理员')
let { shopMerchantName, shopMerchantId } = this.data
wx.$util.setUserInfo({ wx.$util.setUserInfo({
...wx.$util.getUserInfo(), ...wx.$util.getUserInfo(),
shopMerchantName, shopMerchantName,
...@@ -66,14 +76,7 @@ Page({ ...@@ -66,14 +76,7 @@ Page({
merchantName: shopMerchantName merchantName: shopMerchantName
} }
}) })
// 只开通一个场景直接跳转页面 wx.$router.reLaunch('pages.sceneIndex')
if (openSceneArr.length === 1) {
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), sceneType: openSceneArr[0] })
let pageUrl = constantData?.pageUrl
wx.$router.reLaunch(pageUrl[openSceneArr[0]])
} else if (openSceneArr.length > 1) {
wx.$router.reLaunch('pages.sceneIndex')
}
}, },
setValue(value) { setValue(value) {
if (this.properties.filterEmoji) { if (this.properties.filterEmoji) {
...@@ -129,7 +132,6 @@ Page({ ...@@ -129,7 +132,6 @@ Page({
chooseAccount(e) { chooseAccount(e) {
let { item } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
let { loginUserInfoList } = this.data let { loginUserInfoList } = this.data
let userInfo = wx.$util.getUserInfo()
loginUserInfoList.map(i => { loginUserInfoList.map(i => {
i.active = false i.active = false
if (i.merchantId == item?.merchantId) { if (i.merchantId == item?.merchantId) {
......
<!-- style="padding-bottom:{{isFullSucreen?'224rpx':'160rpx'}}" --> <!-- style="padding-bottom:{{isFullSucreen?'224rpx':'160rpx'}}" -->
<view class="layout"> <view class="layout">
<view class="title">请选择4S店</view> <view class="search-box">
<view class="search-box" wx:if="{{copyLoginUserInfoList && copyLoginUserInfoList.length >= 10}}">
<view class="search-input"> <view class="search-input">
<block wx:if="{{!edit}}"> <block wx:if="{{!edit}}">
<view class="input {{searchValue?'':'placeholder'}}" bindtap="open"> <view class="input {{searchValue?'':'placeholder'}}" bindtap="open">
......
// pages/sceneIndex/sceneIndex.js // pages/sceneIndex/sceneIndex.js
import logOutAPI from '../../tabMine/api'
import constantData from '../constant/data' import constantData from '../constant/data'
import api from '~/api/api' import api from '~/api/api'
const app = getApp() import { getShopSceneConfig } from '~/store/index'
const userInfo = wx.$util.getUserInfo()
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
timeState: '',
sceneList: constantData.sceneList, sceneList: constantData.sceneList,
isShow: false, openSceneArr: []
userBoxHeight: 0
}, },
// 选择场景 // 选择场景
selectScene(e) { selectScene(e) {
let { scene, index } = e.currentTarget.dataset let { scene, index } = e.currentTarget.dataset
let { sceneList } = this.data let { sceneList, openSceneArr } = this.data
const userInfo = wx.$util.getUserInfo() if (!openSceneArr.includes(scene) && !userInfo?.isSuper) return wx.$util.showToast('暂未开通此场景')
sceneList.map(i => (i.actived = false)) sceneList.map(i => (i.actived = false))
sceneList[index].actived = true sceneList[index].actived = true
api.selectMerchantScene({ api.selectMerchantScene({
...@@ -46,59 +43,18 @@ Page({ ...@@ -46,59 +43,18 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
let { sceneList } = this.data
let userInfo = wx.$util.getUserInfo() || {}
let openSceneArr = userInfo?.openSceneArr || []
this.setData({
timeState: wx.$util.getTimeState()
})
wx.hideHomeButton({ wx.hideHomeButton({
success: res => {} success: res => {}
}) })
// 获取开通业务场景 this.getSceneArr()
let arr = sceneList.filter(v => openSceneArr.includes(v.sceneType))
this.setData({
isShow: Object.keys(userInfo).length,
sceneList: arr
})
wx.$util.getViewInfo('.user-box', res => {
this.setData({
userBoxHeight: res?.height
})
},)
}, },
// 切换账号 getSceneArr() {
changeAccount() { // 超管默认开通全部场景
wx.$router.reLaunch('pages.accountItems') if (userInfo?.isSuper) return
}, // 获取4s店关联场景数据
getShopSceneConfig({yqMerchantId: userInfo?.subLoginUser?.merchantId, merchantId: userInfo?.isSuper ? undefined : userInfo?.shopMerchantId}).then(result => {
// 退出账号 this.setData({openSceneArr: result.map(val => { return val.scene }) || []})
logout() {
let _this = this
wx.showModal({
title: '温馨提示',
content: '是否退出当前账号?',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
_this.setData({
flag: true
})
_this.showLoading()
logOutAPI.logout().then(_res_ => {
let { code, message } = _res_
if (code == 0) {
app.login(false)
} else {
_this.setData({
flag: false
})
_this.showToast(message)
}
})
}
}
}) })
}, },
...@@ -113,15 +69,13 @@ Page({ ...@@ -113,15 +69,13 @@ Page({
onShow() { onShow() {
let { sceneList } = this.data let { sceneList } = this.data
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
let openSceneArr = userInfo?.openSceneArr || [] sceneList.map(i => {
openSceneArr.includes(userInfo?.sceneType) && i.actived = false
sceneList.map(i => { if (i.sceneType == userInfo?.sceneType) {
i.actived = false i.actived = true
if (i.sceneType == userInfo?.sceneType) { }
i.actived = true return i
} })
return i
})
this.setData({ sceneList }) this.setData({ sceneList })
}, },
......
<!-- pages/sceneIndex/sceneIndex.wxml --> <!-- pages/sceneIndex/sceneIndex.wxml -->
<view class="layout" wx:if="{{isShow}}"> <view class="layout">
<scroll-view class="scene-box" scroll-y style="height: calc(100vh - 140rpx - {{userBoxHeight}}px - {{isFullSucreen ? 34 : 0}}px - 60rpx);"> <scroll-view class="scene-box" scroll-y style="height: calc(100vh - 140rpx - {{isFullSucreen ? 34 : 0}}px - 60rpx);">
<block wx:for="{{sceneList}}" wx:key="index"> <block wx:for="{{sceneList}}" wx:key="index">
<view class="scene-item {{item.actived ? 'active' : ''}}" bindtap="selectScene" data-scene="{{item.sceneType}}" data-index="{{index}}"> <view class="scene-item {{item.actived ? 'active' : ''}}" bindtap="selectScene" data-scene="{{item.sceneType}}" data-index="{{index}}">
<view class="left"> <view class="left">
...@@ -10,15 +10,8 @@ ...@@ -10,15 +10,8 @@
<view class="desc">{{item.sceneDesc}}</view> <view class="desc">{{item.sceneDesc}}</view>
</view> </view>
</view> </view>
<!-- <view class="right">
<image wx:if='{{!item.actived}}' src="/images/arrow-right.png" />
<view class="selected-class" wx:else>当前场景</view>
</view> -->
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
<!-- <view class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="logout text-center" bindtap="logout">退出账号</view>
</view> -->
</view> </view>
...@@ -255,43 +255,14 @@ export const setWebSocket = () => { ...@@ -255,43 +255,14 @@ export const setWebSocket = () => {
/** 获取园区店下的4S店 */ /** 获取园区店下的4S店 */
export const get4SStoreList = options => { export const get4SStoreList = options => {
console.log(options, 'options')
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const app = getApp()
wx.showLoading()
if (app.globalData.storeListRange?.length) {
wx.hideLoading()
return resolve(app.globalData.storeListRange)
}
api api
.getSceneMerchantRefStoreList(options) .getSceneMerchantRefStoreList(options)
.then(res => { .then(res => {
wx.hideLoading() wx.hideLoading()
let { code, data } = res let { code, data } = res
if (code == 0) { if (code == 0) {
app.globalData.storeListRange = data resolve(data || [])
// let default4SStoreInfo = wx.$util.getUserInfo()?.default4SStoreInfo ? wx.$util.getUserInfo()?.default4SStoreInfo : data && data[0]
// let default4SStoreInfo_crowdFunding = wx.$util.getUserInfo()?.default4SStoreInfo_crowdFunding ? wx.$util.getUserInfo()?.default4SStoreInfo_crowdFunding : data && data[0]
// let default4SStoreInfo_newCarConversion = wx.$util.getUserInfo()?.default4SStoreInfo_newCarConversion ? wx.$util.getUserInfo()?.default4SStoreInfo_newCarConversion : data && data[0]
console.log(options)
// if (options.scene == 0)
// wx.$util.setUserInfo({
// ...wx.$util.getUserInfo(),
// default4SStoreInfo: default4SStoreInfo
// })
// if (options.scene == 3 || options.scene == 2)
// if (options.isSubcehicle) {
// // 是否是次新车转化业务场景(商户关联关系与众筹一样)
// wx.$util.setUserInfo({
// ...wx.$util.getUserInfo(),
// default4SStoreInfo_newCarConversion: default4SStoreInfo_newCarConversion
// })
// } else
// wx.$util.setUserInfo({
// ...wx.$util.getUserInfo(),
// default4SStoreInfo_crowdFunding: default4SStoreInfo_crowdFunding
// })
resolve(app.globalData.storeListRange)
} }
}) })
.catch(error => { .catch(error => {
...@@ -337,3 +308,13 @@ export const getPositionList = options => { ...@@ -337,3 +308,13 @@ export const getPositionList = options => {
} }
}) })
} }
/** 获取4s店关联场景数据 */
export const getShopSceneConfig = options => {
return new Promise((resolve, reject) => {
api.getYqMerchantSceneConfigAPI(options).then(res => {
let { data } = res
resolve(data || [])
})
})
}
...@@ -72,5 +72,10 @@ module.exports = { ...@@ -72,5 +72,10 @@ module.exports = {
/** 修改订单备注 */ /** 修改订单备注 */
updateOrderRemark(data) { updateOrderRemark(data) {
return api.post('dj.api.smartcarlife.order.updateRemark', data) return api.post('dj.api.smartcarlife.order.updateRemark', data)
},
/** 获取首页统计数据 */
getHomeStaticData(data) {
return api.post('dj.api.smartcarlife.expanded.gold.getMerchantCrowdfundingStatistics', data)
} }
} }
...@@ -51,7 +51,8 @@ Page({ ...@@ -51,7 +51,8 @@ Page({
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
let params = { let params = {
merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId, merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId,
staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid,
scene: 2
} }
get4SStoreList(params).then(result => { get4SStoreList(params).then(result => {
this.setData({ this.setData({
......
...@@ -30,21 +30,22 @@ Component({ ...@@ -30,21 +30,22 @@ Component({
], ],
staticDataList: [{ staticDataList: [{
label: '今日营业额', label: '今日营业额',
value: 0, value: 'todayAmount',
tipsLabel: '今日成交量', tipsLabel: '今日成交量',
tipsValue: 0 tipsValue: 'todayOrderCount'
}, { }, {
label: '本月营业额', label: '本月营业额',
value: 0, value: 'monthAmount',
tipsLabel: '本月成交量', tipsLabel: '本月成交量',
tipsValue: 0 tipsValue: 'monthOrderCount'
}, { }, {
label: '累计营业额', label: '累计营业额',
value: 0, value: 'totalAmount',
tipsLabel: '累计成交量', tipsLabel: '累计成交量',
tipsValue: 0 tipsValue: 'totalOrderCount'
}], }],
conversionList: {} conversionList: {},
staticData: {}
}, },
lifetimes: { lifetimes: {
attached() { attached() {
...@@ -73,6 +74,14 @@ Component({ ...@@ -73,6 +74,14 @@ Component({
merchantId: wx.$util.getUserInfo()?.shopMerchantId || '' merchantId: wx.$util.getUserInfo()?.shopMerchantId || ''
} }
if (!params.merchantId) return if (!params.merchantId) return
api.getHomeStaticData(params).then(res => {
let { code, data } = res
if (code == 0) {
this.setData({
staticData: data || {}
})
}
})
api.summaryOfOutputValueList(params).then(res => { api.summaryOfOutputValueList(params).then(res => {
if (res.code == 0) { if (res.code == 0) {
if (res.data?.totalOutputValue) { if (res.data?.totalOutputValue) {
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<view class="top_box"> <view class="top_box">
<view class="top_item" wx:for="{{staticDataList}}" wx:key="index"> <view class="top_item" wx:for="{{staticDataList}}" wx:key="index">
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
<view class="value"><text style="font-size: 28rpx;margin-right: 4rpx;">¥</text>{{item.value}}</view> <view class="value"><text style="font-size: 28rpx;margin-right: 4rpx;">¥</text>{{staticData[item.value] || 0}}</view>
<view class="tips_box"> <view class="tips_box">
<text>{{item.tipsLabel}}</text> <text>{{item.tipsLabel}}</text>
<text class="num_text">{{item.tipsValue}}</text> <text class="num_text">{{staticData[item.tipsValue] || 0}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<view class="overview-wrap"> <view class="overview-wrap">
<view class="overview-list" wx:for="{{productionValueList}}" wx:key="index"> <view class="overview-list" wx:for="{{productionValueList}}" wx:key="index">
<view class="overview-left"> <view class="overview-left">
<view class="overview-title"><image class="overview-img" src="{{IMG_URL}}staticIcon/{{item.icon}}.png"></image>{{item.title}}</view> <view class="overview-title"><image class="overview-img" src="{{IMG_URL}}staticIcon/{{item.imgName}}.png"></image>{{item.title}}</view>
<view class="overview-num">{{conversionList[item.valueName]}}</view> <view class="overview-num">{{conversionList[item.valueName]}}</view>
</view> </view>
</view> </view>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
.search-box { .search-box {
width: calc(100% - 64rpx); width: calc(100% - 64rpx);
margin: 53rpx 32rpx 0; margin: 32rpx 32rpx 0;
display: flex; display: flex;
background-color: #fff; background-color: #fff;
position: sticky; position: sticky;
......
...@@ -389,7 +389,7 @@ Page({ ...@@ -389,7 +389,7 @@ Page({
} }
}) })
console.log(data.list, 'list') console.log(data.list, 'list')
const userType = !userInfo?.isSuper && userInfo.merchantType && userInfo.userType == 1 const userType = !userInfo?.isSuper && userInfo?.merchantType && userInfo.userType == 1
list = data.list.map(item => { list = data.list.map(item => {
item.repeal = userType && [1, 2].includes(item.inviteStatus) item.repeal = userType && [1, 2].includes(item.inviteStatus)
return item return item
......
...@@ -133,7 +133,8 @@ Page({ ...@@ -133,7 +133,8 @@ Page({
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
let params = { let params = {
merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId, merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId,
staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid,
scene: 1
} }
get4SStoreList(params).then(result => { get4SStoreList(params).then(result => {
this.setData({ this.setData({
...@@ -193,7 +194,7 @@ Page({ ...@@ -193,7 +194,7 @@ Page({
let { item, type } = e.currentTarget.dataset let { item, type } = e.currentTarget.dataset
let { userInfo } = this.data let { userInfo } = this.data
// 判断是不是门店员工 // 判断是不是门店员工
if (userInfo.merchantType && !userInfo.isSuper && type == 2) { if (userInfo?.merchantType && !userInfo.isSuper && type == 2) {
wx.$util.pointRecord(item.recordId) wx.$util.pointRecord(item.recordId)
if (item.type == 'scanCode') { if (item.type == 'scanCode') {
wx.scanCode({ wx.scanCode({
......
...@@ -22,7 +22,7 @@ page ::-webkit-scrollbar { ...@@ -22,7 +22,7 @@ page ::-webkit-scrollbar {
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 #0000001a; box-shadow: 0 4rpx 20rpx 0 #0000001a;
border-radius: 32rpx 32rpx 0 0; border-radius: 32rpx 32rpx 0 0;
min-height: calc(100% - 238rpx); min-height: calc(100% - 232rpx);
padding: 30rpx 36rpx; padding: 30rpx 36rpx;
} }
} }
......
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
<view class="top_box"> <view class="top_box">
<view class="top_item" wx:for="{{staticDataList}}" wx:key="index"> <view class="top_item" wx:for="{{staticDataList}}" wx:key="index">
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
<view class="value"><text style="font-size: 28rpx;margin-right: 4rpx;">¥</text>{{userStat[item.valueObj]['totalOrderMoney']}}</view> <view class="value"><text style="font-size: 28rpx;margin-right: 4rpx;">¥</text>{{userStat[item.valueObj]['totalOrderMoney'] || 0}}</view>
<view class="tips_box"> <view class="tips_box">
<text>{{item.tipsLabel}}</text> <text>{{item.tipsLabel}}</text>
<text class="num_text">{{userStat[item.valueObj]['totalUpgrade']}}</text> <text class="num_text">{{userStat[item.valueObj]['totalUpgrade'] || 0}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
<div class="menu noStaff"> <div class="menu noStaff">
<block wx:for="{{ menu }}" wx:key="index"> <block wx:for="{{ menu }}" wx:key="index">
<view class="item" bindtap="jump" data-item="{{ item }}" data-type="{{ userInfo.userType }}"> <view class="item" bindtap="jump" data-item="{{ item }}" data-type="{{ userInfo.userType }}">
<image src="{{IMG_URL}}{{item.icon}}.png" /> <image src="{{IMG_URL}}upgrade/{{item.icon}}.png" />
<view class="label">{{item.name}}</view> <view class="label">{{item.name}}</view>
</view> </view>
</block> </block>
...@@ -324,7 +324,7 @@ ...@@ -324,7 +324,7 @@
wx:if="{{ showOrderpop }}" wx:if="{{ showOrderpop }}"
flag="{{ showOrderpop }}" flag="{{ showOrderpop }}"
/> />
<side-select-popup show="{{ shopSideSelectPopup }}" storeList="{{ userInfo.isSuper ? merchantRange : storeRange}}" subIndex="{{subIndex}}" hasTabBar="true" /> <side-select-popup show="{{ shopSideSelectPopup }}" storeList="{{ userInfo.isSuper ? merchantRange : storeRange}}" bindconfirm="storeSearchEvent" subIndex="{{subIndex}}" hasTabBar="true" />
<!-- <store-picker <!-- <store-picker
subIndex="{{ subIndex }}" subIndex="{{ subIndex }}"
pickList="{{ merchantRange }}" pickList="{{ merchantRange }}"
......
...@@ -2,11 +2,13 @@ ...@@ -2,11 +2,13 @@
import api from '../../api.js' import api from '../../api.js'
const app = getApp() const app = getApp()
import constantData from '../../../pages/constant/data' import constantData from '../../../pages/constant/data'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/mine/'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
IMG_URL,
navStyle: 'background-color: rgba(0,0,0,0);box-shadow:none;', navStyle: 'background-color: rgba(0,0,0,0);box-shadow:none;',
workCount: 0, workCount: 0,
workItem: [ workItem: [
...@@ -263,6 +265,7 @@ Page({ ...@@ -263,6 +265,7 @@ Page({
}, },
// 切换场景 // 切换场景
changeScene() { changeScene() {
wx.$router.reLaunch('pages.changeScene') wx.$router.reLaunch('pages.changeScene')
}, },
......
...@@ -52,18 +52,22 @@ ...@@ -52,18 +52,22 @@
<view class="title">工位设置<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view> <view class="title">工位设置<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view>
<view class="set_tips" wx:if="{{workCount>0}}"><text style="font-size: 32rpx;color: #333333; font-weight: 500;">{{workCount}}</text>个</view> <view class="set_tips" wx:if="{{workCount>0}}"><text style="font-size: 32rpx;color: #333333; font-weight: 500;">{{workCount}}</text>个</view>
<view class="set_tips" wx:else>根据门店设置工位数</view> <view class="set_tips" wx:else>根据门店设置工位数</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_4.png" mode=""/>
</view> </view>
<view class="set_item item_2" bindtap="showMerchantPop"> <view class="set_item item_2" bindtap="showMerchantPop">
<view class="title">录单设置<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view> <view class="title">录单设置<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view>
<view class="set_tips">设置录单必填项</view> <view class="set_tips">设置录单必填项</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_2.png" mode=""/>
</view> </view>
<view class="set_item item_3" bindtap="changeScene"> <view class="set_item item_3" bindtap="changeScene">
<view class="title">场景切换<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view> <view class="title">场景切换<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view>
<view class="set_tips">{{selectedSceneName}}</view> <view class="set_tips">{{selectedSceneName}}</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_3.png" mode=""/>
</view> </view>
<view class="set_item item_4" bindtap="goVersionPage"> <view class="set_item item_4" bindtap="goVersionPage">
<view class="title">更新日志<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view> <view class="title">更新日志<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view>
<view class="set_tips">最新{{versionData.version}}版</view> <view class="set_tips">最新{{versionData.version}}版</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_1.png" mode=""/>
</view> </view>
</view> </view>
<!-- <view class="version_box" bindtap="goVersionPage"> <!-- <view class="version_box" bindtap="goVersionPage">
......
...@@ -152,6 +152,15 @@ ...@@ -152,6 +152,15 @@
justify-content: center; justify-content: center;
padding: 32rpx; padding: 32rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
position: relative;
}
.set_box .set_item .icon_image{
width: 120rpx;
height: 120rpx;
position: absolute;
right: 0;
bottom: 0;
} }
.set_box .set_item .title .arrow_icon{ .set_box .set_item .title .arrow_icon{
......
...@@ -67,8 +67,8 @@ const domain_items = { ...@@ -67,8 +67,8 @@ const domain_items = {
scrm: 'https://scrm.dev.glsx.com.cn' scrm: 'https://scrm.dev.glsx.com.cn'
}, },
dev: { dev: {
// dj: 'https://dj.dev.glsx.com.cn', dj: 'https://dj.dev.glsx.com.cn',
dj: 'http://192.168.3.226:9711', // dj: 'http://192.168.3.226:9711',
scrm: 'https://scrm.dev.glsx.com.cn' scrm: 'https://scrm.dev.glsx.com.cn'
}, },
uat: { uat: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!