Browse Source

小程序上增加满意度评价的模块

taidong
duanliangtao 1 year ago
parent
commit
1d03b9585d
  1. BIN
      subpages/demandCheck/images/satisfy-images/face1.png
  2. BIN
      subpages/demandCheck/images/satisfy-images/face1_light.png
  3. BIN
      subpages/demandCheck/images/satisfy-images/face2.png
  4. BIN
      subpages/demandCheck/images/satisfy-images/face2_light.png
  5. BIN
      subpages/demandCheck/images/satisfy-images/face3.png
  6. BIN
      subpages/demandCheck/images/satisfy-images/face3_light.png
  7. 97
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js
  8. 29
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml
  9. 17
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss
  10. 5
      utils/api.js

BIN
subpages/demandCheck/images/satisfy-images/face1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
subpages/demandCheck/images/satisfy-images/face1_light.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

BIN
subpages/demandCheck/images/satisfy-images/face2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
subpages/demandCheck/images/satisfy-images/face2_light.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
subpages/demandCheck/images/satisfy-images/face3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
subpages/demandCheck/images/satisfy-images/face3_light.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

97
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js

@ -35,7 +35,8 @@ Page({
content: "", //内容
address: "", //地址
demandType:'chengguan',
status: "processing"
status: "processing",
satisfaction:''
},
minDate: '2018-01-01 00:00:00',
@ -91,6 +92,17 @@ Page({
categoryIds:'',
processData: [],
//满意度评价
selBad: false,
selGood: false,
selPerfect: false,
badurl: "../../../images/satisfy-images/face1.png",
badurl_light: "../../../images/satisfy-images/face1_light.png",
goodurl: "../../../images/satisfy-images/face2.png",
goodurl_light: "../../../images/satisfy-images/face2_light.png",
perfecturl: "../../../images/satisfy-images/face3.png",
perfecturl_light: "../../../images/satisfy-images/face3_light.png",
},
/**
@ -177,6 +189,7 @@ Page({
'fmData.responsibleName': res.data.responsibleName,
'fmData.responsibleMobile': res.data.responsibleMobile,
'fmData.status': res.data.status,
'fmData.satisfaction': res.data.satisfaction!=null?res.data.satisfaction:'',
agencyName: res.data.gridName,
showTime: res.data.happenTime,
addressContent: res.data.address,
@ -199,6 +212,22 @@ Page({
if (this.data.uploadRecord) {
this.downLoadAudio()
}
if(this.data.fmData.satisfaction==='bad'){
this.setData({
selBad: true
});
}else if(this.data.fmData.satisfaction==='good'){
this.setData({
selGood: true
});
}else if(this.data.fmData.satisfaction==='perfect'){
this.setData({
selPerfect: true
});
}
}).catch(err => {
console.log(err);
})
@ -425,6 +454,50 @@ formatTimestamp(timestamp) {
}
})
},
comment(){
let that = this
wx.showModal({
title: '提示',
content: '确定要提交满意度吗?',
success(res) {
if (res.confirm) {
that.icEventOldComment()
} else if (res.cancel) {}
}
})
},
icEventOldComment() {
const parm = {}
parm.icEventId = this.data.optionsId
if (this.data.selBad) {
parm.satisfaction = "bad";
} else if (this.data.selGood) {
parm.satisfaction = "good";
} else if (this.data.selPerfect) {
parm.satisfaction = "perfect";
}
api.icEventOldComment(parm).then(res => {
if (res.code === 0) {
wx.showToast({
title: '评价成功',
icon: 'none',
success() {
setTimeout(() => {
wx.navigateBack({
delta: 1
})
}, 3000)
}
})
}
}).catch(err => {
console.log(err);
})
},
icEventOldDelete() {
api.icEventOldDelete([this.data.optionsId]).then(res => {
if (res.code === 0) {
@ -1757,6 +1830,28 @@ formatTimestamp(timestamp) {
url: `/subpages/myTroubleshootDemand/pages/event/event?id=${this.data.optionsId}&categoryIds=${this.data.categoryIds}`,
})
},
clickSatisfy(e){
const type = e.currentTarget.dataset.satisfy;
if (type === "bad") {
this.setData({
selGood: false,
selPerfect: false,
selBad: true
})
} else if (type === "good") {
this.setData({
selGood: true,
selPerfect: false,
selBad: false
})
} else if (type === "perfect") {
this.setData({
selGood: false,
selPerfect: true,
selBad: false
})
}
},
previewImage(e) {
const currentUrl = e.currentTarget.dataset.url;
wx.previewImage({

29
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml

@ -192,6 +192,29 @@
</view>
</view>
<view class="card" wx:if="{{fmData.status==='closed_case'}}">
<view class="title1" style="margin-bottom: 0;">满意度评价</view>
<view>
<view class="satisfy_image-row">
<block>
<view>
<image src="{{selBad?badurl_light:badurl}}" mode="aspectFill" bindtap="clickSatisfy" data-satisfy="bad"/>
</view>
</block>
<block>
<view>
<image src="{{selGood?goodurl_light:goodurl}}" mode="aspectFill" bindtap="clickSatisfy" data-satisfy="good"/>
</view>
</block>
<block>
<view>
<image src="{{selPerfect?perfecturl_light:perfecturl}}" mode="aspectFill" bindtap="clickSatisfy" data-satisfy="perfect"/>
</view>
</block>
</view>
</view>
</view>
<view class="card" wx:if="{{(tabVal === '0' || tabVal === '2') && processData.length > 0}}">
<view class="title1" style="margin-bottom: 0;">处理进展</view>
<wux-steps wx:if="{{processData.length > 0}}" style="margin-top: 50rpx" direction="vertical" :current="0">
@ -298,9 +321,13 @@
<view class="bto_btn" wx:if="{{optionsId && fmData.status!='' && fmData.status!='closed_case'}}">
<button hover-class="btn-hover" bind:tap="update" class="btn_blue" >{{isDisabled ? '修改' : '提交'}}</button>
<button bind:tap="delete" class="btn_yellow">删除</button>
<button bind:tap="delete" class="btn_yellow" wx:if="{{!isDisabled}}">删除</button>
<button bind:tap="process" class="btn_red" wx:if="{{tabVal === '0' || tabVal === '2'}}">处理</button>
</view>
<view class="bto_btn" wx:if="{{fmData.status==='closed_case' && fmData.satisfaction==='' }}">
<button bind:tap="comment" class="btn_blue" wx:if="{{selGood || selPerfect || selBad}}">提交满意度</button>
</view>
</block>
</view>
<view class="sheet-bg" wx:if="{{showRecord}}"></view>

17
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss

@ -1144,6 +1144,23 @@ background: rgb(175, 1, 1);
border-radius: 5px; /* 圆角边框,可根据需要调整 */
}
.satisfy_image-row{
display: flex;
flex-wrap: nowrap; /* 防止换行 */
overflow-x: auto; /* 当图片超出一行时,可以横向滚动 */
align-items: center;
margin-top: 50rpx;
}
.satisfy_image-row image {
flex: 0 0 auto; /* 防止图片缩放 */
margin: 0 15px; /* 控制图片之间的间距 */
width: 80px; /* 固定宽度,可根据需要调整 */
height: 80px; /* 固定高度,可根据需要调整 */
object-fit: cover; /* 保持图片比例 */
border: 2px solid #ccc; /* 添加边框,颜色为浅灰色 */
border-radius: 5px; /* 圆角边框,可根据需要调整 */
}
.disabled {
pointer-events: none; /* 禁止点击 */
}

5
utils/api.js

@ -63,6 +63,7 @@ module.exports = {
updateMeasure,
userDemandCance,
icEventOldDelete,
icEventOldComment,
updateEvent,
submitResi,
getAllOrgCategoryCount,
@ -359,6 +360,10 @@ function userDemandCance(parm) {
function icEventOldDelete(parm) {
return fly.post(`governance/icEventOld/delete`,parm)
}
// 评价事件
function icEventOldComment(parm) {
return fly.post(`governance/icEventOld/comment`,parm)
}
// 更新事件
function updateEvent(parm) {
return fly.post(`governance/icEventOld/update`,parm)

Loading…
Cancel
Save