榆山
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.

107 lines
2.6 KiB

var api = require('../../api/common.js')
const app = getApp()
Component({
properties: {
state: Number
},
data: {
items: [],
showSkeleton: true
},
attached: function () {},
ready: function () {
},
pageLifetimes: {
// 组件所在页面的生命周期函数
show: function () {},
},
methods: {
getIssueList(searchData) {
// wx.showLoading({
// title: '加载中',
// })
if (searchData.clear == 0){//清空数据
this.setData({
items: []
})
}
this.searchData = searchData
var orderType = "";
if (searchData.currenttab == "hot") {
orderType = "1"
} else {
orderType = "0"
}
let deptId = ''
let currentGrid = wx.getStorageSync('currentGrid')
console.log('currentGrid', currentGrid)
if (currentGrid !== undefined && currentGrid !== 'undefined' && currentGrid !== '') {
deptId = currentGrid.deptId
}
console.log('deptId', deptId)
// 0-待回应 1-待处理 2-已驳回 3-已关闭
const state = this.data.state
if (state == '0' || state == '2') {
let params = {
"deptId": deptId,
"pageIndex": searchData.indexPage,
"pageSize": app.globalData.pageSize,
"timestamp": searchData.date,
"state": state == '0' ? 0 : 2
}
this.getEventList(params)
} else if (state == '1' || state == '3') {
let params = {
"deptId": deptId,
"orderType": orderType,
"pageIndex": searchData.indexPage,
"pageSize": app.globalData.pageSize,
"timestamp": searchData.date,
"issueState": state == '1' ? 0 : 2
}
console.log(params)
api.getIssueList(params).then((res) => {
// wx.hideLoading()
console.log(res.data)
this.setData({
items: this.data.items.concat(res.data),
showSkeleton: false
})
})
}
},
getEventList(params) {
api.getEventList(params).then((res) => {
// wx.hideLoading()
console.log(res.data)
this.setData({
items: this.data.items.concat(res.data),
showSkeleton: false
})
})
},
toIssueDetail(e) {
const id = e.currentTarget.dataset.id
// 议题状态 0-待处理,2-已关闭
// 事件状态 0-待回应,2-已驳回
// 0-待回应 1-待处理 2-已驳回 3-已关闭
const issueState = this.data.state
wx.navigateTo({
url: `../../pages/issueDetail/issueDetail?issueId=${id}&issueState=${issueState}`
})
}
}
})