Commit 27891367 by chenwq

技师

1 parent 3d5b7095
......@@ -42,9 +42,56 @@ const updateService = data => {
)
}
// 分页查询技师列表
const getTechnicianList = data => {
return api.post(
{
method: 'scrm.api.businessAssistant.technicianConfig.page',
...data
}
)
}
// 新增技师信息
const addTechnician = data => {
return api.post(
{
method: 'scrm.api.businessAssistant.technicianConfig.add',
...data
},
true
)
}
// 修改技师信息
const updateTechnician = data => {
return api.post(
{
method: 'scrm.api.businessAssistant.technicianConfig.update',
...data
},
true
)
}
// 删除技师
const deleteTechnician = data => {
return api.post(
{
method: 'scrm.api.businessAssistant.technicianConfig.delete',
...data
},
true
)
}
export default {
getAllServiceList,
getServiceList,
saveService,
updateService
updateService,
getTechnicianList,
addTechnician,
updateTechnician,
deleteTechnician
}
\ No newline at end of file
......@@ -96,7 +96,8 @@
"serviceManage/editService/editService",
"customerManagement/customerList/customerList",
"customerManagement/editCustomer/editCustomer",
"customerManagement/saleList/saleList"
"customerManagement/saleList/saleList",
"customerManagement/technicianList/technicianList"
]
}
],
......
......@@ -9,6 +9,7 @@ Page({
*/
data: {
IMG_URL,
maxNum: 99,
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
selectInfo: {
yqMerchantName: '全部服务中心'
......@@ -37,6 +38,11 @@ Page({
wx.$router.go('packageMine.saleList', target)
},
handleTechnician(e) {
let { target } = e.currentTarget.dataset
wx.$router.go('packageMine.technicianList', target)
},
handleEdit(e) {
let { type } = e.currentTarget.dataset
let params = {
......
......@@ -139,36 +139,34 @@
.avatar-box {
position: relative;
width: 96rpx;
width: 48rpx;
height: 48rpx;
margin-right: 14rpx;
.employee-img {
position: absolute;
top: 0;
left: 0;
.avatar-img {
width: 48rpx;
height: 48rpx;
z-index: 3;
}
.img-2 {
left: 12rpx;
z-index: 2;
}
.img-3 {
left: 24rpx;
z-index: 1;
.num {
position: absolute;
right: -50%;
top: 0;
width: 36rpx;
height: 22rpx;
line-height: 22rpx;
font-size: 20rpx;
color: #FFFFFF;
text-align: center;
background: #F36261;
border-radius: 12rpx;
}
}
.avatar-box-1 {
width: 48rpx;
}
.avatar-box-2 {
width: 72rpx;
.line {
font-size: 26rpx;
color: #8A8C90;
margin: 0 20rpx;
}
.look-btn {
......
......@@ -29,15 +29,20 @@
<glsx-image src="personal/arrow_right.png" class="arrow_right" />
</view>
<view class="employee-box">
<view>
<view class="employee-list">
<!-- 技师 -->
<view class="employee-list">
<glsx-image class="avatar-box" src="personal/staff_defalut_avatar.png" />
<view class="look-btn" data-target="{{item}}" catchtap="handleTechnician">技师</view>
</view>
<view class="line">|</view>
<!-- 销售顾问 -->
<view class="employee-list" wx:if="{{item.employeeNum != '0'}}">
<view class="avatar-box {{item.employeeNum == 1 ? 'avatar-box-1' : ''}} {{item.employeeNum == 2 ? 'avatar-box-2' : ''}}">
<glsx-image class="employee-img" src="personal/staff_defalut_avatar.png" />
<glsx-image wx:if="{{item.employeeNum > 1}}" class="employee-img img-2" src="personal/staff_defalut_avatar.png" />
<glsx-image wx:if="{{item.employeeNum > 2}}" class="employee-img img-3" src="personal/staff_defalut_avatar.png" />
<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 wx:if="{{item.employeeNum > 3}}">+{{item.employeeNum}}</view>
<view class="look-btn" data-target="{{item}}" catchtap="handleSale">查看</view>
<view class="look-btn" data-target="{{item}}" catchtap="handleSale">销售顾问</view>
</view>
<view class="no-employee" wx:else>暂无销售顾问,去邀请</view>
</view>
......
// packageMine/pages/customerManagement/technicianList/technicianList.js
import { IMG_URL } from '~/utils/constantData'
import mineServiceApi from '~/api/mineApi/mineService'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
technicianList: [],
total: -1,
pageCof: {
pageNum: 1,
pageSize: 10
}
},
handleEdit(e) {
let { type } = e.currentTarget.dataset
let params = {
addOrEdit: type,
target: e.currentTarget.dataset?.target || {}
}
delete params.target?.createdDate
// wx.$router.go('packageMine.edittechnician', params)
},
handleSearch() {
this.setData({
['pageCof.pageNum']: 1,
total: -1
})
this.getList(true)
},
scrollonReachBottom() {
this.getList()
},
getList(isReset = false) {
let { technicianList, pageCof, total } = this.data
if (total == technicianList.length) {
return true
}
let params = {
...pageCof
}
mineServiceApi.getTechnicianList(params).then(res => {
let { list, total } = res
this.setData({
technicianList: pageCof.pageNum == 1 ? (list || []) : technicianList.concat(list),
['pageCof.pageNum']: pageCof.pageNum + 1,
triggered: false,
total
})
if (isReset) {
this.setData({
scrollTop: 0
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getList(true)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
/* packageMine/pages/customerManagement/technicianList/technicianList.wxss */
.technician-list-page {
width: 100%;
box-sizing: border-box;
padding: 20rpx;
background-color: #F2F3F7;
.btn_box {
width: 100%;
height: 96rpx;
display: flex;
justify-content: center;
align-items: center;
background-color: #FFFFFF;
border-radius: 16rpx;
color: var(--btnColor);
font-size: 28rpx;
font-weight: 600;
margin-bottom: 32rpx;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
vertical-align: -12rpx
}
}
.title-box {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
.title {
color: #323436;
font-size: 28rpx;
font-weight: 600;
.number {
color: var(--btnColor)
}
}
}
.item-box {
width: 100%;
background: #FFFFFF;
border-radius: 12rpx;
margin-bottom: 20rpx;
.top {
display: flex;
justify-content: space-between;
align-items: center;
padding: 24rpx 32rpx;
.message {
display: flex;
.avatar {
flex-shrink: 0;
width: 72rpx;
height: 72rpx;
margin-right: 12rpx;
}
.message-text {
display: flex;
flex-flow: column;
justify-content: center;
.merchant {
color: #323436;
font-size: 28rpx;
}
.contact {
color: #858A94;
font-size: 26rpx;
}
}
}
.arrow_right {
width: 36rpx;
height: 36rpx;
}
}
.bottom {
padding: 0 32rpx;
height: 72rpx;
background-color: #FFF9F2;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24rpx;
color: #8A8C90;
.technician_name {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
.bottomTips {
text-align: center;
color: #393b3e;
font-size: 26rpx;
height: 60rpx;
line-height: 40rpx;
}
}
\ No newline at end of file
<!--packageMine/pages/customerManagement/technicianList/technicianList.wxml-->
<view class="technician-list-page">
<view class="btn_box" bindtap="handleEdit" data-type="add">
<glsx-image src="index/apply.png" class="icon" />
<text>新增技师</text>
</view>
<view class="content-box" wx:if="{{technicianList.length}}">
<view class="title-box">
<view class="title">技师:<text class="number">{{total < 0 ? 0 : total}}</text>
</view>
</view>
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="handleSearch" bindscrolltolower="scrollonReachBottom" class="list" style="height:calc(100vh - 148rpx - 110rpx);" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}">
<view class="item-box" wx:for="{{technicianList}}" wx:key="index" bindtap="handleEdit" data-type="edit" data-target="{{item}}">
<view class="top">
<view class="message">
<glsx-image src="personal/service_head.png" class="avatar" />
<view class="message-text">
<view class="merchant">{{item.merchantName}}</view>
<view class="contact">{{item.contactName}} {{item.phone}}</view>
</view>
</view>
<glsx-image src="personal/arrow_right.png" class="arrow_right" />
</view>
<view class="bottom">
<view class="technician_name">
商户号:{{item.merchantId}}
</view>
<view class="time">{{item.createdDate}}</view>
</view>
</view>
<view class="bottomTips" wx:if="{{technicianList.length == total}}">到底啦!</view>
</scroll-view>
</view>
<view wx:else>
<nothing-tips tips="暂无技师~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" />
</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!