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.
140 lines
2.7 KiB
140 lines
2.7 KiB
// pages/demandHall/applyDetail/index.js |
|
const app = getApp() |
|
Page({ |
|
|
|
/** |
|
* 页面的初始数据 |
|
*/ |
|
data: { |
|
active: 0, |
|
detail: [], |
|
userList: [], |
|
communicateId: '', |
|
content: null |
|
}, |
|
itemClick(e){ |
|
let i = e.currentTarget.dataset.i |
|
let id = e.currentTarget.dataset.id |
|
this.setData({ |
|
active: i, |
|
communicateId: id |
|
}) |
|
this.getApplyDetail(); |
|
}, |
|
getApplyDetail(){ |
|
app.http('get','Communicate/getCommunicateInfo',{communicateId: this.data.communicateId}).then((res)=>{ |
|
if(res.data.success){ |
|
this.setData({ |
|
content: res.data.data |
|
}) |
|
} |
|
}) |
|
}, |
|
getUserList(){ |
|
// console.log(this.data.detail) |
|
app.http('get','Communicate/communicateHeadList',{resourceId: this.data.detail.resourceInfo.resourceId}).then((res)=>{ |
|
if(res.data.success){ |
|
this.setData({ |
|
userList: res.data.data, |
|
communicateId: res.data.data[0].communicateId |
|
}) |
|
this.getApplyDetail(); |
|
} |
|
}) |
|
}, |
|
toNeedDetail(e){ |
|
let id = e.currentTarget.dataset.id |
|
wx.navigateTo({ |
|
url: '/pages/demandHall/needsDetail/index?id=' + id, |
|
}) |
|
}, |
|
//查看立项书 |
|
toCreateProject(){ |
|
let content = this.data.content |
|
wx.navigateTo({ |
|
url: '/pages/demandHall/createProject/index?state=' + content.comminuteState+ '&id=' + content.communicateId, |
|
}) |
|
}, |
|
// 立项 |
|
createProject(){ |
|
let id = this.data.communicateId |
|
wx.showModal({ |
|
title: "提示!", |
|
content: '是否确认发起项目?', |
|
success(res){ |
|
if(res.confirm){ |
|
wx.navigateTo({ |
|
url: '/pages/demandHall/createProject/index?id='+ id, |
|
}) |
|
} |
|
} |
|
}) |
|
}, |
|
call(){ |
|
console.log() |
|
wx.makePhoneCall({ |
|
phoneNumber: this.data.content.phone, |
|
}) |
|
}, |
|
/** |
|
* 生命周期函数--监听页面加载 |
|
*/ |
|
onLoad: function (options) { |
|
let data = JSON.parse(decodeURIComponent(options.data)); |
|
this.setData({ |
|
detail: data |
|
}) |
|
// console.log(this.data.detail) |
|
this.getUserList() |
|
|
|
}, |
|
|
|
/** |
|
* 生命周期函数--监听页面初次渲染完成 |
|
*/ |
|
onReady: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 生命周期函数--监听页面显示 |
|
*/ |
|
onShow: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 生命周期函数--监听页面隐藏 |
|
*/ |
|
onHide: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 生命周期函数--监听页面卸载 |
|
*/ |
|
onUnload: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 页面相关事件处理函数--监听用户下拉动作 |
|
*/ |
|
onPullDownRefresh: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 页面上拉触底事件的处理函数 |
|
*/ |
|
onReachBottom: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 用户点击右上角分享 |
|
*/ |
|
onShareAppMessage: function () { |
|
|
|
} |
|
}) |