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.
101 lines
2.8 KiB
101 lines
2.8 KiB
5 years ago
|
import { getItemDetail, itemProcessList } from '../../../../../api/issue'
|
||
|
|
||
|
Page({
|
||
|
/**
|
||
|
* 页面的初始数据
|
||
|
*/
|
||
|
data: {
|
||
|
itemId: "",
|
||
|
itemState: "",
|
||
|
detailData: {},
|
||
|
processList: [],
|
||
|
handleSubmitData: {},
|
||
|
visible: false,
|
||
|
detailType: 'project'
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面加载
|
||
|
*/
|
||
|
onLoad: function (options) {
|
||
|
wx.showLoading({
|
||
|
title: '加载中',
|
||
|
})
|
||
|
let that = this
|
||
|
that.setData({
|
||
|
id: options.Id
|
||
|
})
|
||
|
// 获取项目详情
|
||
|
|
||
|
getItemDetail(options.Id).then((res: any) => {
|
||
|
that.setData({
|
||
|
detailData: {
|
||
|
id: res.data.id,
|
||
|
issueId: res.data.issueId,
|
||
|
eventId: res.data.eventId,
|
||
|
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,
|
||
|
allDeptNames: res.data.allDeptNames,
|
||
|
pageName: 'projectDetails'
|
||
|
}
|
||
|
})
|
||
|
console.log('::::::::::::' + JSON.stringify(that.data.detailData))
|
||
|
// // 获取项目处理进度
|
||
|
// let itemProcessList = new Promise((resolve, reject) => {
|
||
|
// api.itemProcessList(that.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);
|
||
|
// });
|
||
|
// });
|
||
|
|
||
|
|
||
|
|
||
|
itemProcessList(that.data.detailData.id).then((res: any) => {
|
||
|
that.setData({
|
||
|
processList: res.data
|
||
|
})
|
||
|
wx.hideLoading()
|
||
|
})
|
||
|
// 获取议题处理进度
|
||
|
// let issueProcessList = new Promise((resolve, reject) => {
|
||
|
// api.issueProcessList(that.data.detailData.issueId).then(res => {
|
||
|
// if (res.data.length > 0) {
|
||
|
// res.data[res.data.length - 1].lastProcess = true
|
||
|
// }
|
||
|
// resolve(res.data);
|
||
|
// });
|
||
|
// });
|
||
|
|
||
|
// Promise.all([itemProcessList])
|
||
|
// .then(result => {
|
||
|
// console.log(result);
|
||
|
// let processList = [];
|
||
|
// processList = processList.concat(result[0], result[1]);
|
||
|
// processList[0].firstProcess = true
|
||
|
// wx.hideLoading()
|
||
|
// that.setData({
|
||
|
// processList
|
||
|
// });
|
||
|
// })
|
||
|
// .catch(error => {
|
||
|
// console.log(error);
|
||
|
// wx.hideLoading()
|
||
|
// });
|
||
|
})
|
||
|
}
|
||
|
})
|