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.
152 lines
3.5 KiB
152 lines
3.5 KiB
5 years ago
|
var api = require('../../../api/issueDetail.js')
|
||
|
var _api = require('../../../api/itemDetail.js')
|
||
|
Page({
|
||
|
|
||
|
/**
|
||
|
* 页面的初始数据
|
||
|
*/
|
||
|
data: {
|
||
|
itemState:Number,//3已关闭
|
||
|
detailId: "",
|
||
|
detailData: {},
|
||
|
processList: [],
|
||
|
evaluation:[]
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面加载
|
||
|
*/
|
||
|
onLoad: function (options) {
|
||
|
this.setData({
|
||
|
detailId: options.itemId,
|
||
|
itemState: options.itemState
|
||
|
})
|
||
|
console.log('状态:' + options.itemState)
|
||
|
if (options.itemState == 1){
|
||
|
this.getEvaluation();
|
||
|
}
|
||
|
//事件详情
|
||
|
this.getItemDetail();
|
||
|
},
|
||
|
// 获取事件详情
|
||
|
getItemDetail() {
|
||
|
// 获取项目详情
|
||
|
_api.getItemDetail(this.data.detailId).then((res) => {
|
||
|
this.setData({
|
||
|
detailData: {
|
||
|
id: res.data.id,
|
||
|
avatar: res.data.avatar,
|
||
|
nickname: res.data.nickname,
|
||
|
distributeTime: res.data.distributeTime,
|
||
|
partyFlag: res.data.partyFlag,
|
||
|
images: res.data.images,
|
||
|
content: res.data.content,
|
||
|
mobile: res.data.mobile,
|
||
|
address: res.data.address,
|
||
|
categoryName: res.data.categoryName,
|
||
|
statementNum: res.data.statementNum,
|
||
|
approveNum: res.data.approveNum,
|
||
|
opposeNum: res.data.opposeNum,
|
||
|
commentNum: res.data.commentNum,
|
||
|
browseNum: res.data.browseNum,
|
||
|
issueId: res.data.issueId,
|
||
|
eventId: res.data.eventId
|
||
|
}
|
||
|
})
|
||
|
|
||
|
// 获取项目处理进度
|
||
|
let getItemProcessList = new Promise((resolve, reject) => {
|
||
|
_api.getItemProcessList(this.data.detailData.id).then(res => {
|
||
|
if (res.data.length > 0) {
|
||
|
delete res.data[res.data.length - 1].itemDeptDTOS
|
||
|
res.data[res.data.length - 1].state = 100
|
||
|
}
|
||
|
resolve(res.data);
|
||
|
});
|
||
|
});
|
||
|
// 获取议题处理进度
|
||
|
let getIssueProcessList = new Promise((resolve, reject) => {
|
||
|
_api.getIssueProcessList(this.data.detailData.issueId).then(res => {
|
||
|
if (res.data.length > 0) {
|
||
|
res.data[res.data.length - 1].lastProcess = true
|
||
|
}
|
||
|
resolve(res.data);
|
||
|
});
|
||
|
});
|
||
|
|
||
|
Promise.all([getItemProcessList, getIssueProcessList])
|
||
|
.then(result => {
|
||
|
console.log(result);
|
||
|
let processList = [];
|
||
|
processList = processList.concat(result[0], result[1]);
|
||
|
this.setData({
|
||
|
processList
|
||
|
});
|
||
|
})
|
||
|
.catch(error => {
|
||
|
console.log(error);
|
||
|
});
|
||
|
|
||
|
|
||
|
})
|
||
|
},
|
||
|
|
||
|
// 获取满意度评价结果
|
||
|
getEvaluation() {
|
||
|
let that = this;
|
||
|
api.getEvaluation(this.data.detailId).then((res) => {
|
||
|
console.log(res.data)
|
||
|
this.setData({
|
||
|
evaluation: that.data.evaluation.concat(res.data)
|
||
|
})
|
||
|
})
|
||
|
},
|
||
|
/**
|
||
|
* 生命周期函数--监听页面初次渲染完成
|
||
|
*/
|
||
|
onReady: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面显示
|
||
|
*/
|
||
|
onShow: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面隐藏
|
||
|
*/
|
||
|
onHide: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面卸载
|
||
|
*/
|
||
|
onUnload: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||
|
*/
|
||
|
onPullDownRefresh: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 页面上拉触底事件的处理函数
|
||
|
*/
|
||
|
onReachBottom: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 用户点击右上角分享
|
||
|
*/
|
||
|
onShareAppMessage: function () {
|
||
|
|
||
|
}
|
||
|
})
|