Commit 514e301f by zhangxw

修改

1 parent d9cb5738
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
refresher-threshold="104" refresher-threshold="104"
scroll-top="{{scrollTop}}" scroll-top="{{scrollTop}}"
class="list" class="list"
style="height:100%;" style="height:calc(100vh - 108rpx - {{tabBarStyle}}px)"
data-type="message" data-type="message"
refresher-triggered="{{triggered}}"> refresher-triggered="{{triggered}}">
<block wx:for="{{serviceList}}" wx:key="index"> <block wx:for="{{serviceList}}" wx:key="index">
......
...@@ -4,12 +4,11 @@ Component({ ...@@ -4,12 +4,11 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
selectInfo: { staffTypeSelectInfo: {
type: Object, type: Object,
observer: function(n) { observer: function(n) {
this.setData({ console.log(n)
copySelectInfo: n this.setData({copyStaffTypeSelectInfo: n})
})
} }
}, },
popShow: { popShow: {
...@@ -48,7 +47,7 @@ Component({ ...@@ -48,7 +47,7 @@ Component({
staffBusinessTypeStr: '技师' staffBusinessTypeStr: '技师'
} }
], ],
copySelectInfo: {} copyStaffTypeSelectInfo: {}
}, },
/** /**
...@@ -61,12 +60,12 @@ Component({ ...@@ -61,12 +60,12 @@ Component({
select(e) { select(e) {
let { target } = e.currentTarget.dataset let { target } = e.currentTarget.dataset
this.setData({ this.setData({
copySelectInfo: target copyStaffTypeSelectInfo: target
}) })
}, },
confirm() { confirm() {
let { copySelectInfo } = this.data let { copyStaffTypeSelectInfo } = this.data
this.triggerEvent('confirm', copySelectInfo) this.triggerEvent('confirm', copyStaffTypeSelectInfo)
this.hidePopup() this.hidePopup()
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
height="500rpx"> height="500rpx">
<block wx:for="{{staffTypeList}}" wx:key="index"> <block wx:for="{{staffTypeList}}" wx:key="index">
<view <view
class="itemCon text-hide {{item.staffBusinessType == copySelectInfo.staffBusinessType?'active':''}}" class="itemCon text-hide {{item.staffBusinessType == copyStaffTypeSelectInfo.staffBusinessType?'active':''}}"
data-target="{{item}}" data-target="{{item}}"
bindtap="select"> bindtap="select">
{{item.staffBusinessTypeStr}} {{item.staffBusinessTypeStr}}
......
const phoneRex = /^[1]([3-9])[0-9]{9}$/ const phoneRex = /^[1]([3-9])[0-9]{9}$/
const formRule = { const formRule = {
selectInfo: [{ required: true, message: '所属服务中心不能为空' }], selectInfo: [{ required: true, message: '所属服务中心不能为空' }],
staffBusinessType: [{ required: true, message: '员工类型不能为空' }], staffTypeSelectInfo: [{ required: true, message: '员工类型不能为空' }],
staffName: [{ required: true, message: '员工姓名不能为空' }], staffName: [{ required: true, message: '员工姓名不能为空' }],
staffPhone: [ staffPhone: [
{ required: true, message: '手机号码不能为空' }, { required: true, message: '手机号码不能为空' },
...@@ -22,7 +22,7 @@ const formItems = [{ ...@@ -22,7 +22,7 @@ const formItems = [{
pageType: 1 pageType: 1
}, { }, {
label: '员工类型', label: '员工类型',
props: 'staffBusinessType', props: 'staffTypeSelectInfo',
valueFn: 'staffBusinessTypeStr', valueFn: 'staffBusinessTypeStr',
type: 'select', type: 'select',
placeholder: '请选择员工类型', placeholder: '请选择员工类型',
......
...@@ -17,7 +17,13 @@ Page({ ...@@ -17,7 +17,13 @@ Page({
formData: { formData: {
selectedConnectionIds: [], selectedConnectionIds: [],
connectionValue: '全部', connectionValue: '全部',
visualType: 0 // 0:全部 1:选中部分可见客户 visualType: 0, // 0:全部 1:选中部分可见客户
staffBusinessType: '0',
staffBusinessTypeStr: '驻店',
staffTypeSelectInfo: {
staffBusinessType: '0',
staffBusinessTypeStr: '驻店',
}
}, },
showServiceConfirm: false, showServiceConfirm: false,
isConfirm: false, isConfirm: false,
...@@ -52,12 +58,13 @@ Page({ ...@@ -52,12 +58,13 @@ Page({
let optionsInfo = options?.info || {} let optionsInfo = options?.info || {}
let data = options?.info ? { let data = options?.info ? {
...options?.info, ...options?.info,
selectInfo: {yqMerchantId: optionsInfo.merchantNo, yqMerchantName: optionsInfo.merchantName, staffBusinessType: optionsInfo?.staffBusinessType}, selectInfo: {yqMerchantId: optionsInfo.merchantNo, yqMerchantName: optionsInfo.merchantName},
serviceValue: optionsInfo.merchantName, serviceValue: optionsInfo.merchantName,
visualType: optionsInfo.visualType || 0, visualType: optionsInfo.visualType || 0,
connectionValue: optionsInfo.visualType == 1 ? `已选${optionsInfo.visibleMerchantNo?.split(',')?.length}位客户`: '全部', connectionValue: optionsInfo.visualType == 1 ? `已选${optionsInfo.visibleMerchantNo?.split(',')?.length}位客户`: '全部',
selectedConnectionIds: optionsInfo.visualType == 1 ? optionsInfo.visibleMerchantNo?.split(',').map((v) => {return v && Number(v)}) : [], selectedConnectionIds: optionsInfo.visualType == 1 ? optionsInfo.visibleMerchantNo?.split(',').map((v) => {return v && Number(v)}) : [],
staffBusinessTypeStr: optionsInfo.staffBusinessType == 0 ? '驻店' : optionsInfo.staffBusinessType == 1 ? '技师' : '' staffBusinessTypeStr: optionsInfo.staffBusinessType == 0 ? '驻店' : optionsInfo.staffBusinessType == 1 ? '技师' : '',
staffTypeSelectInfo: optionsInfo?.staffBusinessType ? {staffBusinessType: optionsInfo?.staffBusinessType} : undefined
} : {} } : {}
this.setData({ this.setData({
addOrEdit: options?.info ? 'edit' : 'add', addOrEdit: options?.info ? 'edit' : 'add',
...@@ -153,10 +160,8 @@ Page({ ...@@ -153,10 +160,8 @@ Page({
let obj = { let obj = {
...formData, ...formData,
...e.detail, ...e.detail,
selectInfo: { selectInfo: formData.selectInfo,
...formData.selectInfo, staffTypeSelectInfo: e.detail
...e.detail
}
} }
this.setData({ this.setData({
formData: obj formData: obj
......
...@@ -30,4 +30,4 @@ ...@@ -30,4 +30,4 @@
</view> </view>
</view> </view>
<select-service-confirm show="{{showServiceConfirm}}" tabBarStyle="{{tabBarStyle}}" serviceList="{{serviceList}}" selectInfo="{{formData.selectInfo}}" bind:hiddenSelectConfirm="hiddenSelectConfirm"></select-service-confirm> <select-service-confirm show="{{showServiceConfirm}}" tabBarStyle="{{tabBarStyle}}" serviceList="{{serviceList}}" selectInfo="{{formData.selectInfo}}" bind:hiddenSelectConfirm="hiddenSelectConfirm"></select-service-confirm>
<staff-type-popup wx:if="{{staffPopupShow}}" bind:hidePopup="handleStaffTypeChange" selectInfo="{{formData.selectInfo}}" bindconfirm="staffTypeConfiem" popShow="{{staffPopupShow}}" notAll="{{true}}"/> <staff-type-popup wx:if="{{staffPopupShow}}" bind:hidePopup="handleStaffTypeChange" selectInfo="{{formData.selectInfo}}" staffTypeSelectInfo="{{formData.staffTypeSelectInfo}}" bindconfirm="staffTypeConfiem" popShow="{{staffPopupShow}}" notAll="{{true}}"/>
...@@ -62,7 +62,7 @@ Page({ ...@@ -62,7 +62,7 @@ Page({
pageSize: 10, pageSize: 10,
pageNum: currentPage, pageNum: currentPage,
merchantNoList: selectInfo?.yqMerchantId ? [selectInfo?.yqMerchantId] : allServiceIds, merchantNoList: selectInfo?.yqMerchantId ? [selectInfo?.yqMerchantId] : allServiceIds,
staffType: selectInfo.staffBusinessType staffBusinessType: selectInfo.staffBusinessType
} }
if (nothing || isAsk) { if (nothing || isAsk) {
return return
...@@ -71,12 +71,12 @@ Page({ ...@@ -71,12 +71,12 @@ Page({
isAsk: true isAsk: true
}) })
mineApi.getStaffListAPI(params).then(res => { mineApi.getStaffListAPI(params).then(res => {
let tempList = isReset ? res?.list || [] : this.data.staffList.concat(res?.list || []) 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: res.total, total: res.count,
nothing: res.total == tempList.length, nothing: res.count == tempList.length,
triggered: false triggered: false
}) })
if (isReset) { if (isReset) {
......
...@@ -22,13 +22,11 @@ Component({ ...@@ -22,13 +22,11 @@ Component({
} else { } else {
item.act = false item.act = false
} }
this.setData({
merchantRange,
selectedMerchantId: selectInfo.partnerMerchantIds[0]
})
}) })
this.setData({ this.setData({
searchKeyword: '' searchKeyword: '',
merchantRange,
selectedMerchantId: selectInfo.partnerMerchantIds[0] || ''
}) })
} }
} }
...@@ -96,8 +94,14 @@ Component({ ...@@ -96,8 +94,14 @@ Component({
}) })
}, },
input(e) { input(e) {
let { merchantRange, selectedMerchantId } = this.data
let { value } = e.detail let { value } = e.detail
this.setData({
searchKeyword: value
})
},
search(e) {
let { merchantRange, selectedMerchantId } = this.data
let { value } = e.currentTarget.dataset && Object.keys(e.currentTarget.dataset).length ? e.currentTarget.dataset : e.detail
merchantRange.forEach(item => { merchantRange.forEach(item => {
item.act = false item.act = false
item.show = item.merchantName.includes(value) item.show = item.merchantName.includes(value)
......
...@@ -13,13 +13,10 @@ ...@@ -13,13 +13,10 @@
type="text" type="text"
placeholder="请搜索服务商账号名" placeholder="请搜索服务商账号名"
class="input" class="input"
value="{{keyword}}" value="{{searchKeyword}}"
placeholder-class="input-placeholder" placeholder-class="input-placeholder"
bindinput="input" bindinput="input"
bindconfirm="search" /> bindconfirm="search" />
<block wx:if="{{keyword}}">
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view> </view>
<view class="search text-center" bindtap="showConfirm"> <view class="search text-center" bindtap="showConfirm">
<view class="text-center">搜索</view> <view class="text-center">搜索</view>
...@@ -28,9 +25,6 @@ ...@@ -28,9 +25,6 @@
<scroll-view <scroll-view
scroll-y scroll-y
enable-back-to-top enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
refresher-threshold="104"
scroll-top="{{scrollTop}}" scroll-top="{{scrollTop}}"
class="list" class="list"
style="height:100%;" style="height:100%;"
......
...@@ -14,7 +14,6 @@ Component({ ...@@ -14,7 +14,6 @@ Component({
observer: function (n) { observer: function (n) {
if (n) { if (n) {
let { merchantRange, selectInfo } = this.data let { merchantRange, selectInfo } = this.data
console.log(selectInfo)
let activeIndex = merchantRange.findIndex(v => v.merchantId == selectInfo.shopMerchantIds[0]) let activeIndex = merchantRange.findIndex(v => v.merchantId == selectInfo.shopMerchantIds[0])
if (merchantRange.length) merchantRange.unshift({merchantId: '', merchantName: '全部'}) if (merchantRange.length) merchantRange.unshift({merchantId: '', merchantName: '全部'})
merchantRange.forEach((item, ind) => { merchantRange.forEach((item, ind) => {
...@@ -24,13 +23,11 @@ Component({ ...@@ -24,13 +23,11 @@ Component({
} else { } else {
item.act = false item.act = false
} }
this.setData({
merchantRange,
selectedMerchantId: selectInfo.shopMerchantIds[0]
})
}) })
this.setData({ this.setData({
searchKeyword: '' searchKeyword: '',
merchantRange,
selectedMerchantId: selectInfo?.shopMerchantIds[0] || ''
}) })
} }
} }
......
...@@ -12,13 +12,10 @@ ...@@ -12,13 +12,10 @@
type="text" type="text"
placeholder="请搜索门店" placeholder="请搜索门店"
class="input" class="input"
value="{{keyword}}" value="{{searchKeyword}}"
placeholder-class="input-placeholder" placeholder-class="input-placeholder"
bindinput="input" bindinput="input"
bindconfirm="search" /> bindconfirm="search" />
<block wx:if="{{keyword}}">
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view> </view>
<view class="search text-center" bindtap="search" data-value="{{searchKeyword}}"> <view class="search text-center" bindtap="search" data-value="{{searchKeyword}}">
<view class="text-center">搜索</view> <view class="text-center">搜索</view>
...@@ -27,9 +24,6 @@ ...@@ -27,9 +24,6 @@
<scroll-view <scroll-view
scroll-y scroll-y
enable-back-to-top enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
refresher-threshold="104"
scroll-top="{{scrollTop}}" scroll-top="{{scrollTop}}"
class="list" class="list"
style="height:100%;" style="height:100%;"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!