You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
145 lines
2.6 KiB
145 lines
2.6 KiB
3 years ago
|
// pages/user/NeedsManage/index.js
|
||
|
const app = getApp();
|
||
|
Page({
|
||
|
|
||
|
/**
|
||
|
* 页面的初始数据
|
||
|
*/
|
||
|
data: {
|
||
|
tabActive: 1,
|
||
|
list: [],
|
||
|
resourceType: 2,
|
||
|
resourceState: null,
|
||
|
resourceAuditState: null,
|
||
|
},
|
||
|
tabClick(e){
|
||
|
let i = e.currentTarget.dataset.i
|
||
|
this.setParams(i)
|
||
|
},
|
||
|
setParams(i){
|
||
|
if(i == 1){
|
||
|
this.setData({
|
||
|
tabActive: i,
|
||
|
resourceState: 1,
|
||
|
resourceAuditState: [2],
|
||
|
})
|
||
|
} else if(i == 2){
|
||
|
this.setData({
|
||
|
tabActive: i,
|
||
|
resourceState: 0,
|
||
|
resourceAuditState: [1],
|
||
|
})
|
||
|
} else if(i == 3){
|
||
|
this.setData({
|
||
|
tabActive: i,
|
||
|
resourceState: 0,
|
||
|
resourceAuditState: [0,3],
|
||
|
})
|
||
|
} else if(i == 4){
|
||
|
this.setData({
|
||
|
tabActive: i,
|
||
|
resourceState: 2,
|
||
|
resourceAuditState: [],
|
||
|
})
|
||
|
}
|
||
|
this.getList()
|
||
|
},
|
||
|
/**
|
||
|
* 生命周期函数--监听页面加载
|
||
|
*/
|
||
|
onLoad: function (options) {
|
||
|
this.setData({
|
||
|
tabActive: options.type
|
||
|
})
|
||
|
this.setParams(options.type)
|
||
|
},
|
||
|
toRelease(){
|
||
|
wx.navigateTo({
|
||
|
url: '/pages/release/index',
|
||
|
})
|
||
|
},
|
||
|
getList(){
|
||
|
app.http('post','Resources/listMyResources',{
|
||
|
resourceType: this.data.resourceType,
|
||
|
resourceState: this.data.resourceState,
|
||
|
resourceAuditState : this.data.resourceAuditState
|
||
|
}).then((res)=>{
|
||
|
if(res.data.success){
|
||
|
this.setData({
|
||
|
list: res.data.data.content
|
||
|
})
|
||
|
}
|
||
|
})
|
||
|
},
|
||
|
// 下架
|
||
|
xiajiaClick(e){
|
||
|
let id = e.currentTarget.dataset.id;
|
||
|
console.log(id)
|
||
|
},
|
||
|
// 撤回
|
||
|
withdrawClick(e){
|
||
|
let id = e.currentTarget.dataset.id;
|
||
|
console.log(id)
|
||
|
},
|
||
|
// 编辑
|
||
|
editClick(e){
|
||
|
let id = e.currentTarget.dataset.id;
|
||
|
console.log(id)
|
||
|
wx.navigateTo({
|
||
|
url: '/pages/user/editNeeds/index?id=' + id,
|
||
|
})
|
||
|
},
|
||
|
// 删除
|
||
|
delClick(e){
|
||
|
let id = e.currentTarget.dataset.id;
|
||
|
console.log(id)
|
||
|
},
|
||
|
/**
|
||
|
* 生命周期函数--监听页面初次渲染完成
|
||
|
*/
|
||
|
onReady: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面显示
|
||
|
*/
|
||
|
onShow: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面隐藏
|
||
|
*/
|
||
|
onHide: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面卸载
|
||
|
*/
|
||
|
onUnload: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||
|
*/
|
||
|
onPullDownRefresh: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 页面上拉触底事件的处理函数
|
||
|
*/
|
||
|
onReachBottom: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 用户点击右上角分享
|
||
|
*/
|
||
|
onShareAppMessage: function () {
|
||
|
|
||
|
}
|
||
|
})
|