|
@@ -25,10 +25,10 @@
|
|
|
</view>
|
|
|
<view class="rate-wrap u-flex">
|
|
|
<text class="rate-title">商品评价</text>
|
|
|
- <u-rate count="5" v-model="params.rate" active-color="#FFBE00" size="20"></u-rate>
|
|
|
- <text class="rate-text">{{params.rate|rateText}}</text>
|
|
|
+ <u-rate count="5" v-model="params.star" active-color="#FFBE00" size="20"></u-rate>
|
|
|
+ <text class="rate-text">{{params.star|rateText}}</text>
|
|
|
</view>
|
|
|
- <u--textarea v-model="params.content" height="200rpx" maxlength="200" placeholder="如实描述商品和使用感受,更受欢迎" ></u--textarea>
|
|
|
+ <u--textarea v-model="params.contentText" height="200rpx" maxlength="200" placeholder="如实描述商品和使用感受,更受欢迎" ></u--textarea>
|
|
|
<view class="upload-wrap">
|
|
|
<u-upload
|
|
|
width="140rpx"
|
|
@@ -39,7 +39,7 @@
|
|
|
:previewImage="true"
|
|
|
multiple
|
|
|
name="name"
|
|
|
- :maxCount="9"
|
|
|
+ :maxCount="5"
|
|
|
></u-upload>
|
|
|
</view>
|
|
|
<view class="full-btn" @click="submit">提交评价</view>
|
|
@@ -53,9 +53,10 @@
|
|
|
return {
|
|
|
id:'',
|
|
|
params:{
|
|
|
- rate:3,
|
|
|
- content:'',
|
|
|
- imgs:[]
|
|
|
+ orderId:'',
|
|
|
+ star:5,
|
|
|
+ contentText:'',
|
|
|
+ contentImgList:[]
|
|
|
},
|
|
|
fileList:[],
|
|
|
orderDetails:{},
|
|
@@ -66,8 +67,8 @@
|
|
|
},
|
|
|
onLoad(page) {
|
|
|
console.log('page',page);
|
|
|
- this.id = page.id;
|
|
|
- this.getOrderDetails(this.id)
|
|
|
+ this.params.orderId = page.id;
|
|
|
+ this.getOrderDetails(this.params.orderId)
|
|
|
},
|
|
|
methods: {
|
|
|
getOrderDetails(id){
|
|
@@ -95,10 +96,21 @@
|
|
|
this.fileList.splice(event.index, 1)
|
|
|
},
|
|
|
submit(){
|
|
|
- this.params.imgs = this.fileList.map(item =>{
|
|
|
+ this.params.contentImgList = this.fileList.map(item =>{
|
|
|
if(item.message=='成功'){
|
|
|
return item.url.url
|
|
|
}
|
|
|
+ });
|
|
|
+ this.$u.api.addGoodsComment(this.params).then(res=>{
|
|
|
+ console.log('res',res.data);
|
|
|
+ uni.showToast({
|
|
|
+ title:res.msg,
|
|
|
+ complete() {
|
|
|
+ uni.navigateBack()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }).catch(err=>{
|
|
|
+ console.log('addGoodsComment',err);
|
|
|
})
|
|
|
console.log('params',this.params);
|
|
|
}
|