Commit 472e2dc5 by 杨明

样式

1 parent 5fa3d3db
......@@ -8,7 +8,6 @@
font-size: 24rpx;
color: #999;
letter-spacing: 2rpx;
padding-left: 28rpx;
box-sizing: border-box;
display: flex;
align-items: center;
......@@ -37,7 +36,7 @@
}
.tips .choose-box {
width: 80rpx;
height: 80rpx;
width: 64rpx;
height: 64rpx;
position: relative;
}
\ No newline at end of file
import {
setSessionId,
setUserInfo,
setSubMerchant
setSessionId,
setUserInfo,
setSubMerchant
} from '~/utils/cache/storageApi'
import USERAPI from '~/api/usersApi/index'
import outputApi from '~/api/outputApi/index'
import { IMG_URL } from '~/utils/constantData'
const setRouteData = targetPath => {
let [url, query] = targetPath.split('?'),
obj = {}
if (query) {
var list = query.split('&') || []
list.forEach(item => {
const [key, val] = item.split('=')
obj[key] = val
})
}
return {
url,
obj
}
let [url, query] = targetPath.split('?'),
obj = {}
if (query) {
var list = query.split('&') || []
list.forEach(item => {
const [key, val] = item.split('=')
obj[key] = val
})
}
return {
url,
obj
}
}
/**选择账号登录 */
const selectAccountLogin = ({
id,
sessionId
}) => {
USERAPI.selectAccountLogin({
id,
sessionId
}).then(({
code,
data,
message
}) => {
if (code == '0') {
setLoginInfo(data.loginUserInfoList[0], data.sessionId)
} else wx.$api.showToast(message || '系统异常')
})
}) => {
USERAPI.selectAccountLogin({
id,
sessionId
}).then(({
code,
data,
message
}) => {
if (code == '0') {
setLoginInfo(data.loginUserInfoList[0], data.sessionId)
} else wx.$api.showToast(message || '系统异常')
})
}
/**获取门店号下的全部门店 */
const findSubordinateListByPage = (userInfo)=> {
return new Promise(resolve=>{
USERAPI.findSubordinateListByPage({pageSize:10000,pageNum:1,merchantId:userInfo.merchantId,apiProjectName:'rop-merchants'}).then(res=>{
const list = res.data||[]
const merchant = list.map(i=>i.merchantNo)
const findSubordinateListByPage = (userInfo) => {
return new Promise(resolve => {
USERAPI.findSubordinateListByPage({ pageSize: 10000, pageNum: 1, merchantId: userInfo.merchantId, apiProjectName: 'rop-merchants' }).then(res => {
const list = res.data || []
const merchant = list.map(i => i.merchantNo)
resolve(merchant)
})
})
}
/**查找二级流量方商户 */
const secondFlow = (userInfo)=> {
return new Promise(resolve=>{
USERAPI.secondFlow({merchantId:userInfo.merchantId}).then(res=>{
const list = res||{}
const merchant = list.merchantNoList||[]
const secondFlow = (userInfo) => {
return new Promise(resolve => {
USERAPI.secondFlow({ merchantId: userInfo.merchantId }).then(res => {
const list = res || {}
const merchant = list.merchantNoList || []
resolve(merchant)
})
})
}
/**设置登录信息 */
const setLoginInfo = async (userInfo, sessionId) => {
if (!userInfo) {
wx.$api.showToast('请使用商户账号登陆')
return
}
setUserInfo(userInfo)
setSessionId(sessionId)
try {
const merchant = await Promise.all([findSubordinateListByPage(userInfo),secondFlow(userInfo)])
setSubMerchant(merchant.flat())
} catch (error) {
}
loginSuccess()
if (!userInfo) {
wx.$api.showToast('请使用商户账号登陆')
return
}
setUserInfo(userInfo)
setSessionId(sessionId)
try {
const merchant = await Promise.all([findSubordinateListByPage(userInfo), secondFlow(userInfo)])
setSubMerchant(merchant.flat())
} catch (error) {
}
loginSuccess()
}
const initServiceCenter = () => {
USERAPI.initServiceCenter({})
USERAPI.initServiceCenter({})
}
/**成功跳转 */
const loginSuccess = () => {
const {
options: {
targetPath
let { subMerchant } = wx.$storage.get()
let params = {
merchantIds: subMerchant,
}
} = wx.$router.getPageInstance()
wx.setStorageSync('first_enter', true)
if (targetPath) {
const {
url,
obj
} = setRouteData(targetPath)
wx.$router.reLaunch(url, obj)
} else wx.reLaunch({url:"/pages/tab/output/output"})
outputApi.getBusiStatistics(params).then(res => {
// 0:全部-1;1:精品升级SC002;2:售后众筹SC004;3:会员权益/升级SC001
let _openList = [{
code: 'SC002',
name: 'boutiqueUpgrade',
type: 1,
}, {
code: 'SC004',
name: 'afterSalesCrowdfunding',
type: 0,
}, {
code: 'SC001',
name: 'vdUpgrade',
type: 2,
}]
let type = null;
let _list = []
_list = res.merchantList || []
_openList.forEach(k => {
if (_list[0].sceneCodes && _list[0].sceneCodes.includes(k.code)) {
type = k.type
return
}
})
if (_list.length == 1 && type !== null) {
wx.reLaunch({
url: `/pages/tab/output/output?merchantId=${_list[0].merchantId4s}&type=${type}&merchantName=${_list[0].merchantName4s}`,
})
} else wx.reLaunch({ url: "/pages/tab/output/output" })
})
}
const loginModal = async ({
message,
confirmText,
cancelText
message,
confirmText,
cancelText
}) => {
return new Promise((resolve, reject) => {
wx.showModal({
content: message || '网络异常',
confirmText: confirmText || '重试',
cancelText: cancelText || '取消',
confirmColor: '#3666FE',
success(res) {
if (res.confirm) resolve(res.confirm)
if (res.cancel) reject(false)
}
return new Promise((resolve, reject) => {
wx.showModal({
content: message || '网络异常',
confirmText: confirmText || '重试',
cancelText: cancelText || '取消',
confirmColor: '#3666FE',
success(res) {
if (res.confirm) resolve(res.confirm)
if (res.cancel) reject(false)
}
})
})
})
}
/**手机号&微信登录:是否跳转登录列表页 */
const checkLoginUserInfo = ({
loginUserInfoList,
sessionId
loginUserInfoList,
sessionId
}) => {
const thisPage = wx.$router.getPageInstance()
/**多个账号 */
if (loginUserInfoList.length > 1)
wx.$router.go('login.accountItems', {
sessionId,
...thisPage.options
})
/**只有一个账号 */
else
selectAccountLogin({
id: loginUserInfoList[0].uuid,
sessionId
})
const thisPage = wx.$router.getPageInstance()
/**多个账号 */
if (loginUserInfoList.length > 1)
wx.$router.go('login.accountItems', {
sessionId,
...thisPage.options
})
/**只有一个账号 */
else
selectAccountLogin({
id: loginUserInfoList[0].uuid,
sessionId
})
}
module.exports = {
checkLoginUserInfo,
selectAccountLogin,
loginSuccess,
setRouteData,
setLoginInfo,
loginModal,
initServiceCenter
checkLoginUserInfo,
selectAccountLogin,
loginSuccess,
setRouteData,
setLoginInfo,
loginModal,
initServiceCenter
}
\ No newline at end of file
......@@ -97,6 +97,9 @@
height: 64rpx;
line-height: 64rpx;
margin-left: 15rpx;
&::placeholder {
color: red;
}
}
}
}
......@@ -106,7 +109,7 @@
}
.table_left_column {
min-width: 150rpx;
min-width: 100rpx;
height: auto;
display: flex;
flex-direction: column;
......@@ -114,13 +117,14 @@
.left_col_item {
width: 100%;
height: 63rpx;
height: 72rpx;
font-size: 20rpx;
display: flex;
align-items: center;
color: #1B233D;
// background: #F9F9F9;
background: #F5F9FE;
padding-left: 18rpx;
&:first-child {
font-weight: 600;
......@@ -160,14 +164,14 @@
}
.flex_direction_column_item {
min-width: 200rpx;
min-width: 150rpx;
display: inline-block;
/* border: 1px solid #000; */
}
.item_name {
min-width: 200rpx;
height: 63rpx;
min-width: 120rpx;
height: 72rpx;
display: flex;
align-items: center;
justify-content: center;
......
......@@ -17,7 +17,7 @@
</view>
<view class="staff-input">
<icon class="icon-small" type="search" size="14"></icon>
<input placeholder="输入员工名称" value="{{empName}}" bind:blur="hanldBlur"/>
<input placeholder="输入员工名称" placeholder-style="color:#cdcdd1" value="{{empName}}" bind:blur="hanldBlur"/>
</view>
<blokc wx:if="{{sfaff[0].list.length}}">
<view class='table'>
......
<view class="bar-wrap">
<view class="searchList">
<block wx:for="{{opts.barList}}" wx:for-item="item" wx:key="index">
<view class="search-text {{dataType==item.type?'active':''}}" data-condition="dataType" data-type="{{item.type}}" bindtap="selectCondition">{{item.title}}</view></block>
<view class="search-unit">单位:{{opts.barList.length == 3?'元':'张'}}</view>
</view>
<view class="searchList">
<block wx:for="{{opts.barList}}" wx:for-item="item" wx:key="index">
<view class="search-text {{dataType==item.type?'active':''}}" data-condition="dataType" data-type="{{item.type}}" bindtap="selectCondition">{{item.title}}</view>
</block>
<view class="search-unit">单位:{{(dataType == 3&&opts.barList.length == 3) || (opts.barList.length == 2&&dataType==1) ?'元':'张'}}</view>
</view>
<view class="container">
<bar-echart class="f2-chart" keys="{{opts.keys}}" chartData="{{chartData}}" color="{{opts.color}}" tickCount="{{opts.tickCount}}" />
</view>
<view class="container">
<bar-echart class="f2-chart" keys="{{opts.keys}}" chartData="{{chartData}}" color="{{opts.color}}" tickCount="{{opts.tickCount}}" />
</view>
</view>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<view class="searchList">
<block wx:for="{{opts.lineList}}" wx:for-item="item" wx:key="index">
<view class="search-text {{dataType==item.type?'active':''}}" data-condition="dataType" data-type="{{item.type}}" bindtap="selectCondition">{{item.title}}</view></block>
<view class="search-unit">单位:元</view>
<view class="search-unit">单位:{{dataType==1?'元':'单'}}</view>
</view>
<view class="searchTime">
<block wx:for="{{dimension}}" wx:for-item="item" wx:key="index">
......
......@@ -111,7 +111,7 @@
}
.icon {
width: 56rpx;
height: 48rpx;
height: 56rpx;
// margin-left: 6rpx;
}
}
......
......@@ -7,7 +7,7 @@
.searchInput {
width: 100%;
background: #fff;
padding: 24rpx 0;
padding: 18rpx 0;
}
......
......@@ -20,7 +20,7 @@ Component({
all: { title: '总访客(人)', num: s.visitCount },
},
shareData: {
all: { title: '产值值(元)', num: this.priceFormat(s.realAmount || 0), unit: '¥' }
all: { title: '总产值(元)', num: this.priceFormat(s.realAmount || 0), unit: '¥' }
},
}
......
......@@ -5,6 +5,7 @@
// height: 78rpx;
// line-height: 78rpx;
justify-content: space-around;
padding-bottom: 12rpx;
.tab-item {
color: #666666;
......
/* pages/tab/index/components/activityTop/activityTop.wxss */
.active-top{
display: flex;
.active-img{
flex-shrink: 0;
position: relative;
width: 160rpx;
height: 160rpx;
margin-right: 24rpx;
.thum-icon{
width: 100%;
height: 100%;
position: absolute;
border-radius: 16rpx;
overflow: hidden;
top: 0;
left: 0;
image {
height: 100%;
}
}
.active-type{
position: absolute;
top: 0;
left: 0;
width: 72rpx;
height: 40rpx;
background-image: linear-gradient(90deg, #FFF3A2 7%, #FFDA85 95%);
border-radius: 16rpx 0 24rpx 0;
color: #673F00;
font-size: 24rpx;
text-align: center;
}
}
.active-title{
flex: 1;
.active-top {
display: flex;
flex-flow: column;
justify-content: space-between;
padding: 8rpx 0;
.name{
// display: flex;
// align-items: center;
.name-left{
font-weight: 600;
font-size: 36rpx;
color: #1B233D;
line-height: 48rpx;
word-break: break-all;
.activity-type{
float: right;
line-height: 44rpx;
font-size: 28rpx;
font-weight: 400;
color: #FE5662;
margin-top: 4rpx;
image{
margin-top: 4rpx;
width: 32rpx;
height: 32rpx;
}
}
}
.right{
display: flex;
flex-flow: 1;
font-size: 28rpx;
align-items: center;
image{
width: 32rpx;
height: 32rpx;
.active-img {
flex-shrink: 0;
position: relative;
width: 160rpx;
height: 160rpx;
margin-right: 24rpx;
.thum-icon {
width: 100%;
height: 100%;
position: absolute;
border-radius: 16rpx;
overflow: hidden;
top: 0;
left: 0;
image {
height: 100%;
}
}
.active-type {
position: absolute;
top: 0;
left: 0;
width: 72rpx;
height: 40rpx;
background-image: linear-gradient(90deg, #FFF3A2 7%, #FFDA85 95%);
border-radius: 16rpx 0 24rpx 0;
color: #673F00;
font-size: 24rpx;
text-align: center;
}
}
}
.time{
color: #7A8299;
font-size: 28rpx;
text{
color: #1B233D;
}
.active-title {
flex: 1;
display: flex;
flex-flow: column;
justify-content: space-between;
padding: 8rpx 0;
.name {
// display: flex;
// align-items: center;
.name-left {
font-weight: 600;
font-size: 28rpx;
color: #1B233D;
line-height: 48rpx;
word-break: break-all;
.activity-type {
float: right;
line-height: 44rpx;
font-size: 28rpx;
font-weight: 400;
color: #FE5662;
margin-top: 4rpx;
image {
margin-top: 4rpx;
width: 32rpx;
height: 32rpx;
}
}
}
.right {
display: flex;
flex-flow: 1;
font-size: 28rpx;
align-items: center;
image {
width: 32rpx;
height: 32rpx;
}
}
}
.time {
color: #7A8299;
font-size: 24rpx;
text {
color: #1B233D;
}
}
}
}
}
\ No newline at end of file
......@@ -39,6 +39,7 @@
}
.end{
color: #6E6E7A;
margin-left: 8rpx;
}
.un-start-class {
width: 32rpx;
......
......@@ -6,7 +6,7 @@
<!-- 活动top信息 -->
<activity-top tabType="{{tabType}}" data="{{item}}" widthStyle="flex: 0 0 62%;">
<block wx:if="{{item.activityStatus==2}}">
<glsx-image webp src="store-assistant/hot-icon.png"></glsx-image>
<glsx-image class="un-start-class" webp src="store-assistant/hot-icon.png"></glsx-image>
<text class="hot">火热进行中</text>
</block>
<block wx:if="{{item.activityStatus==1}}">
......
......@@ -3,7 +3,7 @@
<view class="title">场景切换</view>
<block wx:for="{{menus}}" wx:key="index">
<view catch:tap="selectMenu" data-index="{{item.serviceType}}" class="element {{item.serviceType==current?'active':''}}">
<glsx-image class="logo" webp src="store-assistant-assemble/menu/{{item.logo}}.png"></glsx-image>
<glsx-image class="logo" webp src="store-assistant-assemble/menu/{{item.logo}}{{item.serviceType==current?'-o':''}}.png"></glsx-image>
<view class="label">{{item.title}}</view>
<view wx:if="{{totals&&item.serviceType==0}}" class="num_pannel">{{totals}}</view>
</view>
......
......@@ -20,7 +20,7 @@ page {
.layout {
box-sizing: border-box;
position: relative;
padding-top: 400rpx;
padding-bottom: 60rpx;
// background-color: #fff;
&::after {
......
......@@ -10,7 +10,7 @@
</navigation-bar>
</view>
<block wx:if="{{navHeight}}">
<view class="layout" id="layout" style="padding-top:{{navHeight}}px; height: calc(100vh - {{navHeight*2}}rpx)">
<view class="layout" id="layout" style="padding-top:{{navHeight}}px; height: 100vh">
<!-- 背景图 -->
<!-- <view class="bg-box" style="height:{{368 + navHeight * 2}}rpx;top:-{{navHeight}}px">
<view class="bg">
......
......@@ -14,17 +14,17 @@ Page({
timeValue: new Date().format('yyyy-MM-dd'),
outputView: {
outputValue: [{
label: '报价量',
label: '报价量(单)',
name: 'quotationCount',
unit: '',
iconUrl:'store-assistant-assemble/output/icon02.png'
}, {
label: '成交量',
label: '成交量(单)',
name: 'successCount',
unit: '',
iconUrl:'store-assistant-assemble/output/icon07.png'
}, {
label: '产值',
label: '产值(元)',
name: 'outputValue',
_unit: '¥',
iconUrl:'store-assistant-assemble/output/icon05.png'
......
......@@ -61,6 +61,7 @@
}
.store-desc {
margin-top: 6rpx;
font-size: 24rpx;
color: #1b233da8;
line-height: 32rpx;
......@@ -167,7 +168,7 @@
display: flex;
justify-content: space-between;
// align-items: center;
font-size: 24rpx;
font-size: 22rpx;
color: #6E6E7A;
// line-height: 36rpx;
......@@ -236,8 +237,9 @@
// background: #F4F8FE;
// border-radius: 32rpx;
background: #FFFFFF;
margin: 16rpx;
margin-top: 16rpx;
padding: 24rpx;
min-height: calc(100% - 500rpx);
.billboard-title {
font-weight: 600;
......@@ -263,18 +265,18 @@
position: relative;
.billboard-item {
width: 209.54rpx;
height: 321.3rpx;
width: 216rpx;
height: 368rpx;
position: absolute;
&:first-child {
top: 55rpx;
left: 220rpx;
top: 25rpx;
left: 228rpx;
z-index: 10;
.bill-bg {
width: 233.52rpx !important;
height: 358.06rpx !important;
width: 216rpx;
height: 368rpx;
}
.bill-num,
......@@ -285,23 +287,31 @@
&:nth-child(2) {
left: 0rpx;
top: 125rpx;
width: 233.52rpx;
height: 358.06rpx;
top: 65rpx;
width: 216rpx;
height: 336rpx;
image {
width: 216rpx;
height: 336rpx;
}
}
&:nth-child(3) {
z-index: 20;
top: 180rpx;
top: 80rpx;
right: 0rpx;
width: 216rpx;
height: 304rpx;
image {
width: 216rpx;
height: 304rpx;
}
}
.billboard-item-bar {
position: relative;
.bill-bg {
width: 209.54rpx;
height: 321.3rpx;
position: absolute;
top: 0;
left: 0;
......
......@@ -9,7 +9,7 @@
<glsx-image webp src="store-assistant/index_bg.webp"></glsx-image>
</view>
</view> -->
<scroll-view scroll-y class="content" class="content" refresher-triggered="{{triggered}}" refresher-enabled bindrefresherrefresh="getReport" bindscroll="scrollIng" style="{{'height: calc(100% - 22rpx);'}}">
<scroll-view scroll-y class="content" class="content" refresher-triggered="{{triggered}}" refresher-enabled bindrefresherrefresh="getReport" bindscroll="scrollIng" style="{{'height: 100%'}}">
<view class="store-box">
<view class="store-item">
<view class="store-logo">
......@@ -65,8 +65,8 @@
<view class="billboard-item" wx:for="{{billboard}}" wx:key="index">
<view class="billboard-item-bar">
<view class="bill-border">
<view class="bill-name" style="transform:translate({{index==1?-20:0}}rpx,0rpx)">{{item.name}}</view>
<view class="bill-num" wx:if="{{item.name}}" style="transform:translate({{index==1?-20:0}}rpx,0rpx)"><text class="unit">¥</text>{{item.value}}</view>
<view class="bill-name">{{item.name}}</view>
<view class="bill-num" wx:if="{{item.name}}"><text class="unit">¥</text>{{item.value}}</view>
</view>
<glsx-image webp custom-class="bill-bg" src="store-assistant-assemble/output/bill0{{item.sort}}.png"></glsx-image>
</view>
......
......@@ -66,6 +66,8 @@ Page({
*/
onLoad: async function (options) {
let { userInfo } = wx.$storage.get()
if(userInfo.subLoginUser&&userInfo.subLoginUser.phone)
userInfo.subLoginUser.phone = userInfo.subLoginUser.phone.replace(/\B(?=(\d{4})+(?!\d))/g, ' ');
this.setData({
userInfo: userInfo.subLoginUser
})
......
......@@ -15,8 +15,7 @@
width: 40rpx;
height: 40rpx;
margin-right: 8rpx;
padding-bottom: 14rpx;
border-radius: 50%;
margin-top: -4rpx;
}
.title {
......
......@@ -126,14 +126,6 @@ Component({
item[k.name] = '未开通'
} else if (item.sceneCodes && !item.sceneCodes.includes(k.code)) {
item[k.name] = '未开通'
} else {
if (_list.length == 1 && wx.getStorageSync('first_enter')){
wx.setStorageSync('first_enter', false)
wx.navigateTo({
url: `/packagesList/outDetail/index?merchantId=${_list[0].merchantId4s}&type=${k.type}&merchantName=${_list[0].merchantName4s}`,
})
}
}
})
})
......
......@@ -214,6 +214,7 @@
font-size: 24rpx;
text-align: center;
color: #CCCED1;
margin-top: 16rpx;
padding-bottom: 60rpx;
}
......
......@@ -2,7 +2,6 @@
.sort-tab {
display: flex;
box-sizing: border-box;
width: calc(100vw - 32rpx);
height: 86rpx;
line-height: 86rpx;
background-color: #FFFFFF;
......@@ -15,6 +14,7 @@
font-weight: 600;
font-size: 30rpx;
width: 196rpx;
padding-left: 8rpx;
flex-shrink: 0;
}
......@@ -32,6 +32,7 @@
justify-content: center;
align-items: center;
margin-right: 20rpx;
color: #5a6066;
}
.icon {
......
......@@ -4,167 +4,180 @@ import USERAPI from '~/api/usersApi/index'
import { IMG_URL } from '~/utils/constantData'
import { getMockData } from '~/api/api'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
navStyle: 'background-color: rgba(0,0,0,0);',
loginType: 0,
agree: true,
tabIndx: 0,
// tabList: ['我的客户', '我的门店', '我的员工'],
tabList: ['我的客户', '我的员工'],
popupShow: false,
subIndex: -1,
merchantList: [
{
merchantId: 0,
merchantName: 'string',
show: true
},
{
merchantId: 1,
merchantName: 'test',
show: true
}
],
isShowService: false,
},
// 切换园区
tapPicker() {
let { isSuper } = this.data
isSuper &&
this.setData({
moveArrow: !this.data.moveArrow,
popupShow: !this.data.popupShow
})
},
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight
})
// console.log(e)
},
changeTabIndx(e) {
this.setData({
tabIndx: e.detail
})
},
init() {
this.setUserInfo()
this.getMerchantRange()
// this.getMockInfo()
},
setUserInfo() {
let { userInfo } = wx.$storage.get()
// console.log(userInfo)
this.setData({
userInfo,
isSuper: userInfo.isSuper
})
},
async getMockInfo() {
let { serviceMerchatList } = await getMockData() || { serviceMerchatList: [] }
this.setData({
isShowService: serviceMerchatList.includes(this.data.userInfo.merchantId + '')
})
},
getMerchantRange(e) {
// 重新刷新
// let { detail } = e || null
// console.log(detail)
if (e) {
this.setUserInfo()
let clientModule = this.selectComponent('#client')
// let merchantModule = this.selectComponent('#merchant')
clientModule.getClientApi && clientModule.clientRefresh()
clientModule.getBusinessData && clientModule.getBusinessData()
// merchantModule.init && merchantModule.init()
}
let { isSuper, userInfo } = this.data
// 判断是超管才需要切换账号
if (isSuper) {
USERAPI.adminSelectLogin()
.then(result => {
// console.log(result)
let { merchantList: merchantRange } = result
// console.log(merchantRange)
let subIndex = -1
merchantRange.forEach((item, index) => {
item.show = true
if (item.merchantId == userInfo.subLoginUser.merchantId) {
subIndex = index
item.act = true
/**
* 页面的初始数据
*/
data: {
IMG_URL,
isShow: true,
navStyle: 'background-color: rgba(0,0,0,0);',
loginType: 0,
agree: true,
tabIndx: 0,
// tabList: ['我的客户', '我的门店', '我的员工'],
tabList: ['我的客户', '我的员工'],
popupShow: false,
subIndex: -1,
merchantList: [
{
merchantId: 0,
merchantName: 'string',
show: true
},
{
merchantId: 1,
merchantName: 'test',
show: true
}
})
this.setData({
merchantRange,
subIndex
})
],
isShowService: false,
},
// 切换园区
tapPicker() {
let { isSuper } = this.data
isSuper &&
this.setData({
moveArrow: !this.data.moveArrow,
popupShow: !this.data.popupShow
})
},
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight
})
// console.log(e)
},
changeTabIndx(e) {
this.setData({
tabIndx: e.detail
})
},
init() {
this.setUserInfo()
this.getMerchantRange()
// this.getMockInfo()
},
setUserInfo() {
let { userInfo } = wx.$storage.get()
// console.log(userInfo)
this.setData({
userInfo,
isSuper: userInfo.isSuper
})
.catch(err => { })
} else {
let merchantRange = [{ merchantId: userInfo.subLoginUser.merchantId, merchantName: userInfo.subLoginUser.merchantName }]
this.setData({
merchantRange,
subIndex: 0
})
}
},
},
async getMockInfo() {
let { serviceMerchatList } = await getMockData() || { serviceMerchatList: [] }
this.setData({
isShowService: serviceMerchatList.includes(this.data.userInfo.merchantId + '')
})
},
getMerchantRange(e) {
// 重新刷新
// let { detail } = e || null
// console.log(detail)
if (e) {
this.setUserInfo()
let clientModule = this.selectComponent('#client')
// let merchantModule = this.selectComponent('#merchant')
clientModule.getClientApi && clientModule.clientRefresh()
clientModule.getBusinessData && clientModule.getBusinessData()
// merchantModule.init && merchantModule.init()
}
let { isSuper, userInfo } = this.data
// 判断是超管才需要切换账号
if (isSuper) {
USERAPI.adminSelectLogin()
.then(result => {
// console.log(result)
let { merchantList: merchantRange } = result
// console.log(merchantRange)
let subIndex = -1
merchantRange.forEach((item, index) => {
item.show = true
if (item.merchantId == userInfo.subLoginUser.merchantId) {
subIndex = index
item.act = true
}
})
this.setData({
merchantRange,
subIndex
})
})
.catch(err => { })
} else {
let merchantRange = [{ merchantId: userInfo.subLoginUser.merchantId, merchantName: userInfo.subLoginUser.merchantName }]
this.setData({
merchantRange,
subIndex: 0
})
}
},
onRoute(options) {
if (!options || wx.$util.isEmptyObj(options)) return
let { page = 'client', refresh = true } = options
if (page == 'client' && refresh) {
let clientModule = this.selectComponent('#client')
clientModule.getClientApi && clientModule.clientRefresh()
clientModule.getBusinessData && clientModule.getBusinessData()
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const {merchantId,type,merchantName} = options
if (merchantId) {
wx.navigateTo({
url: `/packagesList/outDetail/index?merchantId=${merchantId}&type=${type}&merchantName=${merchantName}`,
})
this.setData({ isShow: false }, () => {
setTimeout(() => {
this.setData({ isShow: true })
}, 1000)
})
onRoute(options) {
if (!options || wx.$util.isEmptyObj(options)) return
let { page = 'client', refresh = true } = options
if (page == 'client' && refresh) {
let clientModule = this.selectComponent('#client')
clientModule.getClientApi && clientModule.clientRefresh()
clientModule.getBusinessData && clientModule.getBusinessData()
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.init()
},
}
this.init()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
// console.log(getTextWidth('随后获取dom元素的clientWidth 随后获取dom元素的clientWidth随后获取dom元素的clientWidth随后获取dom元素的clientWidth', '12px'))
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
// console.log(getTextWidth('随后获取dom元素的clientWidth 随后获取dom元素的clientWidth随后获取dom元素的clientWidth随后获取dom元素的clientWidth', '12px'))
},
/**
* 生命周期函数--监听页面显示
*/
onShow() { },
/**
* 生命周期函数--监听页面显示
*/
onShow() { },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() { },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload() { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload() { },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() { },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() { },
/**
* 用户点击右上角分享
*/
onShareAppMessage() { }
/**
* 用户点击右上角分享
*/
onShareAppMessage() { }
})
<!-- pages/tab/output/output.wxml -->
<block wx:if="{{isShow}}">
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady">看产值</navigation-bar>
<!-- <view class="layout" style="padding-top:{{tabBarStyle}}px;">
<client id="client" />
</view> -->
<view class="layout" id="layout" style="padding-top:{{navHeight}}px; height: calc(100vh - 150rpx)">
<!-- 背景图 -->
<!-- <glsx-image webp src="store-assistant/index_bg.webp"></glsx-image> -->
<!-- <view class="bg-box" style="height:{{368 + navHeight * 2}}rpx;top:-{{navHeight+16}}px">
<view class="bg">
<glsx-image webp src="store-assistant/index_bg.webp"></glsx-image>
</view>
</view> -->
<client id="client" />
</view>
\ No newline at end of file
<client id="client" />
</view>
</block>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!