Commit b72de2ff by zhangxw

联调

1 parent 873b8a25
...@@ -83,5 +83,15 @@ class mineApi { ...@@ -83,5 +83,15 @@ class mineApi {
} }
) )
} }
// 获取当前服务中心下的客户列表
getConnectionListByServiceAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.listByServiceCenterMerchantId',
...data
}
)
}
} }
export default mineApi export default mineApi
...@@ -13,7 +13,7 @@ Component({ ...@@ -13,7 +13,7 @@ Component({
let { connectionList } = this.data let { connectionList } = this.data
if (n?.length) { if (n?.length) {
connectionList.map(val => { connectionList.map(val => {
if (n.findIndex(item => item.connectionCode == val.connectionCode) > -1) val.checked = true if (n.findIndex(item => item.merchantId == val.merchantId) > -1) val.checked = true
return val return val
}) })
} }
...@@ -39,7 +39,7 @@ Component({ ...@@ -39,7 +39,7 @@ Component({
// 不可操作选项 // 不可操作选项
if (item.disabled) return if (item.disabled) return
connectionList.forEach(v => { connectionList.forEach(v => {
if (v.connectionCode == item.connectionCode) v.checked = !v.checked if (v.merchantId == item.merchantId) v.checked = !v.checked
}) })
this.setData({ this.setData({
connectionList connectionList
......
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
padding-bottom: env(safe-area-inset-bottom) !important; padding-bottom: env(safe-area-inset-bottom) !important;
} }
.btn { .btn {
position: fixed; position: sticky;
bottom: 16rpx; bottom: 16rpx;
left: 0; left: 0;
width: calc(100% - 64rpx); width: calc(100% - 64rpx);
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<glsx-image src="login/radio.png" class="radio_class" /> <glsx-image src="login/radio.png" class="radio_class" />
</block> </block>
</view> </view>
<view class="item-text {{item.disabled?'disabled_text':''}}">{{item.serviceName}}</view> <view class="item-text {{item.disabled?'disabled_text':''}}">{{item.merchantName}}</view>
</view> </view>
</block> </block>
</view> </view>
......
...@@ -12,7 +12,6 @@ Component({ ...@@ -12,7 +12,6 @@ Component({
observer: function(n) { observer: function(n) {
if (n) { if (n) {
let { serviceList, selectInfo } = this.data let { serviceList, selectInfo } = this.data
console.log(serviceList)
let activeIndex = serviceList.findIndex(v => v.yqMerchantId == selectInfo?.yqMerchantId) let activeIndex = serviceList.findIndex(v => v.yqMerchantId == selectInfo?.yqMerchantId)
serviceList.forEach((item, ind) => { serviceList.forEach((item, ind) => {
item.show = true item.show = true
......
...@@ -15,9 +15,10 @@ Component({ ...@@ -15,9 +15,10 @@ Component({
if (n) { if (n) {
let { serviceRange, selectInfo } = this.data let { serviceRange, selectInfo } = this.data
let activeIndex = serviceRange.findIndex(v => v.yqMerchantId == selectInfo.yqMerchantId) let activeIndex = serviceRange.findIndex(v => v.yqMerchantId == selectInfo.yqMerchantId)
if (serviceRange.length) serviceRange.unshift({yqMerchantId: '', yqMerchantName: '全部'})
serviceRange.forEach((item, ind) => { serviceRange.forEach((item, ind) => {
item.show = true item.show = true
if (activeIndex == ind) { if (activeIndex == (ind - 1)) {
item.act = true item.act = true
} else { } else {
item.act = false item.act = false
...@@ -47,7 +48,7 @@ Component({ ...@@ -47,7 +48,7 @@ Component({
observers: { observers: {
serviceRange: function (e) { serviceRange: function (e) {
this.setData({ this.setData({
serviceList: e serviceList: e || []
}) })
} }
}, },
...@@ -66,13 +67,13 @@ Component({ ...@@ -66,13 +67,13 @@ Component({
} }
return item.act return item.act
}) })
if (!actObj) { if (!actObj) {
return wx.$api.showToast({ return wx.$api.showToast({
title: '请选择服务中心', title: '请选择服务中心',
icon: 'error' icon: 'error'
}) })
} else { } else {
if (actObj.yqMerchantId == '' && actObj.yqMerchantName == '全部') actObj.yqMerchantName = '全部服务中心'
this.changePicker(actObj) this.changePicker(actObj)
} }
}, },
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import constantData from './constant/data' import constantData from './constant/data'
import { behavior as computedBehavior } from "~/utils/lib/miniprogram-computed" import { behavior as computedBehavior } from "~/utils/lib/miniprogram-computed"
import mineApi from '~/api/mineApi/index' import mineApi from '~/api/mineApi/index'
import Util from '~/utils/util'
Page({ Page({
behaviors: [computedBehavior], behaviors: [computedBehavior],
...@@ -13,18 +14,23 @@ Page({ ...@@ -13,18 +14,23 @@ Page({
serviceList: [], serviceList: [],
formItems: constantData.formItems, formItems: constantData.formItems,
formData: { formData: {
selectedConnectionList: [], selectedConnectionIds: [],
connectionValue: '全部' connectionValue: '全部',
visualType: 0
}, },
showServiceConfirm: false showServiceConfirm: false
}, },
watch: { watch: {
'formData.selectInfo.yqMerchantId': function (e) { 'formData.selectInfo.yqMerchantId': function (e) {
// 获取当前服务中心下的客户列表
this.getConnectionList(e)
let { optionsInfo } = this.data
if (e == optionsInfo?.merchantNo) return
// 将可见客户置为全部 // 将可见客户置为全部
this.setData({ this.setData({
'formData.connectionValue': '全部', 'formData.connectionValue': '全部',
'formData.selectedConnectionList': [] 'formData.selectedConnectionIds': []
}) })
} }
}, },
...@@ -40,9 +46,20 @@ Page({ ...@@ -40,9 +46,20 @@ Page({
onRoute(options) { onRoute(options) {
// 选择可见客户回退 // 选择可见客户回退
if (!options.info) return if (!options.info) return
let optionsInfo = options?.info || {}
let data = options?.info ? {
...options?.info,
selectInfo: {yqMerchantId: optionsInfo.merchantNo, yqMerhcantName: optionsInfo.merchantName},
serviceValue: optionsInfo.merchantName,
visualType: optionsInfo.visualType || 0,
connectionValue: optionsInfo.visualType == 1 ? `已选${optionsInfo.visibleMerchantNo?.split(',')?.length}位客户`: '全部',
selectedConnectionIds: optionsInfo.visibleMerchantNo?.split(',')
} : {}
this.setData({ this.setData({
addOrEdit: options?.info ? 'edit' : 'add', addOrEdit: options?.info ? 'edit' : 'add',
formData: options?.info 'formItems[0].disabled': options?.info ? true : false,
formData: data,
optionsInfo: Util.deepClone(optionsInfo)
}) })
}, },
...@@ -67,6 +84,21 @@ Page({ ...@@ -67,6 +84,21 @@ Page({
}) })
}, },
// 获取服务中心下的客户列表
getConnectionList(e) {
mineApi.getConnectionListByServiceAPI({
serviceCenterMerchantId: e
}).then(res => {
// 全部客户
let { allConnectionIds, copyFormData } = this.data
allConnectionIds = res?.map(val => {return val.merchantId})
this.setData({
allConnectionIds
})
})
},
getSelectList() { getSelectList() {
// 获取服务中心 // 获取服务中心
mineApi.getServiceCenterListAPI({}).then(res => { mineApi.getServiceCenterListAPI({}).then(res => {
...@@ -75,8 +107,6 @@ Page({ ...@@ -75,8 +107,6 @@ Page({
serviceList: data serviceList: data
}) })
}) })
// 获取全部客户
}, },
back() { back() {
...@@ -91,7 +121,8 @@ Page({ ...@@ -91,7 +121,8 @@ Page({
// 选择服务中心/客户 // 选择服务中心/客户
jump(e) { jump(e) {
let { formData } = this.data let { formData } = this.data
let { type } = e.currentTarget.dataset let { type, disabled } = e.currentTarget.dataset
if (disabled) return
switch(type) { switch(type) {
// 选择服务中心 // 选择服务中心
case 1: case 1:
...@@ -124,7 +155,7 @@ Page({ ...@@ -124,7 +155,7 @@ Page({
// 提交 // 提交
handleConfirm() { handleConfirm() {
let { addOrEdit, formData } = this.data let { addOrEdit, formData, allConnectionIds } = this.data
let validObj = wx.$util.checkRule(formData, constantData.formRule) let validObj = wx.$util.checkRule(formData, constantData.formRule)
if (validObj) { if (validObj) {
wx.$api.showToast(validObj.message) wx.$api.showToast(validObj.message)
...@@ -132,11 +163,12 @@ Page({ ...@@ -132,11 +163,12 @@ Page({
} }
let params = { let params = {
merchantNo: formData?.selectInfo?.yqMerchantId, merchantNo: formData?.selectInfo?.yqMerchantId,
staffUuid: '', staffUuid: formData?.staffUuid,
staffName: formData?.staffName, staffName: formData?.staffName,
staffPhone: formData?.staffPhone, staffPhone: formData?.staffPhone,
createdSource: 3, // 创建来源 固定3 生意助手 createdSource: 3, // 创建来源 固定3 生意助手
visibleMerchantNoList: [] visualType: formData?.visualType,
visibleMerchantNoList: formData?.visualType == 0 ? allConnectionIds : formData?.selectedConnectionIds
} }
let message = addOrEdit == 'add' ? '是否确定创建员工?' : '是否确定修改员工信息?' let message = addOrEdit == 'add' ? '是否确定创建员工?' : '是否确定修改员工信息?'
wx.showModal({ wx.showModal({
...@@ -151,7 +183,7 @@ Page({ ...@@ -151,7 +183,7 @@ Page({
let requestEvent = addOrEdit == 'add' ? 'createStaffAPI' : 'updateStaffAPI' let requestEvent = addOrEdit == 'add' ? 'createStaffAPI' : 'updateStaffAPI'
mineApi[requestEvent](params).then(res => { mineApi[requestEvent](params).then(res => {
if (addOrEdit == 'add') { if (addOrEdit == 'add') {
wx.$router.redirectTo('packageMine.successPage') wx.$router.redirectTo('packageMine.successPage?page=staff')
} else { } else {
wx.$router.back() wx.$router.back()
} }
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
value="{{formData[item.props]}}" value="{{formData[item.props]}}"
placeholder-class="input-placeholder" /> placeholder-class="input-placeholder" />
</view> </view>
<view class="select-box" wx:if="{{item.type == 'select'}}" bindtap="jump" data-type="{{item.pageType}}"> <view class="select-box" wx:if="{{item.type == 'select'}}" bindtap="jump" data-type="{{item.pageType}}" data-disabled="{{item.disabled}}">
<view class="name" wx:if="{{formData[item.valueFn]}}">{{formData[item.valueFn]}}</view> <view class="name" wx:if="{{formData[item.valueFn]}}">{{formData[item.valueFn]}}</view>
<view class="placeholder-text" wx:else>{{item.placeholder}}</view> <view class="placeholder-text" wx:else>{{item.placeholder}}</view>
<glsx-image src="personal/arrow_right.png" class="arrow_right" /> <glsx-image src="personal/arrow_right.png" wx:if="{{!item.disabled}}" class="arrow_right" />
</view> </view>
</block> </block>
</view> </view>
......
var formatMobile = function (item) { var formatMobile = function (item) {
return item.substring(0,3)+" " + item.substring(3,7) +" "+item.substring(7) return item ? item.substring(0,3)+" " + item.substring(3,7) +" "+item.substring(7) : ' '
} }
module.exports = { module.exports = {
......
// packagesList/mineDetail/pages/staffManage/selectConnectionPage/selectConnectionPage.js // packagesList/mineDetail/pages/staffManage/selectConnectionPage/selectConnectionPage.js
import mineApi from '~/api/mineApi/index'
Page({ Page({
/** /**
...@@ -6,119 +7,8 @@ Page({ ...@@ -6,119 +7,8 @@ Page({
*/ */
data: { data: {
showConnectionConfirm: false, showConnectionConfirm: false,
connectionList: [{ connectionList: [],
connectionCode: 1, selectTypeList: [{
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加1号服务中心',
time: '2022.10.03',
checked: true,
disabled: true
}, {
connectionCode: 2,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加2号服务',
time: '2022.10.03'
}, {
connectionCode: 3,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加3号服务',
time: '2022.10.03'
}, {
connectionCode: 4,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加4号服务中心',
time: '2022.10.03'
}, {
connectionCode: 5,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加5号服务中心',
time: '2022.10.03'
}, {
connectionCode: 6,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心',
time: '2022.10.03'
}, {
connectionCode: 7,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心',
time: '2022.10.03'
}, {
connectionCode: 8,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心',
time: '2022.10.03'
}, {
connectionCode: 9,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心',
time: '2022.10.03'
}, {
connectionCode: 10,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心',
time: '2022.10.03'
}, {
connectionCode: 11,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心',
time: '2022.10.03'
}, {
connectionCode: 12,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心',
time: '2022.10.03'
}, {
connectionCode: 13,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '123456',
time: '2022.10.03',
disabled: true
}, {
connectionCode: 14,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心',
time: '2022.10.03'
}, {
connectionCode: 15,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心',
time: '2022.10.03'
}, {
connectionCode: 16,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心',
time: '2022.10.03'
}, {
connectionCode: 17,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心',
time: '2022.10.03'
}, {
connectionCode: 18,
staffName: '马保国',
staffMobile: '13645674567',
serviceName: '789',
time: '2022.10.03'
}],
selectType: [{
label: '全部', label: '全部',
tips: '所有客户可见', tips: '所有客户可见',
type: 0, type: 0,
...@@ -139,20 +29,20 @@ Page({ ...@@ -139,20 +29,20 @@ Page({
}, },
onRoute(options) { onRoute(options) {
let { selectType } = this.data let { selectTypeList } = this.data
selectType.map(v => { selectTypeList.map(v => {
// 未指定可见客户 // 未指定可见客户
if (options?.selectedConnectionList.length == 0 && v.type == 0) { if (options?.visualType == v.type) {
v.active = true v.active = true
} else if (options?.selectedConnectionList.length > 0 && v.type == 1) { if (v.type == 1) this.setData({
v.active = true
this.setData({
showConnectionList: true showConnectionList: true
}) })
} }
return v return v
}) })
this.setData({selectType, selectedConnectionList: options?.selectedConnectionList || []}) this.setData({selectTypeList})
// 获取服务中心下的客户数据
this.getConnectionList(options)
}, },
/** /**
...@@ -176,10 +66,21 @@ Page({ ...@@ -176,10 +66,21 @@ Page({
}) })
}, },
getConnectionList(options) {
mineApi.getConnectionListByServiceAPI({
serviceCenterMerchantId: options?.selectInfo?.yqMerchantId
}).then(res => {
this.setData({
connectionList: res || [],
selectedConnectionList: res?.filter(val => { return options?.selectedConnectionIds.length && options.selectedConnectionIds.includes(val.merchantId + '') }) || []
})
})
},
changeType(e) { changeType(e) {
let { type } = e.currentTarget.dataset let { type } = e.currentTarget.dataset
let { selectType, showConnectionList } = this.data let { selectTypeList, showConnectionList } = this.data
selectType.forEach((v, ind) => { selectTypeList.forEach((v, ind) => {
if (type == v.type && v.active) return showConnectionList = !showConnectionList if (type == v.type && v.active) return showConnectionList = !showConnectionList
if (type == v.type && !v.active) { if (type == v.type && !v.active) {
v.active = true v.active = true
...@@ -189,7 +90,7 @@ Page({ ...@@ -189,7 +90,7 @@ Page({
else v.active = false else v.active = false
}) })
this.setData({ this.setData({
selectType, selectTypeList,
showConnectionList showConnectionList
}) })
}, },
...@@ -213,8 +114,8 @@ Page({ ...@@ -213,8 +114,8 @@ Page({
// 确定 // 确定
handleConfirm() { handleConfirm() {
let { selectType, selectedConnectionList } = this.data let { selectTypeList, selectedConnectionList } = this.data
let arr = selectType.filter(v => v.active) || [] let arr = selectTypeList.filter(v => v.active) || []
if (!arr.length || (arr.find(v => v.active && v.type == 1) && !selectedConnectionList?.length)) return wx.showToast({ if (!arr.length || (arr.find(v => v.active && v.type == 1) && !selectedConnectionList?.length)) return wx.showToast({
title: '请选择可见客户', title: '请选择可见客户',
icon: 'none', icon: 'none',
...@@ -223,8 +124,9 @@ Page({ ...@@ -223,8 +124,9 @@ Page({
const currentPages = getCurrentPages() const currentPages = getCurrentPages()
let prevPage = currentPages[currentPages.length - 2] let prevPage = currentPages[currentPages.length - 2]
prevPage.setData({ prevPage.setData({
'formData.connectionValue': arr.find(v => v.active && v.type == 0) ? '全部' : `已选择${selectedConnectionList?.length}位客户`, 'formData.connectionValue': arr.find(v => v.active)?.type == 0 ? '全部' : `已选择${selectedConnectionList?.length}位客户`,
'formData.selectedConnectionList': arr.find(v => v.active && v.type == 0) ? [] : selectedConnectionList 'formData.selectedConnectionIds': selectedConnectionList.map(val => { return val.merchantId }),
'formData.visualType': arr.find(v => v.active)?.type || 0
}) })
this.back() this.back()
}, },
......
...@@ -58,8 +58,8 @@ ...@@ -58,8 +58,8 @@
padding-bottom: 28rpx; padding-bottom: 28rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
flex-flow: wrap; flex-flow: wrap;
gap: 12rpx;
.item{ .item{
height: 54rpx; height: 54rpx;
line-height: 54rpx; line-height: 54rpx;
...@@ -68,7 +68,6 @@ ...@@ -68,7 +68,6 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
margin-bottom: 12rpx;
padding: 0 20rpx; padding: 0 20rpx;
} }
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
</navigation-bar> </navigation-bar>
<view class="select-connection-page" style="padding-top:{{tabBarStyle}}px;"> <view class="select-connection-page" style="padding-top:{{tabBarStyle}}px;">
<view class="select-content"> <view class="select-content">
<view class="flex_class" wx:for="{{selectType}}" wx:key="index" bindtap="changeType" data-type="{{item.type}}"> <view class="flex_class" wx:for="{{selectTypeList}}" wx:key="index" bindtap="changeType" data-type="{{item.type}}">
<view class="checked_class"> <view class="checked_class">
<view hidden="{{!item.active}}"> <view hidden="{{!item.active}}">
<glsx-image src="personal/checked.png" class="checked_class" /> <glsx-image src="personal/checked.png" class="checked_class" />
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<view class="connection_box" hidden="{{!showConnectionList}}"> <view class="connection_box" hidden="{{!showConnectionList}}">
<view class="select_btn" bindtap="showConfirm">请选择指定客户</view> <view class="select_btn" bindtap="showConfirm">请选择指定客户</view>
<view class="list-items" wx:if="{{selectedConnectionList.length}}"> <view class="list-items" wx:if="{{selectedConnectionList.length}}">
<view class="item" wx:for="{{selectedConnectionList}}" wx:key="index">{{item.serviceName}}</view> <view class="item" wx:for="{{selectedConnectionList}}" wx:key="index">{{item.merchantName}}</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -12,25 +12,17 @@ Page({ ...@@ -12,25 +12,17 @@ Page({
popupShow: false, popupShow: false,
staffList: [], staffList: [],
selectInfo: {yqMerchantName: '全部服务中心'}, selectInfo: {yqMerchantName: '全部服务中心'},
total: 15, total: 0,
serviceList: [], serviceList: [],
currentPage: 1, currentPage: 1,
allServiceIds: [] allServiceIds: [],
nothing: false,
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
// 获取服务中心数据
mineApi.getServiceCenterListAPI({}).then(res => {
let data = res || []
let serviceIds = data.map(val => {return val.yqMerchantId})
this.setData({
serviceList: res || [],
allServiceIds: serviceIds
})
})
}, },
/** /**
...@@ -44,23 +36,39 @@ Page({ ...@@ -44,23 +36,39 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
// 获取员工列表 // 获取服务中心数据
this.getList(true) mineApi.getServiceCenterListAPI({}).then(res => {
let data = res || []
let serviceIds = data.map(val => {return val.yqMerchantId})
this.setData({
serviceList: res || [],
allServiceIds: serviceIds,
currentPage: 1,
nothing: false,
total: 0
})
// 获取员工列表
this.getList(true)
})
}, },
getList(isReset = false) { getList(isReset = false) {
let { currentPage, selectInfo, allServiceIds } = this.data let { currentPage, selectInfo, allServiceIds, nothing } = this.data
let params = { let params = {
pageSize: 10, pageSize: 10,
pageNum: currentPage, pageNum: currentPage,
merchantNoList: selectInfo?.yqMerchantId ? [selectInfo?.yqMerchantId] : allServiceIds merchantNoList: selectInfo?.yqMerchantId ? [selectInfo?.yqMerchantId] : allServiceIds
} }
if (nothing) {
return
}
mineApi.getStaffListAPI(params).then(res => { mineApi.getStaffListAPI(params).then(res => {
let tempList = isReset ? res || [] : this.data.staffList.concat(res || []) let tempList = isReset ? res?.data || [] : this.data.staffList.concat(res?.data || [])
this.setData({ this.setData({
staffList: tempList, staffList: tempList,
currentPage: currentPage + 1, currentPage: currentPage + 1,
total, total: res.count,
nothing: res.count == tempList.length,
triggered: false triggered: false
}) })
if (isReset) { if (isReset) {
...@@ -77,7 +85,9 @@ Page({ ...@@ -77,7 +85,9 @@ Page({
search() { search() {
this.setData({ this.setData({
currentPage: 1 currentPage: 1,
nothing: false,
total: 0
}) })
this.getList(true) this.getList(true)
}, },
...@@ -93,8 +103,11 @@ Page({ ...@@ -93,8 +103,11 @@ Page({
getStaffList(e) { getStaffList(e) {
wx.$api.hideLoading() wx.$api.hideLoading()
this.setData({ this.setData({
selectInfo: e.detail selectInfo: e.detail,
nothing: false,
currentPage: 1
}) })
this.getList(true)
}, },
// 创建/编辑员工 // 创建/编辑员工
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<scroll-view scroll-y <scroll-view scroll-y
enable-back-to-top enable-back-to-top
refresher-enabled="{{true}}" refresher-enabled="{{true}}"
bindrefresherrefresh="getList" bindrefresherrefresh="search"
bindscrolltolower="onBottomRefresh" bindscrolltolower="onBottomRefresh"
class="list" class="list"
style="height:calc(100vh - 148rpx - 110rpx);" style="height:calc(100vh - 148rpx - 110rpx);"
...@@ -31,19 +31,19 @@ ...@@ -31,19 +31,19 @@
<image wx:else src="{{item.avatarUrl}}" class="avatar"></image> <image wx:else src="{{item.avatarUrl}}" class="avatar"></image>
<view class="message-text"> <view class="message-text">
<view class="name">{{item.staffName}}</view> <view class="name">{{item.staffName}}</view>
<view class="mobile">{{format.formatMobile(item.staffMobile)}}</view> <view class="mobile">{{format.formatMobile(item.staffPhone)}}</view>
</view> </view>
</view> </view>
<glsx-image src="personal/arrow_right.png" class="arrow_right" /> <glsx-image src="personal/arrow_right.png" class="arrow_right" />
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="service_name"> <view class="service_name">
所属:{{item.serviceName}} 所属:{{item.merchantName}}
</view> </view>
<view class="time">{{item.time}}</view> <view class="time">{{item.createdDate}}</view>
</view> </view>
</view> </view>
<view class="bottomTips" wx:if="{{staffList.length>10}}">到底啦!</view> <view class="bottomTips" wx:if="{{nothing}}">到底啦!</view>
</scroll-view> </scroll-view>
</view> </view>
......
...@@ -11,6 +11,12 @@ const obj = { ...@@ -11,6 +11,12 @@ const obj = {
primaryBtn: '邀请销售顾问', primaryBtn: '邀请销售顾问',
primaryCallback: 'packageMine.editService', primaryCallback: 'packageMine.editService',
cancelBtn: 'S后自动跳转我的客户' cancelBtn: 'S后自动跳转我的客户'
},
staff: {
navigationTitle: '创建员工',
primaryBtn: '继续创建员工',
primaryCallback: 'packageMine.createStaff',
cancelBtn: 'S后自动跳转我的员工'
} }
} }
Page({ Page({
...@@ -19,12 +25,7 @@ Page({ ...@@ -19,12 +25,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
paramsObj: { paramsObj: {},
navigationTitle: '创建员工',
primaryBtn: '继续创建员工',
primaryCallback: 'packageMine.createStaff',
cancelBtn: 'S后自动跳转我的员工'
},
count: 5 count: 5
}, },
...@@ -35,6 +36,7 @@ Page({ ...@@ -35,6 +36,7 @@ Page({
// this.setData({ // this.setData({
// paramsObj: options // paramsObj: options
// }) // })
console.log(options)
if(options) { if(options) {
let { page } = options let { page } = options
this.setData({ this.setData({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!