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.
424 lines
9.5 KiB
424 lines
9.5 KiB
import { wxRequestPost, wxNavigateTo } from "@utils/promise-wx-api";
|
|
import validate from "@utils/validate/index.js";
|
|
|
|
import copyKeyHave from "@npm/dai-mp/tools/copyKeyHave.js";
|
|
|
|
import computedBehavior from "@npm/dai-mp/mixins/computed-component/index.js";
|
|
import commonBehavior from "@mixins/common";
|
|
import listBehavior from "@mixins/list";
|
|
import { inputSync, getComponent } from "@utils/tools";
|
|
|
|
const app = getApp();
|
|
let $modal;
|
|
|
|
Component({
|
|
behaviors: [commonBehavior, computedBehavior, listBehavior],
|
|
properties: {
|
|
eventId: {
|
|
type: String,
|
|
value: "",
|
|
},
|
|
|
|
//处理中:processing;已办结:closed_case
|
|
status: {
|
|
type: String,
|
|
value: "processing",
|
|
},
|
|
//yes:已转项目;no: 未立项
|
|
shiftProject: {
|
|
type: String,
|
|
value: "no",
|
|
},
|
|
//是否能够回复 :true:能够回复; false: 不能恢复
|
|
replyButtonFlag: {
|
|
type: String,
|
|
value: "true",
|
|
},
|
|
},
|
|
|
|
data: {
|
|
iniLoaded: false,
|
|
refreshFlag: false,
|
|
|
|
info: {
|
|
icEventId: "",
|
|
eventContent: "",
|
|
happenTime: "",
|
|
imageList: [],
|
|
voiceList: [],
|
|
address: "",
|
|
redDot: false,
|
|
replyFlag: false,
|
|
status: "",
|
|
statusName: "",
|
|
operationType: "",
|
|
operationId: "",
|
|
latestOperatedTime: "",
|
|
satisfaction: "",
|
|
satisfactionName: "",
|
|
categoryId: "",
|
|
categoryName: "",
|
|
},
|
|
|
|
replyInfo: {
|
|
content: "", //回复内容
|
|
icEventId: "", //上报事件Id
|
|
},
|
|
|
|
replyList: [],
|
|
|
|
progressList: [],
|
|
// @ts-ignore
|
|
|
|
currentResolveType: "",
|
|
// 评价
|
|
satisifyType: "",
|
|
notSatisify: "../../../images/myReportEvent/face1.png",
|
|
notSatisifySelected: "../../../images/myReportEvent/face1_light.png",
|
|
normalSatisify: "../../../images/myReportEvent/face2.png",
|
|
normalSatisifySelected: "../../../images/myReportEvent/face2_light.png",
|
|
verySatisify: "../../../images/myReportEvent/face3.png",
|
|
verySatisifySelected: "../../../images/myReportEvent/face3_light.png",
|
|
},
|
|
|
|
methods: {
|
|
inputSync,
|
|
|
|
onLoad() {
|
|
$modal = getComponent("#modal");
|
|
this.init();
|
|
},
|
|
onUnload() {
|
|
wx.removeStorageSync("myEvent");
|
|
},
|
|
async onShow() {
|
|
if (this.data.refreshFlag) {
|
|
this.getInfo();
|
|
}
|
|
},
|
|
|
|
async init() {
|
|
await app.doAfterLogin();
|
|
|
|
await this.getApiData();
|
|
|
|
this.setData({
|
|
iniLoaded: true,
|
|
refreshFlag: true,
|
|
});
|
|
},
|
|
|
|
async getApiData() {
|
|
await this.getInfo();
|
|
// const { info } = this.data;
|
|
// if (info.userIdentity === "mention_user") {//人大代表
|
|
// await this.readEvent();
|
|
// }
|
|
|
|
await this.getReplyList();
|
|
await this.getProgressInfo();
|
|
},
|
|
|
|
//读取
|
|
async readEvent() {
|
|
const { eventId } = this.data;
|
|
|
|
const {
|
|
data: {
|
|
data: { code, data },
|
|
},
|
|
msg,
|
|
} = await wxRequestPost(
|
|
"gov/project/resievent/updateviewtime",
|
|
{
|
|
viewType: "resi_user",
|
|
eventId,
|
|
},
|
|
{
|
|
//isMock: true,
|
|
// isQuiet: true
|
|
}
|
|
);
|
|
if (msg === "success" && code === 0) {
|
|
}
|
|
},
|
|
|
|
//回复
|
|
async replay() {
|
|
const { eventId, info } = this.data;
|
|
let { replyInfo } = this.data;
|
|
|
|
if (replyInfo.content === "") {
|
|
return wx.showToast({
|
|
title: "回复内容不能为空",
|
|
icon: "none",
|
|
duration: 1500,
|
|
});
|
|
}
|
|
|
|
replyInfo.icEventId = eventId;
|
|
|
|
let url = "gov/project/icEvent/resi-reply";
|
|
// if (info.userIdentity === "report_user") {
|
|
// //报事人回复
|
|
// url = "gov/project/resieventreply/selfReply";
|
|
// } else if (info.userIdentity === "mention_user") {
|
|
// //被@的人大代表回复
|
|
// url = "gov/project/resieventreply/atReply";
|
|
// } else {
|
|
// return wx.showToast({
|
|
// title: "回复失败,请重试",
|
|
// icon: "none",
|
|
// duration: 1500,
|
|
// });
|
|
// }
|
|
|
|
const {
|
|
data: {
|
|
data: { code, data },
|
|
},
|
|
msg,
|
|
} = await wxRequestPost(url, replyInfo, {
|
|
//isMock: true,
|
|
// isQuiet: true
|
|
});
|
|
if (msg === "success" && code === 0) {
|
|
wx.showToast({
|
|
title: "回复成功",
|
|
icon: "none",
|
|
duration: 1500,
|
|
});
|
|
|
|
replyInfo.content = "";
|
|
|
|
this.setData({
|
|
replyInfo,
|
|
});
|
|
|
|
//刷新回复列表
|
|
this.getReplyList();
|
|
}
|
|
},
|
|
|
|
//解决/未解决
|
|
async resolve(e) {
|
|
const {
|
|
currentTarget: {
|
|
dataset: { type },
|
|
},
|
|
} = e;
|
|
|
|
this.setData({
|
|
currentResolveType: type,
|
|
});
|
|
|
|
let typeShow = type === "resolve" ? "已解决" : "未解决";
|
|
|
|
const confirm = await $modal.show({
|
|
title: "",
|
|
content: "确认" + typeShow + "?",
|
|
showCancel: true,
|
|
confirmText: "确定",
|
|
});
|
|
$modal.hide();
|
|
|
|
if (confirm) {
|
|
const {
|
|
data: {
|
|
data: { code, data },
|
|
},
|
|
msg,
|
|
} = await wxRequestPost(
|
|
"gov/project/resievent/chooseresolve",
|
|
{
|
|
resiEventId: this.data.eventId,
|
|
resolveStatus: type,
|
|
},
|
|
{
|
|
//isMock: true,
|
|
// isQuiet: true
|
|
}
|
|
);
|
|
if (msg === "success" && code === 0) {
|
|
wx.showToast({
|
|
title: "操作成功",
|
|
icon: "none",
|
|
duration: 1500,
|
|
});
|
|
await this.getInfo();
|
|
}
|
|
}
|
|
},
|
|
|
|
// 事件详情
|
|
async getInfo() {
|
|
const { eventId } = this.data;
|
|
|
|
const {
|
|
data: {
|
|
data: { code, data },
|
|
},
|
|
msg,
|
|
} = await wxRequestPost(
|
|
"gov/project/icEvent/myreport-detail",
|
|
{
|
|
icEventId: eventId,
|
|
},
|
|
{
|
|
//isMock: true,
|
|
// isQuiet: true
|
|
}
|
|
);
|
|
if (msg === "success" && code === 0) {
|
|
this.setData({
|
|
info: data,
|
|
});
|
|
}
|
|
},
|
|
|
|
// 回复列表
|
|
async getReplyList() {
|
|
const { eventId } = this.data;
|
|
|
|
const {
|
|
data: {
|
|
data: { code, data },
|
|
},
|
|
msg,
|
|
} = await wxRequestPost(
|
|
"gov/project/icEvent/reply-list",
|
|
{
|
|
icEventId: eventId,
|
|
},
|
|
{
|
|
//isMock: true,
|
|
// isQuiet: true
|
|
}
|
|
);
|
|
if (msg === "success" && code === 0) {
|
|
this.setData({
|
|
replyList: data,
|
|
});
|
|
}
|
|
},
|
|
|
|
// 处理进展
|
|
async getProgressInfo() {
|
|
const { info } = this.data;
|
|
|
|
const {
|
|
data: {
|
|
data: { code, data },
|
|
},
|
|
msg,
|
|
} = await wxRequestPost(
|
|
"gov/project/icEvent/process",
|
|
{
|
|
icEventId: info.icEventId,
|
|
},
|
|
{
|
|
//isMock: true,
|
|
// isQuiet: true
|
|
}
|
|
);
|
|
if (msg === "success" && code === 0) {
|
|
this.setData({
|
|
progressList: data[0] ? [data[0]] : data,
|
|
});
|
|
}
|
|
},
|
|
|
|
//撤回
|
|
async recall() {
|
|
const confirm = await $modal.show({
|
|
title: "",
|
|
content: "确认撤回事件?",
|
|
showCancel: true,
|
|
confirmText: "确定",
|
|
});
|
|
$modal.hide();
|
|
|
|
if (confirm) {
|
|
const {
|
|
data: {
|
|
data: { code, data },
|
|
},
|
|
msg,
|
|
} = await wxRequestPost(
|
|
"gov/project/resievent/recall",
|
|
{
|
|
resiEventId: this.data.eventId,
|
|
},
|
|
{
|
|
//isMock: true,
|
|
// isQuiet: true
|
|
}
|
|
);
|
|
if (msg === "success" && code === 0) {
|
|
wx.navigateBack();
|
|
}
|
|
}
|
|
},
|
|
|
|
// 点击查看作品图集
|
|
previewImg(e) {
|
|
const {
|
|
target: {
|
|
dataset: { index },
|
|
},
|
|
} = e;
|
|
const { info } = this.data,
|
|
currentImg = info.imageList[index],
|
|
imgArr = info.imageList;
|
|
wx.previewImage({
|
|
current: currentImg,
|
|
urls: imgArr,
|
|
});
|
|
},
|
|
|
|
// 选择 满意度
|
|
chooseSatisifyType(e) {
|
|
let type = e.currentTarget.dataset.type;
|
|
this.setData({
|
|
satisifyType: type, //e.currentTarget.dataset.type
|
|
});
|
|
wx.showModal({
|
|
content: "提交当前评价?",
|
|
success: (res) => {
|
|
if (res.confirm) {
|
|
this.icEventEvaluate();
|
|
}
|
|
},
|
|
});
|
|
},
|
|
// 提交满意度
|
|
async icEventEvaluate() {
|
|
const { eventId } = this.data;
|
|
const {
|
|
data: {
|
|
data: { code, data },
|
|
},
|
|
msg,
|
|
} = await wxRequestPost(
|
|
"gov/project/icEvent/comment",
|
|
{
|
|
icEventId: eventId,
|
|
satisfaction: this.data.satisifyType,
|
|
},
|
|
{
|
|
//isMock: true,
|
|
}
|
|
);
|
|
if (msg === "success" && code === 0) {
|
|
wx.showToast({
|
|
title: "评价完成",
|
|
icon: "none",
|
|
duration: 2500,
|
|
});
|
|
this.setData({
|
|
"info.satisfaction": this.data.satisifyType,
|
|
});
|
|
}
|
|
},
|
|
},
|
|
});
|
|
|