|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
this.getListData(); |
|
|
this.getListData(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 置顶/取消置顶需求 |
|
|
|
|
|
productIsOnTop(e) { |
|
|
|
|
|
let item = e.currentTarget.dataset.item; |
|
|
|
|
|
let that = this; |
|
|
|
|
|
if (item.isOnTop) { |
|
|
|
|
|
wx.showModal({ |
|
|
|
|
|
title: '提示', |
|
|
|
|
|
content: "是否确认取消置顶?", |
|
|
|
|
|
confirmText: "确认", |
|
|
|
|
|
cancelText: "取消", |
|
|
|
|
|
success(res) { |
|
|
|
|
|
if (res.confirm) { |
|
|
|
|
|
that.productIsOnTopPost(item); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
that.productIsOnTopPost(item); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
// 置顶/取消置顶需求Fn |
|
|
|
|
|
productIsOnTopPost(item) { |
|
|
|
|
|
let { businessCommunicationDemandId, isOnTop } = item; |
|
|
|
|
|
this.showLoading(); |
|
|
|
|
|
$request.post(`/businessCommunicationDemand/setOnTopOrDown.action`, |
|
|
|
|
|
{ businessCommunicationDemandId, isOnTop: isOnTop ? 0 : 1 } |
|
|
|
|
|
).then(res => { |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
if (res.status == 0) { |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: isOnTop ? '取消置顶' : '置顶' + '成功', |
|
|
|
|
|
icon: 'success', |
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
|
|
|
let listData = this.data.listData; |
|
|
|
|
|
listData.forEach(el => { |
|
|
|
|
|
if (el.businessCommunicationDemandId == businessCommunicationDemandId) { |
|
|
|
|
|
el.isOnTop = isOnTop ? false : true |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
listData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
console.log(error, 'error appletLogin') |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
// 上架/下架需求 |
|
|
// 上架/下架需求 |
|
|
productRelease(e) { |
|
|
productRelease(e) { |
|
|
let item = e.currentTarget.dataset.item; |
|
|
let item = e.currentTarget.dataset.item; |
|
|
|
|
|
|
|
|
duration: 2000 |
|
|
duration: 2000 |
|
|
}) |
|
|
}) |
|
|
let listData = this.data.listData; |
|
|
let listData = this.data.listData; |
|
|
listData.forEach(el => { |
|
|
|
|
|
|
|
|
listData.forEach((el, inx) => { |
|
|
if (el.businessCommunicationDemandId == businessCommunicationDemandId) { |
|
|
if (el.businessCommunicationDemandId == businessCommunicationDemandId) { |
|
|
el.state = state == 0 ? 1 : 0; |
|
|
|
|
|
|
|
|
listData.splice(inx, 1); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
this.setData({ |
|
|
this.setData({ |