Commit 5b915de3 by 前端

fixed

1 parent cdd9f546
<!--packageOutput/components/staff/staff.wxml-->
<wxs src="staff.wxs" module="filter" />
<view class="box staff-box">
<view class="box-title">
<text>员工排行榜</text>
......@@ -33,7 +34,7 @@
<image wx:if="{{item.name == '员工'&& litem.avatarUrl}}" src="{{ litem.avatarUrl? litem.avatarUrl:''}}"></image>
<block wx:if="{{item.name == '转化率'}}">{{litem?litem+'%': '--'}}</block>
<block wx:elif="{{item.name == '员工'}}">{{litem.transferName?litem.transferName:'--'}}</block>
<block wx:else>{{litem||'--'}}</block>
<block wx:else>{{filter.thousand(litem)||'--'}}</block>
</view>
</view>
</view>
......
function thousand(n) {
if(!n || isNaN(n)) return n
var r = getRegExp('\B(?=(\d{3})+(?!\d))', 'g')
var p = (n+'').replace(r, ',')
return p
}
module.exports = {thousand:thousand}
\ No newline at end of file
......@@ -63,7 +63,7 @@
}
.temporal {
font-size: 24rpx;
font-size: 22rpx;
color: #A6A6A6;
margin: 0 8rpx;
}
......
import ActivityApi from '~/api/activityApi/index'
let thisPage;
import {thousand} from '~/utils/format'
Component({
/**
* 组件的属性列表
......@@ -9,8 +10,7 @@ Component({
type: Number,
observer: function (val) {
console.log(val, 'index')
console.log(Date.now())
this.initLocal(val)
this.control && this.initLocal(val)
}
}
},
......@@ -139,12 +139,13 @@ Component({
sfaffList: [],
tabelTh: []
}, () => {
thisPage = wx.$router.getPageInstance()
this.getActivityInfo()
})
thisPage = wx.$router.getPageInstance()
this.getActivityInfo()
},
getActivityInfo() {
console.log(Date.now())
console.log(Date.now())
this.initSearch()
this.getOutput()
this.getStaffOutput()
......@@ -423,11 +424,11 @@ Component({
})
}
},
// lifetimes: {
// attached() {
// if(this.control)return
// this.control = true
// this.initLocal(this.data.entranceType)
// }
// },
lifetimes: {
attached() {
if(this.control)return
this.control = true
this.initLocal(this.data.entranceType)
}
},
})
\ No newline at end of file
......@@ -78,6 +78,7 @@
display: flex;
justify-content: center;
margin: 48rpx 0;
padding-bottom: 30rpx;
.btn-box {
width: 316rpx;
......
......@@ -28,4 +28,4 @@
</view>
</scroll-view >
<van-calendar max-range="{{ 30 }}" show="{{ isShow }}" type="range" color="#4466F0" bind:confirm="onConfirm" bind:close="onClose" min-date="{{ minDate }}" max-date="{{ maxDate }}"/>
\ No newline at end of file
<van-calendar max-range="{{ 30 }}" show="{{ isShow }}" type="range" color="#4466F0" bind:confirm="onConfirm" bind:close="onClose"/>
\ No newline at end of file
......@@ -5,7 +5,7 @@ Component({
behaviors: [imgUrlMixin],
properties: {},
data: {
loading:true,
loading: true,
navStyle,
tab: [],
roadTodayNum: 0,
......@@ -28,14 +28,14 @@ Component({
}
},
hideEmpSelect() {
wx.$eventbus.emit("hideEmpSelect")
},
hideEmpSelect() {
wx.$eventbus.emit("hideEmpSelect")
},
// 点击菜单按钮切换到对应的tab
getCurrentMenu(e) {
let { tab } = this.data
const index = tab.findIndex(item=>item.serviceType == e.detail)
const index = tab.findIndex(item => item.serviceType == e.detail)
this.setData({
tabIndex: index,
to: `to-${index}`,
......@@ -60,7 +60,7 @@ Component({
let { index } = e.currentTarget.dataset
let { tab } = this.data
const TEMP = tab[index]
this.setData({
tabIndex: index,
to: `to-${index}`,
......@@ -69,8 +69,8 @@ Component({
},
onLoad(options) {
const {merchantId,merchantName} = options;
this.setData({merchantId,merchantName})
const { merchantId, merchantName } = options;
this.setData({ merchantId, merchantName })
this.getSubscribeConfig(options)
console.log(Date.now())
this.addEvent()
......@@ -84,8 +84,9 @@ Component({
this.setData({
tab,
fresh: obj && obj.fresh,
currentServiceType:obj.type
currentServiceType: obj.type
})
console.log(Date.now())
setTimeout(() => {
this.configHttpCount = false
this.setData({
......
<!-- pages/index/index.wxml 引入模板 -->
<import src="index.skeleton.wxml"/>
<template is="skeleton" wx:if="{{loading}}"/>
<!-- <import src="index.skeleton.wxml" />
<template is="skeleton" wx:if="{{loading}}" /> -->
<wxs src="./index.wxs" module="fn"></wxs>
<view class="navigation-bar">
<navigation-bar showBack="{{true}}" navStyle="{{navStyle}}" bindnavbarReady="navbarReady" page-title="工作台">
<view class="bar-nav">
<view class="bar-text">{{merchantName}}</view>
</view>
</navigation-bar>
<navigation-bar showBack="{{true}}" navStyle="{{navStyle}}" bindnavbarReady="navbarReady" page-title="工作台">
<view class="bar-nav">
<view class="bar-text">{{merchantName}}</view>
</view>
</navigation-bar>
</view>
<block wx:if="{{navHeight}}">
<view class="layout" id="layout" style="top:{{navHeight}}px; height: calc(100vh - {{navHeight*2}}rpx - 60rpx)">
<!-- 背景图 -->
<view class="bg-box" style="height:{{368 + navHeight * 2}}rpx;top:-{{navHeight}}px">
<view class="bg">
<glsx-image webp src="store-assistant/index_bg.webp"></glsx-image>
</view>
</view>
<!-- tab切换 -->
<view class="tab-box" style="top: {{navHeight}}px">
<scroll-view class="tab-scroll" scroll-into-view="{{to}}" enhanced="{{true}}" show-scrollbar="{{false}}" scroll-x="{{true}}" scroll-with-animation>
<block wx:for="{{tab}}" wx:key="index">
<view id="{{tab.length<3?'':'to-'+index}}" class="tab_element" bindtap="click" data-index="{{index}}">
<view class="inner {{currentServiceType == item.serviceType? 'active' : '' }}">
{{item.serviceTypeName}}
<block wx:if="{{item.serviceType == 0&&totals_zc}}">({{totals_zc|| 0}})</block>
<view class="layout" id="layout" style="top:{{navHeight}}px; height: calc(100vh - {{navHeight*2}}rpx - 60rpx)">
<!-- 背景图 -->
<view class="bg-box" style="height:{{368 + navHeight * 2}}rpx;top:-{{navHeight}}px">
<view class="bg">
<glsx-image webp src="store-assistant/index_bg.webp"></glsx-image>
</view>
</view>
<!-- tab切换 -->
<view class="tab-box" style="top: {{navHeight}}px">
<scroll-view class="tab-scroll" scroll-into-view="{{to}}" enhanced="{{true}}" show-scrollbar="{{false}}" scroll-x="{{true}}" scroll-with-animation>
<block wx:for="{{tab}}" wx:key="index">
<view id="{{tab.length<3?'':'to-'+index}}" class="tab_element" bindtap="click" data-index="{{index}}">
<view class="inner {{currentServiceType == item.serviceType? 'active' : '' }}">
{{item.serviceTypeName}}
<block wx:if="{{item.serviceType == 0&&totals_zc}}">({{totals_zc|| 0}})</block>
</view>
<view wx:if="{{currentServiceType == item.serviceType}}" class="line"></view>
</view>
</block>
</scroll-view>
<view class="nav-btn">
<glsx-image class="nav-func-icon" bind:tap="showMenuList" webp src="store-assistant/menu/menu_logo.png"></glsx-image>
</view>
</view>
<!-- currentServiceType 0售后众筹 1续保膨胀金 2定保招揽 3私域运营 4精品礼券 5续保招揽 6节假日关怀 -->
<view class="pannel" style="height:calc(100%)" bindtap="hideEmpSelect">
<!-- 售后众筹 -->
<view wx:if="{{fn.arrInclues(currentServiceType,[0])}}" style="height: calc(100%);">
<workertableEntrance entranceType="{{currentServiceType}}" ids="{{ids}}" fresh="{{fresh}}" isHaveSubcribe="{{isHaveSubcribe}}" bind:total="getTotal" />
</view>
<view wx:if="{{currentServiceType == item.serviceType}}" class="line"></view>
</view>
</block>
</scroll-view>
<view class="nav-btn">
<glsx-image class="nav-func-icon" bind:tap="showMenuList" webp src="store-assistant/menu/menu_logo.png"></glsx-image>
</view>
</view>
<!-- currentServiceType 0售后众筹 1续保膨胀金 2定保招揽 3私域运营 4精品礼券 5续保招揽 6节假日关怀 -->
<view class="pannel" style="height:calc(100% - 30rpx)" bindtap="hideEmpSelect">
<!-- 售后众筹 -->
<view wx:if="{{fn.arrInclues(currentServiceType,[0])}}" style="height: calc(100% - 30rpx);">
<workertableEntrance entranceType="{{currentServiceType}}" ids="{{ids}}" fresh="{{fresh}}" isHaveSubcribe="{{isHaveSubcribe}}" bind:total="getTotal" />
</view>
<!-- 精品升级 会员权益 -->
<view wx:if="{{fn.arrInclues(currentServiceType,[1,2,3,4])}}" style="height: calc(100% - 30rpx);">
<OutputWork entranceType="{{currentServiceType}}"/>
</view>
<view wx:if="{{fn.arrInclues(currentServiceType,[1,2,3,4])}}" style="height: calc(100%);">
<OutputWork entranceType="{{currentServiceType}}" />
</view>
</view>
</view>
</view>
</block>
<!-- 菜单信息 -->
<menu bind:currentMenu="getCurrentMenu" tabs="{{tab}}" totals="{{totals_zc}}" tabIndex="{{currentServiceType}}" show="{{showMenu}}"></menu>
\ No newline at end of file
/* pages/tab/output/components/client/client.wxss */
.client {
box-sizing: border-box;
height: calc(100% - 92rpx);
height: calc(100% - 280rpx);
color: #323436;
}
......@@ -80,7 +80,7 @@
.sort-fix {
box-sizing: border-box;
position: absolute;
position: sticky;
top: 0;
left: 16rpx;
}
......
......@@ -208,3 +208,6 @@ export function deleteSecond(time) {
hour = hour.join(':')
return `${moth} ${hour}`
}
export function thousand(num) {
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
}
\ 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!