Commit 6a7b74fd by chenwq

样式调整,联调

1 parent 32f68ea5
......@@ -132,5 +132,15 @@ class outputApi {
...data
})
}
// 我的员工
/** 服务商查询园区店员工产值统计 */
getStaffList(data) {
data.routerMethod = 'dj.api.smarcarlife.yquser.stat.byPartnerMerchant'
return api.post({
method: 'scrm.api.boutiquecoupon.rop.boutique.router.withoutLogin',
...data
})
}
}
export default outputApi
......@@ -33,7 +33,7 @@
<!-- 技师 -->
<view class="employee-list">
<view class="avatar-box">
<glsx-image class="avatar-img" src="personal/staff_defalut_avatar.png" />
<glsx-image class="avatar-img" src="personal/tech_defalut_avatar.png" />
<view wx:if="{{item.technicianCount != '0'}}" class="num">{{item.technicianCount > maxNum ? (maxNum + '+') : item.technicianCount}}</view>
</view>
<view class="look-btn" data-target="{{item}}" catchtap="handleTechnician">技师</view>
......
......@@ -7,7 +7,7 @@ const formItems = [{
props: 'technicianName',
type: 'input',
placeholder: '请输入技师的名称',
maxlength: 10
maxlength: 15
}]
export default {
......
......@@ -134,17 +134,19 @@ Page({
cancelText: '取消',
confirmColor: '#3666FE',
success(res) {
wx.$api.showLoading('加载中...')
mineServiceApi.deleteTechnician(params).then(res => {
let { code, data, message } = res
if (code == '0') {
wx.hideLoading()
wx.$api.showToast('删除成功')
_this.handleSearch(true)
} else {
wx.$api.showToast(message)
}
})
if (res.confirm) {
wx.$api.showLoading('加载中...')
mineServiceApi.deleteTechnician(params).then(res => {
let { code, data, message } = res
if (code == '0') {
wx.hideLoading()
wx.$api.showToast('删除成功')
_this.handleSearch(true)
} else {
wx.$api.showToast(message)
}
})
}
}
})
},
......
......@@ -13,12 +13,12 @@
<view class="item-box" wx:for="{{technicianList}}" wx:key="index">
<view class="top">
<view class="message">
<glsx-image src="personal/staff_defalut_avatar.png" class="avatar" />
<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>
</view>
<glsx-image wx:if="{{!item.isEdit}}" src="personal/icon-department.png" class="icon-edit" bindtap="handleEdit" data-type="edit" data-target="{{item}}" data-idx="{{index}}" />
<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>
<view class="delete" bindtap="handleDelete" data-target="{{item}}">删除</view>
</view>
......
// pages/tab/output/components/BusiCard/BusiCard.js
import constantData from './constant/data'
Component({
/**
* 组件的属性列表
......@@ -11,6 +12,32 @@ Component({
sceneCode: {
type: String,
value: '-1'
},
fromPage: {
type: String,
value: 'client'
},
formData: {
type: Object,
value: () => { }
}
},
lifetimes: {
attached() {
let { fromPage, clientFormObj, staffFormObj } = this.data
let _obj = {}
switch (fromPage) {
case 'staff':
_obj = JSON.parse(JSON.stringify(staffFormObj))
break
default:
_obj = JSON.parse(JSON.stringify(clientFormObj))
break
}
this.setData({
formObj: _obj
})
}
},
......@@ -18,74 +45,10 @@ Component({
* 组件的初始数据
*/
data: {
formObj: {
'-1': [{
label: '精品升级',
name: 'boutiqueUpgrade',
prefix: '¥',
isNum: true
}, {
label: '售后众筹',
name: 'afterSalesCrowdfunding',
prefix: '¥',
isNum: true
}, {
label: '会员权益/升级',
name: 'vdUpgrade',
prefix: '¥',
isNum: true
}],
'SC002': [{
label: '营业额',
name: 'totalSubOrderOrderMoney',
prefix: '¥',
isNum: true
}, {
label: '到店贴膜量',
name: 'toShopCount'
}, {
label: '升级订单',
name: 'upgradeCount'
}, {
label: '战败订单',
name: 'noUpgradeCount'
}, {
label: '升级客单价',
name: 'calUpPrice',
prefix: '¥',
isNum: true
}, {
label: '升级转化率',
name: 'calTransform',
suffix: '%'
}],
'SC001': [{
label: '营业额',
name: 'turnover',
prefix: '¥',
isNum: true
}, {
label: '推荐客户量',
name: 'customerNum'
}, {
label: '成交客户量',
name: 'successNum'
}, {
label: '融合客单价',
name: 'fuseCustomerPrice',
prefix: '¥',
isNum: true
}, {
label: '权益客单价',
name: 'equityCustomerPrice',
prefix: '¥',
isNum: true
}, {
label: '转化率',
name: 'conversionRate',
suffix: '%'
}]
}
formObj: {},
timeTabObj: constantData.timeTabObj,
clientFormObj: constantData.clientFormObj,
staffFormObj: constantData.staffFormObj
},
/**
......
......@@ -4,29 +4,58 @@
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
border-radius: 8rpx;
margin-bottom: 20rpx;
padding: 20rpx;
padding: 20rpx 0;
.title-box {
display: flex;
align-items: center;
padding: 0 20rpx;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 8rpx;
padding-bottom: 14rpx;
border-radius: 50%;
}
.title {
display: flex;
justify-content: space-between;
width: calc(100% - 40rpx);
border-bottom: 2rpx dotted #E0E0E0;
padding-bottom: 14rpx;
}
.title-tap {
height: 36rpx;
line-height: 36rpx;
background: #3e71fe1f;
border-radius: 4rpx;
font-size: 20rpx;
color: #3E71FE;
padding: 0 8rpx;
}
}
.bf-blue {
padding: 0;
}
.bf-blue::before {
display: inline-block;
content: '';
width: 6rpx;
height: 28rpx;
background: #3666FE;
border-radius: 0 4rpx 4rpx 0;
margin: -12rpx 16rpx 0 0;
}
.content {
display: flex;
flex-wrap: wrap;
padding: 0 20rpx;
}
.content-item {
......
<!--pages/tab/output/components/BusiCard/BusiCard.wxml-->
<wxs src="../index.wxs" module="filter" />
<view class="busi-card">
<view class="title-box">
<glsx-image src="output/icon-head.png" class="icon" />
<view class="title-box" wx:if="{{fromPage == 'staff'}}">
<image wx:if="{{formObj.userAvatar}}" src="{{formObj.userAvatar}}" class="icon" />
<glsx-image wx:else src="personal/staff_defalut_avatar.png" class="icon" />
<view class="title">
{{info.userName}}
<view class="title-tap">{{timeTabObj[formData.timeIdx || '0']}}</view>
</view>
</view>
<view class="title-box bf-blue" wx:else>
<view class="title">{{info.merchantName || info.merchantName4s || ''}}</view>
</view>
<view class="content">
......
const timeTabObj = {
0: '今日指标',
1: '本月指标',
2: '累计指标'
}
// -1:全部;SC002:精品升级;SC001:会员权益/升级
const clientFormObj = {
'-1': [{
label: '精品升级',
name: 'boutiqueUpgrade',
prefix: '¥',
isNum: true
}, {
label: '售后众筹',
name: 'afterSalesCrowdfunding',
prefix: '¥',
isNum: true
}, {
label: '会员权益/升级',
name: 'vdUpgrade',
prefix: '¥',
isNum: true
}],
'SC002': [{
label: '营业额',
name: 'totalSubOrderOrderMoney',
prefix: '¥',
isNum: true
}, {
label: '到店贴膜量',
name: 'toShopCount'
}, {
label: '升级订单',
name: 'upgradeCount'
}, {
label: '战败订单',
name: 'noUpgradeCount'
}, {
label: '升级客单价',
name: 'calUpPrice',
prefix: '¥',
isNum: true
}, {
label: '升级转化率',
name: 'calTransform',
suffix: '%'
}],
'SC001': [{
label: '营业额',
name: 'turnover',
prefix: '¥',
isNum: true
}, {
label: '推荐客户量',
name: 'customerNum'
}, {
label: '成交客户量',
name: 'successNum'
}, {
label: '融合客单价',
name: 'fuseCustomerPrice',
prefix: '¥',
isNum: true
}, {
label: '权益客单价',
name: 'equityCustomerPrice',
prefix: '¥',
isNum: true
}, {
label: '转化率',
name: 'conversionRate',
suffix: '%'
}]
}
// -1:全部;SC002:精品升级;SC001:会员权益/升级
const staffFormObj = {
'-1': [{
label: '全部',
name: 'totalAmount',
prefix: '¥',
isNum: true
}, {
label: '精品升级',
name: 'totalBoutiqueAmount',
prefix: '¥',
isNum: true
}, {
label: '会员权益/升级',
name: 'totalVdAmount',
prefix: '¥',
isNum: true
}],
'SC002': [{
label: '营业额',
name: 'orderMoneyTotal',
prefix: '¥',
isNum: true
}, {
label: '升级客单价',
name: 'upgradeUnitPrice',
prefix: '¥',
isNum: true
}, {
label: '到店贴膜量',
name: 'toShopTotal'
}, {
label: '升级订单',
name: 'upgradeTotal'
}, {
label: '战败订单',
name: 'notUpgradeTotal'
}, {
label: '升级转化率',
name: 'upgradeRate',
suffix: '%'
}],
'SC001': [{
label: '营业额',
name: 'orderMoneyTotal',
prefix: '¥',
isNum: true
}, {
label: '推荐客户量',
name: 'recommendTotal'
}, {
label: '成交客户量',
name: 'dealTotal'
}, {
label: '融合客单价',
name: 'fusionUnitPrice',
prefix: '¥',
isNum: true
}, {
label: '权益客单价',
name: 'vdUnitPrice',
prefix: '¥',
isNum: true
}, {
label: '转化率',
name: 'convertRate',
suffix: '%'
}]
}
export default {
timeTabObj,
clientFormObj,
staffFormObj
}
\ No newline at end of file
// pages/tab/output/components/StaffSort/StaffSort.js
import { scenceList } from '~/pages/tab/index/constant/data'
const busiOptSceneCode = ['-1', 'SC002', 'SC001']
const busiOptSceneCode = ['-1', 'SC001', 'SC002']
import mineApi from '~/api/mineApi/index'
import { getNowMonth } from '~/utils/format'
Component({
......@@ -17,10 +17,10 @@ Component({
data: {
busiOptSceneCode,
formData: {
// 0:全部-1;1:精品升级SC002;2:会员权益/升级SC001
// 0:全部-1;2:精品升级SC002;1:会员权益/升级SC001
busiIdx: 0,
sceneCode: '-1',
yqMerchantName: '全部服务中心',
yqMerchantName: '服务中心',
timeIdx: 0
},
// 服务中心
......@@ -28,6 +28,7 @@ Component({
serviceList: [],
// 筛选项折叠
isFold: false,
isInputClear: false,
baseData: {
busiList: [],
timeList: [{
......@@ -44,8 +45,10 @@ Component({
},
lifetimes: {
attached() {
created() {
this.initTime()
},
attached() {
this.dealBusiList()
this.getSeviceCenter()
}
......@@ -55,6 +58,29 @@ Component({
* 组件的方法列表
*/
methods: {
dealSearchTime() {
let { dataObj, formData, baseData: { timeList } } = this.data
var params = dataObj[timeList[formData.timeIdx || 0]?.name || 'todayTime']
return params
},
dealParams() {
let { formData } = this.data
let params = {
sceneType: formData.busiIdx || '',
yqMerchantIds: formData.yqMerchantId || '',
userName: formData.userName || '',
...this.dealSearchTime()
}
return params
},
// handleInputeClear(e) {
// this.setData({
// isInputClear: true,
// ['formData.userName']: ''
// })
// },
handleInput(e) {
let { attr } = e.currentTarget.dataset
let { value } = e.detail
......@@ -75,9 +101,18 @@ Component({
},
handleInputBlur() {
let { isInputClear } = this.data
console.log(isInputClear, 'eieieii')
if (isInputClear) {
this.setData({
isInputClear: false
})
return true
}
this.changeFold()
this.triggerEvent('staffSearch')
},
// 获取服务中心数据
getSeviceCenter() {
mineApi.getServiceCenterListAPI({}).then(res => {
......@@ -96,9 +131,8 @@ Component({
})
},
// 获取员工列表
getStaffList(e) {
handleServiceChange(e) {
wx.$api.hideLoading()
console.log(e, '切换----')
let { formData } = this.data
this.setData({
formData: {
......@@ -107,6 +141,7 @@ Component({
yqMerchantName: e.detail.yqMerchantName
}
})
this.triggerEvent('staffSearch')
},
// 格式化时间
initTime() {
......@@ -114,16 +149,16 @@ Component({
let today = date.getDate()
let month = getNowMonth()
const todayTime = {
startTime: `${month}-${today} 00:00:00`,
endTime: `${month}-${today} 23:59:59`
dataBeginDate: `${month}-${today} 00:00:00`,
dataEndDate: `${month}-${today} 23:59:59`
}
const monthTime = {
startTime: `${month}-01 00:00:00`,
endTime: `${month}-${today} 23:59:59`
dataBeginDate: `${month}-01 00:00:00`,
dataEndDate: `${month}-${today} 23:59:59`
}
const defaultTime = {
startTime: '',
endTime: `${month}-${today} 23:59:59`
dataBeginDate: '',
dataEndDate: `${month}-${today} 23:59:59`
}
this.setData({
dataObj: {
......@@ -142,7 +177,7 @@ Component({
this.setData({
['formData.timeIdx']: res.tapIndex
})
// this.handleBusiSearch()
this.triggerEvent('staffSearch')
}
})
},
......@@ -166,17 +201,15 @@ Component({
},
handleClickTab(e) {
let { baseData: { busiList } } = this.data
console.log('???')
// 筛选
wx.showActionSheet({
itemList: busiList.map(item => item.name),
success: res => {
// this.resetBusiSearch()
this.setData({
['formData.busiIdx']: res.tapIndex,
['formData.sceneCode']: busiOptSceneCode[res.tapIndex]
})
// this.handleBusiSearch()
this.triggerEvent('staffSearch')
}
})
},
......
......@@ -48,6 +48,9 @@
}
.input {
position: relative;
display: flex;
align-items: center;
box-sizing: border-box;
width: 128rpx;
height: 60rpx;
......@@ -58,12 +61,18 @@
transition: width 0.2s ease-out;
}
.icon-delete {
position: absolute;
top: 6rpx;
right: 10rpx;
}
.long-input {
width: calc(100vw - 180rpx);
}
.input-placeholder {
font-size: 28rpx;
font-size: 24rpx;
color: #858A94;
}
}
\ No newline at end of file
......@@ -19,8 +19,10 @@
</view>
</view>
</scroll-view>
<view class="right-box">
<input type="text" placeholder="{{isFold ? '请输入员工姓名搜索' : '姓名'}}" maxlength="10" class="input {{ isFold ? 'long-input' : '' }}" value="{{formData.userName}}" placeholder-class="input-placeholder" data-attr="userName" confirm-type="search" bindinput="handleInput" bindfocus="handleInputFocus" bindblur="handleInputBlur" />
<view class="right-box input {{ isFold ? 'long-input' : '' }}">
<glsx-image src="output/searchIcon.png" class="icon" />
<input type="text" placeholder="{{isFold ? '请输入员工姓名搜索' : '姓名'}}" maxlength="30" value="{{formData.userName}}" placeholder-class="input-placeholder" data-attr="userName" confirm-type="search" bindinput="handleInput" bindfocus="handleInputFocus" bindblur="handleInputBlur" />
<!-- <glsx-image wx:if="{{isFold}}" src="output/icon-delete.png" class="icon icon-delete" data-attr="userName" bindcatch="handleInputeClear" /> -->
</view>
</view>
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="getStaffList" selectInfo="{{formData}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" />
\ No newline at end of file
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="handleServiceChange" selectInfo="{{formData}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" />
\ No newline at end of file
// pages/tab/output/components/staff/staff.js
import { IMG_URL } from '~/utils/constantData'
import outputApi from '~/api/outputApi/index'
Component({
/**
* 组件的属性列表
......@@ -10,11 +11,64 @@ Component({
* 组件的初始数据
*/
data: {
IMG_URL,
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
formData: {
// 0:全部-1;2:精品升级SC002;1:会员权益/升级SC001
busiIdx: 0,
sceneCode: '-1',
yqMerchantName: '服务中心',
timeIdx: 0
},
},
lifetimes: {
attached() {
this.getStaff()
}
},
/**
* 组件的方法列表
*/
methods: {}
methods: {
// tab-业务经营切换
handleSearch(e) {
this.getStaff(true, true)
},
getStaff(isReset = false) {
let staffSortModule = this.selectComponent('#staffSort')
let staffSearchData = staffSortModule ? staffSortModule.dealParams() : {}
this.setData({
formData: JSON.parse(JSON.stringify(staffSortModule.data.formData))
})
let { userInfo } = wx.$storage.get()
let params = {
...staffSearchData,
partnerMerchantId: userInfo.subLoginUser.merchantId
// partnerMerchantId: 44209468
}
outputApi.getStaffList(params).then(res => {
if (isReset) {
this.setData({
busiScrollTop: 0
})
}
this.setData({
triggered: false
})
let _list = []
// 1-会员权益/升级;2-精品升级
let attrToNum = {
'': 'totalStat',
'1': 'vdStat',
'2': 'boutiqueStat'
}
_list = res[attrToNum[staffSearchData.sceneType || '']] || []
this.setData({
staffList: _list
})
})
},
}
})
{
"component": true,
"usingComponents": {
"staff-sort": "../StaffSort/StaffSort"
"staff-sort": "../StaffSort/StaffSort",
"busi-card": "../BusiCard/BusiCard"
}
}
\ No newline at end of file
......@@ -3,4 +3,41 @@
box-sizing: border-box;
background-color: #fff;
height: 100%;
}
.staff {
box-sizing: border-box;
height: calc(100% - 92rpx);
color: #323436;
// padding-top: 16rpx;
// background-color: #F2F3F7;
background-color: #FFFFFF;
.title {
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
color: #323436;
}
.title::before {
display: inline-block;
content: '';
width: 6rpx;
height: 28rpx;
background: #3666FE;
border-radius: 0 4rpx 4rpx 0;
margin-right: 16rpx;
}
}
.staff-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/output/components/staff/staff.wxml -->
<view class="staffCon">
<staff-sort></staff-sort>
<staff-sort id="staffSort" bindstaffSearch="handleSearch"></staff-sort>
<scroll-view class="staff" id="scroller" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="handleSearch" lower-threshold='50' scroll-top="{{busiScrollTop}}">
<view wx:for="{{staffList}}" wx:key="index" class="staff-content">
<view class="title">{{item.yqMerchantName || ''}}</view>
<view wx:for="{{item.list}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<busi-card info="{{subItem}}" fromPage="staff" sceneCode="{{formData.sceneCode}}" formData="{{formData}}"></busi-card>
</view>
</view>
<view wx:if="{{!staffList.length}}" class="end-txt">
<nothing-tips tips="暂无数据~" bgColor="{{'#FFFFFF'}}" bg="{{bgUrl}}" />
</view>
<view wx:else class="end-txt">
<view wx:if="{{formData.sceneCode == 'SC002'}}">数据统计精品升级全品类产品</view>
<view wx:else>到底啦~</view>
</view>
</scroll-view>
</view>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!