Commit 6aa357bd by chenwq

bug修复,客户管理

1 parent 3e99966e
......@@ -22,7 +22,8 @@ Page({
pageCof: {
pageNum: 1,
pageSize: 10
}
},
isAsk: false
},
// 筛选服务中心
......@@ -76,14 +77,18 @@ Page({
},
getList(isReset = false) {
let { customerList, pageCof, total, selectInfo } = this.data
if (total == customerList.length) {
let { customerList, pageCof, total, selectInfo, isAsk } = this.data
let _this = this
if (total == customerList.length || isAsk) {
return true
}
let params = {
...pageCof,
serviceCenterMerchantId: selectInfo?.yqMerchantId || ''
}
this.setData({
isAsk: true
})
mineCustomerApi.getCustomerList(params).then(res => {
let { list, total } = res
this.setData({
......@@ -97,6 +102,10 @@ Page({
scrollTop: 0
})
}
}).finally(function () {
_this.setData({
isAsk: false
})
})
},
......
......@@ -31,21 +31,21 @@
<view class="employee-box">
<view class="employee-list">
<!-- 技师 -->
<view class="employee-list">
<view class="employee-list" catchtap="handleTechnician" data-target="{{item}}">
<view class="avatar-box">
<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>
<view class="look-btn">技师</view>
</view>
<view class="line">|</view>
<!-- 销售顾问 -->
<view class="employee-list" wx:if="{{item.employeeNum != '0'}}">
<view class="employee-list" wx:if="{{item.employeeNum != '0'}}" catchtap="handleSale" data-target="{{item}}">
<view class="avatar-box">
<glsx-image class="avatar-img" src="personal/staff_defalut_avatar.png" />
<view class="num">{{item.employeeNum > maxNum ? (maxNum + '+') : item.employeeNum}}</view>
</view>
<view class="look-btn" data-target="{{item}}" catchtap="handleSale">销售顾问</view>
<view class="look-btn">销售顾问</view>
</view>
<view class="no-employee" wx:else>暂无销售顾问,去邀请</view>
</view>
......
......@@ -4,6 +4,8 @@ import { scenceList } from '~/pages/tab/index/constant/data'
import { IMG_URL } from '~/utils/constantData'
import mineServiceApi from '~/api/mineApi/mineService'
import mineCustomerApi from '~/api/mineApi/mineCustomer'
import outputApi from '~/api/outputApi/index'
const sceneCodeList = ['SC002', 'SC003', 'SC004', 'SC001']
Page({
/**
......@@ -24,12 +26,33 @@ Page({
serviceList: [],
// 场景业务
scenceList,
isConfirm: false
isConfirm: false,
baseData: {
proList: []
}
},
getProList(sceneCode) {
let { scenceList } = this.data
var params = {
sceneCode: sceneCode || ''
}
let list = []
outputApi.findProByScene(params).then(res => {
console.log(res)
console.log(this.data.scenceList)
sceneCodeList.forEach(item => {
let target = res.find(k => k.sceneCode == item)
list.push(target)
})
this.setData({
scenceList: list
})
})
},
getAllServiceList() {
mineServiceApi.getAllServiceList({}).then(res => {
console.log(res)
this.setData({
serviceList: res || []
})
......@@ -159,6 +182,7 @@ Page({
*/
onLoad(options) {
let { scenceList } = this.data
this.getProList()
wx.$router.getData(res => {
let { addOrEdit, target } = res
this.setData({
......
......@@ -82,25 +82,20 @@
}
.scene {
text-align: center;
width: 100%;
font-size: 28rpx;
color: #323436;
}
.scene-item {
display: flex;
box-sizing: border-box;
position: relative;
width: 25%;
/* flex: 1; */
background: #F7F8FC;
margin-right: 4rpx;
font-size: 18rpx;
color: #8A8C90;
/* padding: 32rpx 0 28rpx; */
padding: 24rpx 0 18rpx;
border-radius: 12rpx;
font-size: 24rpx;
padding: 8rpx 28rpx;
font-weight: 500;
border: 2rpx solid #F7F8FC;
/* margin-bottom: 20rpx; */
border: 2rpx solid #F2F3F7;
border-radius: 12rpx;
}
.scene-item:last-child {
......@@ -115,18 +110,6 @@
height: 22rpx;
}
.scene-title {
width: 100rpx;
font-size: 24rpx;
font-weight: 600;
text-align: center;
color: #323436;
}
.scene-item:nth-child(2) .scene-title {
width: 120rpx;
}
/* 选中 - start */
.active.scene-item {
background-image: linear-gradient(144deg, #F0F7FF 0%, #FFFFFF 73%);
......@@ -135,32 +118,11 @@
}
/* 选中 - end */
.title-box {
height: 68rpx;
display: flex;
justify-content: center;
align-items: center;
margin: 10rpx 0 4rpx;
}
.scene-title.on-open {
color: #8A8C90;
}
.no-open-img {
position: relative;
}
.scene-img {
width: 92rpx;
height: 64rpx;
}
.lock-img {
width: 92rpx;
height: 64rpx;
}
/* .notOpened {
color: #8A8C90;
} */
\ No newline at end of file
......@@ -13,15 +13,19 @@
<glsx-image src="personal/arrow_right.png" class="arrow_right" />
</view>
<view wx:if="{{item.type == 'business'}}">
<view class="flex scene">
<view class="scene-item {{item.isCheck ? 'active' : ''}}" wx:for="{{scenceList}}" wx:key="index" bindtap="handleSceneClick" data-idx="{{index}}" data-scenecode="{{item.sceneCode}}">
<glsx-image wx:if="{{item.isCheck}}" src="personal/scene-check.png" class="check-icon" />
<!-- <view class="scene"> -->
<!-- <view class="scene-item {{item.isCheck ? 'active' : ''}}" wx:for="{{scenceList}}" wx:key="index" bindtap="handleSceneClick" data-idx="{{index}}" data-scenecode="{{item.sceneCode}}"> -->
<view wx:for="{{scenceList}}" wx:key="index" class="scene">
<!-- <glsx-image wx:if="{{item.isCheck}}" src="personal/scene-check.png" class="check-icon" /> -->
<view class="scene-item">
<image webp class="scene-img" src="{{IMGURL}}output/caracticon0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
<view class="title-box">
<view class="scene-title">{{item.name}}</view>
</view>
<view>{{item.name}}</view>
</view>
<view wx:for="{{item.productList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
{{subItem.productName}}
</view>
</view>
<!-- </view> -->
</view>
</block>
</view>
......
......@@ -165,9 +165,6 @@ Page({
getList(isReset = false) {
let { technicianList, pageCof, total, customerInfo } = this.data
if (total == technicianList.length) {
return true
}
let params = {
...pageCof,
merchantId: customerInfo.merchantId
......
......@@ -14,7 +14,8 @@ Page({
pageCof: {
pageNum: 1,
pageSize: 10
}
},
isAsk: false
},
handleEdit(e) {
......@@ -40,13 +41,17 @@ Page({
},
getList(isReset = false) {
let { serviceList, pageCof, total } = this.data
if (total == serviceList.length) {
let { serviceList, pageCof, total, isAsk } = this.data
let _this = this
if (total == serviceList.length || isAsk) {
return true
}
let params = {
...pageCof
}
this.setData({
isAsk: true
})
mineServiceApi.getServiceList(params).then(res => {
let { list, total } = res
this.setData({
......@@ -60,6 +65,10 @@ Page({
scrollTop: 0
})
}
}).finally(function () {
_this.setData({
isAsk: false
})
})
},
......
......@@ -11,13 +11,14 @@ Page({
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
popupShow: false,
staffList: [],
selectInfo: {yqMerchantName: '全部服务中心'},
selectInfo: { yqMerchantName: '全部服务中心' },
total: 0,
serviceList: [],
currentPage: 1,
allServiceIds: [],
nothing: false,
scrollTop: 0
scrollTop: 0,
isAsk: false
},
/**
......@@ -40,7 +41,7 @@ Page({
// 获取服务中心数据
mineApi.getServiceCenterListAPI({}).then(res => {
let data = res || []
let serviceIds = data.map(val => {return val.yqMerchantId})
let serviceIds = data.map(val => { return val.yqMerchantId })
this.setData({
serviceList: res || [],
allServiceIds: serviceIds,
......@@ -54,15 +55,19 @@ Page({
},
getList(isReset = false) {
let { currentPage, selectInfo, allServiceIds, nothing } = this.data
let { currentPage, selectInfo, allServiceIds, nothing, isAsk } = this.data
let _this = this
let params = {
pageSize: 10,
pageNum: currentPage,
merchantNoList: selectInfo?.yqMerchantId ? [selectInfo?.yqMerchantId] : allServiceIds
}
if (nothing) {
if (nothing || isAsk) {
return
}
this.setData({
isAsk: true
})
mineApi.getStaffListAPI(params).then(res => {
let tempList = isReset ? res?.list || [] : this.data.staffList.concat(res?.list || [])
this.setData({
......@@ -77,6 +82,10 @@ Page({
scrollTop: 0
})
}
}).finally(function () {
_this.setData({
isAsk: false
})
})
},
......
......@@ -704,7 +704,7 @@ const scenceList = [
sale: 10000, //销量
varType: 1,
flow: 10000,
"productCode": "PC009",
"productCode": "PC011",
"productName": "智能香氛系统",
"category": "轻改类",
prodImg: `${IMG_URL}index/prod2/prod3-5.png`,
......
......@@ -631,7 +631,7 @@ const scenario_3 = [
sale: 10000, //销量
varType: 1,
flow: 10000,
productCode: 'PC009',
productCode: 'PC011',
productName: '智能香氛系统',
category: '轻改类',
prodImg: `${IMG_URL}index/prod2/prod3-5.png`,
......
......@@ -76,13 +76,13 @@ Component({
return params
},
handleInputeClear(e) {
this.setData({
isInputClear: true,
['formData.userName']: ''
})
console.log(this.data.isInputClear, 'isInputClear---')
},
// handleInputeClear(e) {
// this.setData({
// isInputClear: true,
// ['formData.userName']: ''
// })
// console.log(this.data.isInputClear, 'isInputClear---')
// },
handleInput(e) {
let { attr } = e.currentTarget.dataset
......@@ -93,13 +93,13 @@ Component({
},
changeFold() {
let { isInputClear } = this.data
if (isInputClear) {
this.setData({
isInputClear: false
})
return true
}
// let { isInputClear } = this.data
// if (isInputClear) {
// this.setData({
// isInputClear: false
// })
// return true
// }
this.setData({
isFold: !this.data.isFold
})
......
<!--pages/tab/output/components/StaffSort/StaffSort.wxml-->
<view class="total-tab">
<view wx:if="{{isFold}}" class="tab {{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? 'active' : ''}}">筛选
<glsx-image src="{{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? 'output/icon-arrow-act.png' : 'output/icon-arrow.png'}}" class="icon" />
<view wx:if="{{isFold}}" class="tab {{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? 'active' : ''}}">
{{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? '已选' : '筛选'}}
<glsx-image src="{{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? 'output/sort.png' : 'output/sort-default.png'}}" class="icon" />
</view>
<scroll-view wx:else scroll-x="{{true}}">
<view class="tabs-box">
......@@ -20,14 +21,14 @@
</view>
</scroll-view>
<view class="right-box input {{ isFold ? 'long-input' : '' }}">
<!-- <view class="right-box input long-input"> -->
<!-- <view class="right-box input long-input"> -->
<view class="input-flex">
<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" />
</view>
<view wx:if="{{isFold}}" class="icon-delete" bindtap="handleInputeClear" data-attr="userName">
<!-- <view wx:if="{{isFold}}" class="icon-delete" bindtap="handleInputeClear" data-attr="userName">
<glsx-image src="output/icon-delete.png" class="icon" />
</view>
</view> -->
</view>
</view>
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="handleServiceChange" selectInfo="{{formData}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" />
\ 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!