|
@@ -1,7 +1,7 @@
|
|
|
-const _Http = getApp().globalData.http;
|
|
|
+const _Http = getApp().globalData.http,
|
|
|
+ MFT = require("../../utils/matchingFeilType");
|
|
|
|
|
|
Page({
|
|
|
-
|
|
|
/**
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
@@ -9,9 +9,11 @@ Page({
|
|
|
rate: {
|
|
|
nubmer: 5,
|
|
|
text: "非常满意"
|
|
|
- }
|
|
|
+ },
|
|
|
+ videoList: [],
|
|
|
+ loading: false,
|
|
|
+ isEvaluate: false
|
|
|
},
|
|
|
-
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
@@ -25,11 +27,26 @@ Page({
|
|
|
}
|
|
|
}).then(res => {
|
|
|
console.log('详情', res)
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+
|
|
|
+ let list = MFT.fileList(res.data[0].attinfos.filter(v => v.usetype != 'cover')),
|
|
|
+ videoList = [],
|
|
|
+ attinfos = [];
|
|
|
+ if (list.length > 0) {
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ list[i].fileType == 'video' ? videoList.push(list[i]) : attinfos.push(list[i]);
|
|
|
+ }
|
|
|
+ res.data[0].attinfos = attinfos;
|
|
|
+ }
|
|
|
if (res.data[0].content.length) res.data[0].content = decodeURIComponent(res.data[0].content);
|
|
|
this.setData({
|
|
|
- detailsData: res.data[0]
|
|
|
- })
|
|
|
- })
|
|
|
+ detailsData: res.data[0],
|
|
|
+ videoList
|
|
|
+ });
|
|
|
+ });
|
|
|
_Http.basic({
|
|
|
"classname": "saletool.notice.notice",
|
|
|
"method": "queryReadRecord",
|
|
@@ -37,9 +54,22 @@ Page({
|
|
|
"sat_noticeid": options.id
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- console.log("评分", res)
|
|
|
- })
|
|
|
-
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ let isEvaluate = false;
|
|
|
+ if (res.data[0].score != 0) {
|
|
|
+ this.rateChange({
|
|
|
+ detail: res.data[0].score
|
|
|
+ })
|
|
|
+ isEvaluate = true;
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ evaluate: res.data[0],
|
|
|
+ isEvaluate
|
|
|
+ })
|
|
|
+ });
|
|
|
},
|
|
|
/* 评分 */
|
|
|
rateChange({
|
|
@@ -70,13 +100,65 @@ Page({
|
|
|
rate
|
|
|
})
|
|
|
},
|
|
|
+ textInput({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ this.setData({
|
|
|
+ "evaluate.leavemessage": detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ submit() {
|
|
|
+ if (this.data.isEvaluate) return wx.showToast({
|
|
|
+ title: '您已提交过建议',
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ const evaluate = this.data.evaluate,
|
|
|
+ that = this;
|
|
|
+ if (evaluate.leavemessage.length > 0) {
|
|
|
+ that.updateReadRecord()
|
|
|
+ } else {
|
|
|
+ wx.showModal({
|
|
|
+ title: "提示",
|
|
|
+ content: "通告评分(建议与反馈)没有完成,是否确认提交,提交后无法修改",
|
|
|
+ success: res => {
|
|
|
+ if (res.confirm) that.updateReadRecord()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ updateReadRecord() {
|
|
|
+ this.setData({
|
|
|
+ loading: true
|
|
|
+ })
|
|
|
+ _Http.basic({
|
|
|
+ "classname": "saletool.notice.notice",
|
|
|
+ "method": "updateReadRecord",
|
|
|
+ "content": {
|
|
|
+ "sat_noticeid": this.data.detailsData.sat_noticeid,
|
|
|
+ "score": this.data.rate.nubmer,
|
|
|
+ "leavemessage": this.data.evaluate.leavemessage
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ this.setData({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ wx.showToast({
|
|
|
+ title: '提交成功!',
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ isEvaluate: true
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
|
|
- onReady() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
+ onReady() {},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|