Browse Source

提交代码,完成我发布的需求!

release/210823_需求对对碰
王饶冀 3 years ago
parent
commit
be1bd4236d
2 changed files with 25 additions and 8 deletions
  1. 13
    7
      pages/myModule/components/myRelease/myRelease.js
  2. 12
    1
      pages/releaseModule/index.js

+ 13
- 7
pages/myModule/components/myRelease/myRelease.js View File

let { businessCommunicationDemandId, isOnTop } = item; let { businessCommunicationDemandId, isOnTop } = item;
this.showLoading(); this.showLoading();
$request.post(`/businessCommunicationDemand/setOnTopOrDown.action`, $request.post(`/businessCommunicationDemand/setOnTopOrDown.action`,
{ businessCommunicationDemandId, isOnTop: isOnTop ? 0 : 1 }
{ businessCommunicationDemandId, isOnTop: isOnTop ? 0 : 1, customerId: "666967" }
).then(res => { ).then(res => {
wx.hideLoading() wx.hideLoading()
if (res.status == 0) { if (res.status == 0) {
wx.showToast({ wx.showToast({
title: isOnTop ? '取消置顶' : '置顶' + '成功',
title: isOnTop ? '取消置顶成功' : '置顶成功',
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
this.setData({ this.setData({
listData listData
}) })
}else if(res.status == 106){
wx.showToast({
title: res.msg,
icon: 'error',
duration: 2000
})
} }
}).catch(error => { }).catch(error => {
console.log(error, 'error appletLogin') console.log(error, 'error appletLogin')
wx.hideLoading() wx.hideLoading()
if (res.status == 0) { if (res.status == 0) {
wx.showToast({ wx.showToast({
title: state == 0 ? '下架' : '上架' + '成功',
title: state == 0 ? '下架成功' : '上架成功',
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
} }
}) })
this.setData({ this.setData({
listData
listData
}) })
} }
}).catch(error => { }).catch(error => {
console.log(error, 'error appletLogin') console.log(error, 'error appletLogin')
wx.hideLoading()
wx.hideLoading()
}) })
}, },
// 删除需求 // 删除需求
}) })
}, },
// 修改需求 // 修改需求
productEdit(e){
productEdit(e) {
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
let that = this; let that = this;
wx.navigateTo({ wx.navigateTo({
}) })
}, },


getListData() { getListData() {
let { page, size, customerId, keyword, currentTab } = this.data; let { page, size, customerId, keyword, currentTab } = this.data;
$request.get('/businessCommunicationDemand/getDemandByStateAndCustomerId.action', $request.get('/businessCommunicationDemand/getDemandByStateAndCustomerId.action',

+ 12
- 1
pages/releaseModule/index.js View File

}) })
setTimeout(() => { setTimeout(() => {
wx.hideLoading() wx.hideLoading()
// wx.navigateBack()
let pages = getCurrentPages();
let Page = pages[pages.length - 1];//当前页
let prevPage = pages[pages.length - 2]; //上一个页面
let info = prevPage.data //取上页data里的数据也可以修改
let tempListData = info.listData;
tempListData.forEach(el=>{
if(el.businessCommunicationDemandId == businessCommunicationDemandId){
el.info = Page.data.detailValue
}
})
prevPage.setData({listData:tempListData })//设置数据
wx.navigateBack()
}, 1000); }, 1000);
} }

Loading…
Cancel
Save