|
|
@ -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({ |
|
|
|