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.
144 lines
5.3 KiB
144 lines
5.3 KiB
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, title, content } = 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 (businessType.indexOf("act_sign_up_success") > -1) {//爱心互助活动报名成功
|
|
wx.navigateTo({
|
|
url: `/subpages/heart/pages/heartDetail/heartDetail?id=${issueId}`
|
|
})
|
|
} else if (businessType.indexOf("act_sign_up_failure") > -1) {//爱心互助活动审核未通过
|
|
console.log("ssss")
|
|
wx.navigateTo({
|
|
url: `/subpages/heart/pages/refusedOrEndedDetail/refusedOrEndedDetail?id=${issueId}`
|
|
})
|
|
} else if (businessType.indexOf("volunteer") > -1) {//志愿者认证
|
|
wx.navigateTo({
|
|
url: "/subpages/heart/pages/volunteer/volunteer"
|
|
})
|
|
}
|
|
} 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 (businessType.indexOf("activity") > -1) {//爱心互助详情
|
|
wx.navigateTo({
|
|
url: `/subpages/heart/pages/heartDetail/heartDetail?id=${issueId}`
|
|
})
|
|
} else if (businessType.indexOf("act_cancel") > -1) {//爱心互助活动取消
|
|
wx.navigateTo({
|
|
url: `/subpages/heart/pages/cancelDetail/cancelDetail?id=${issueId}`
|
|
})
|
|
} else if (businessType.indexOf('points') > -1) {
|
|
wx.navigateTo({
|
|
url: `/subpages/heart/pages/noticeDetail/noticeDetail?title=${title}&content=${content}`
|
|
})
|
|
}
|
|
} 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"
|
|
})
|
|
}
|
|
},
|
|
})
|