Commit 98e6cfea by 张立顺

合并代码

2 parents f9dabdd6 92e44dff
Showing 90 changed files with 4339 additions and 125 deletions
......@@ -48,6 +48,7 @@ class mineApi {
}
// 获取服务中心下拉筛选 所有服务商数据
getServiceCenterListAPI(data) {
// data.querySubPartner = true
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.listByServiceMerchantId',
......
......@@ -46,7 +46,8 @@ const updateService = data => {
const getTechnicianList = data => {
return api.post(
{
method: 'scrm.api.busassistant.technicianConfig.page',
// method: 'scrm.api.busassistant.technicianConfig.page',
method: 'scrm.api.busassistant.staff.findStaffByPage',
...data
}
)
......
......@@ -3,6 +3,7 @@
"login/loading/loading",
"pages/tab/index/index",
"pages/tab/output/output",
"pages/tab/outputValue/outputValue",
"pages/tab/mine/mine",
"pages/webView/webView",
"login/index/index",
......@@ -37,7 +38,7 @@
"selectedIconPath": "images/home_active.png"
},
{
"pagePath": "pages/tab/output/output",
"pagePath": "pages/tab/outputValue/outputValue",
"text": "看产值",
"iconPath": "images/output.png",
"selectedIconPath": "images/output_active.png"
......
// components/Calendar/Calendar.js
import Calendar from './Calendar_Function'
import _component_ from './Static_Properties'
const CalendarFunction = Symbol('CalendarFunction')
Component({
/**
* 组件的属性列表
*/
properties: _component_.properties,
/**
* 组件的初始数据
*/
data: _component_.data,
/**
* 组件的方法列表
*/
methods: {
noScroll() {},
setCalenderBodyHeight() {
this[CalendarFunction].setCalenderBodyHeight()
},
showCalendar(e) {
let type = (e && e.currentTarget && e.currentTarget.dataset.type) || ''
let result = type === 'show'
if (!result) {
this.setData({
hideCalendar: true
})
setTimeout(() => {
this.setData({
show: result,
hideCalendar: false
})
}, 300)
} else {
this.setData({
show: result
})
if (!this.data.calenderBodyHeight) this[CalendarFunction].setCalenderBodyHeight()
}
this.triggerEvent('tapCalendar')
},
dateChange(e) {
let { current, source } = e.detail
// console.log(source)
// console.log(current)
/**
* 根据官方 source 来进行判断swiper的change事件是通过什么来触发的,autoplay是自动轮播。
* touch是用户手动滑动。其他的就是未知问题。抖动问题主要由于未知问题引起的,所以做了限制
* 只有在自动轮播和用户主动触发才去改变current值,达到规避了抖动bug
*/
source == 'touch' &&
this.setData({
current
})
},
bindDateChange: function (e) {
var date = e.detail.value
console.log(date)
this.setData({
date: date
})
this.post_data.year = date
this.renderHtml()
},
choose(e) {
let { dateType, minDate, maxDate } = this.data
let { data } = e.currentTarget.dataset
// console.log((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data)))
console.log(minDate && Date.parse(minDate) > Date.parse(data))
console.log(maxDate && Date.parse(maxDate) < Date.parse(data))
if ((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data))) return
this[CalendarFunction][dateType](e)
},
monChoose(e) {
let { data, type } = e.currentTarget.dataset
if (data.disable) return false
this[CalendarFunction][type](e)
},
done() {
let { dateType } = this.data
this[CalendarFunction].done(dateType)
},
changeDate(e) {
let { value } = e.detail
console.log(value)
this.setData({
current: value
})
},
bindYearChange(e) {
let { value } = e.detail
this.setData({
yearCurrent: value
})
},
showShortcutPicker() {
this.setData({
showShortcut: !this.data.showShortcut
})
},
showShortcutPickerYear() {
this.setData({
showShortcutYear: !this.data.showShortcutYear
})
},
chooseAll() {
this[CalendarFunction].chooseAll()
},
changeModel() {
let { dayType } = this.data
this.setData({
dayType: dayType == 0 ? 1 : 0
})
}
},
ready() {
// console.log(this)
// return
this[CalendarFunction] = new Calendar(this)
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class='calender-picker' bindtap="showCalendar" data-type='show'>
<slot />
</view>
<!-- 弹框模式 -->
<!-- 先取消 -->
<view class='calender-box' hidden='{{!show}}' catchtouchmove="noScroll">
<view class='calender-bg' bindtap="showCalendar" />
<view class='calender-view {{hasRadius}} {{hideCalendar?"hideCalendar":""}} {{(isFullSucreen&&!showConfirm)?"isFullSucreen":""}} ' style="height:{{height}};">
<!-- 按日期选择 开始 -->
<view class='calender-header'>
<view class='calender-title' wx:if='{{showTitle}}'>
<!-- <block wx:if="{{rangeAll && dateType == 'range'}}"> -->
<!-- bindtap="chooseAll" -->
<view wx:if="{{isChangeType}}" class="calender-all" style="color:{{calenderColor}};" bindtap="changeModel">
{{dateObj['tips'][dayType]}}
</view>
<!-- </block> -->
{{title||'日期选择'}}
<view class='calender-close' bindtap="showCalendar">
<image src="./images/close.png" class='calender-close-image' />
</view>
</view>
<block wx:if='{{showSubTitle}}'>
<!-- <block hidden="{{!dayType}}"> -->
<picker class='calender-subtitle' bindchange="changeDate" bindcancel='showShortcutPicker' value="{{current}}" range="{{dateList}}" wx:if='{{shortcut&&dayType}}'>
<view class='calender-subtitle-text' bindtap="showShortcutPicker">
{{dateList[current]}}
<view class='arrow {{showShortcut}}' />
</view>
</picker>
<picker class='calender-subtitle' value="{{yearCurrent}}" bindcancel='showShortcutPickerYear' range="{{monPickList}}" wx:elif='{{shortcut&&!dayType}}' bindchange="bindYearChange">
<view class='calender-subtitle-text' bindtap="showShortcutPickerYear`">
{{monPickList[yearCurrent]}}
<view class='arrow {{showShortcutYear}}' />
</view>
</picker>
<view class='calender-subtitle' wx:else>{{monPickList[current]}}</view>
<!-- </block> -->
<!-- <block hidden="{{dayType}}"> -->
<!-- </block> -->
</block>
<view class='calendar-weekdays' hidden="{{!dayType}}">
<block wx:for='{{weekdays}}' wx:key='index'>
<view class='calendar-weekday'>{{item}}</view>
</block>
</view>
</view>
<view class='calender-body' style="height:calc(100% - {{calenderBodyHeight}})">
<!-- 日期 -->
<swiper hidden="{{!dayType}}" class='calender-swiper' bindchange='dateChange' current='{{current}}' vertical='{{vertical}}'>
<block wx:for='{{monthList}}' wx:key='index'>
<swiper-item>
<view class='calender-mark box-center' wx:if="{{!hideMark}}">{{item.mark}}</view>
<view class='calender-month'>
<block wx:for='{{item.data}}' wx:for-item='i' wx:for-index='ind' wx:key='ind'>
<view class='calender-day {{ind == 0?i.week:""}} {{i.active?"active":""}} {{i.disable?"disable":""}}' style="background:{{i.active?calenderColor:''}};color:{{i.middle?calenderColor:''}}" bindtap="choose" data-index='{{index}}' data-ind='{{ind}}' data-data='{{i.data}}'>
<view class='calender-middle' style="background:{{calenderColor}};" wx:if='{{i.middle}}' />
<view class='box-center text'>
{{i.day}}
<view wx:if='{{dateType==="range"}}' class='calender-tips'>
<view wx:if='{{i.start}}'>{{rangeText.start}}</view>
<view wx:if='{{i.end}}'>{{rangeText.end}}</view>
</view>
</view>
</view>
</block>
</view>
</swiper-item>
</block>
</swiper>
<!-- 月份 wx:if="{{!dayType}}" -->
<div class='calenderMonth'>
<swiper hidden="{{dayType}}" class='calender-year ' bindchange='dateChange' current='{{yearCurrent}}' vertical='{{vertical}}'>
<block wx:for="{{yearList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<swiper-item class="calenderMonth">
<block wx:for="{{item}}" wx:for-item="monItem" wx:for-index="monIndex" wx:key="monIndex">
<view bindtap="monChoose" data-type="month" data-index="{{monIndex}}" data-yearindex="{{index}}" data-data="{{monItem}}" class="monItem {{monItem.start?'active':''}} {{monItem.select?'select':''}} {{monItem.end?'end':''}} {{monItem.disable?'disable':''}}">
<view>{{monItem.label}}</view>
<view class="text" wx:if="{{monItem.start}}">开始</view>
<view class="text" wx:if="{{monItem.end}}">结束</view>
</view>
</block>
</swiper-item>
</block>
</swiper>
</div>
</view>
<!-- 月份 结束 -->
<view class='calender-footer {{isFullSucreen?true:""}} ' wx:if='{{showConfirm}}'>
<view class='calender-btn {{dateType === "range" && !rangeDate.end ?"disable":""}} {{dateType === "multiple" && multipleDate.length < 1 ?"disable":""}}' style="background:{{calenderColor}}" bindtap="done">
{{confirmText||'确定'}}
</view>
</view>
</view>
</view>
\ No newline at end of file
/* components/Calendar/Calendar.wxss */
.calender-box {
position: fixed;
left: 0;
bottom: 0;
z-index: 99;
width: 100%;
height: 100%;
}
.calender-bg {
position: absolute;
background: rgba(0, 0, 0, .5);
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.calender-view {
position: absolute;
left: 0;
width: 100%;
background: #fff;
animation: show-calender .5s forwards;
color: #333;
}
.calender-view.true {
border-radius: 40rpx 40rpx 0 0;
}
.calender-view.isFullSucreen {
box-sizing: border-box;
padding-bottom: 34px !important;
}
@keyframes show-calender {
from {
bottom: -100%;
}
to {
bottom: 0;
}
}
.calender-view.hideCalendar {
animation: hide-calender .5s forwards;
}
@keyframes hide-calender {
from {
bottom: 0;
}
to {
bottom: -100%;
}
}
.calender-header {
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.10);
}
.calender-title,
.calender-subtitle {
width: 100%;
height: 88rpx;
text-align: center;
position: relative;
font-size: 32rpx;
display: flex;
align-items: center;
justify-content: center;
}
.calender-all {
position: absolute;
top: 50%;
left: 40rpx;
transform: translateY(-50%);
}
.calender-subtitle-text {
display: flex;
align-items: center;
justify-content: center;
}
.calender-subtitle {
font-size: 28rpx;
}
.calender-subtitle .arrow {
width: 14rpx;
height: 14rpx;
border-top: 2rpx solid transparent;
border-right: 2rpx solid #ccc;
border-bottom: 2rpx solid #ccc;
border-left: 2rpx solid transparent;
transform: rotate(45deg) translateY(-4rpx);
margin-left: 16rpx;
transition: all .3s;
}
.calender-subtitle .arrow.true {
transform: rotate(225deg) translateY(0) translateX(-4rpx);
}
.calender-close {
position: absolute;
width: 40rpx;
height: 40rpx;
top: 50%;
right: 24rpx;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
}
.calender-close-image {
width: 24rpx;
height: 24rpx;
}
.calendar-weekdays {
display: grid;
grid-template-columns: repeat(7, 1fr);
font-size: 24rpx;
line-height: 60rpx;
}
.calendar-weekday {
text-align: center;
}
.calender-body {
width: 100%;
padding: 20rpx 0;
box-sizing: border-box;
}
.calender-swiper {
height: 100%;
}
.calender-mark {
color: #F2F3F5;
text-shadow: 0 4rpx 20rpx #F2F3F5;
font-size: 320rpx;
width: 100%;
text-align: center;
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.calender-month {
height: 100%;
position: relative;
z-index: 1;
display: grid;
grid-template-rows: repeat(minmax(5, 6), 1fr);
grid-template-columns: repeat(7, 1fr);
}
.calender-day {
position: relative;
font-size: 32rpx;
display: flex;
}
.calender-day.active {
color: #fff;
border-radius: 8rpx;
}
.calender-day.disable {
opacity: .25;
}
.calender-day .calender-middle {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 0.1;
}
.calender-day .text {
text-align: center;
width: 100%;
}
.calender-tips {
font-size: 14rpx;
}
.week-1 {
grid-column-start: 2;
}
.week-2 {
grid-column-start: 3;
}
.week-3 {
grid-column-start: 4;
}
.week-4 {
grid-column-start: 5;
}
.week-5 {
grid-column-start: 6;
}
.week-6 {
grid-column-start: 7;
}
.calender-year {
/* display: flex;
flex-wrap: wrap; */
width: 100%;
height: 100%;
}
.calenderMonth {
display: flex;
flex-wrap: wrap;
width: 100%;
height: 100%;
}
.monItem {
box-sizing: border-box;
width: 25%;
height: 186rpx;
font-size: 32rpx;
/* text-align: center; */
/* line-height: 186rpx; */
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex-wrap: wrap;
color: #666666;
border: 1rpx solid #fff;
}
.monItem .text {
font-size: 20rpx;
margin-top: 5rpx;
}
.monItem.select {
color: #3582EE;
/* background: #3582EE;
opacity: 0.1; */
background-color: rgba(53, 130, 238, .1);
}
.monItem.active {
color: #fff;
background: #3582EE;
border-radius: 8px 0px 0px 8px;
}
.monItem.end {
color: #fff;
background: #3582EE;
border-radius: 0px 8px 8px 0px;
}
.monItem.disable {
color: #C8C9CC;
}
.calender-footer {
position: absolute;
width: 100%;
left: 0;
bottom: 0;
padding: 14rpx 32rpx;
box-sizing: border-box;
}
.calender-footer.true {
padding-bottom: 34px !important;
}
.calender-footer .calender-btn {
width: 100%;
height: 72rpx;
font-size: 28rpx;
color: #fff;
border-radius: 999rpx;
display: flex;
justify-content: center;
align-items: center;
}
.calender-footer .calender-btn.disable {
opacity: .3;
}
\ No newline at end of file
export default {
properties: {
calenderHeight: {
// 新版本不能使用type 改用optionalTypes 属性避免提示错误
type: String,
optionalTypes: [Number]
},
title: String, // 标题名称
hasRadius: {
type: Boolean,
value: true
}, // 是否圆角
showTitle: {
type: Boolean,
value: true
}, // 是否显示标题
showSubTitle: {
type: Boolean,
value: true
}, // 是否显示副标题
confirmText: String, // 确定按钮文本
showConfirm: {
type: Boolean,
value: true
}, // 是否显示确定按钮
calenderColor: {
type: String,
value: '#00A479'
}, // 日历主题色
previous: {
type: Number,
value: 3
}, // 当前月的前几个月 ,默认3个月
next: {
type: Number,
value: 3
}, // 当前月的后几个月 , 默认3个月
vertical: Boolean, //是否纵向滑动
/** 选择类型默认单选,single单选, multiple多个日期,range日期范围 */
dateType: {
type: String,
value: 'single'
},
value: String, //单选绑定数据
shortcut: Boolean, //日期快捷切换 默认为false
/** 分隔符,默认为 "-" */
separator: {
type: String,
value: '-'
},
/** 日期范围-开始结束文本 */
rangeText: {
type: Object,
value: {
start: '开始',
end: '结束'
}
},
/**是否显示日期范围 全选 */
rangeAll: Boolean,
/** 是否允许日期范围的起止时间为同一天, 默认为false */
allowSameDay: Boolean,
/** 周起始日,默认周日 */
firstDayOfWeek: {
// 新版本不能使用type 改用optionalTypes 属性避免提示错误
type: Number,
optionalTypes: [Number],
value: 7
},
/**
* 可选最小日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致。 */
minDate: String,
/** 可选最大日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致 */
maxDate: String,
/**隐藏水印 */
hideMark: Boolean,
isComponents: Boolean,
isChangeType: {
type: Boolean,
value: true
}, // 是否显示切换 按月份 按日期
dayType: { // 0按月份 1按日期
type: Number,
value: 1
}
},
data: {
weekdays: ['一', '二', '三', '四', '五', '六', '日'],
monthList: [],
dateList: [],
monPickList: [],
current: 0,
height: '80%',
rangeDate: {},
multipleDate: [],
date: '',
yearCurrent: 0,
yearList: [],
rangeMonth: {},
// MonthShowList: [
// {
// label: '1月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '2月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '3月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '4月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '5月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '6月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '7月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '8月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '9月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '10月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '11月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '12月',
// disable: false,
// start: false,
// end: false,
// select: false
// }
// ],
// dayType: 1, // 1 日期 0 月份 默认日期
dateObj: {
// switch:'按月份',
// type:'day',
tips: ['按日期', '按月份']
}
}
}
// components/navigationBar/navigationBar.js
Component({
externalClasses: ['custom-class'],
/**
* 组件的属性列表
*/
......
<view class="navigation-bar" id="navigation-bar" style="padding-top:{{statusBarHeight}}px;height:{{navigationBarHeight}}px;{{navStyle}}">
<block wx:if="{{!custom}}">
<view class="navigation-bar-box" wx:if="{{showNavBar}}" style="{{navigationBarStyle}}{{navBarBoxStyle}}">
<view class="navigation-bar-box custom-class" wx:if="{{showNavBar}}" style="{{navigationBarStyle}}{{navBarBoxStyle}}">
<block wx:if="{{SHOWBACK}}">
<view class="back " bindtap="back">
<image class="img" src="./images/icon-back.png" />
......
......@@ -19,12 +19,11 @@ Component({
})
}, 0.2 * 1000)
} else {
let hideTab = wx.$hideTab
// console.log(hideTab)
// let hideTab = wx.$hideTab
this.setData({
showPopup: true,
close: false,
hideTab
// hideTab
})
}
}
......@@ -37,7 +36,9 @@ Component({
only: {
type: Boolean,
value: true
}
},
hideTab: Boolean,
isTab: Boolean
},
/**
......@@ -63,9 +64,9 @@ Component({
}
},
attached() {
const { isTab } = wx.$router.getRouterList().find(item => item.url === `/${wx.$router.getPageInstance().route}`)
this.setData({
isTab
})
// const { isTab } = wx.$router.getRouterList().find(item => item.url === `/${wx.$router.getPageInstance().route}`)
// this.setData({
// isTab
// })
}
})
......@@ -27,6 +27,7 @@ Page({
*/
onShow() {
const appEnter = wx.getEnterOptionsSync()
console.log(appEnter,'appEnter');
if (appEnter.scene == 1037) {
if (Object.keys(appEnter.referrerInfo).length) {
const { extraData } = appEnter.referrerInfo
......@@ -34,6 +35,8 @@ Page({
else this.init()
} else this.init()
} else if ([1047, 1048, 1049].includes(appEnter.scene)) {
// debugger
console.log(!this.options.scene,this.options,'!this.options.scene');
if (!this.options.scene) {
this.init()
return
......@@ -169,6 +172,7 @@ Page({
const { sessionId, loginUserInfoList } = data
var routeParams = {}
var list = []
console.log(obj,'obj');
if (obj.url == '/packagesList/packageOutput/pages/summary') {
routeParams = {
merchantId: obj.merchantId,
......@@ -182,6 +186,7 @@ Page({
list.push(item + "=" + routeParams[item])
})
this.options.targetPath = obj.url + "?" + list.join("&")
this.options.targetPath = '/pages/tab/output/output' + "?" + list.join("&")
}
setLoginInfo(loginUserInfoList[0], sessionId)
} else {
......
// packageMine/pages/staffManage/staffTypePopup/staffTypePopup.js
Component({
/**
* 组件的属性列表
*/
properties: {
selectInfo: {
type: Object,
observer: function(n) {
this.setData({
copySelectInfo: n
})
}
},
popShow: {
type: Boolean,
observer: function(n) {
if (n) {
let { staffTypeList, notAll } = this.data
if (notAll) {
let index = staffTypeList.findIndex(v => v.type == '')
if (index > -1) staffTypeList.splice(index, 1)
this.setData({
staffTypeList
})
}
}
}
},
notAll: Boolean
},
/**
* 组件的初始数据
*/
data: {
staffTypeList: [
{
type: '',
typeStr: '全部'
},
{
type: '1',
typeStr: '驻店'
},
{
type: '2',
typeStr: '技师'
}
],
copySelectInfo: {}
},
/**
* 组件的方法列表
*/
methods: {
hidePopup() {
this.triggerEvent('hidePopup')
},
select(e) {
let { target } = e.currentTarget.dataset
this.setData({
copySelectInfo: target
})
},
confirm() {
let { copySelectInfo } = this.data
this.triggerEvent('confirm', copySelectInfo)
this.hidePopup()
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageMine/pages/staffManage/staffTypePopup/staffTypePopup.wxss */
.itemCon {
box-sizing: border-box;
width: 100%;
height: 80rpx;
color: #323436;
line-height: 80rpx;
padding: 0 32rpx;
}
.active {
background: #F0F7FF;
font-size: 28rpx;
color: #3666FE;
}
\ No newline at end of file
<!--packageMine/pages/staffManage/staffTypePopup/staffTypePopup.wxml-->
<popup
show="{{popShow}}"
bind:hidePopup="hidePopup"
bindconfirm="confirm"
title="员工类型"
height="500rpx">
<block wx:for="{{staffTypeList}}" wx:key="index">
<view
class="itemCon text-hide {{item.type == copySelectInfo.type?'active':''}}"
data-target="{{item}}"
bindtap="select">
{{item.typeStr}}
</view>
</block>
</popup>
const formRule = {
const phoneRex = /^[1]([3-9])[0-9]{9}$/
const editFormRule = {
technicianName: [{ required: true, message: '技师名称不能为空' }]
}
const formRule = {
technicianName: [{ required: true, message: '技师名称不能为空' }],
technicianPhone: [{ required: true, message: '手机号不能为空' },
{
validator: (rule, value) => {
return !phoneRex.test(value) ? { message: '请输入正确的手机号' } : null
}
}]
}
const formItems = [{
label: '技师',
label: '技师名称',
props: 'technicianName',
type: 'input',
placeholder: '请输入技师的名称',
maxlength: 15
}, {
label: '手机号',
props: 'technicianPhone',
type: 'input',
inputType: 'number',
placeholder: '请输入技师的手机号',
maxlength: 11
}]
export default {
editFormRule,
formRule,
formItems
}
\ No newline at end of file
......@@ -22,14 +22,15 @@ Page({
formItems: constantData.formItems,
targetIdx: '-1',
target: {},
targetIdx: {}
targetIdx: {},
isAsk: false
},
handleInput(e) {
let { attr } = e.currentTarget.dataset
let { value } = e.detail
this.setData({
['formData.' + attr]: value.replace(/(^\s*)|(\s*$)/g,"")
['formData.' + attr]: value.replace(/(^\s*)|(\s*$)/g, "")
})
},
......@@ -72,10 +73,10 @@ Page({
}
let params = {
...formData,
merchantId: customerInfo.merchantId,
merchantName: customerInfo.merchantName
merchantId: customerInfo.serviceCenterMerchantId,
merchantName: customerInfo.serviceCenterMerchantName
}
let validObj = wx.$util.checkRule(formData, constantData.formRule)
let validObj = wx.$util.checkRule(formData, addOrEdit == 'add' ? constantData.formRule : constantData.editFormRule)
if (validObj) {
wx.$api.showToast(validObj.message)
return
......@@ -133,7 +134,7 @@ Page({
let _this = this
wx.showModal({
title: '删除',
content: '确认删除' + target.technicianName + '技师吗?',
content: '确认删除' + target.staffName + '技师吗?',
confirmText: '确定',
cancelText: '取消',
confirmColor: '#3666FE',
......@@ -168,24 +169,38 @@ Page({
},
getList(isReset = false) {
let { technicianList, pageCof, total, customerInfo } = this.data
let { technicianList, pageCof, total, customerInfo, isAsk } = this.data
let _this = this
if (total == technicianList.length || isAsk) {
return true
}
let params = {
...pageCof,
merchantId: customerInfo.merchantId
status: 0,
merchantNoList: [customerInfo.serviceCenterMerchantId],
// roleName: '技师'
staffBusinessType: 1
}
this.setData({
isAsk: true
})
mineServiceApi.getTechnicianList(params).then(res => {
let { list, total } = res
let { data, count } = res
this.setData({
technicianList: pageCof.pageNum == 1 ? (list || []) : technicianList.concat(list),
technicianList: pageCof.pageNum == 1 ? (data || []) : technicianList.concat(data),
['pageCof.pageNum']: pageCof.pageNum + 1,
triggered: false,
total
total: count
})
if (isReset) {
this.setData({
scrollTop: 0
})
}
}).finally(function () {
_this.setData({
isAsk: false
})
})
},
......
......@@ -153,16 +153,32 @@
text-align: center;
box-sizing: border-box;
width: 614rpx;
height: 440rpx;
background: #FFFFFF;
border-radius: 32rpx;
.form {
margin: 64rpx 40rpx;
.form-box {
margin: 32rpx 40rpx;
text-align: left;
.form {
display: flex;
}
.form:first-child {
margin-bottom: 32rpx;
}
.label {
width: calc(100% - 390rpx);
height: 88rpx;
line-height: 88rpx;
font-size: 28rpx;
color: #323436;
text-align: left;
}
.input {
width: 534rpx;
width: 390rpx;
height: 88rpx;
background: #F8F9FC;
border-radius: 12rpx;
......@@ -186,10 +202,7 @@
}
.dialog-btn {
position: absolute;
display: flex;
bottom: 0;
left: 0;
width: 100%;
height: 110rpx;
line-height: 110rpx;
......
......@@ -15,8 +15,8 @@
<view class="message">
<glsx-image src="personal/tech_defalut_avatar.png" class="avatar" />
<view class="message-text">
<input wx:if="{{item.isEdit}}" type="text" placeholder="{{formItems[0].placeholder}}" maxlength="{{formItems[0].maxlength}}" class="input" value="{{formData.technicianName}}" focus="{{item.isEdit}}" placeholder-class="input-placeholder" data-attr="{{formItems[0].props}}" confirm-type="done" bindinput="handleInput" bindblur="handleConfirm" />
<view wx:else class="merchant">{{item.technicianName}}</view>
<input wx:if="{{item.isEdit}}" type="text" placeholder="{{formItems[0].placeholder}}" maxlength="{{formItems[0].maxlength}}" class="input" value="{{formData.staffName}}" focus="{{item.isEdit}}" placeholder-class="input-placeholder" data-attr="{{formItems[0].props}}" confirm-type="done" bindinput="handleInput" bindblur="handleConfirm" />
<view wx:else class="merchant">{{item.staffName}}</view>
</view>
<glsx-image wx:if="{{!item.isEdit}}" src="personal/icon-edit.png" class="icon-edit" bindtap="handleEdit" data-type="edit" data-target="{{item}}" data-idx="{{index}}" />
</view>
......@@ -26,7 +26,7 @@
<view class="technician_name">
所属:{{item.merchantName}}
</view>
<view class="time">{{item.createdDate}}</view>
<view class="time">{{item.createdTime}}</view>
</view>
</view>
<view class="bottomTips" wx:if="{{technicianList.length == total}}">到底啦!</view>
......@@ -41,8 +41,11 @@
<view class="bg" bindtap="handleDialogShow" />
<view class="content">
<view class="title">新增技师</view>
<view class="form" wx:for="{{formItems}}" wx:key="index">
<input type="text" placeholder="{{item.placeholder || '请输入' + item.label}}" maxlength="{{item.maxlength}}" class="input" value="{{formData[item.props]}}" type="{{item.inputType || 'text'}}" password="{{item.password}}" placeholder-class="input-placeholder" data-attr="{{item.props}}" bindinput="handleInput" />
<view class="form-box">
<view class="form" wx:for="{{formItems}}" wx:key="index">
<view class="label">{{item.label}}<text class="tips">{{item.tips}}</text></view>
<input type="text" placeholder="{{item.placeholder || '请输入' + item.label}}" maxlength="{{item.maxlength}}" class="input" value="{{formData[item.props]}}" type="{{item.inputType || 'text'}}" password="{{item.password}}" placeholder-class="input-placeholder" data-attr="{{item.props}}" bindinput="handleInput" />
</view>
</view>
<view class="dialog-btn">
<view class="cancel-btn" bindtap="handleCancel">取消</view>
......
const phoneRex = /^[1]([3-9])[0-9]{9}$/
const formRule = {
selectInfo: [{ required: true, message: '所属服务中心不能为空' }],
type: [{ required: true, message: '员工类型不能为空' }],
staffName: [{ required: true, message: '员工姓名不能为空' }],
staffPhone: [
{ required: true, message: '手机号码不能为空' },
......@@ -20,6 +21,13 @@ const formItems = [{
placeholder: '请选择服务中心',
pageType: 1
}, {
label: '员工类型',
props: 'type',
valueFn: 'typeStr',
type: 'select',
placeholder: '请选择员工类型',
pageType: 3
}, {
label: '员工姓名',
props: 'staffName',
type: 'input',
......
......@@ -20,7 +20,8 @@ Page({
visualType: 0 // 0:全部 1:选中部分可见客户
},
showServiceConfirm: false,
isConfirm: false
isConfirm: false,
staffPopupShow: false
},
watch: {
......@@ -134,7 +135,31 @@ Page({
if (!formData.selectInfo) return wx.$api.showToast('请先选择所属服务中心')
wx.$router.go('packageMine.selectConnectionPage', this.data.formData)
break
case 3:
this.handleStaffTypeChange()
break
}
},
handleStaffTypeChange() {
this.setData({
staffPopupShow: !this.data.staffPopupShow
})
},
staffTypeConfiem(e) {
let { formData } = this.data
let obj = {
...formData,
...e.detail,
selectInfo: {
...formData.selectInfo,
...e.detail
}
}
this.setData({
formData: obj
})
},
hiddenSelectConfirm(e) {
......@@ -171,6 +196,7 @@ Page({
let params = {
merchantNo: formData?.selectInfo?.yqMerchantId,
merchantName: userInfo?.merchantName,
type: formData.type,
staffUuid: formData?.staffUuid,
staffName: formData?.staffName,
staffPhone: formData?.staffPhone,
......
{
"usingComponents": {
"select-service-confirm": "../../../components/selectServiceConfirm/selectServiceConfirm"
"select-service-confirm": "../../../components/selectServiceConfirm/selectServiceConfirm",
"staff-type-popup": "../../../components/staffTypePopup/staffTypePopup"
},
"navigationStyle": "custom"
}
\ No newline at end of file
......@@ -30,3 +30,4 @@
</view>
</view>
<select-service-confirm show="{{showServiceConfirm}}" tabBarStyle="{{tabBarStyle}}" serviceList="{{serviceList}}" selectInfo="{{formData.selectInfo}}" bind:hiddenSelectConfirm="hiddenSelectConfirm"></select-service-confirm>
<staff-type-popup wx:if="{{staffPopupShow}}" bind:hidePopup="handleStaffTypeChange" selectInfo="{{formData.selectInfo}}" bindconfirm="staffTypeConfiem" popShow="{{staffPopupShow}}" notAll="{{true}}"/>
......@@ -2,6 +2,11 @@ var formatMobile = function (item) {
return item ? item.substring(0,3)+" " + item.substring(3,7) +" "+item.substring(7) : ' '
}
var filterType = function (item) {
return ['驻店', '员工'][item.type] || ''
}
module.exports = {
formatMobile: formatMobile
formatMobile: formatMobile,
filterType: filterType
}
\ No newline at end of file
......@@ -11,14 +11,15 @@ Page({
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
popupShow: false,
staffList: [],
selectInfo: { yqMerchantName: '全部服务中心' },
selectInfo: { yqMerchantName: '全部服务中心', typeStr: '全部员工类型', type: '' },
total: 0,
serviceList: [],
currentPage: 1,
allServiceIds: [],
nothing: false,
scrollTop: 0,
isAsk: false
isAsk: false,
staffPopupShow: false
},
/**
......@@ -60,7 +61,8 @@ Page({
let params = {
pageSize: 10,
pageNum: currentPage,
merchantNoList: selectInfo?.yqMerchantId ? [selectInfo?.yqMerchantId] : allServiceIds
merchantNoList: selectInfo?.yqMerchantId ? [selectInfo?.yqMerchantId] : allServiceIds,
type: selectInfo.type
}
if (nothing || isAsk) {
return
......@@ -73,8 +75,8 @@ Page({
this.setData({
staffList: tempList,
currentPage: currentPage + 1,
total: res.total,
nothing: res.total == tempList.length,
total: res.count,
nothing: res.count == tempList.length,
triggered: false
})
if (isReset) {
......@@ -102,6 +104,13 @@ Page({
this.getList(true)
},
// 筛选员工类型
handleStaffTypeChange() {
this.setData({
staffPopupShow: !this.data.staffPopupShow
})
},
// 筛选服务中心
filterTypeFn() {
this.setData({
......@@ -112,8 +121,15 @@ Page({
// 获取员工列表
getStaffList(e) {
wx.$api.hideLoading()
let { selectInfo } = this.data
let { type, typeStr } = e.detail
if (type == '' && typeStr == '全部') e.detail.typeStr = '全部员工类型'
let obj = {
...selectInfo,
...e.detail
}
this.setData({
selectInfo: e.detail,
selectInfo: obj,
nothing: false,
currentPage: 1
})
......
{
"navigationBarTitleText": "员工管理",
"usingComponents": {
"select-service-popup": "../../../components/selectServicePopup/selectServicePopup"
"select-service-popup": "../../../components/selectServicePopup/selectServicePopup",
"staff-type-popup": "../../../components/staffTypePopup/staffTypePopup"
}
}
\ No newline at end of file
......@@ -35,35 +35,38 @@
color: var(--btnColor)
}
}
.select-btn {
box-sizing: border-box;
padding: 16rpx 0;
.select-box{
display: flex;
align-items: center;
z-index: 2;
background-color: #f2f3f7;
.type {
margin-left: 8px;
.select-btn {
box-sizing: border-box;
padding: 16rpx 0;
display: flex;
justify-content: center;
align-items: center;
padding: 0 16rpx;
height: 24px;
line-height: 24px;
background: #ffffff;
border-radius: 14px;
font-size: 12px;
color: #8a8c90;
text{
max-width: 360rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.point {
margin-left: 2px;
width: 12px;
height: 12px;
z-index: 2;
background-color: #f2f3f7;
.type {
margin-left: 8px;
display: flex;
justify-content: center;
align-items: center;
padding: 0 16rpx;
height: 24px;
line-height: 24px;
background: #ffffff;
border-radius: 14px;
font-size: 12px;
color: #8a8c90;
text{
max-width: 360rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.point {
margin-left: 2px;
width: 12px;
height: 12px;
}
}
}
}
......@@ -94,6 +97,14 @@
.name{
color: #323436;
font-size: 28rpx;
.type_tips{
background: #F1F3F9;
border: 2rpx solid #FFFFFF;
border-radius: 8rpx;
font-size: 22rpx;
margin-left: 16rpx;
color: #6B7384;
}
}
.mobile{
color: #858A94;
......
......@@ -8,10 +8,18 @@
<view class="content-box">
<view class="title-box">
<view class="title">员工数量:<text class="number">{{total}}</text></view>
<view class="select-btn">
<view class="type" bindtap="filterTypeFn">
<text>{{selectInfo.yqMerchantName}}</text>
<glsx-image class="point" src="index/point.png" />
<view class="select-box">
<view class="select-btn">
<view class="type" bindtap="handleStaffTypeChange">
<text>{{selectInfo.typeStr}}</text>
<glsx-image class="point" src="index/point.png" />
</view>
</view>
<view class="select-btn">
<view class="type" bindtap="filterTypeFn">
<text>{{selectInfo.yqMerchantName}}</text>
<glsx-image class="point" src="index/point.png" />
</view>
</view>
</view>
</view>
......@@ -32,7 +40,7 @@
<glsx-image wx:if="{{!item.weChatAvatarUrl}}" src="personal/staff_defalut_avatar.png" class="avatar"/>
<image wx:else src="{{item.weChatAvatarUrl}}" class="avatar"></image>
<view class="message-text">
<view class="name">{{item.staffName}}</view>
<view class="name"><text>{{item.staffName}}</text><text wx:if="{{item.type}}" class="type_tips">{{filter.filterType(item.type)}}</text></view>
<view class="mobile">{{format.formatMobile(item.staffPhone)}}</view>
</view>
</view>
......@@ -54,3 +62,4 @@
</view>
</view>
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="getStaffList" selectInfo="{{selectInfo}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" />
<staff-type-popup wx:if="{{staffPopupShow}}" bind:hidePopup="handleStaffTypeChange" selectInfo="{{selectInfo}}" bindconfirm="getStaffList" popShow="{{staffPopupShow}}"/>
......@@ -116,7 +116,7 @@ Component({
// 获取服务中心数据
getSeviceCenter() {
mineApi.getServiceCenterListAPI({}).then(res => {
mineApi.getServiceCenterListAPI({querySubPartner: true}).then(res => {
let data = res || []
let serviceIds = data.map(val => { return val.yqMerchantId })
this.setData({
......
......@@ -2,6 +2,7 @@
import outputApi from '~/api/outputApi/index'
import { IMG_URL } from '~/utils/constantData'
import { deleteSecond } from '~/utils/format'
import { h5Url } from '~/utils/request/http'
Component({
/**
* 组件的属性列表
......@@ -304,7 +305,7 @@ Component({
}
const { idx } = e.currentTarget.dataset
let obj = this.data.busiTotalList[idx]
let url = 'https://dj.glsx.com.cn/dj-car-revenue-analysis/#/?merchantId=' + obj?.merchantId4s + '&merchantName=' + obj?.merchantName4s
let url = h5Url + '?merchantId=' + obj?.merchantId4s + '&merchantName=' + obj?.merchantName4s
wx.$router.jumpH5(url)
},
......
......@@ -14,7 +14,7 @@ Page({
agree: true,
tabIndx: 0,
// tabList: ['我的客户', '我的门店', '我的员工'],
tabList: ['我的客户', '我的员工'],
tabList: ['我的门店', '我的员工'],
popupShow: false,
subIndex: -1,
merchantList: [
......@@ -33,12 +33,12 @@ Page({
},
// 切换园区
tapPicker() {
let { isSuper } = this.data
isSuper &&
this.setData({
moveArrow: !this.data.moveArrow,
popupShow: !this.data.popupShow
})
// let { isSuper } = this.data
// isSuper &&
this.setData({
moveArrow: !this.data.moveArrow,
popupShow: !this.data.popupShow
})
},
navbarReady(e) {
let { height, statusBarHeight } = e.detail
......@@ -48,8 +48,9 @@ Page({
// console.log(e)
},
changeTabIndx(e) {
const { idx } = e.currentTarget.dataset
this.setData({
tabIndx: e.detail
tabIndx: idx
})
},
init() {
......
{
"usingComponents": {
"navigation-bar": "../../../components/NavigationBar/NavigationBar",
"tab": "../../../components/Tab/Tab",
"client": "./components/client/client",
"merchant": "./components/merchant/mrechant",
"staff": "./components/staff/staff",
"search-input": "../../../components/SearchInput/SearchInput",
"accountSwitchingPop": "./components/accountSwitchingPop/accountSwitchingPop",
......
......@@ -9,6 +9,31 @@
}
}
.navbarReady {
justify-content: flex-start !important;
.tab-container {
box-sizing: border-box;
display: flex;
width: calc(100vw - 176rpx);
height: 88rpx;
line-height: 88rpx;
padding: 0 32rpx;
.tab {
font-size: 34rpx;
color: #636465;
margin-right: 32rpx;
}
.tabIndx {
font-weight: 600;
font-size: 34rpx;
color: #323436;
}
}
}
.layout {
box-sizing: border-box;
position: relative;
......@@ -35,12 +60,6 @@
z-index: -1;
}
.tabContainer {
height: 100rpx;
padding: 0 32rpx;
// background-color: #F2F3F7;
}
.comCom {
// flex: 1;
height: calc(100% - 100rpx);
......@@ -58,31 +77,51 @@
}
.navigation-title {
.select-box {
display: flex;
justify-content: space-between;
align-items: center;
justify-content: center;
}
box-sizing: border-box;
height: 88rpx;
line-height: 88rpx;
padding: 0 32rpx;
font-size: 26rpx;
color: #333333;
.navigation-title-text {
text-align: center;
max-width: calc(100% - 24rpx);
}
.select-item {
display: flex;
align-items: center;
height: 56rpx;
line-height: 56rpx;
padding: 0 24rpx;
background: #F7F7F7;
border-radius: 8rpx;
}
.navigation-title .arrow {
width: 26rpx;
height: 26rpx;
margin-left: 4rpx;
transform: translateY(25%);
transition: all 0.5s;
.select-item.active {
color: #3666FE;
background: #3666fe1a;
}
image {
.arrow {
width: 26rpx;
height: 26rpx;
margin-left: 4rpx;
transition: all 0.5s;
image {
width: 26rpx;
height: 26rpx;
}
}
}
.navigation-title .move {
.merchant-select-text {
text-align: center;
max-width: calc(100vw - 340rpx);
}
.merchant-select .move {
transform: rotate(-180deg) translateY(0);
}
......
<!-- pages/tab/output/output.wxml -->
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady">
<view class="navigation-title" bindtap="tapPicker">
<view class="navigation-title-text text-hide">
{{merchantRange[subIndex].merchantName||userInfo.merchantName}}
</view>
<view class="arrow {{moveArrow?'move':''}}" wx:if="{{merchantRange.length > 1}}">
<image src="{{IMG_URL}}/output/arrow.png" />
</view>
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady" custom-class="navbarReady">
<view class="tab-container">
<view wx:for="{{tabList}}" wx:key="index" class="tab {{index==tabIndx?'tabIndx':''}}" bindtap="changeTabIndx" data-idx="{{index}}">{{item}}</view>
</view>
<!-- </picker> height:calc(100vh - {{tabBarStyle}}px) -->
</navigation-bar>
<view class="layout" style="padding-top:{{tabBarStyle}}px;">
<tab tab="{{tabList}}" itemWidth="{{'27%'}}" index="{{tabIndx}}" bindclick="changeTabIndx" class="tabContainer" />
<!-- <view class="">{{IMG_URL}}</view> -->
<view class="select-box">
<!-- 门店筛选 -->
<view class="select-item {{'active'}}" bindtap="tapPicker">
<view class="merchant-select-text text-hide">
{{merchantRange[subIndex].merchantName||userInfo.merchantName}}
</view>
<view class="arrow {{moveArrow?'move':''}}">
<image src="{{IMG_URL}}/output/arrow.png" />
</view>
</view>
<view class="select-item {{'active'}}">
筛选
<view class="arrow">
<image src="{{IMG_URL}}/output/arrow.png" />
</view>
</view>
</view>
<!-- 我的客户 -->
<view class="comCom" hidden="{{tabIndx != 0}}">
<!-- <view class="comCom" hidden="{{tabIndx != 0}}">
<client id="client" />
</view>
</view> -->
<!-- 我的门店 -->
<!-- <view class="comCom" hidden="{{tabIndx != 1}}">
<merchant id="merchant" />
<!-- <view class="comCom" hidden="{{tabIndx != 0}}">
<staff id="staff" />
</view> -->
<!-- 我的员工 -->
<view class="comCom" hidden="{{tabIndx != 1}}">
......
// pages/tab/outputValue/components/CommissionPopup/CommissionPopup.js
import { getNowMonth } from '~/utils/format'
Component({
/**
* 组件的属性列表
*/
properties: {
popShow: Boolean,
handleCommissionObj: Object
},
/**
* 组件的初始数据
*/
data: {
monthCommossionData: [
{
month: '2023-08',
ruleStatus: '1',
commission: 5230
}, {
month: '2023-07',
ruleStatus: '1',
commission: 5230
}, {
month: '2023-06',
ruleStatus: '0',
commission: 5230
}, {
month: '2023-05',
ruleStatus: '1',
commission: 5230
}, {
month: '2023-04',
ruleStatus: '0',
commission: 5230
}, {
month: '2023-03',
ruleStatus: '1',
commission: 5230
}
],
nowMonth: getNowMonth()
},
/**
* 组件的方法列表
*/
methods: {
hidePopup() {
this.triggerEvent('hidePopup')
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* pages/tab/outputValue/components/CommissionPopup/CommissionPopup.wxss */
.title_tips{
height: 96rpx;
line-height: 96rpx;
font-size: 28rpx;
color: #323436;
padding: 0 32rpx;
background: #F7F7F7;
border-radius: 8rpx;
display: flex;
.merchant_text{
display: flex;
view{
max-width: 500rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
.month_box{
padding: 0 32rpx;
box-sizing: border-box;
font-size: 28rpx;
height: calc(100% - 100rpx);
.month_item{
display: flex;
align-items: center;
justify-content: space-between;
color: #323436;
font-weight: 600;
padding: 52rpx 40rpx 8rpx;
border-bottom: 2rpx solid #F5F5F5;
.inline_b{
display: inline-block;
}
.tips{
font-weight: 400;
}
}
}
\ No newline at end of file
<!--pages/tab/outputValue/components/CommissionPopup/CommissionPopup.wxml-->
<wxs src="../../index.wxs" module="filter" />
<popup
show="{{popShow}}"
bind:hidePopup="hidePopup"
bindconfirm="confirm"
height="60%"
title="员工提成">
<!-- 服务多家门店不显示门店名称 -->
<view class="title_tips">
<view decode="{{true}}" class="merchant_text" wx:if="{{(handleCommissionObj.constructionStats && handleCommissionObj.constructionStats.length == 1) || (handleCommissionObj.outputValueStats && handleCommissionObj.outputValueStats.length == 1)}}">
<view>{{handleCommissionObj.constructionStats[0].shopMerchantName || handleCommissionObj.outputValueStats[0].shopMerchantName}}</view>
<view style="padding: 0 10rpx;"> | </view>
</view>
<view>{{handleCommissionObj.staffName}}</view>
</view>
<scroll-view scroll-y class="month_box">
<view class="month_item" wx:for="{{monthCommossionData}}" wx:key="index">
<view class="month">{{filter.getMonth(item.month)}}月份<view class="inline_b" wx:if="{{nowMonth == item.month}}">(当前月)</view></view>
<view wx:if="{{item.ruleStatus == '1' && nowMonth == item.month}}" class="tips">提成在本月完结后自动计算</view>
<view wx:if="{{item.ruleStatus == '0'}}" class="tips">提成未设置,请登录后台设置</view>
<view wx:if="{{item.ruleStatus == '1' && nowMonth != item.month}}" class="commissionNum">¥{{filter.setPrice(item.commission)}}</view>
</view>
</scroll-view>
</popup>
// pages/tab/output/components/ScreenBox/ScreenBox.js
import { getMerchantListApi } from '~/api/applyProd.js'
Component({
/**
* 组件的属性列表
*/
properties: {
formData: Object,
tabBarStyle: String,
isShowFilterScreen: Boolean,
tabType: Number
},
/**
* 组件的初始数据
*/
data: {
merchantList: [],
popupShow: false,
confirmShow: false
},
lifetimes: {
attached() {
// 获取服务商下4s店
this.getMerchantList()
},
},
/**
* 组件的方法列表
*/
methods: {
// 选择门店
handleSlectMerchant() {
this.setData({
popupShow: !this.data.popupShow
})
},
// 筛选
filterTypeFn() {
this.setData({
confirmShow: !this.data.confirmShow
})
this.data.confirmShow ? wx.pro.hideTabBar() : wx.pro.showTabBar()
},
// 获取服务商下的4s店
getMerchantList() {
let { userInfo } = wx.$storage.get()
getMerchantListApi({serviceMerchantId: userInfo?.subLoginUser?.merchantId}).then(res => {
let { code, data } = res
if (code == '0') {
this.setData({
merchantList: data
})
}
})
},
handleMerchantChange(e) {
console.log('111111')
let {merchantId, merchantName} = e.detail
let { formData } = this.data
const thisPage = wx.$router.getPageInstance()
formData.shopMerchantIds = [merchantId]
formData.shopMerchantNames = merchantName
this.setData({
formData
})
thisPage.setData({
screenFormData: formData
})
thisPage.searchEvent(true)
}
}
})
{
"component": true,
"usingComponents": {
"select-merchant-popup": "../selectMerchantPopup/selectMerchantPopup",
"screen-confirm-box": "../ScreenConfirmBox/ScreenConfirmBox"
}
}
\ No newline at end of file
<!--pages/tab/output/components/ScreenBox/ScreenBox.wxml-->
<view class="content_box" hidden="{{isShowFilterScreen}}">
<view class="screen_item {{formData.shopMerchantIds.length ? 'active' : ''}}" bindtap="handleSlectMerchant">
<view class="merchant_name">{{ formData.shopMerchantNames }}</view>
<glsx-image src="{{'output/drop_down.png'}}" class="icon" />
</view>
<view class="screen_item wid_140 {{formData}}" bindtap="filterTypeFn">
筛选
<glsx-image src="{{'output/drop_down.png'}}" class="icon" />
</view>
</view>
<!-- 选择门店 -->
<select-merchant-popup wx:if="{{popupShow}}" bind:hidePopup="handleSlectMerchant" bindmerchantConfirm="handleMerchantChange" selectInfo="{{formData}}" popShow="{{popupShow}}" merchantRange="{{merchantList}}" isTab="{{true}}"/>
<!-- 筛选 -->
<screen-confirm-box wx:if="{{confirmShow}}" tabBarStyle="{{tabBarStyle}}" show="{{confirmShow}}" formData="{{formData}}" tabType="{{tabType}}" bindreloadMerchantList="getMerchantList"></screen-confirm-box>
\ No newline at end of file
/* pages/tab/output/components/ScreenBox/ScreenBox.wxss */
.content_box{
width: 100%;
height: 88rpx;
/* background: #ffffff; */
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 32rpx;
}
.screen_item{
height: 56rpx;
color: #333333;
background: #F7F7F7;
border-radius: 12rpx;
font-size: 26rpx;
display: flex;
align-items: center;
justify-content: center;
padding: 0 24rpx;
box-sizing: border-box;
}
.screen_item.active{
color: #3666FE;
background: #3666fe1a;
}
.screen_item .merchant_name{
max-width: 400rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.screen_item.wid_140{
width: 140rpx;
padding: 0;
}
.screen_item .icon{
width: 40rpx;
height: 40rpx;
}
\ No newline at end of file
// pages/tab/output/components/ScreenConfirmBox/ScreenConfirmBox.js
import USERAPI from '~/api/usersApi/index'
import outputApi from '~/api/outputApi/index'
import { setUserInfo } from '~/utils/cache/storageApi'
Component({
/**
* 组件的属性列表
*/
properties: {
tabBarStyle: String,
formData: Object,
show: {
type: Boolean,
observer: function (n, o) {
if (n) {
const thisPage = wx.$router.getPageInstance()
thisPage.setData({
isShowFilterScreen: true
})
this.setViewData()
this.updateUserInfo()
}
}
},
tabType: Number // tab值 0我的门店 1我的员工
},
/**
* 组件的初始数据
*/
data: {
userInfo: {},
isSuper: false,
servicePopupShow: false,
merchantRange: [],
sceneList: [
{
id: '',
label: '全部',
active: true
},
{
id: '1',
label: '太阳膜'
},
{
id: '3',
label: '众筹活动'
},
{
id: '0',
label: '会员权益/升级'
}
],
staffList: []
},
/**
* 组件的方法列表
*/
methods: {
updateUserInfo() {
let { userInfo } = wx.$storage.get()
this.setData({
userInfo,
isSuper: userInfo.isSuper
})
},
setViewData() {
let { tabBarStyle } = this.data
wx.$api.getViewInfo(
'.btn-box',
res => {
this.setData({
height: tabBarStyle,
btnHeight: res[0]?.height
})
},
this
)
},
getMerchantRange() {
let { isSuper, userInfo } = this.data
// 判断是超管才需要切换账号
if (isSuper) {
USERAPI.adminSelectLogin()
.then(result => {
let { merchantList: merchantRange } = result
merchantRange.forEach((item, index) => {
item.show = true
})
this.setData({
merchantRange
})
})
.catch(err => { })
} else {
let merchantRange = [{ merchantId: userInfo.subLoginUser.merchantId, merchantName: userInfo.subLoginUser.merchantName }]
this.setData({
merchantRange
})
}
},
changeMerchantRange(e) {
let { merchantRange, subIndex, formData } = this.data
let { merchantId } = e.detail
merchantRange.forEach((item, index) => {
item.show = true
if (item.merchantId == merchantId) {
subIndex = index
item.act = true
}
})
formData.partnerMerchantIds = [merchantId]
this.setData({
merchantRange,
subIndex,
formData
})
if (this.data.tabType == 1 && merchantId !== userInfo?.subLoginUser?.merchantId) this.getStaffList()
this.servicePicker()
},
// 服务商切换
servicePicker() {
this.setData({
servicePopupShow: !this.data.servicePopupShow
})
},
// 月份确定
dateRangeSelect(e) {
let { start, end } = e.detail.date
let { formData } = this.data
let [year, month] = end.split('-')
let day = this.getLastDay(year, month)
formData.startTime = start + '-01' + ' 00:00:00'
formData.endTime = end + '-' + day + ' 23:59:59'
this.setData({
formData
})
},
getLastDay(year, month) {
var new_year = year //取当前的年份
var new_month = month++ //取下一个月的第一天,方便计算(最后一天不固定)
if (month > 12) {
new_month -= 12 //月份减
new_year++ //年份增
}
var new_date = new Date(new_year, new_month, 1) //取当年当月中的第一天
return new Date(new_date.getTime() - 1000 * 60 * 60 * 24).getDate() //获取当月最后一天日期
},
// 员工数据
getStaffList() {
let { partnerMerchantIds, sceneType } = this.data.formData
outputApi.getStaffList({partnerMerchantId: partnerMerchantIds[0]}).then(res => {
let _list = []
// 1-会员权益/升级;2-精品升级
let attrToNum = {
'': 'totalStat',
'1': 'vdStat',
'2': 'boutiqueStat',
'3': 'carTransformStat'
}
_list = res[attrToNum[sceneType || '']] || []
let arr = []
_list.forEach(val => {
val.list.length && val.list.forEach(subVal => {
arr.push(subVal)
})
})
if (!arr.length || arr[0]?.userName !== '全部') {
arr.unshift({
active: true,
userId: '',
userName: '全部'
})
}
this.setData({
staffList: arr
})
})
},
init() {
this.getMerchantRange()
if (this.data.tabType == 1) this.getStaffList() // 我的员工有员工筛选条件
},
choose(e) {
let { index, listName } = e.currentTarget.dataset
let { formData } = this.data
let target = this.data[listName]
switch (listName) {
case 'staffList':
if (index == 0) { // 选择全部
target.map(i => (i.active = false))
target[index].active = true
} else {
target[index].active = true
target[0].active = false
}
break
case 'sceneList':
target.map(i => (i.active = false))
target[index].active = true
formData.sceneType = target[index]?.id
this.setData({
formData
})
break
}
this.setData({
[`${listName}`]: target,
isReset: false
})
},
confirm() {
wx.$api.showLoading('加载中')
let { userInfo, formData, staffList, sceneList } = this.data
formData.sceneType = sceneList.filter(val => val.active)[0]?.id || ''
formData.staffUUIDs = staffList.filter(val => val.active).map(subVal => {return subVal.userId})
const thisPage = wx.$router.getPageInstance()
if (formData?.partnerMerchantIds[0] !== userInfo.subLoginUser.merchantId) {
USERAPI.switchSubLoginInfo({ merchantId: formData?.partnerMerchantIds[0] }).then(res => {
setUserInfo(res)
wx.$api.hideLoading()
this.triggerEvent('reloadMerchantList')
// 切换服务商 清空已选的门店
formData.shopMerchantIds = []
formData.shopMerchantNames = '全部门店'
thisPage.setData({
screenFormData: formData
})
thisPage.searchEvent()
})
} else {
wx.$api.hideLoading()
thisPage.setData({
screenFormData: formData
})
thisPage.searchEvent()
}
},
reset() {
let { formData, userInfo, sceneList, staffList, tabType, merchantRange, subIndex } = this.data
formData.partnerMerchantIds = [userInfo.subLoginUser.merchantId]
formData.startTime = ''
formData.endTime = ''
formData.sceneType = ''
formData.staffUUIDs = []
if (tabType == 0) {
sceneList.map(val => val.active = false)
sceneList[0].active = true
} else if (tabType == 1) {
staffList.map(val => val.active = false)
staffList[0].active = true
}
merchantRange.forEach((item, index) => {
item.show = true
if (item.merchantId == userInfo.subLoginUser.merchantId) {
subIndex = index
}
})
this.setData({
formData,
sceneList,
staffList,
merchantRange,
subIndex
})
this.init()
}
},
attached() {
this.init()
}
})
{
"component": true,
"usingComponents": {
"switchAccountPopup": "../../components/SwitchAccountPopup/SwitchAccountPopup",
"CalendarMonth": "/components/CalendarMonth/CalendarMonth"
}
}
\ No newline at end of file
/* pages/tab/output/components/ScreenConfirmBox/ScreenConfirmBox.wxss */
.confirm-box {
position: fixed;
top: 0;
z-index: 10;
height: 100vh;
width: 100%;
box-sizing: border-box;
background-color: #fff;
animation: show-confirm-box .5s forwards;
}
@keyframes show-confirm-box {
0%{
right: -100%;
}
100%{
right: 0;
}
}
.main{
box-sizing: border-box;
}
.confirm-title {
height: 80rpx;
position: relative;
}
.confirm-title .back {
position: absolute;
left: 40rpx;
font-size: 24rpx;
border-radius: 12rpx;
background-color: #0075F9;
color: #fff;
height: 46rpx;
padding: 0 24rpx;
}
.box {
margin: 0 24rpx;
}
.box .title {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 30rpx;
font-weight: 600;
color: #323436;
padding: 24rpx 0;
background: #fff;
z-index: 2;
}
.box .title .picker_box, .box .title .picker_box .picker_box_text{
display: flex;
align-items: center;
}
.box .title .picker_box .picker_text{
font-size: 26rpx;
font-weight: 400;
color: #333333;
}
.box .title .picker_box .icon{
width: 40rpx;
height: 40rpx;
}
.box .service_name{
height: 68rpx;
line-height: 68rpx;
text-align: left;
font-size: 26rpx;
width: 100%;
box-sizing: border-box;
background: #F7F7F7;
border-radius: 8rpx;
padding: 0 32rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.box .date_box {
display: flex;
align-items: center;
justify-content: space-around;
}
.box .date_box .date_item {
width: 316rpx;
height: 68rpx;
line-height: 68rpx;
text-align: center;
background: #F7F7F7;
border-radius: 8rpx;
}
.box .list_box {
display: flex;
flex-wrap: wrap;
font-size: 26rpx;
align-items: flex-start;
gap: 24rpx;
}
.box .list_box .list_item {
width: 216rpx;
box-sizing: border-box;
text-align: center;
background: #F7F7F7;
border-radius: 8rpx;
padding: 16rpx 24rpx;
view{
white-space: normal;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
}
}
.box .list_box .list_item.active{
background: #F0F7FF;
color: #3666FE;
}
.box .list-box {
display: flex;
border-bottom: 2rpx solid rgba(195, 195, 195, .3);
flex-wrap: wrap;
padding-bottom: 20rpx;
}
.box .list-box .item {
width: 210rpx;
min-height: 64rpx;
border: 2rpx solid transparent;
box-sizing: border-box;
padding: 16rpx 33rpx;
margin-bottom: 20rpx;
flex-wrap: wrap;
font-size: 24rpx;
text-align: center;
background-color: #F7F7F7;
color: #666666;
transition: all .2s;
margin: 0 20rpx 20rpx 0;
}
.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.btn-box {
position: fixed;
padding: 10rpx 32rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
bottom: 0;
left: 0;
width: 100%;
box-sizing: border-box;
z-index: 9;
background-color: #fff;
}
.btn-box .btn {
border-radius: 12rpx;
border: 2rpx solid #0075F9;
box-sizing: border-box;
height: 80rpx;
}
.btn-box .btn.clear {
width: 336rpx;
height: 88rpx;
border: 2rpx solid #EEEEEE;
border-radius: 12rpx;
color: #8A8C90;
}
.btn-box .btn.done {
width: 336rpx;
height: 88rpx;
background: #3666FE;
border-radius: 12rpx;
color: #ffffff;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
\ No newline at end of file
<!--pages/tab/output/components/ScreenConfirmBox/ScreenConfirmBox.wxml-->
<wxs src="./index.wxs" module="filter" />
<scroll-view scroll-y class="confirm-box" style="height:calc(100vh - {{height}}px);margin-top:{{tabBarStyle}}px;"
hidden="{{!show}}">
<view class="main" style="padding-bottom:{{btnHeight}}px;min-height: calc(100% - {{btnHeight}}px);">
<view class="box">
<view class="title">
服务商名称
<block wx:if="{{isSuper}}">
<view class="picker_box" bindtap="servicePicker">
<view class="picker_text">
切换
</view>
<glsx-image src="{{'output/drop_down.png'}}" class="icon" />
</view>
</block>
</view>
<view class="service_name">
{{ merchantRange[subIndex].merchantName||userInfo.subLoginUser.merchantName }}
</view>
</view>
<view class="box">
<view class="title">
自定义月份
<view class="picker_box">
<CalendarMonth
allowSameDay
shortcut
bindselect="dateRangeSelect"
rangeAll
dateType="range"
calenderColor="#3582EE"
vertical
minDate="2020-10-01"
maxDate="{{ dateObj.today }}"
forceFullSucreen="{{ bottomLift>0?true:false }}"
isComponents
isChangeType="{{false}}"
dayType="{{0}}"
>
<view class="picker_box_text">
<view class="picker_text">
选择日期
</view>
<glsx-image src="{{'output/drop_down.png'}}" class="icon" />
</view>
</CalendarMonth>
</view>
</view>
<view class="date_box">
<view class="date_item">{{filter.filterDate(formData.startTime)}}</view>
<view>-</view>
<view class="date_item">{{filter.filterDate(formData.endTime)}}</view>
</view>
</view>
<view class="box" wx:if="{{tabType == 0}}">
<view class="title">
场景品类
</view>
<view class="list_box">
<block wx:for="{{sceneList}}" wx:key="index">
<view class="list_item {{item.active?'active':''}}" bindtap="choose" data-index="{{index}}" data-list-name="sceneList">{{item.label}}</view>
</block>
</view>
</view>
<view class="box" wx:if="{{tabType == 1}}">
<view class="title">
员工
</view>
<view class="list_box">
<block wx:for="{{staffList}}" wx:key="index">
<view class="list_item {{item.active?'active':''}}" bindtap="choose" data-index="{{index}}" data-multiple="true" data-list-name="staffList">
<view>{{item.userName}}</view>
</view>
</block>
</view>
</view>
</view>
<view class="btn-box isFullSucreen">
<view class="btn clear text-center" bindtap="reset">重置</view>
<view class="btn done text-center" bindtap="confirm">确定</view>
</view>
</scroll-view>
<switchAccountPopup wx:if="{{servicePopupShow}}" bind:hidePopup="servicePicker" bindchangeAccount="changeMerchantRange" popShow="{{servicePopupShow}}" merchantRange="{{merchantRange}}" selectInfo="{{formData}}" hideTab="{{true}}"/>
/** 具体时间截取月份 */
var filterDate = function (n) {
var year = n && n.split('-')[0]
var month = n && n.split('-')[1]
return n && year + '/' + month
}
/*
* 导出
*/
module.exports = {
filterDate: filterDate
}
// pages/tab/output/components/accountSwitchingPop/accountSwitchingPop.js
import { IMG_URL } from '~/utils/constantData.js'
Component({
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {
popShow: {
type: Boolean,
value: false,
observer: function (n) {
if (n) {
let { merchantRange, selectInfo } = this.data
let activeIndex = merchantRange.findIndex(v => v.merchantId == selectInfo.partnerMerchantIds[0])
merchantRange.forEach((item, ind) => {
item.show = true
if (activeIndex == ind) {
item.act = true
} else {
item.act = false
}
this.setData({
merchantRange,
selectedMerchantId: selectInfo.partnerMerchantIds[0]
})
})
this.setData({
searchKeyword: ''
})
}
}
},
merchantRange: Object,
selectInfo: Object,
hideTab: Boolean
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
merchantList: []
},
observers: {
merchantRange: function (e) {
this.setData({
merchantList: e
})
}
},
/**
* 组件的方法列表
*/
methods: {
hidePopup() {
this.triggerEvent('hidePopup')
},
confirm() {
let { merchantRange, subIndex } = this.data
let actObj = merchantRange.find((item, index) => {
if (item.act) {
subIndex = index
}
return item.act
})
if (!actObj) {
return wx.$api.showToast({
title: '请选择服务商',
icon: 'error'
})
} else {
this.changePicker(actObj)
}
},
changePicker(actObj) {
this.triggerEvent('changeAccount', actObj)
},
select(e) {
let { index, target } = e.currentTarget.dataset
let { merchantRange } = this.data
merchantRange.forEach((item, ind) => {
if (index == ind) {
item.act = true
} else {
item.act = false
}
this.setData({
merchantRange,
selectedMerchantId: target.merchantId
})
})
},
input(e) {
let { merchantRange, selectedMerchantId } = this.data
let { value } = e.detail
merchantRange.forEach(item => {
item.act = false
item.show = item.merchantName.includes(value)
if (item.merchantId == selectedMerchantId) item.act = true
})
this.setData({
merchantRange
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* pages/tab/output/components/accountSwitchingPop/accountSwitchingPop.wxss */
.search-box {
width: 100%;
height: 104rpx;
padding-left: 32rpx;
// margin-top: 20rpx;
display: flex;
align-items: center;
background-color: #fff;
position: sticky;
top: 0;
left: 0;
z-index: 9;
box-sizing: border-box;
}
.search-box .search-input {
background: #F7F8FA;
border-radius: 38rpx;
width: 606rpx;
height: 72rpx;
display: flex;
align-items: center;
}
.search-box .search-input .search-icon {
width: 28rpx;
height: 28rpx;
margin: 0 10rpx 0 26rpx;
}
.search-box .search-input .search-clear {
width: 36rpx;
height: 36rpx;
margin: 0 26rpx 0 10rpx;
}
.search-box .search-input .input {
font-size: 28rpx;
width: calc(100% - 136rpx);
}
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
.search-box .search {
width: 144rpx;
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 24rpx;
}
.list {
height: calc(100% - 100rpx) !important;
}
.search-box .search .text-center {
font-size: 24rpx;
/* background-color: #f7f7f7; */
border-radius: 12rpx;
width: 100%;
font-size: 32rpx;
color: #858A94;
}
.search-box .search .text-center .search-filter {
margin-left: 6rpx;
width: 24rpx;
height: 24rpx;
}
.itemCon {
box-sizing: border-box;
width: 100%;
// background-color: #fff;
height: 80rpx;
color: #323436;
line-height: 80rpx;
padding: 0 32rpx;
}
.active {
// color: aqua;
background: #F0F7FF;
font-size: 28rpx;
color: #3666FE;
}
\ No newline at end of file
<!-- pages/tab/output/components/accountSwitchingPop/accountSwitchingPop.wxml -->
<popup
show="{{popShow}}"
bind:hidePopup="hidePopup"
bindconfirm="confirm"
height="60%"
hideTab="{{hideTab}}">
<!-- <search-input placeholder="请搜索服务商账号名" ></search-input> -->
<view class="search-box">
<view class="search-input">
<image src="{{IMG_URL}}/output/searchIcon.png" class="search-icon" />
<input
type="text"
placeholder="请搜索服务商账号名"
class="input"
value="{{keyword}}"
placeholder-class="input-placeholder"
bindinput="input"
bindconfirm="search" />
<block wx:if="{{keyword}}">
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view>
<view class="search text-center" bindtap="showConfirm">
<view class="text-center">搜索</view>
</view>
</view>
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
refresher-threshold="104"
scroll-top="{{scrollTop}}"
class="list"
style="height:100%;"
data-type="message"
refresher-triggered="{{triggered}}">
<block wx:for="{{merchantList}}" wx:key="index">
<view
class="itemCon text-hide {{item.act?'active':''}}"
hidden="{{!item.show}}"
data-index="{{index}}"
data-target="{{item}}"
bindtap="select">
{{item.merchantName}}
</view>
</block>
</scroll-view>
</popup>
// components/Tab/Tab.js
// behaviors: [LocationBehavior],
import { imgUrlMixin } from '~/mixins/index'
Component({
behaviors: [imgUrlMixin],
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {
outClassName:String,
tab: Array,
openScroll: Boolean,
tabHeight: {
type: Boolean,
value: false
},
productHeight: {
type: Boolean,
value: false
},
index: {
type: Number,
observer: function (n) {
this.setData({
count: n,
to: `to-${n}`
})
}
},
itemWidth: String,
align: {
type: String,
value: ''
},
// 是否有红点
unreadClueCount: {
type: Number,
value: 0
},
noLine: Boolean
},
/**
* 组件的初始数据
*/
data: {
count: 0,
to: ''
},
// lifetimes:{
// attached: function() {
// console.log('unreadClueCount',this.data.unreadClueCount)
// }
// },
/**
* 组件的方法列表
*/
methods: {
click(e) {
let { count } = e.currentTarget.dataset
this.setData({
count,
to: `to-${count}`,
unreadClueCount:0
})
this.triggerEvent('click', count)
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<wxs src="./Tab.wxs" module="filterUtils" />
<block>
<scroll-view class="tab-box flex" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}" enhanced="{{true}}" show-scrollbar="{{false}}" style="{{tabHeight ? 'height: 88rpx;' : ''}}">
<block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index==count?'active':''}}" style="width:{{itemWidth}}; margin-left: 32rpx" bindtap="click" data-count="{{index}}">
<view class="text text-center" style="{{tabHeight ? 'height: 88rpx;' : ''}}">{{item}}</view>
<view wx:if="{{!noLine}}" class="line" style="{{tabHeight ? 'margin-top: 6rpx;' : ''}}" />
</view>
</block>
</scroll-view>
</block>
\ No newline at end of file
var hasRedpoint = function (unreadClueCount) {
// console.log('unreadClueCount: ', unreadClueCount);
if(unreadClueCount>0){
return true
}else{
return false;
}
};
module.exports = {
hasRedpoint: hasRedpoint,
};
/* components/Tab/Tab.wxss */
.tab-box {
display: flex;
width: 100%;
height: 92rpx;
box-sizing: border-box;
}
.tab-box.left {
padding-left: 32rpx;
}
.left .tab {
padding-right: 40rpx;
}
/* .flex .tab {
flex: 1;
} */
.tab {
position: relative;
flex-shrink: 0;
}
.tab .text {
height: 84rpx;
display: flex;
align-items: center;
box-sizing: border-box;
color: #A9A9A9;
justify-content: center;
font-size: 34rpx;
}
.left .text {
justify-content: flex-start;
}
.flex .tab .text {
padding: 0;
}
/* .tab + .tab{
margin-left: 20rpx;
} */
.tab.active .text {
/* font-weight: 500; */
font-weight: 600;
/* font-size: 38rpx; */
transition: all .25s;
color: #2C2C2C;
font-family: PingFangSC-S0pxibold;
}
.tab .line {
width: 48rpx;
height: var(--borderRadius);
background: var(--btnColor);
border-radius: 2rpx;
margin: 0 auto;
transform: scale(0);
transition: all .25s;
}
.tab.active .line {
transform: scale(1);
}
.tab-box::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
.active .redpoint {
display: none;
}
.redpoint {
position: absolute;
top: 10px;
right: 5px;
/* top: 8px;
right: 10px; */
width: 10px;
height: 10px;
background: #EB4E4E;
border-radius: 50%;
}
/* 外部出进来的自定义样式 */
.project-tab {
padding-left: 20px;
padding-right: 20px;
}
.project-tab .tab {
margin-right: 28px;
}
.project-tab .tab.active .text {
font-size: 28rpx;
color: var(--btnColor);
}
.project-tab .tab .line {
width: auto;
}
\ No newline at end of file
// pages/tab/outputValue/components/employees/employess.js
const IMAGES = Object.freeze({
userAvatarUrl: `/personal/userAvatarUrl.png`
})
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
IMAGES,
dataList: [{
staffRoleName: '技师',
staffName: '张三',
staffUUID: 1,
totalOutputValue: 185041,
commissionFlag: false,
outputValueType: 1,
outputValueStats: [
{
shopMerchantId: 123123,
shopMerchantName: '明明崇文4s店A明明崇文4s店A明明崇文4s店A明明崇文4s店A',
totalOrderMoney: 15,
customerUnitPrice: 2000.01,
orderCount: 20
},
{
shopMerchantId: 123123,
shopMerchantName: '明明崇文4s店A',
totalOrderMoney: 15,
customerUnitPrice: 2000.01,
orderCount: 20
},
{
shopMerchantId: 123123,
shopMerchantName: '明明崇文4s店A',
totalOrderMoney: 15,
customerUnitPrice: 2000.01,
orderCount: 20
},
{
shopMerchantId: 123123,
shopMerchantName: '明明崇文4s店A',
totalOrderMoney: 10,
customerUnitPrice: 2000.01,
orderCount: 15
}
]
}, {
staffRoleName: '驻店员工',
staffName: '李四',
staffUUID: 1,
totalOutputValue: 185041,
commissionFlag: true,
outputValueType: 2,
constructionStats: [
{
shopMerchantId: 123123,
shopMerchantName: '明明崇文4s店A',
upgradeConstructionCount: 15,
notUpgradeConstructionCount: 20,
upgradeIncentiveFee: 40
},
{
shopMerchantId: 123123,
shopMerchantName: '明明崇文4s店A',
upgradeConstructionCount: 15,
notUpgradeConstructionCount: 20,
upgradeIncentiveFee: 40
},
{
shopMerchantId: 123123,
shopMerchantName: '明明崇文4s店A',
upgradeConstructionCount: 15,
notUpgradeConstructionCount: 20,
upgradeIncentiveFee: 40
}
]
}],
commissionPopup: false,
handleCommissionObj: {}
},
/**
* 组件的方法列表
*/
methods: {
handleCommissionPopup(e) {
let { target } = e.currentTarget.dataset
this.setData({
commissionPopup: !this.data.commissionPopup,
handleCommissionObj: target
})
},
showMore(e) {
let { index } = e.currentTarget.dataset
let params = `dataList[${index}].showMore`
this.setData({
[params]: true
})
}
}
})
{
"component": true,
"usingComponents": {
"commissionPopup": "../CommissionPopup/CommissionPopup"
}
}
\ No newline at end of file
/* pages/tab/outputValue/components/employees/employess.wxss */
.list{
padding: 0 16rpx;
width: 100%;
box-sizing: border-box;
.empty_box{
width: 100%;
height: 24rpx;
box-sizing: border-box;
background: transparent;
}
.list_item{
box-sizing: border-box;
width: 100%;
background: #FFFFFF;
box-shadow: 0 2rpx 2rpx 0 #b4bacc52;
border-radius: 16rpx;
padding: 40rpx 0 24rpx 24rpx;
margin: 0 24rpx 24rpx 0;
.staff_messsage{
padding-right: 26rpx;
.flex_spa-be{
display: flex;
justify-content: space-between;
.flex{
display: flex;
align-items: flex-start;
.headPortrait{
width: 52rpx;
height: 52rpx;
margin-right: 12rpx;
}
.name{
font-weight: 600;
font-size: 32rpx;
color: #333333;
}
.role_name{
margin: 6rpx 0 0 8rpx;
font-size: 20rpx;
color: #8A8C90;
}
}
.output_text text{
color: #4772FC;
font-size: 36rpx;
font-weight: 700;
}
.merchant_num{
margin-left: 64rpx;
}
.commission{
font-size: 24rpx;
color: #323436;
.disabled{
color: #B6B7B7;
}
.flex{
display: flex;
align-items: center;
}
.arrow {
position: relative;
display: inline-block;
margin-left: 12rpx;
margin-bottom: 6rpx;
}
.arrow::before {
content: "";
display: inline-block;
border-top: 2rpx solid #323436;
border-right: 2rpx solid #323436;
width: 8rpx;
height: 8rpx;
transform: rotate(45deg);
}
}
}
}
.line{
width: calc(100% + 48rpx);
height: 1rpx;
background: #E4E6EE;
margin: 40rpx -24rpx 0;
}
.merchant_box{
padding-top: 24rpx;
.title{
font-size: 24rpx;
color: #8A8C90;
}
.flex_spa-arr{
display: flex;
gap: 20rpx;
justify-content: space-around;
.flex_1{
flex: 1;
}
.flex_2{
flex: 2;
}
.flex_3{
flex: 3;
}
.font_wei{
font-size: 28rpx;
font-weight: 600;
color: #323436;
}
.padd_r16{
padding-right: 16rpx;
}
.name{
font-size: 26rpx;
color: #323436;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
}
.merchant_item{
padding: 32rpx 0;
border-bottom: 2rpx solid #E4E6EE;
}
.merchant_item:last-child{
border: none;
padding-bottom: 8rpx;
}
.showMore{
display: flex;
align-items: center;
justify-content: center;
image{
width: 92rpx;
height: 36rpx;
}
}
}
}
}
.end-txt {
font-size: 24rpx;
text-align: center;
color: #CCCED1;
padding-bottom: 60rpx;
}
\ No newline at end of file
<!--pages/tab/outputValue/components/employees/employess.wxml-->
<scroll-view scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
refresher-threshold="104"
scroll-top="{{scrollTop}}"
class="list"
data-type="message"
refresher-triggered="{{triggered}}">
<view class="empty_box"></view>
<block wx:for="{{dataList}}" wx:key="index">
<view class="list_item">
<view class="staff_messsage">
<view class="flex_spa-be">
<view class="flex">
<glsx-image class="headPortrait" src="{{item.userAvatarUrl||IMAGES.userAvatarUrl}}" webp></glsx-image>
<view class="name">{{item.staffName}}</view>
<view class="role_name">「{{item.staffRoleName}}」</view>
</view>
<view class="output_text"><text style="font-size: 24rpx;">¥</text><text>{{item.totalOutputValue}}</text></view>
</view>
<view class="flex_spa-be">
<view class="merchant_num">服务门店·{{item.outputValueType == 1 ? item.outputValueStats.length : item.constructionStats.length}}家</view>
<view class="commission">
<view class="flex" wx:if="{{item.commissionFlag}}" data-target="{{item}}" bindtap="handleCommissionPopup"><text>提成</text><text class="arrow"></text></view>
<view class="disabled" wx:else="">提成未设置</view>
</view>
</view>
</view>
<view class="line"></view>
<view class="merchant_box">
<!-- 驻店员工 -->
<block wx:if="{{item.outputValueType == 1}}">
<view class="title flex_spa-arr">
<view class="flex_2">服务门店</view>
<view class="flex_1">产值/客单价</view>
<view class="flex_1 padd_r16">订单/转化率</view>
</view>
<block wx:for="{{item.outputValueStats}}" wx:for-index="subIndex" wx:for-item="subItem" wx:key="subIndex">
<view class="merchant_item flex_spa-arr" style="{{item.outputValueStats.length > 3 && !item.showMore && subIndex == 2 ? 'border:none;' : ''}}" wx:if="{{subIndex < 3 || item.showMore}}">
<view class="flex_2 name">{{subItem.shopMerchantName}}</view>
<view class="flex_1">
<view class="font_wei">{{'¥' + subItem.totalOrderMoney}}</view>
<view>{{'¥' + subItem.customerUnitPrice}}</view>
</view>
<view class="flex_1 padd_r16">
<view class="font_wei">{{subItem.orderCount}}单</view>
<view>{{subItem.orderCount}}%</view>
</view>
</view>
<view class="showMore" wx:if="{{subIndex >= 3 && subIndex === (item.outputValueStats.length - 1) && !item.showMore}}" bindtap="showMore" data-index="{{index}}">
<glsx-image src="output/show_more_icon.png" webp></glsx-image>
</view>
</block>
</block>
<!-- 技师 -->
<block wx:if="{{item.outputValueType == 2}}">
<view class="title flex_spa-arr" >
<view class="flex_3">服务门店</view>
<view class="flex_2">订单台次</view>
<view class="flex_1 padd_r16">激励费</view>
</view>
<block wx:for="{{item.constructionStats}}" wx:for-index="subIndex" wx:for-item="subItem" wx:key="subIndex">
<view class="merchant_item flex_spa-arr" style="{{item.constructionStats.length > 3 && !item.showMore && subIndex == 2 ? 'border:none;' : ''}}" wx:if="{{subIndex < 3 || item.showMore}}">
<view class="flex_3 name">{{subItem.shopMerchantName}}</view>
<view class="flex_2">
<view class="font_wei">升级膜{{subItem.upgradeConstructionCount || '-'}}台/次</view>
<view>赠送膜{{subItem.notUpgradeConstructionCount || '-'}}台/次</view>
</view>
<view class="flex_1 padd_r16">
<view class="font_wei" wx:if="{{subItem.upgradeIncentiveFee}}">¥{{subItem.upgradeIncentiveFee}}X{{subItem.upgradeConstructionCount}}</view>
<view class="font_wei" wx:if="{{!subItem.upgradeIncentiveFee}}">-</view>
<view wx:if="{{subItem.notUpgradeIncentiveFee}}">¥{{subItem.notUpgradeIncentiveFee}}X{{subItem.notUpgradeConstructionCount}}</view>
<view wx:if="{{!subItem.notUpgradeIncentiveFee}}">-</view>
</view>
</view>
<view class="showMore" wx:if="{{subIndex >= 3 && subIndex === (item.constructionStats.length - 1) && !item.showMore}}" bindtap="showMore" data-index="{{index}}">
<glsx-image src="output/show_more_icon.png" webp></glsx-image>
</view>
</block>
</block>
</view>
</view>
</block>
<view wx:if="{{!dataList.length}}" class="end-txt">
<nothing-tips tips="暂无数据~" bgColor="{{'#FFFFFF'}}" bg="{{bgUrl}}" />
</view>
<view wx:else class="end-txt">
<view>到底啦~</view>
</view>
</scroll-view>
<commissionPopup wx:if="commissionPopup" popShow="{{commissionPopup}}" bind:hidePopup="handleCommissionPopup" handleCommissionObj="{{handleCommissionObj}}"/>
// pages/tab/outputValue/components/merchant/merchant.js
import { IMG_URL } from '~/utils/constantData'
import outputApi from '~/api/outputApi/index'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
formData: {},
serviceName: '四川精手指鑫都汽车服务有限公司',
totalObj: {
scene1Total: '72536',
scene0Total: '76400',
scene3Total: '15486',
total: '164422'
},
// 1精品升级(太阳膜),3众筹,0会员权益)
// 服务商-多4s店-全部
// merchantList: [{
// yearMonth: '2023-08',
// curMonthTotalData: {
// scene1Total: '5986',
// scene0Total: '76400',
// scene3Total: '11000',
// total: '19567'
// },
// merchantDataList: [{
// merchantName: '四川申蓉汇亚汽车贸易有限公司',
// curMonthTotalData: {
// scene1Total: '5026',
// scene0Total: '11000',
// scene3Total: '2581',
// total: '18607'
// },
// lastMonthTotalData: {
// scene1Total: '51122',
// scene0Total: '2355',
// scene3Total: '65400',
// total: '0'
// }
// }, {
// merchantName: '四川港宏新通汽车销售服务有限公司',
// curMonthTotalData: {
// scene1Total: '960',
// scene0Total: '0',
// scene3Total: '0',
// total: '960'
// },
// lastMonthTotalData: {
// scene1Total: '123223',
// scene0Total: '0',
// scene3Total: '0',
// total: '0'
// }
// }]
// }],
// 指定场景
merchantList: [{
yearMonth: '2023-08',
curMonthTotalData: {
totalCustomer: '100',
total: '133862000',
notUpgradeCount: '22',
bizTotal: '960523',
custUnitPrice: '1523',
upgradeCount: '66',
activityTotal: '25',
orderTotal: '22',
upgradeRate: '65',
productCode: 'pc001'
},
merchantDataList: [{
merchantId: 111,
merchantName: '广西弘泽汽车销售服务有限公司',
bizTotal: '39000',
curMonthTotalData: {
totalCustomer: '',
total: '',
notUpgradeCount: '199',
bizTotal: '18228',
custUnitPrice: '559',
upgradeCount: '177',
activityTotal: '',
orderTotal: '',
upgradeRate: '89',
productCode: ''
},
lastMonthTotalData: {
totalCustomer: '',
total: '',
notUpgradeCount: '199',
bizTotal: '258228',
custUnitPrice: '559',
upgradeCount: '2000',
activityTotal: '',
orderTotal: '',
upgradeRate: '12',
productCode: ''
}
}, {
merchantId: 222,
merchantName: '益阳佳烨丰田汽车销售服务有限公司啦啦啦啦',
bizTotal: '19000',
curMonthTotalData: {
totalCustomer: '',
total: '',
notUpgradeCount: '199',
bizTotal: '18228',
custUnitPrice: '559',
upgradeCount: '2000',
activityTotal: '',
orderTotal: '',
upgradeRate: '89',
productCode: ''
},
lastMonthTotalData: {
totalCustomer: '',
total: '',
notUpgradeCount: '199',
bizTotal: '258228',
custUnitPrice: '559',
upgradeCount: '2000',
activityTotal: '',
orderTotal: '',
upgradeRate: '5',
productCode: ''
}
}]
}]
},
lifetimes: {
attached() {
this.getMerchant()
}
},
/**
* 组件的方法列表
*/
methods: {
getMerchant(isReset = false) {
let { userInfo } = wx.$storage.get()
let params = {
partnerMerchantId: userInfo.subLoginUser.merchantId
}
outputApi.getStaffList(params).then(res => {
if (isReset) {
this.setData({
busiScrollTop: 0
})
}
this.setData({
triggered: false
})
// let _list = []
// _list = res || []
// this.setData({
// merchantList: _list
// })
})
},
}
})
{
"component": true,
"usingComponents": {
"service-total": "../merchantCom/serviceTotal/serviceTotal",
"merchant-all": "../merchantCom/merchantAll/merchantAll",
"membranes": "../merchantCom/Membranes/Membranes"
}
}
\ No newline at end of file
/* pages/tab/outputValue/components/merchant/merchant.wxss */
.merchantCon {
box-sizing: border-box;
background-color: #F2F3F7;
height: 100%;
padding: 0 16rpx;
}
.merchant {
box-sizing: border-box;
color: #323436;
// padding-top: 16rpx;
background-color: #F2F3F7;
}
.merchant-content {
// margin: 0 16rpx;
}
.end-txt {
font-size: 24rpx;
text-align: center;
color: #CCCED1;
padding-bottom: 60rpx;
}
\ No newline at end of file
<!--pages/tab/outputValue/components/merchant/merchant.wxml-->
<view class="merchantCon">
<scroll-view class="merchant" id="scroller" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="handleSearch" lower-threshold='50' scroll-top="{{busiScrollTop}}">
<!-- 全部 - 服务商总产值 -->
<!-- <service-total serviceName="{{serviceName}}" totalObj="{{totalObj}}"></service-total> -->
<view wx:for="{{merchantList}}" wx:key="index" class="merchant-content">
<!-- 全部 -->
<!-- <merchant-all curInfo="{{item}}"></merchant-all> -->
<!-- 太阳膜 - scene1 -->
<membranes curInfo="{{item}}"></membranes>
</view>
<view wx:if="{{!merchantList.length}}" class="end-txt">
<nothing-tips tips="暂无数据~" bgColor="{{'#FFFFFF'}}" bg="{{bgUrl}}" />
</view>
<view wx:else class="end-txt">
<view>到底啦~</view>
</view>
</scroll-view>
</view>
\ No newline at end of file
// pages/tab/outputValue/components/merchantCom/Membranes/Membranes.js
import constant from '../constant'
Component({
/**
* 组件的属性列表
*/
properties: {
curInfo: {
type: Object,
value: () => { },
observer(n) { }
}
},
/**
* 组件的初始数据
*/
data: {
sceneTopList: constant.membranesTopList,
sceneFormList: constant.membranesFormList,
compareList: [],
switchChecked: false
},
/**
* 组件的方法列表
*/
methods: {
// switchChange() {
// this.setData({
// switchChecked: !this.data.switchChecked
// })
// },
}
})
{
"component": true,
"usingComponents": {},
"styleIsolation": "shared"
}
\ No newline at end of file
/* pages/tab/outputValue/components/merchantCom/Membranes/Membranes.wxss */
.membranes {
background-color: #ffffff;
margin-top: 24rpx;
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
border-radius: 16rpx;
.flex {
display: flex;
}
.flex-between {
display: flex;
justify-content: space-between;
align-items: center;
}
.num {
font-weight: 600;
font-size: 28rpx;
color: #323436;
}
.num-blue {
font-weight: 700;
font-size: 36rpx;
color: #4772FC;
}
.num-grey {
font-size: 24rpx;
color: #8A8C90;
}
.num-green {
font-weight: 600;
font-size: 24rpx;
color: #00C580;
}
.num-red {
font-weight: 600;
font-size: 24rpx;
color: #F35251;
}
.ft-40 {
font-size: 40rpx;
}
.top {
position: relative;
padding: 32rpx 24rpx;
.num-month {
color: #323436;
font-size: 60rpx;
font-weight: 600;
}
.month {
color: #323436;
font-size: 24rpx;
font-weight: 600;
margin-right: 12rpx;
}
.year {
font-weight: 500;
font-size: 24rpx;
color: #B6B7B7;
}
.scene-label {
position: absolute;
top: 0;
right: 0;
height: 36rpx;
line-height: 36rpx;
background-image: linear-gradient(270deg, #FFF7F7 0%, #EEF5FC 100%);
border-radius: 0 16rpx 0 30rpx;
font-size: 24rpx;
color: #32508D;
padding: 0 36rpx;
}
.top-num-box {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 24rpx;
color: #5A6066;
margin-top: 10rpx;
.total-txt {
margin-top: 16rpx;
}
.top-right-box {
display: flex;
justify-content: flex-end;
margin-bottom: 12rpx;
.label {
color: #8A8C90;
margin-right: 4rpx;
}
}
}
}
.contanier {
.list {
border-top: 0.3rpx solid #E4E6EE;
}
.title-box-first {
background-image: linear-gradient(179deg, #FAFAFA 0%, #FFFFFF 50%);
}
.title-box {
position: relative;
padding: 26rpx 24rpx;
font-weight: 600;
font-size: 28rpx;
color: #323436;
}
.title-box::before {
position: absolute;
left: 0;
top: 36rpx;
display: inline-block;
content: '';
width: 6rpx;
height: 32rpx;
background: #3666FE;
border-radius: 0 4rpx 4rpx 0;
}
.title-block {
width: 70%;
display: flex;
align-items: center;
}
.title-name {
width: calc(100% - 72rpx);
}
.tips-store {
box-sizing: border-box;
width: 64rpx;
height: 28rpx;
background: #fc8f2826;
border-radius: 5rpx;
font-weight: 400;
font-size: 20rpx;
color: #FC8F28;
padding: 0 12rpx;
margin-left: 8rpx;
}
.list-content {
padding: 10rpx 24rpx 36rpx;
.com-box {
display: flex;
justify-content: center;
align-items: center;
margin: 8rpx 0;
.com-month {
width: 66rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 22rpx;
color: #B6B7B7;
margin: 0 40rpx;
}
.line {
width: calc((100% - 146rpx) / 2);
height: 0.3rpx;
background-color: #F2F3F7;
}
}
.cur-block {
width: calc(100% / 5);
text-align: center;
.label {
font-size: 28rpx;
color: #323436;
margin-bottom: 16rpx;
}
}
// .compare-block {
// width: 33.33%;
// }
}
}
}
\ No newline at end of file
<!--pages/tab/outputValue/components/merchantCom/Membranes/Membranes.wxml-->
<wxs src="/pages/tab/outputValue/index.wxs" module="filter" />
<view class="membranes">
<view class="top">
<view class="scene-label">太阳膜</view>
<view>
<text class="num-month">8</text><text class="month">月</text><text class="year">2023年</text>
</view>
<view class="top-num-box">
<view>
<view class="num-blue ft-40">¥{{filter.money_three_for_two_thousands(curInfo.curMonthTotalData.total || 0)}}</view>
<view class="total-txt">本月业绩产生至{{curInfo.merchantDataList.length}}家门店</view>
</view>
<view>
<view wx:for="{{sceneTopList}}" wx:key="index" class="top-right-box">
<view class="label">{{item.label}}</view>
<view class="num-grey">
<text wx:if="{{item.prefix}}">{{item.prefix}}</text>
{{filter.money_three_for_two_thousands(curInfo.curMonthTotalData[item.name] || 0)}}
</view>
<text wx:if="{{item.suffix}}">{{item.suffix}}</text>
</view>
</view>
</view>
</view>
<!-- 门店列表 -->
<view class="contanier">
<view wx:for="{{curInfo.merchantDataList}}" wx:key="index" class="list">
<view class="title-box flex-between {{index == 0 ? 'title-box-first' : ''}}">
<view class="title-block">
<view class="title-name text-hide">{{item.merchantName}}</view>
<text class="tips-store">门店</text>
</view>
<view class="num-blue">¥{{filter.money_three_for_two_thousands(item.bizTotal || 0)}}</view>
</view>
<!-- 内容 -->
<view class="list-content">
<view class="com-box">
<view class="line"></view>
<view class="com-month">当日</view>
<view class="line"></view>
</view>
<view class="flex-between">
<view wx:for="{{sceneFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx" class="cur-block">
<view class="label">{{subItem.label}}</view>
<view class="num">
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
{{filter.money_three_for_two_thousands(item.curMonthTotalData[subItem.name] || 0)}}
<text wx:if="{{subItem.suffix}}">{{subItem.suffix}}</text>
</view>
</view>
</view>
<view>
<view class="com-box">
<view class="line"></view>
<view class="com-month">本月</view>
<view class="line"></view>
</view>
<view class="flex-between">
<view wx:for="{{sceneFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx" class="cur-block">
<view class="num">
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
{{filter.money_three_for_two_thousands(item.curMonthTotalData[subItem.name] || 0)}}
<text wx:if="{{subItem.suffix}}">{{subItem.suffix}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
const sceneFormList = [{
label: '太阳膜',
name: 'scene1Total'
}, {
label: '众筹活动',
name: 'scene3Total'
}, {
label: '会员权益/升级',
name: 'scene0Total'
}]
const membranesTopList = [{
label: '订单量',
name: 'orderTotal'
}, {
label: '转化率',
name: 'upgradeRate',
suffix: '%'
}, {
label: '客单价',
name: 'custUnitPrice',
prefix: '¥'
}]
const membranesFormList = [{
label: '营业额',
name: 'bizTotal',
prefix: '¥'
}, {
label: '升级/量',
name: 'upgradeCount'
}, {
label: '战败/单',
name: 'notUpgradeCount'
}, {
label: '客单价',
name: 'custUnitPrice',
prefix: '¥'
}, {
label: '转化率',
name: 'upgradeRate',
suffix: '%'
}]
export default {
sceneFormList,
membranesTopList,
membranesFormList
}
\ No newline at end of file
// pages/tab/outputValue/components/merchantCom/merchantAll/merchantAll.js
import constant from '../constant'
Component({
/**
* 组件的属性列表
*/
properties: {
curInfo: {
type: Object,
value: () => { },
observer(n) {
n && this.dealCompare()
}
}
},
/**
* 组件的初始数据
*/
data: {
sceneFormList: constant.sceneFormList,
compareList: [],
switchChecked: false
},
/**
* 组件的方法列表
*/
methods: {
dealCompare() {
let { merchantDataList } = this.data.curInfo
let list = []
merchantDataList.forEach((item, index) => {
list.push({
scene0Total: Math.abs(item.curMonthTotalData.scene0Total - item.lastMonthTotalData.scene0Total),
scene0TotalSign: (item.curMonthTotalData.scene0Total - item.lastMonthTotalData.scene0Total) > 0,
scene1Total: Math.abs(item.curMonthTotalData.scene1Total - item.lastMonthTotalData.scene1Total),
scene1TotalSign: (item.curMonthTotalData.scene1Total - item.lastMonthTotalData.scene1Total) > 0,
scene3Total: Math.abs(item.curMonthTotalData.scene3Total - item.lastMonthTotalData.scene3Total),
scene3TotalSign: (item.curMonthTotalData.scene3Total - item.lastMonthTotalData.scene3Total) > 0,
})
})
this.setData({
compareList: list
})
console.log(this.data.compareList, 'compareList---')
},
switchChange() {
this.setData({
switchChecked: !this.data.switchChecked
})
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* pages/tab/outputValue/components/merchantCom/merchantAll/merchantAll.wxss */
.merchant-all {
background-color: #ffffff;
margin-top: 24rpx;
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
border-radius: 16rpx;
.flex {
display: flex;
}
.flex-between {
display: flex;
justify-content: space-between;
align-items: center;
}
.num {
font-weight: 600;
font-size: 28rpx;
color: #323436;
}
.num-blue {
font-weight: 700;
font-size: 36rpx;
color: #4772FC;
}
.num-grey {
font-size: 24rpx;
color: #8A8C90;
}
.num-green {
font-weight: 600;
font-size: 24rpx;
color: #00C580;
}
.num-red {
font-weight: 600;
font-size: 24rpx;
color: #F35251;
}
.ft-40 {
font-size: 40rpx;
}
.top {
position: relative;
padding: 32rpx 24rpx;
.num-month {
color: #323436;
font-size: 60rpx;
font-weight: 600;
}
.month {
color: #323436;
font-size: 24rpx;
font-weight: 600;
margin-right: 12rpx;
}
.year {
font-weight: 500;
font-size: 24rpx;
color: #B6B7B7;
}
.switch-box {
position: absolute;
top: 34rpx;
right: 24rpx;
display: flex;
align-items: center;
}
.top-num-box {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 24rpx;
color: #5A6066;
margin-top: 10rpx;
.total-txt {
margin-top: 16rpx;
}
.top-right-box {
display: flex;
justify-content: flex-end;
margin-bottom: 12rpx;
.label {
color: #8A8C90;
margin-right: 4rpx;
}
}
}
}
.contanier {
.list {
border-top: 0.3rpx solid #E4E6EE;
}
.title-box-first {
background-image: linear-gradient(179deg, #FAFAFA 0%, #FFFFFF 50%);
}
.title-box {
position: relative;
padding: 26rpx 24rpx;
font-weight: 600;
font-size: 28rpx;
color: #323436;
}
.title-box::before {
position: absolute;
left: 0;
top: 36rpx;
display: inline-block;
content: '';
width: 6rpx;
height: 32rpx;
background: #3666FE;
border-radius: 0 4rpx 4rpx 0;
}
.tips-store {
box-sizing: border-box;
width: 64rpx;
height: 28rpx;
background: #fc8f2826;
border-radius: 5rpx;
font-weight: 400;
font-size: 20rpx;
color: #FC8F28;
padding: 0 12rpx;
margin-left: 8rpx;
}
.list-content {
padding: 36rpx 24rpx;
.com-box {
display: flex;
justify-content: center;
align-items: center;
margin: 8rpx 0;
.com-month {
width: 66rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 22rpx;
color: #B6B7B7;
margin: 0 40rpx;
}
.line {
width: calc((100% - 146rpx) / 2);
height: 0.3rpx;
background-color: #F2F3F7;
}
}
.cur-block {
width: 33.33%;
.label {
font-size: 28rpx;
color: #323436;
margin-bottom: 16rpx;
}
}
.compare-block {
width: 33.33%;
}
}
}
}
\ No newline at end of file
<!--pages/tab/outputValue/components/merchantCom/merchantAll/merchantAll.wxml-->
<wxs src="/pages/tab/outputValue/index.wxs" module="filter" />
<view class="merchant-all">
<view class="top">
<view class="switch-box">对比上月
<switch style="zoom:.6; margin-left: 8rpx;" color="#3666FE" checked="{{switchChecked}}" bindchange="switchChange" />
</view>
<view>
<text class="num-month">8</text><text class="month">月</text><text class="year">2023年</text>
</view>
<view class="top-num-box">
<view>
<view class="num-blue ft-40">¥{{filter.money_three_for_two_thousands(curInfo.curMonthTotalData.total || 0)}}</view>
<view class="total-txt">本月业绩产生至{{curInfo.merchantDataList.length}}家门店</view>
</view>
<view>
<view wx:for="{{sceneFormList}}" wx:key="index" class="top-right-box">
<view class="label">{{item.label}}</view>
<view class="num-grey">¥{{filter.money_three_for_two_thousands(curInfo.curMonthTotalData[item.name] || 0)}}</view>
</view>
</view>
</view>
</view>
<!-- 门店列表 -->
<view class="contanier">
<view wx:for="{{curInfo.merchantDataList}}" wx:key="index" class="list">
<view class="title-box flex-between {{index == 0 ? 'title-box-first' : ''}}">
<view>
{{item.merchantName}}
<text class="tips-store">门店</text>
</view>
<view class="num-blue">¥{{filter.money_three_for_two_thousands(item.curMonthTotalData.total || 0)}}</view>
</view>
<!-- 内容 -->
<view class="list-content">
<view class="flex">
<view wx:for="{{sceneFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx" class="cur-block">
<view class="label">{{subItem.label}}</view>
<view class="num">¥{{filter.money_three_for_two_thousands(item.curMonthTotalData[subItem.name] || 0)}}</view>
</view>
</view>
<view wx:if="{{switchChecked}}">
<view class="com-box">
<view class="line"></view>
<view class="com-month">较上月</view>
<view class="line"></view>
</view>
<view class="flex">
<view wx:for="{{sceneFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx" class="compare-block">
<view wx:if="{{compareList[index][subItem.name] == 0}}">0</view>
<view wx:else class="{{compareList[index][subItem.name + 'Sign'] ? 'num-red' : 'num-green'}}"><text>{{compareList[index][subItem.name + 'Sign'] ? '+' : '-'}}</text>¥{{filter.money_three_for_two_thousands(compareList[index][subItem.name])}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
// pages/tab/outputValue/components/merchantCom/serviceTotal/serviceTotal.js
import constant from '../constant'
Component({
/**
* 组件的属性列表
*/
properties: {
serviceName: {
type: String,
value: ''
},
totalObj: {
type: Object,
value: () => { }
}
},
/**
* 组件的初始数据
*/
data: {
sceneFormList: constant.sceneFormList
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* pages/tab/outputValue/components/merchantCom/serviceTotal/serviceTotal.wxss */
.service-total {
height: 388rpx;
background-image: url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/output/bg-merchant.png");
background-size: 100% 100%;
margin-top: 24rpx;
.top {
display: flex;
align-items: center;
height: 80rpx;
font-weight: 600;
font-size: 28rpx;
color: #323436;
padding: 0 24rpx;
.tips {
width: 84rpx;
height: 28rpx;
font-size: 20rpx;
text-align: center;
color: #3666FE;
background: #3666fe1a;
border-radius: 5rpx;
margin-left: 8rpx;
}
}
.box {
font-size: 28rpx;
padding: 32rpx 24rpx;
.total {
height: 154rpx;
.num {
font-weight: 700;
font-size: 40rpx;
color: #3666FE;
margin-top: 12rpx;
}
}
.label {
color: #8A8C90;
}
.content {
display: flex;
justify-content: space-between;
align-items: center;
.num {
color: #323436;
font-weight: 600;
margin-top: 16rpx;
}
}
}
}
\ No newline at end of file
<!--pages/tab/outputValue/components/merchantCom/serviceTotal/serviceTotal.wxml-->
<wxs src="/pages/tab/outputValue/index.wxs" module="filter" />
<view class="service-total">
<view class="top">
{{serviceName}}
<view class="tips">服务商</view>
</view>
<view class="box">
<view class="total">
<view class="label">总产值</view>
<view class="num">¥{{filter.money_three_for_two_thousands(totalObj.total || 0)}}</view>
</view>
<view class="content">
<view wx:for="{{sceneFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="label">{{subItem.label}}</view>
<view class="num">¥{{filter.money_three_for_two_thousands(totalObj[subItem.name] || 0)}}</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
// pages/tab/output/components/accountSwitchingPop/accountSwitchingPop.js
import { IMG_URL } from '~/utils/constantData.js'
Component({
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {
popShow: {
type: Boolean,
value: false,
observer: function (n) {
if (n) {
let { merchantRange, selectInfo } = this.data
let activeIndex = merchantRange.findIndex(v => v.merchantId == selectInfo.shopMerchantIds[0])
if (merchantRange.length) merchantRange.unshift({merchantId: '', merchantName: '全部'})
merchantRange.forEach((item, ind) => {
item.show = true
if (activeIndex == (ind - 1)) {
item.act = true
} else {
item.act = false
}
this.setData({
merchantRange,
selectedMerchantId: selectInfo.shopMerchantIds[0]
})
})
this.setData({
searchKeyword: ''
})
}
}
},
merchantRange: Object,
selectInfo: Object,
isMerchant: Boolean,
isTab: Boolean
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
serviceList: [],
searchKeyword: ''
},
observers: {
merchantRange: function (e) {
this.setData({
serviceList: e || []
})
}
},
/**
* 组件的方法列表
*/
methods: {
hidePopup() {
this.triggerEvent('hidePopup')
},
confirm() {
let { merchantRange, subIndex } = this.data
let actObj = merchantRange.find((item, index) => {
if (item.act) {
subIndex = index
}
return item.act
})
if (!actObj) {
return wx.$api.showToast({
title: '请选择门店',
icon: 'error'
})
} else {
if (actObj.merchantId == '' && actObj.merchantName == '全部') actObj.merchantName = '所有门店'
this.changePicker(actObj)
}
},
changePicker(actObj) {
this.triggerEvent('merchantConfirm', {...actObj})
this.hidePopup()
},
select(e) {
let { index, target } = e.currentTarget.dataset
let { merchantRange } = this.data
merchantRange.forEach((item, ind) => {
if (index == ind) {
item.act = true
} else {
item.act = false
}
this.setData({
merchantRange,
selectedMerchantId: target.merchantId
})
})
},
search(e) {
let { merchantRange, selectedMerchantId } = this.data
let { value } = e.currentTarget.dataset && Object.keys(e.currentTarget.dataset).length ? e.currentTarget.dataset : e.detail
merchantRange.forEach(item => {
item.act = false
item.show = item.merchantName?.includes(value)
if (item.merchantId == selectedMerchantId) item.act = true
})
this.setData({
merchantRange
})
},
input(e) {
let { value } = e.detail
this.setData({
searchKeyword: value
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packagesList/mineDetail/components/selectService/selectService.wxss */
.search-box {
width: 100%;
height: 104rpx;
padding-left: 32rpx;
display: flex;
align-items: center;
background-color: #fff;
position: sticky;
top: 0;
left: 0;
z-index: 9;
box-sizing: border-box;
.search {
width: 144rpx;
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 24rpx;
.text-center {
font-size: 24rpx;
border-radius: 12rpx;
width: 100%;
font-size: 32rpx;
color: #858A94;
.search-filter {
margin-left: 6rpx;
width: 24rpx;
height: 24rpx;
}
}
}
.search-input {
background: #F7F8FA;
border-radius: 38rpx;
width: 606rpx;
height: 72rpx;
display: flex;
align-items: center;
padding-left: 26rpx;
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
.search-icon {
width: 28rpx;
height: 28rpx;
}
.search-clear {
width: 36rpx;
height: 36rpx;
margin: 0 26rpx 0 10rpx;
}
.input {
font-size: 28rpx;
width: calc(100% - 136rpx);
margin-left: 10rpx;
}
}
}
.list {
height: calc(100% - 100rpx) !important;
}
.itemCon {
box-sizing: border-box;
width: 100%;
height: 80rpx;
color: #323436;
line-height: 80rpx;
padding: 0 32rpx;
}
.active {
background: #F0F7FF;
font-size: 28rpx;
color: #3666FE;
}
\ No newline at end of file
<!--packagesList/mineDetail/components/selectService/selectService.wxml-->
<popup
show="{{popShow}}"
bind:hidePopup="hidePopup"
bindconfirm="confirm"
height="60%"
isTab="{{isTab}}">
<view class="search-box">
<view class="search-input">
<glsx-image src="output/searchIcon.png" class="search-icon" />
<input
type="text"
placeholder="请搜索门店"
class="input"
value="{{keyword}}"
placeholder-class="input-placeholder"
bindinput="input"
bindconfirm="search" />
<block wx:if="{{keyword}}">
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view>
<view class="search text-center" bindtap="search" data-value="{{searchKeyword}}">
<view class="text-center">搜索</view>
</view>
</view>
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
refresher-threshold="104"
scroll-top="{{scrollTop}}"
class="list"
style="height:100%;"
data-type="message"
refresher-triggered="{{triggered}}">
<block wx:for="{{serviceList}}" wx:key="index">
<view
class="itemCon text-hide {{item.act?'active':''}}"
data-index="{{index}}"
data-target="{{item}}"
hidden="{{!item.show}}"
bindtap="select">
{{item.merchantName}}
</view>
</block>
</scroll-view>
</popup>
/**设置千分位 */
var setPrice = function (n = 0.0) {
if ((typeof n == 'string' || typeof n == 'number') && !isNaN(n)) {
n = parseFloat(n).toFixed(2)
var r = getRegExp('(d{1,3})(?=(d{3})+(?:.))', 'g')
var p = n.replace(r, ',')
return p
// var r = getRegExp('/./', 'g')
// var p = n.replace(r, 'test')
// return n
} else {
console.log(n, '不是一个数字', !isNaN(n))
}
}
var threeNumForTwo = {
money_three_for_two_thousands: function (num, isInt = true) {
//num = parseInt(num);
// return num
var num = num + ''
var d = ''
if (num.slice(0, 1) == '-') {
d = num.slice(0, 1)
num = num.slice(1)
}
var len = num.length
var index = num.indexOf('.')
if (index == -1) {
num = num + '.00'
} else if (index + 2 == len) {
num = num + '0'
}
var index = num.indexOf('.') // 字符出现的位置
var num2 = num.slice(-3)
num = num.slice(0, index)
var result = ''
while (num.length > 3) {
result = ',' + num.slice(-3) + result
num = num.slice(0, num.length - 3)
}
if (num) {
result = num + result
}
// return result
return isInt ? d + result : d + (result + num2)
}
}
var getMonth = function (n) {
if (n) return n.split('-').length && Number(n.split('-')[1])
}
/*
* 导出
*/
module.exports = {
setPrice: setPrice,
money_three_for_two_thousands: threeNumForTwo.money_three_for_two_thousands, //暴露接口调用
getMonth: getMonth
}
// pages/tab/output/output.js
import { getSessionId, setSessionId } from '~/utils/cache/storageApi'
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: [],
isShowService: false,
unreadClueCount: 0,
navBarBoxStyle: "justify-content: start;align-items: stretch",
navTitleStyle: "width: 100%; padding: 0;",
screenFormData: {
partnerMerchantIds: [],
shopMerchantIds: [],
shopMerchantNames: '全部门店',
startTime: '',
endTime: '',
sceneType: '',
staffUUIDs: []
},
isShowFilterScreen: false
},
back() {
this.setData({
isShowFilterScreen: false
})
this.childEle = this.selectComponent('#screenBox')
this.childEle.filterTypeFn()
},
// 切换园区
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
})
},
changeTabIndx(e) {
this.setData({
tabIndx: e.detail
})
},
init() {
this.setUserInfo()
},
// 筛选回调
searchEvent(isNoBack = false) {
if (!isNoBack) this.back()
},
setUserInfo() {
let { userInfo } = wx.$storage.get()
let { screenFormData } = this.data
screenFormData.partnerMerchantIds = [userInfo?.subLoginUser?.merchantId]
this.setData({
userInfo,
isSuper: userInfo.isSuper,
screenFormData
})
},
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)
// console.log(e)
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
}
})
console.log(subIndex, merchantRange)
this.setData({
merchantRange,
subIndex
})
})
.catch(err => { })
} else {
let merchantRange = [{ merchantId: userInfo.subLoginUser.merchantId, merchantName: userInfo.subLoginUser.merchantName }]
console.log('merchantRange', merchantRange)
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) {
this.init()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
// console.log(getTextWidth('随后获取dom元素的clientWidth 随后获取dom元素的clientWidth随后获取dom元素的clientWidth随后获取dom元素的clientWidth', '12px'))
},
/**
* 生命周期函数--监听页面显示
*/
onShow() { },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload() { },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() { },
/**
* 用户点击右上角分享
*/
onShareAppMessage() { }
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!