store 8.13

This commit is contained in:
2020-08-13 11:54:44 +08:00
parent f9a2ada1d3
commit 02639fc9e1
12 changed files with 118 additions and 84 deletions

View File

@@ -8,14 +8,15 @@
<view class="order-rate">
<view class="rate">
<view class="title">物流评分</view>
<u-rate :count="5" active-color="#FF780F" inactive-color="#CCCCCC" v-model="logistics" gutter="20" size="32"></u-rate>
<u-rate :count="5" min-count="1" active-color="#FF780F" inactive-color="#CCCCCC" v-model="logistics" gutter="20" size="32"></u-rate>
</view>
<view class="rate">
<view class="title">服务态度</view>
<u-rate :count="5" v-model="service" active-color="#FF780F" inactive-color="#CCCCCC" gutter="20" size="32"></u-rate>
<u-rate :count="5" min-count="1" v-model="service" active-color="#FF780F" inactive-color="#CCCCCC" gutter="20" size="32"></u-rate>
</view>
</view>
<view class="write-btn" @click="submitComment">发表意见</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
@@ -26,13 +27,14 @@ export default {
return {
orderId: '',
count: 3, // 最大图片数量
logistics: 0, // 物流服务
service: 0, // 服务态度
logistics: 1, // 物流服务
service: 1, // 服务态度
describe: [],
content: [],
imageList: [], // 本地图片路径
goodsList: [],
uploadImageList: [], // 线上图片名字
debounce: true, // 防止多次提交
}
},
components: {
@@ -76,7 +78,7 @@ export default {
setModelKey(data) {
data.forEach(() => {
this.content.push('');
this.describe.push(0);
this.describe.push(1);
this.imageList.push([]);
})
},
@@ -123,29 +125,28 @@ export default {
})
},
verifyParams() {
let status = true;
this.goodsList.forEach((_, index) => {
if(this.$u.test.isEmpty(this.content[index])) {
this.$u.toast('内容不可为空');
return false;
status = false;
}
})
return true;
return status;
},
submitComment() {
// console.log(this.content);
// console.log(this.describe);
// console.log(this.imageList);
this.uploadImage();
// this.goodsList.forEach((_, index) => {
// })
},
addOrderEvaluate() {
if(!this.verifyParams()) return false;
if(!this.debounce) return false;
let files = [];
// console.log(this.uploadImageList);
this.uploadImageList.forEach((item, index) => {
files[index] = '';
// files[index] = '';
// console.log(item);
item.forEach((img, idx) => {
if(idx < item.length-1) {
@@ -161,11 +162,21 @@ export default {
scores_one: this.logistics,
scores_two: this.service,
scores_three: this.describe,
file: files,
};
console.log(params);
if(files.length) {
Object.assign(params, { file: files })
}
// console.log(params);
this.$u.api.updateOrderEvaluate(params).then(res => {
this.$u.toast(res.message);
if(res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
back: true,
})
} else {
this.$u.toast(res.message);
this.debounce = true;
}
})
},
},

View File

@@ -128,7 +128,7 @@ export default {
orderInfo: {},
oid: '',
timer: '',
countdown: '', // 倒计时
countdown: '00:00:00', // 倒计时
isSpike: false, // 倒计时是否结束
}
},

View File

@@ -10,7 +10,7 @@
</view>
<view class="rate">
<view class="title">描述相符</view>
<u-rate :count="5" v-model="describe" active-color="#FF780F" inactive-color="#CCCCCC" gutter="20" size="32"></u-rate>
<u-rate :count="5" min-count="1" v-model="describe" active-color="#FF780F" inactive-color="#CCCCCC" gutter="20" size="32"></u-rate>
</view>
<u-input v-model="content" type="textarea" height="100" :auto-height="true" placeholder="发表你的评价吧,收货时心情如何?" />
<u-upload
@@ -45,7 +45,7 @@ export default {
name: 'common', // 其他图片
},
content: '',
describe: '',
describe: 1,
imageList: [],
}
},
@@ -68,7 +68,7 @@ export default {
lists.forEach(item => {
this.imageList.push(item.url);
})
console.log(this.imageList);
// console.log(this.imageList);
this.$emit('setLocalImage', { list: this.imageList, index: this.index });
}
}