123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <template>
- <view class="layout">
- <view class="assessHead">
- <span style="padding-right: 10upx;">评价</span>
- <van-rate
- :value="valueNumber"
- :size="20"
- void-color="#eee"
- void-icon="star"
- color="#ee0a24"
- @change="changestar"
- />
- </view>
- <TextArea :tips="tips" @submitValue="submitValue"/>
- <view>
- <view>添加图片(最多3张)</view>
- <uploadImage @getImg="getImg" />
-
- </view>
- <view class="submitRemin" @click="submitRemin">提交</view>
- </view>
- </template>
- <script>
- import TextArea from '@/component/textarea.vue'
- import uploadImage from '@/component/uploadImage.vue'
- export default {
- components: {
- TextArea,
- uploadImage
- },
- data() {
- return{
- order_id:'',
- valueNumber: 0,
- imageList:'',
- size: 25,
- goodComment:'',
- tips: '五星好评超过20个字就有机会获得积分'
- }
- },
- onUnload() {
-
- },
- onLoad(e) {
- this.order_id = e.order_id;
-
- },
- methods: {
- changestar(e) {
- this.valueNumber = e.detail;
- },
- getImg(e) {
- console.log(e);
- this.imageList = e.join(',');
- },
- submitValue(e) {
- this.goodComment = e.detail.value;
- },
- submitRemin() {
- if(this.valueNumber == 0) {
- this.$msg("请完成星级评价");
- return;
-
- }else if(this.goodComment == '') {
- this.$msg("请填写反馈内容");
- return;
- }else {
- this.request({
- url: '/v2/order/evaluate',
- method: 'post',
- data: {
- order_id: this.order_id,
- score: this.valueNumber,
- content: this.goodComment,
- img_list: this.imageList
- },
-
- success: (res) => {
- uni.$emit('finshesitmate');
- setTimeout(()=> {
- uni.navigateBack()
- }, 2000)
- }
- })
- }
- }
-
- }
- }
- </script>
- <style lang="scss">
- .layout {
- padding: 0 32upx;
- .assessHead {
- padding: 20upx 0;
- }
- .deepHeight {
- height: 108upx;
- width: 108upx;
- }
- }
- </style>
|