|
|
@ -2,14 +2,24 @@ import { |
|
|
|
getIssueDetail, |
|
|
|
getIssueTypeStatistics, |
|
|
|
getRemarkList, |
|
|
|
showRemarkStatement, |
|
|
|
showIssueStatement, |
|
|
|
// showRemarkStatement,
|
|
|
|
issueComLike, |
|
|
|
issueComUnlike, |
|
|
|
itemComLike, |
|
|
|
itemComUnlike, |
|
|
|
// showIssueStatement,
|
|
|
|
issueSupport, |
|
|
|
issueOpposition, |
|
|
|
itemSupport, |
|
|
|
itemOpposition, |
|
|
|
getProjectDetail, |
|
|
|
getProjectTypeStatistics, |
|
|
|
getIssueHandleProgressV2, |
|
|
|
getProjectHandleProgressV2 |
|
|
|
} from '../../utils/api' |
|
|
|
import { formatTimestamp } from '../../utils/common' |
|
|
|
import { |
|
|
|
formatTimestamp |
|
|
|
} from '../../utils/common' |
|
|
|
const app = getApp() |
|
|
|
Page({ |
|
|
|
data: { |
|
|
@ -68,7 +78,7 @@ Page({ |
|
|
|
infoCompleted: 0, // 当前用户是否完善信息
|
|
|
|
showClassify: 'hide' // 是否显示 议题/项目分类列表
|
|
|
|
}, |
|
|
|
onLoad (options) { |
|
|
|
onLoad(options) { |
|
|
|
if (options.showClassify === 'show') { |
|
|
|
this.setData({ |
|
|
|
showClassify: 'show' |
|
|
@ -85,7 +95,7 @@ Page({ |
|
|
|
}) |
|
|
|
this.getIssueHandleProgressV2(this.data.issueId).then(res => { |
|
|
|
const handleProgressList = [] |
|
|
|
res.forEach((item,index) => { |
|
|
|
res.forEach((item, index) => { |
|
|
|
if (index === res.length - 1) { |
|
|
|
item.type = 'point' |
|
|
|
item.isFirst = true |
|
|
@ -119,7 +129,7 @@ Page({ |
|
|
|
console.log('项目和议题处理进展', res) |
|
|
|
const issueList = [] |
|
|
|
const projectList = [] |
|
|
|
res[0].forEach((item,index) => { |
|
|
|
res[0].forEach((item, index) => { |
|
|
|
if (index === res[0].length - 1) { |
|
|
|
item.type = 'point' |
|
|
|
item.isFirst = true |
|
|
@ -149,13 +159,13 @@ Page({ |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.getRemarkList() |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
infoCompleted: app.globalData.infoCompleted |
|
|
|
}) |
|
|
|
}, |
|
|
|
onReachBottom () { |
|
|
|
onReachBottom() { |
|
|
|
this.setData({ |
|
|
|
loadMoreVisible: true |
|
|
|
}) |
|
|
@ -167,7 +177,7 @@ Page({ |
|
|
|
} |
|
|
|
}, |
|
|
|
// 获取议题详情
|
|
|
|
getIssueDetail () { |
|
|
|
getIssueDetail() { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
getIssueDetail(this.data.issueId).then(res => { |
|
|
|
console.log('议题详情', res) |
|
|
@ -186,7 +196,7 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取项目详情
|
|
|
|
getProjectDetail () { |
|
|
|
getProjectDetail() { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
getProjectDetail(this.data.projectId).then(res => { |
|
|
|
console.log('项目详情', res) |
|
|
@ -206,7 +216,7 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 议题类别统计
|
|
|
|
getIssueTypeStatistics (categoryCode) { |
|
|
|
getIssueTypeStatistics(categoryCode) { |
|
|
|
getIssueTypeStatistics(categoryCode).then(res => { |
|
|
|
console.log('议题类别统计', res) |
|
|
|
const typeStatisticsObj = {} |
|
|
@ -221,7 +231,7 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 项目类别统计
|
|
|
|
getProjectTypeStatistics (categoryCode) { |
|
|
|
getProjectTypeStatistics(categoryCode) { |
|
|
|
getProjectTypeStatistics(categoryCode).then(res => { |
|
|
|
console.log('项目类别统计', res) |
|
|
|
const typeStatisticsObj = {} |
|
|
@ -236,10 +246,10 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 议题处理进展 v2
|
|
|
|
getIssueHandleProgressV2 (issueId) { |
|
|
|
getIssueHandleProgressV2(issueId) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
getIssueHandleProgressV2(issueId).then(res => { |
|
|
|
console.log('议题处理进度v2',res) |
|
|
|
console.log('议题处理进度v2', res) |
|
|
|
resolve(res.data) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
@ -248,7 +258,7 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 项目处理进展 v2
|
|
|
|
getProjectHandleProgressV2 () { |
|
|
|
getProjectHandleProgressV2() { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
getProjectHandleProgressV2(this.data.projectId).then(res => { |
|
|
|
console.log('项目处理进展', res) |
|
|
@ -260,7 +270,7 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 最新最热 评论列表切换
|
|
|
|
changeRemarkType (e) { |
|
|
|
changeRemarkType(e) { |
|
|
|
this.setData({ |
|
|
|
remarkType: e.detail.type, |
|
|
|
loadMoreVisible: false |
|
|
@ -268,7 +278,7 @@ Page({ |
|
|
|
this.getRemarkList() |
|
|
|
}, |
|
|
|
// 获取评论列表 下拉刷新
|
|
|
|
getRemarkList () { |
|
|
|
getRemarkList() { |
|
|
|
this.setData({ |
|
|
|
timeStamp: formatTimestamp(), |
|
|
|
pageNo: 1, |
|
|
@ -296,7 +306,7 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取评论列表 上拉加载
|
|
|
|
loadMoreGetRemarkList () { |
|
|
|
loadMoreGetRemarkList() { |
|
|
|
const para = { |
|
|
|
pageIndex: this.data.pageNo, |
|
|
|
pageSize: this.data.pageSize, |
|
|
@ -310,7 +320,7 @@ Page({ |
|
|
|
this.setData({ |
|
|
|
remarkObj: { |
|
|
|
statementNum: res.data.statementNum, |
|
|
|
commentsList: [...this.data.remarkObj.commentsList,...res.data.commentsList] |
|
|
|
commentsList: [...this.data.remarkObj.commentsList, ...res.data.commentsList] |
|
|
|
}, |
|
|
|
loadMoreType: res.data.commentsList.length === 10 ? 'loading' : 'none' |
|
|
|
}) |
|
|
@ -318,18 +328,18 @@ Page({ |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
debounceSupportRemark (e) { |
|
|
|
debounceSupportRemark(e) { |
|
|
|
clearTimeout(this.data.supportTimer) |
|
|
|
this.data.supportTimer = setTimeout(() => { |
|
|
|
this.supportRemark(e) |
|
|
|
}, 300) |
|
|
|
}, |
|
|
|
// 评论 支持 点赞
|
|
|
|
supportRemark (e) { |
|
|
|
supportRemark(e) { |
|
|
|
if (this.verifyCompleteInfo()) { |
|
|
|
return false |
|
|
|
} |
|
|
|
if(this.verifyState()) { |
|
|
|
if (this.verifyState()) { |
|
|
|
return false |
|
|
|
} |
|
|
|
const hasAttitude = this.data.remarkObj.commentsList.some(item => item.commentId === e.detail.commentId && (item.userLike || item.userDislike)) |
|
|
@ -354,24 +364,37 @@ Page({ |
|
|
|
issueId: this.data.detailType === 'issue' ? this.data.issueId : '', |
|
|
|
itemId: this.data.detailType === 'project' ? this.data.projectId : '' |
|
|
|
} |
|
|
|
showRemarkStatement(para).then(res => { |
|
|
|
console.log('评论支持', res) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
if (this.data.detailType == 'issue') { //议题
|
|
|
|
issueComLike(para).then(res => { |
|
|
|
console.log('评论支持', res) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
itemComLike(para).then(res => { |
|
|
|
console.log('评论支持', res) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} |
|
|
|
// showRemarkStatement(para).then(res => {
|
|
|
|
// console.log('评论支持', res)
|
|
|
|
// }).catch(err => {
|
|
|
|
// console.log(err)
|
|
|
|
// })
|
|
|
|
}, |
|
|
|
debounceDispportRemark (e) { |
|
|
|
debounceDispportRemark(e) { |
|
|
|
clearTimeout(this.data.dispportTimer) |
|
|
|
this.data.dispportTimer = setTimeout(() => { |
|
|
|
this.dispportRemark(e) |
|
|
|
}, 300) |
|
|
|
}, |
|
|
|
// 评论 不支持 点踩
|
|
|
|
dispportRemark (e) { |
|
|
|
dispportRemark(e) { |
|
|
|
if (this.verifyCompleteInfo()) { |
|
|
|
return false |
|
|
|
} |
|
|
|
if(this.verifyState()) { |
|
|
|
if (this.verifyState()) { |
|
|
|
return false |
|
|
|
} |
|
|
|
const hasAttitude = this.data.remarkObj.commentsList.some(item => item.commentId === e.detail.commentId && (item.userLike || item.userDislike)) |
|
|
@ -397,18 +420,31 @@ Page({ |
|
|
|
issueId: this.data.detailType === 'issue' ? this.data.issueId : '', |
|
|
|
itemId: this.data.detailType === 'project' ? this.data.projectId : '' |
|
|
|
} |
|
|
|
showRemarkStatement(para).then(res => { |
|
|
|
console.log('评论不支持', res) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
if (this.data.detailType == 'issue') { //议题
|
|
|
|
issueComUnlike(para).then(res => { |
|
|
|
console.log('评论不支持', res) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
itemComUnlike(para).then(res => { |
|
|
|
console.log('评论不支持', res) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} |
|
|
|
// showRemarkStatement(para).then(res => {
|
|
|
|
// console.log('评论不支持', res)
|
|
|
|
// }).catch(err => {
|
|
|
|
// console.log(err)
|
|
|
|
// })
|
|
|
|
}, |
|
|
|
// 对 议题/项目 进行评论
|
|
|
|
navigateToReply () { |
|
|
|
navigateToReply() { |
|
|
|
if (this.verifyCompleteInfo()) { |
|
|
|
return false |
|
|
|
} |
|
|
|
if(this.verifyState()) { |
|
|
|
if (this.verifyState()) { |
|
|
|
return false |
|
|
|
} |
|
|
|
wx.navigateTo({ |
|
|
@ -416,29 +452,29 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 评论 回复 回调
|
|
|
|
replyRemark (e) { |
|
|
|
replyRemark(e) { |
|
|
|
if (this.verifyCompleteInfo()) { |
|
|
|
return false |
|
|
|
} |
|
|
|
if(this.verifyState()) { |
|
|
|
if (this.verifyState()) { |
|
|
|
return false |
|
|
|
} |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/subpages/discussion/pages/remarkOrReply/remarkOrReply?detailId=${this.data.detailId}&faCommentId=${e.detail.commentId}&detailType=${this.data.detailType}` |
|
|
|
}) |
|
|
|
}, |
|
|
|
debounceSupportIssueOrProject () { |
|
|
|
debounceSupportIssueOrProject() { |
|
|
|
clearTimeout(this.data.supportTimer) |
|
|
|
this.data.supportTimer = setTimeout(() => { |
|
|
|
this.supportIssueOrProject() |
|
|
|
}, 300) |
|
|
|
}, |
|
|
|
// 点赞 议题或评论
|
|
|
|
supportIssueOrProject () { |
|
|
|
supportIssueOrProject() { |
|
|
|
if (this.verifyCompleteInfo()) { |
|
|
|
return false |
|
|
|
} |
|
|
|
if(this.verifyState()) { |
|
|
|
if (this.verifyState()) { |
|
|
|
return false |
|
|
|
} |
|
|
|
if (this.data.detailObj.userDislike || this.data.detailObj.userLike) { |
|
|
@ -459,24 +495,39 @@ Page({ |
|
|
|
issueId: this.data.detailType === 'issue' ? this.data.issueId : '', |
|
|
|
itemId: this.data.detailType === 'project' ? this.data.projectId : '' |
|
|
|
} |
|
|
|
showIssueStatement(para).then(res => { |
|
|
|
console.log('点赞议题或项目', res) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
|
|
|
|
// showIssueStatement(para).then(res => {
|
|
|
|
// console.log('点赞议题或项目', res)
|
|
|
|
// }).catch(err => {
|
|
|
|
// console.log(err)
|
|
|
|
// })
|
|
|
|
if (this.data.detailType == 'issue') { //议题
|
|
|
|
issueSupport(para).then(res => { //v2新接口 2020.5.8
|
|
|
|
console.log('点赞议题', res) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else { //项目 itemSupport,
|
|
|
|
itemSupport(para).then(res => { //v2新接口 2020.5.8
|
|
|
|
console.log('点赞项目', res) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
debounceDispportIssueOrProject () { |
|
|
|
debounceDispportIssueOrProject() { |
|
|
|
clearTimeout(this.data.dispportTimer) |
|
|
|
this.data.dispportTimer = setTimeout(() => { |
|
|
|
this.dispportIssueOrProject() |
|
|
|
}, 300) |
|
|
|
}, |
|
|
|
// 点踩 议题活评论
|
|
|
|
dispportIssueOrProject () { |
|
|
|
dispportIssueOrProject() { |
|
|
|
if (this.verifyCompleteInfo()) { |
|
|
|
return false |
|
|
|
} |
|
|
|
if(this.verifyState()) { |
|
|
|
if (this.verifyState()) { |
|
|
|
return false |
|
|
|
} |
|
|
|
if (this.data.detailObj.userDislike || this.data.detailObj.userLike) { |
|
|
@ -497,14 +548,29 @@ Page({ |
|
|
|
issueId: this.data.detailType === 'issue' ? this.data.issueId : '', |
|
|
|
itemId: this.data.detailType === 'project' ? this.data.projectId : '' |
|
|
|
} |
|
|
|
showIssueStatement(para).then(res => { |
|
|
|
console.log('点踩议题或项目', res) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
|
|
|
|
// showIssueStatement(para).then(res => {
|
|
|
|
// console.log('点踩议题或项目', res)
|
|
|
|
// }).catch(err => {
|
|
|
|
// console.log(err)
|
|
|
|
// })
|
|
|
|
if (this.data.detailType == 'issue') { //议题
|
|
|
|
issueOpposition(para).then(res => { //v2新接口 2020.5.8
|
|
|
|
console.log('点踩议题', res) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
itemOpposition(para).then(res => { //v2新接口 2020.5.8
|
|
|
|
console.log('点踩项目', res) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 跳转到 分类列表
|
|
|
|
navigateToCategoryList () { |
|
|
|
navigateToCategoryList() { |
|
|
|
if (this.data.showClassify === 'show') { |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/subpages/discussion/pages/categoryList/categoryList?type=${this.data.detailType}&categoryCode=${this.data.detailObj.firstCategoryCode}` |
|
|
@ -512,14 +578,14 @@ Page({ |
|
|
|
} |
|
|
|
}, |
|
|
|
// 满意度评价
|
|
|
|
publishEvaluation () { |
|
|
|
publishEvaluation() { |
|
|
|
if (this.verifyCompleteInfo()) { |
|
|
|
return false |
|
|
|
} |
|
|
|
if (this.data.detailObj.itemState !== 10) { |
|
|
|
this.setData({ |
|
|
|
dialogConformText: '知道了', |
|
|
|
dialogContent: ['项目未处理完毕或已关闭','不能进行评价!'], |
|
|
|
dialogContent: ['项目未处理完毕或已关闭', '不能进行评价!'], |
|
|
|
dialogTitle: '满意度评价', |
|
|
|
dialogVisible: !this.data.dialogVisible |
|
|
|
}) |
|
|
@ -530,11 +596,11 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 检查 议题/项目的状态
|
|
|
|
verifyState () { |
|
|
|
verifyState() { |
|
|
|
if (this.data.detailType === 'issue' && !this.data.detailObj.operational) { |
|
|
|
this.setData({ |
|
|
|
dialogConformText: '知道了', |
|
|
|
dialogContent: ['议题已关闭,不可再进行','评论/回复/支持/不支持等表达态度'], |
|
|
|
dialogContent: ['议题已关闭,不可再进行', '评论/回复/支持/不支持等表达态度'], |
|
|
|
dialogTitle: '已关闭', |
|
|
|
dialogVisible: !this.data.dialogVisible |
|
|
|
}) |
|
|
@ -543,7 +609,7 @@ Page({ |
|
|
|
if (this.data.detailObj.itemState === 5) { |
|
|
|
this.setData({ |
|
|
|
dialogConformText: '知道了', |
|
|
|
dialogContent: ['项目已关闭,不可再进行','评论/回复/支持/不支持等表达态度'], |
|
|
|
dialogContent: ['项目已关闭,不可再进行', '评论/回复/支持/不支持等表达态度'], |
|
|
|
dialogTitle: '已关闭', |
|
|
|
dialogVisible: !this.data.dialogVisible |
|
|
|
}) |
|
|
@ -551,7 +617,7 @@ Page({ |
|
|
|
} else if (this.data.detailObj.itemState === 10) { |
|
|
|
this.setData({ |
|
|
|
dialogConformText: '知道了', |
|
|
|
dialogContent: ['项目已结案,不可再进行','评论/回复/支持/不支持等表达态度'], |
|
|
|
dialogContent: ['项目已结案,不可再进行', '评论/回复/支持/不支持等表达态度'], |
|
|
|
dialogTitle: '已结案', |
|
|
|
dialogVisible: !this.data.dialogVisible |
|
|
|
}) |
|
|
@ -560,7 +626,7 @@ Page({ |
|
|
|
} |
|
|
|
}, |
|
|
|
// 检查 是否完善信息
|
|
|
|
verifyCompleteInfo () { |
|
|
|
verifyCompleteInfo() { |
|
|
|
if (this.data.infoCompleted == 0) { |
|
|
|
this.setData({ |
|
|
|
completeInfoDialogVisible: !this.data.completeInfoDialogVisible |
|
|
|