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.
118 lines
4.0 KiB
118 lines
4.0 KiB
6 years ago
|
const api = require('../../../../utils/home')
|
||
|
import { getTimestamp } from '../../../../utils/common'
|
||
|
Page({
|
||
|
data: {
|
||
|
pageNo: 1,
|
||
|
pageSize: 10,
|
||
|
timestamp: getTimestamp(),
|
||
|
infoList: []
|
||
|
},
|
||
|
onShow() {
|
||
|
this.setData({
|
||
|
pageNo: 1,
|
||
|
infoList: []
|
||
|
})
|
||
|
this.getInfoList()
|
||
|
},
|
||
|
onReachBottom() {
|
||
|
console.log('加载翻页')
|
||
|
this.setData({
|
||
|
pageNo: this.data.pageNo + 1,
|
||
|
pageSize: this.data.pageSize,
|
||
|
pageIndex: getTimestamp()
|
||
|
})
|
||
|
this.getInfoList()
|
||
|
},
|
||
|
// 加载网格长管辖的网格列表
|
||
|
getInfoList() {
|
||
|
let that = this
|
||
|
let para = {
|
||
|
pageIndex: this.data.pageNo,
|
||
|
pageSize: this.data.pageSize,
|
||
|
timestamp: getTimestamp()
|
||
|
}
|
||
|
api.getInfoList(para).then(res => {
|
||
|
that.setData({
|
||
|
infoList: that.data.infoList.concat(res.data)
|
||
|
})
|
||
|
}).catch(err => {
|
||
|
console.log(err)
|
||
|
})
|
||
|
},
|
||
|
lookDetail(e) {
|
||
|
console.log('item',e.currentTarget.dataset.item)
|
||
|
const { id: infoId, businessId: issueId, type, businessType, relBusinessContent } = e.currentTarget.dataset.item
|
||
|
console.log('businessType',businessType)
|
||
|
let params = {
|
||
|
informationId: infoId
|
||
|
}
|
||
|
api.infoDetail(params).then(res => {
|
||
|
console.log('消息已阅', res)
|
||
|
}).catch(err => {
|
||
|
console.log(err)
|
||
|
})
|
||
|
if (type === '0') {
|
||
|
if (businessType === 'groupUserReviewPassed' || businessType === 'groupPassed' || businessType === 'groupUserReviewNotPass') {
|
||
|
wx.reLaunch({
|
||
|
url: '/pages/association/association'
|
||
|
})
|
||
|
} else if (businessType === 'groupNotPassedOrDisband') {
|
||
|
wx.navigateTo({
|
||
|
url: `/subpages/association/pages/unpassAssociation/unpassAssociation?id=${issueId}&state=5&description=${encodeURIComponent(relBusinessContent)}`
|
||
|
})
|
||
|
} else if (businessType.indexOf('event') > -1) {
|
||
|
wx.navigateTo({
|
||
|
url: `/subpages/mine/pages/eventDetail/eventDetail?eventId=${issueId}&eventType=未通过`
|
||
|
})
|
||
|
} else if (businessType.indexOf('issue') > -1) {
|
||
|
wx.navigateTo({
|
||
|
url: `/subpages/discussion/pages/discussionDetail/discussionDetail?detailId=${issueId}&type=issue`
|
||
|
})
|
||
|
} else if (businessType.indexOf('item') > -1) {
|
||
|
wx.navigateTo({
|
||
|
url: `/subpages/discussion/pages/discussionDetail/discussionDetail?detailId=${issueId}&type=project`
|
||
|
})
|
||
|
}
|
||
|
} else if (type === '1') {
|
||
|
if (businessType === 'groupTopicClosed') {
|
||
|
wx.navigateTo({
|
||
|
url: `/subpages/association/pages/topicDetail/topicDetail?detailId=${issueId}`
|
||
|
})
|
||
|
} else if (businessType.indexOf('issue') > -1) {
|
||
|
wx.navigateTo({
|
||
|
url: `/subpages/discussion/pages/discussionDetail/discussionDetail?detailId=${issueId}&type=issue`
|
||
|
})
|
||
|
} else if (businessType.indexOf('item') > -1) {
|
||
|
wx.navigateTo({
|
||
|
url: `/subpages/discussion/pages/discussionDetail/discussionDetail?detailId=${issueId}&type=project`
|
||
|
})
|
||
|
} else if (businessType.indexOf('topic') > -1) {
|
||
|
wx.navigateTo({
|
||
|
url: `/subpages/association/pages/topicDetail/topicDetail?detailId=${issueId}`
|
||
|
})
|
||
|
}
|
||
|
} else if (type === '2') {
|
||
|
if (businessType === 'topicToIssuePass') {
|
||
|
wx.navigateTo({
|
||
|
url: `/subpages/discussion/pages/discussionDetail/discussionDetail?detailId=${issueId}&type=issue`
|
||
|
})
|
||
|
} else if (businessType.indexOf('event') > -1) {
|
||
|
wx.navigateTo({
|
||
|
url: `/subpages/mine/pages/eventDetail/eventDetail?eventId=${issueId}&eventType=未通过`
|
||
|
})
|
||
|
} else if (businessType.indexOf('issue') > -1) {
|
||
|
wx.navigateTo({
|
||
|
url: `/subpages/discussion/pages/discussionDetail/discussionDetail?detailId=${issueId}&type=issue`
|
||
|
})
|
||
|
} else if (businessType.indexOf('item') > -1) {
|
||
|
wx.navigateTo({
|
||
|
url: `/subpages/discussion/pages/discussionDetail/discussionDetail?detailId=${issueId}&type=project`
|
||
|
})
|
||
|
}
|
||
|
} else if (type === '3') {
|
||
|
wx.reLaunch({
|
||
|
url: '/pages/association/association'
|
||
|
})
|
||
|
}
|
||
|
},
|
||
|
})
|