Commit 514e301f by zhangxw

修改

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