处理搜索异常

cyl/dev
jscyl13849007907 1 year ago
parent 9ff056d5cd
commit 906f653861

@ -3,7 +3,7 @@ Component({
data: { data: {
labelColor: ["#c41d7f", "#096dd9", "#531dab", "#d46b08", "#389e0d", "#08979c", "#cf1322"], labelColor: ["#c41d7f", "#096dd9", "#531dab", "#d46b08", "#389e0d", "#08979c", "#cf1322"],
bgColor: ["#fff0f6", "#e6f7ff", "#f9f0ff", "#fff7e6", "#f6ffed", "#e6fffb", "#fff1f0"], bgColor: ["#fff0f6", "#e6f7ff", "#f9f0ff", "#fff7e6", "#f6ffed", "#e6fffb", "#fff1f0"],
}, },
properties: { properties: {
// 抽屉高度 // 抽屉高度
recordList: { recordList: {

@ -29,7 +29,7 @@
<view class="f12 pl4 pr4" style="color:#646572;padding:4px;" hover-class="none" hover-stop-propagation="false"> <view class="f12 pl4 pr4" style="color:#646572;padding:4px;" hover-class="none" hover-stop-propagation="false">
{{itm || '-'}} {{itm || '-'}}
</view> </view>
</view> </view>
<view class="f12 pl4 pr4" style="background: #f1faff;padding:4px;" wx:if="{{item.labelGroup.length <= 0}}"> <view class="f12 pl4 pr4" style="background: #f1faff;padding:4px;" wx:if="{{item.labelGroup.length <= 0}}">
暂无特色 暂无特色
</view> </view>

@ -2611,10 +2611,25 @@ Page({
data.recordList.length < data.recordList.length <
that.data.storeJobListSearchForm.pageSize that.data.storeJobListSearchForm.pageSize
) { ) {
console.log('from 搜索')
var jobListTemp = commonUtil.disposeJobListData( var jobListTemp = commonUtil.disposeJobListData(
data.recordList data.recordList
); );
jobListTemp.forEach((item, index) => {
if (item.jobSpecialLabelNames && item.jobSpecialLabelNames.length > 0) {
console.log('为什么不会执行',item,index)
item.labelGroup = item.jobSpecialLabelNames.split(', ').filter((itm, inx) => {
return inx < 6
}).map(itm => {
return itm
})
} else {
console.log('为什么会执行',item,index)
item.labelGroup = [];
}
})
that.data.recordList = that.data.recordList.concat(jobListTemp); that.data.recordList = that.data.recordList.concat(jobListTemp);
that.setData({ that.setData({
@ -2623,18 +2638,21 @@ Page({
isTrigger: false, isTrigger: false,
}); });
} else { } else {
console.log('from 其他')
var jobListTemp = commonUtil.disposeJobListData( var jobListTemp = commonUtil.disposeJobListData(
data.recordList data.recordList
); );
that.data.recordList = that.data.recordList.concat(jobListTemp); that.data.recordList = that.data.recordList.concat(jobListTemp);
that.data.recordList.forEach((item, index) => { that.data.recordList.forEach((item, index) => {
if (item.jobSpecialLabelNames && item.jobSpecialLabelNames.length > 0) { if (item.jobSpecialLabelNames && item.jobSpecialLabelNames.length > 0) {
item.labelGroup = item.jobSpecialLabelNames.split(', ').filter((item, index) => { console.log('为什么不会执行',item,index)
return index < 6 item.labelGroup = item.jobSpecialLabelNames.split(', ').filter((itm, inx) => {
}).map(item => { return inx < 6
return item }).map(itm => {
return itm
}) })
} else { } else {
console.log('为什么会执行',item,index)
item.labelGroup = []; item.labelGroup = [];
} }
}) })

Loading…
Cancel
Save