|
|
|
@ -7,15 +7,17 @@
|
|
|
|
|
<view>
|
|
|
|
|
<text>{{"菜品名称:" + dish_name + '\n'}}</text>
|
|
|
|
|
<text>{{"菜品位置:" + dish_location + dish_window_name + '\n'}}</text>
|
|
|
|
|
<text>{{"菜品类别:" + dish_label + '\n'}}</text>
|
|
|
|
|
<text>{{"菜品评分:" + dish_avg_score + '\n'}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="evaluete">
|
|
|
|
|
|
|
|
|
|
<hb-comment ref="hbComment" @add="add" @del="del" @like="like" :deleteTip="'确认删除?'"
|
|
|
|
|
:cmData="commentData" v-if="commentData"></hb-comment>
|
|
|
|
|
<hb-comment ref="hbComment" @add="add" @del="del" @like="like" :deleteTip="'确认删除?'" :cmData="commentData"
|
|
|
|
|
v-if="commentData"></hb-comment>
|
|
|
|
|
</view>
|
|
|
|
|
<view>
|
|
|
|
|
<text>{{"评分:\n"}}</text>
|
|
|
|
|
<uni-rate v-model="value" @change="onChange(e.value)" allow-half="true" size="75" />
|
|
|
|
|
<text>{{"菜品打分:\n"}}</text>
|
|
|
|
|
<uni-rate v-model="value" @change="onChange" allow-half="true" size="75" />
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
@ -32,8 +34,9 @@
|
|
|
|
|
dish_location: '',
|
|
|
|
|
dish_window_name: '',
|
|
|
|
|
value: 4,
|
|
|
|
|
comentData:[],
|
|
|
|
|
dish_id:''
|
|
|
|
|
comentData: [],
|
|
|
|
|
dish_id: '',
|
|
|
|
|
dish_avg_score: 5.0
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
onLoad(option) {
|
|
|
|
@ -41,7 +44,7 @@
|
|
|
|
|
//this.getLabels()
|
|
|
|
|
this.dish_id = JSON.parse(decodeURIComponent(option._id))
|
|
|
|
|
this.getImage()
|
|
|
|
|
console.log(this.dish_id )
|
|
|
|
|
console.log(this.dish_id)
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getImage() {
|
|
|
|
@ -55,8 +58,9 @@
|
|
|
|
|
success: function(res) {
|
|
|
|
|
that.dish_image_src = res.result.data[0].dish_src
|
|
|
|
|
that.dish_name = res.result.data[0].dish_name
|
|
|
|
|
that.dish_location =res.result.data[0].location
|
|
|
|
|
that.dish_window_name =res.result.data[0].window_name
|
|
|
|
|
that.dish_location = res.result.data[0].location
|
|
|
|
|
that.dish_window_name = res.result.data[0].window_name
|
|
|
|
|
that.dish_avg_score = res.result.data[0].avg_score
|
|
|
|
|
console.log(res)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -75,25 +79,23 @@
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
onChange() {
|
|
|
|
|
this.value = e.value
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
updateScore() {
|
|
|
|
|
onChange(e) {
|
|
|
|
|
let that = this
|
|
|
|
|
uniCloud.callFunction({
|
|
|
|
|
name: 'scoreUpdate',
|
|
|
|
|
data: {
|
|
|
|
|
//用户信息和获取的评分
|
|
|
|
|
score: that.value,
|
|
|
|
|
dish_id: that.dish_id
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
add(commentReq){
|
|
|
|
|
add(commentReq) {
|
|
|
|
|
console.log(commentReq)
|
|
|
|
|
},
|
|
|
|
|
del(commentid){
|
|
|
|
|
del(commentid) {
|
|
|
|
|
console.log(commentid)
|
|
|
|
|
},
|
|
|
|
|
like(commentid){
|
|
|
|
|
like(commentid) {
|
|
|
|
|
console.log(commentid)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -117,6 +119,5 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.evaluete{
|
|
|
|
|
}
|
|
|
|
|
.evaluete {}
|
|
|
|
|
</style>
|