Commit 1e773bfe by chenwq

bug修复

1 parent 9df04358
...@@ -65,6 +65,10 @@ Page({ ...@@ -65,6 +65,10 @@ Page({
this.getList(true) this.getList(true)
}, },
scrollonReachBottom() {
this.getList()
},
getList(isReset = false) { getList(isReset = false) {
let { customerList, pageCof, total, selectInfo } = this.data let { customerList, pageCof, total, selectInfo } = this.data
if (total == customerList.length) { if (total == customerList.length) {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</view> </view>
</view> </view>
</view> </view>
<scroll-view wx:if="{{customerList.length}}" scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="onRefreshBottom" bindscrolltolower="getList" class="list" style="height:calc(100vh - 148rpx - 110rpx);" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}"> <scroll-view wx:if="{{customerList.length}}" scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="onRefreshBottom" 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="{{customerList}}" wx:key="index" bindtap="handleEdit" data-type="edit" data-target="{{item}}"> <view class="item-box" wx:for="{{customerList}}" wx:key="index" bindtap="handleEdit" data-type="edit" data-target="{{item}}">
<view class="top"> <view class="top">
<view class="message"> <view class="message">
......
...@@ -142,7 +142,8 @@ Page({ ...@@ -142,7 +142,8 @@ Page({
addOrEdit, addOrEdit,
formData: { formData: {
...target, ...target,
oldPhone: target?.phone oldPhone: target?.phone,
oldMerchantName: target.merchantName || ''
} }
}) })
if (addOrEdit == 'edit') { if (addOrEdit == 'edit') {
......
...@@ -88,7 +88,7 @@ Page({ ...@@ -88,7 +88,7 @@ Page({
sceneStr = sceneStr + (sceneStr ? (',' + sceneToNum[item]) : sceneToNum[item]) sceneStr = sceneStr + (sceneStr ? (',' + sceneToNum[item]) : sceneToNum[item])
}) })
let params = { let params = {
merchantId: customerInfo.serviceCenterMerchantId, merchantId: customerInfo.merchantId,
staffLabel: sceneStr staffLabel: sceneStr
} }
mineCustomerApi.getInviteCode(params).then(res => { mineCustomerApi.getInviteCode(params).then(res => {
......
...@@ -81,17 +81,33 @@ Page({ ...@@ -81,17 +81,33 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
let { formItems } = this.data let { formItems } = this.data
wx.$router.getData(res => { wx.$router.getData(res => {
console.log(res)
let { addOrEdit, target } = res let { addOrEdit, target } = res
this.setData({ this.setData({
addOrEdit, addOrEdit: addOrEdit || 'add',
formData: { formData: {
...target, ...target,
oldPhone: target.phone || '' oldPhone: target.phone || '',
oldMerchantName: target.merchantName || ''
} }
}) })
if (addOrEdit == 'add') { if (this.data.addOrEdit == 'add') {
formItems.shift() formItems.shift()
this.setData({ this.setData({
formItems formItems
...@@ -103,20 +119,6 @@ Page({ ...@@ -103,20 +119,6 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {
......
...@@ -35,6 +35,10 @@ Page({ ...@@ -35,6 +35,10 @@ Page({
this.getList(true) this.getList(true)
}, },
scrollonReachBottom() {
this.getList()
},
getList(isReset = false) { getList(isReset = false) {
let { serviceList, pageCof, total } = this.data let { serviceList, pageCof, total } = this.data
if (total == serviceList.length) { if (total == serviceList.length) {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<view class="title-box"> <view class="title-box">
<view class="title">服务中心数量:<text class="number">{{total < 0 ? 0 : total}}</text></view> <view class="title">服务中心数量:<text class="number">{{total < 0 ? 0 : total}}</text></view>
</view> </view>
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="handleSearch" bindscrolltolower="getList" class="list" style="height:calc(100vh - 148rpx - 110rpx);" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}"> <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="{{serviceList}}" wx:key="index" bindtap="handleEdit" data-type="edit" data-target="{{item}}"> <view class="item-box" wx:for="{{serviceList}}" wx:key="index" bindtap="handleEdit" data-type="edit" data-target="{{item}}">
<view class="top"> <view class="top">
<view class="message"> <view class="message">
......
...@@ -34,16 +34,15 @@ Page({ ...@@ -34,16 +34,15 @@ Page({
}, { }, {
name: '服务中心管理', name: '服务中心管理',
path: 'packageMine.serviceList', path: 'packageMine.serviceList',
hasRedPot: true, isHide: true
isRead: false
}, { }, {
name: '员工管理', name: '员工管理',
path: 'packageMine.staffList', path: 'packageMine.staffList',
hasRedPot: true, isHide: true
isRead: false
}, { }, {
name: '客户管理', name: '客户管理',
path: 'packageMine.customerList' path: 'packageMine.customerList',
isHide: true
}], }],
isShowService: false, isShowService: false,
}, },
...@@ -145,6 +144,19 @@ Page({ ...@@ -145,6 +144,19 @@ Page({
}) })
}, },
judgeIsHide() {
let { boxItemList, userInfo } = this.data
let nameList = ['服务中心管理', '员工管理', '客户管理']
if(!userInfo.isSuper) {
nameList.forEach(item => {
let idx = boxItemList.findIndex(k => k.name == item)
this.setData({
[`boxItemList[${idx}].isHide`]: false
})
})
}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -162,6 +174,7 @@ Page({ ...@@ -162,6 +174,7 @@ Page({
this.setData({ this.setData({
isShowService: serviceMerchatList.includes(userInfo.merchantId + '') isShowService: serviceMerchatList.includes(userInfo.merchantId + '')
}) })
this.judgeIsHide()
console.log(serviceMerchantId) console.log(serviceMerchantId)
}, },
/** /**
......
...@@ -15,11 +15,13 @@ ...@@ -15,11 +15,13 @@
<view class="utilBoxTitle">常用工具</view> <view class="utilBoxTitle">常用工具</view>
<view class="boxItemCon"> <view class="boxItemCon">
<view wx:for="{{boxItemList}}" wx:key="index" class="item" data-path="{{item.path}}" data-item="{{item}}" bind:tap="navGO"> <view wx:for="{{boxItemList}}" wx:key="index" class="item" data-path="{{item.path}}" data-item="{{item}}" bind:tap="navGO">
<block wx:if="{{!item.isHide}}">
<view class="imgcon"> <view class="imgcon">
<view wx:if="{{item.hasRedPot}}" class="redPot" hidden="{{!item.isRead}}" /> <view wx:if="{{item.hasRedPot}}" class="redPot" hidden="{{!item.isRead}}" />
<glsx-image class="img" src="{{IMAGES['icon' + index]}}" /> <glsx-image class="img" src="{{IMAGES['icon' + index]}}" />
</view> </view>
<view class="name">{{item.name}}</view> <view class="name">{{item.name}}</view>
</block>
</view> </view>
<!-- <view class="item" data-path="packagesList.customerManagement" bind:tap="navGO"> <!-- <view class="item" data-path="packagesList.customerManagement" bind:tap="navGO">
<view class="imgcon"> <view class="imgcon">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!