chenteng 5 years ago
parent
commit
972c161221
  1. 7
      models/user.js
  2. 11
      pages/topics/talents/index.js
  3. 60
      pages/user/myWhistle/evaluate/index.js
  4. 35
      pages/user/myWhistle/evaluate/index.wxml
  5. 6
      pages/user/myWhistle/evaluate/index.wxss
  6. 2
      pages/user/myWhistle/index.wxss
  7. 19
      pages/user/myWhistle/whistleDetail/index.js
  8. 21
      pages/user/myWhistle/whistleDetail/index.wxml
  9. 1
      pages/user/myWhistle/whistleDetail/index.wxss

7
models/user.js

@ -205,9 +205,10 @@ class UserModel extends HTTP {
url:UserConst.user_saveWhistleComment_url,
method: Method.POST,
data: {
id:data.id,
score:data.score,
comment:data.comment
// id:data.id,
// score:data.score,
// comment:data.comment,
list:data.list
},
success: success
}

11
pages/topics/talents/index.js

@ -170,9 +170,7 @@ Component({
return
}
topicModel.addTalents(this.data.messageDetail, this.data.files,this.data.streetID,res=>{
const id = res.result;
console.log("得到id值");
console.log(id);
const id = res.result;
if(res.code === 200){
this.setData({
messageDetail: '',
@ -186,16 +184,9 @@ Component({
confirmText:'查看进度',
success (res) {
if (res.confirm) {
console.log('用户点击查看进度')
console.log(res)
// 查看进度怎么填呀??
// wx.navigateTo({
// url: `/pages/article/index?id=${id}`,
// })
//不用wx.navigateTo,改用wx.redirectTo(url: 'test?id=1'})
//浩然会给我一个接口返回id值
console.log('talent的id')
console.log(id);
wx.redirectTo({
// url: '../../user/myWhistle/whistleDetail/index?id=${id}',
url: '/pages/user/myWhistle/whistleDetail/index?id='+id,

60
pages/user/myWhistle/evaluate/index.js

@ -9,7 +9,8 @@ Page({
data: {
evaluate:'',
comment:'',
score:''
score:'',
list:[]
},
/**
@ -17,8 +18,11 @@ Page({
*/
onLoad: function (options) {
this.setData({
id:options.id
id:options.id,
list:JSON.parse(options.list)
})
// console.log(this.data.list)
},
/**
@ -70,32 +74,54 @@ Page({
},
rate:function(e){
var score = e.detail;
var id = e.currentTarget.id;
var list = this.data.list;
list[id]['score'] = score;
this.setData({
score:score
list:list
})
// this.setData({
// score:score
// })
},
opinion:function(e){
var id = e.currentTarget.id;
var list = this.data.list;
list[id]['comment'] = e.detail.value;
this.setData({
comment: e.detail.value
// comment: e.detail.value
list:list
})
},
submit:function(){
var score = this.data.score;
if(score == ''){
wx.showToast({
title: '请为本次处理评分',
icon: 'none',
duration: 1500
});
return;
// var score = this.data.score;
// if(score == ''){
// wx.showToast({
// title: '请为本次处理评分',
// icon: 'none',
// duration: 1500
// });
// return;
// }
for(var i in this.data.list){
if(!this.data.list[i]['score']){
wx.showToast({
title: '请为本次处理评分',
icon: 'none',
duration: 1500
});
return;
}
}
var param = {};
param.id = this.data.id;
param.score = this.data.score;
param.comment = this.data.comment;
// param.id = this.data.id;
// param.score = this.data.score;
// param.comment = this.data.comment;
param.list = JSON.stringify(this.data.list);
userModel.whistleComment(param,res=>{
if(res.code == 200){
wx.showModal({

35
pages/user/myWhistle/evaluate/index.wxml

@ -1,25 +1,28 @@
<!--pages/user/myWhistle/evaluate/index.wxml-->
<wxs module="whistle" src="../whistle.wxs"></wxs>
<view class="title">请对本次的处理进行评价</view>
<view class="rate">
<block wx:for="{{list}}" wx:for-index='key'>
<van-rate
value="{{ value }}"
size="{{ 45 }}"
gutter="{{ 10 }}"
color="#ee0a24"
void-color="#eee"
void-icon="star"
bind:change="rate" />
</view>
<view class="title">请对{{item.departName}}的处理进行评价</view>
<view class="evaluate">{{whistle.getEvaluate(score)}}</view>
<view class="rate">
<van-rate
id="{{ key }}"
value="{{ item.score }}"
size="{{ 45 }}"
gutter="{{ 10 }}"
color="#ee0a24"
void-color="#eee"
void-icon="star"
bind:change="rate" />
</view>
<view class="evaluate">{{whistle.getEvaluate(item.score)}}</view>
<view class="opinion">
<textarea placeholder="请填写您的建议" bindinput="opinion" />
</view>
<view class="opinion">
<textarea placeholder="请填写您的建议" id="{{key}}" bindinput="opinion" />
</view>
</block>
<view class="btn-bottom">
<button class="btn1" bindtap="submit">提交</button>

6
pages/user/myWhistle/evaluate/index.wxss

@ -39,8 +39,10 @@ textarea{
display: flex;
width:100%;
justify-content: center;
position: fixed;
bottom: 40rpx;
/* position: fixed; */
/* bottom: 40rpx; */
margin-bottom: 40rpx;
background-color: white;
}
.btn1{

2
pages/user/myWhistle/index.wxss

@ -8,7 +8,7 @@ page{
width:100%;
height: 130px;
background-color: white;
margin-top:15rpx;
margin-top:3px;
display: flex;
flex-direction: column;
align-items: center;

19
pages/user/myWhistle/whistleDetail/index.js

@ -8,7 +8,9 @@ Page({
*/
data: {
detail:{},
img:[]
img:[],
commentList:[],
score:false
},
/**
@ -20,8 +22,15 @@ Page({
var img = res.result.picList.split(";");
this.setData({
detail:res.result,
img:img
})
img:img,
commentList:res.result.commentList
});
if(res.result.commentList[0]['score']){
this.setData({
score:true
})
}
});
},
/**
@ -84,9 +93,9 @@ Page({
if (!th.data.detail.id) {
return;
}
// console.log(JSON.stringify(th.data.commentList))
wx.navigateTo({
url: '../evaluate/index?id=' + th.data.detail.id
url: '../evaluate/index?id=' + th.data.detail.id + '&list=' + JSON.stringify(th.data.commentList)
})
}

21
pages/user/myWhistle/whistleDetail/index.wxml

@ -46,7 +46,7 @@
<view class="process-tit"><text style="font-size:16px">{{item.handleType}}</text><text style="font-size:13px">{{item.handleDate}}</text></view>
<text style="font-size:13px;color:#737373;">{{item.handleSuggestions}}</text>
<block wx:if="{{item.handleDepartName}}">
<text style="font-size:13px">处理部门{{item.handleDepartName}}</text>
<text style="font-size:13px">处理部门{{item.handleDepartName}}</text>
</block>
</view>
<!-- <view class="time">{{item.handleDate}}</view> -->
@ -64,20 +64,23 @@
<button class="btn1" bindtap="evaluation">我要评价</button>
</block>
<block wx:if="{{detail.score}}">
<block wx:if="{{score}}">
<view class="score">
<view class="text-title">
评价反馈
</view>
<view class="comment">
<view class="com-top">
<view>
<van-rate readonly value="{{ detail.score }}" color="#ee0a24"/> <text> {{whistle.getEvaluate(detail.score)}}</text>
<block wx:for="{{commentList}}">
<view class="comment">
<view class="com-top">
<view>
{{item.departName}} <van-rate readonly value="{{ item.score }}" color="#ee0a24"/> <text> {{whistle.getEvaluate(item.score)}}</text>
</view>
<view>{{item.commentDate}}</view>
</view>
<view>{{detail.commentDate}}</view>
<view class="com-bottom">{{item.comment}}</view>
</view>
<view class="com-bottom">{{detail.comment}}</view>
</view>
</block>
</view>
</block>

1
pages/user/myWhistle/whistleDetail/index.wxss

@ -143,6 +143,7 @@ text{
display: flex;
flex-direction: column;
justify-content: center;
margin-bottom: 10px;
}
.com-top{

Loading…
Cancel
Save