Browse Source

Merge branch 'master' of http://git.izouma.com/xiongzhu/jetour

drew 5 years ago
parent
commit
e3f614948b

+ 14 - 0
project.config.json

@@ -167,6 +167,20 @@
                     "query": "orderId=2042",
                     "query": "orderId=2042",
                     "scene": null
                     "scene": null
                 },
                 },
+                {
+                    "id": -1,
+                    "name": "评价晒单",
+                    "pathName": "pages/order/evaluation",
+                    "query": "orderId=5089",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "评价晒单详情",
+                    "pathName": "pages/order/evaluationInfo",
+                    "query": "orderId=5089",
+                    "scene": null
+                },
                 {
                 {
                     "id": -1,
                     "id": -1,
                     "name": "发票信息",
                     "name": "发票信息",

+ 15 - 3
src/components/OrderCardDefault.vue

@@ -78,7 +78,7 @@
                     size="small"
                     size="small"
                     round
                     round
                     type="default"
                     type="default"
-                    @click.stop="toRefundOrder"
+                    @click.stop="goDetail"
                     >查看进度</van-button
                     >查看进度</van-button
                 >
                 >
                 <van-button
                 <van-button
@@ -86,7 +86,7 @@
                     size="small"
                     size="small"
                     round
                     round
                     type="default"
                     type="default"
-                    @click.stop="toRefundOrder"
+                    @click.stop="goDetail"
                     >查看结果</van-button
                     >查看结果</van-button
                 >
                 >
                 <van-button
                 <van-button
@@ -95,11 +95,13 @@
                     round
                     round
                     type="default"
                     type="default"
                     :color="$colors.prim"
                     :color="$colors.prim"
-                    @click.stop="toRefundOrder"
+                    @click.stop="goDetail"
                     >填写物流信息</van-button
                     >填写物流信息</van-button
                 >
                 >
             </template>
             </template>
         </div>
         </div>
+
+        <span v-if="!isBack && info.inBackProgress" class="tips">售后处理中</span>
         <van-dialog id="van-dialog" />
         <van-dialog id="van-dialog" />
     </div>
     </div>
 </template>
 </template>
@@ -119,6 +121,7 @@ export default {
     border-radius: 5px;
     border-radius: 5px;
     box-shadow: 0 0 10px 2px #ebebeb;
     box-shadow: 0 0 10px 2px #ebebeb;
     padding: 16px 10px;
     padding: 16px 10px;
+    position: relative;
 }
 }
 .btnList {
 .btnList {
     display: flex;
     display: flex;
@@ -127,6 +130,7 @@ export default {
     ._van-button + ._van-button {
     ._van-button + ._van-button {
         margin-left: 10px;
         margin-left: 10px;
     }
     }
+    position: relative;
 }
 }
 .top2 {
 .top2 {
     display: flex;
     display: flex;
@@ -211,4 +215,12 @@ export default {
         color: @prim !important;
         color: @prim !important;
     }
     }
 }
 }
+
+.tips {
+    position: absolute;
+    bottom: 18px;
+    left: 15px;
+    font-size: 12px;
+    color: red;
+}
 </style>
 </style>

+ 2 - 0
src/main.js

@@ -90,6 +90,8 @@ export default {
             'pages/order/logistics',
             'pages/order/logistics',
             'pages/order/transparent',
             'pages/order/transparent',
             'pages/order/refundOrder',
             'pages/order/refundOrder',
+            'pages/order/evaluation',
+            'pages/order/evaluationInfo',
             'pages/video',
             'pages/video',
             'pages/coupe'
             'pages/coupe'
         ],
         ],

+ 1 - 4
src/mixins/Order.js

@@ -168,10 +168,7 @@ export default {
             this.goNext('/pages/order/backMoney?orderId=' + this.info.id + '&money=' + this.info.depositPrice);
             this.goNext('/pages/order/backMoney?orderId=' + this.info.id + '&money=' + this.info.depositPrice);
         },
         },
         //去支付
         //去支付
-        toPay() {
-            console.log('aaaa');
-            this.goNext('/pages/order/payonlyforcar?carOrderId=' + this.info.id);
-        },
+        toPay() {},
         cancelOrder() {
         cancelOrder() {
             this.goNext('/pages/order/cancelOrder?orderId=' + this.info.id);
             this.goNext('/pages/order/cancelOrder?orderId=' + this.info.id);
         },
         },

+ 7 - 3
src/mixins/OrderDefault.js

@@ -100,10 +100,14 @@ export default {
         },
         },
         cancelOrder() {},
         cancelOrder() {},
         toRefundOrder() {
         toRefundOrder() {
-            this.goNext(`/pages/order/refundOrder?orderId=${this.info.id}&money=${this.info.price}`);
+            this.goNext(`/pages/order/refundOrder?orderId=${this.info.id}&money=${this.info.backPrice}`);
         },
         },
         toCheckLogistics() {},
         toCheckLogistics() {},
-        toevaluation() {},
-        toevaluationDetail() {}
+        toevaluation() {
+            this.goNext(`/pages/order/evaluation?orderId=${this.info.id}`);
+        },
+        toevaluationDetail() {
+            this.goNext(`/pages/order/evaluationInfo?orderId=${this.info.id}`);
+        }
     }
     }
 };
 };

+ 4 - 1
src/mixins/OrderList.js

@@ -18,7 +18,10 @@ export default {
             this.getList();
             this.getList();
         }
         }
     },
     },
-    onLoad() {
+    onShow() {
+        this.pageNum = 0;
+        this.finish = false;
+        this.empty = false;
         this.getList();
         this.getList();
     },
     },
     methods: {
     methods: {

+ 7 - 1
src/pages/coupe.vue

@@ -215,9 +215,12 @@
                 id="dealerPicker"
                 id="dealerPicker"
             />
             />
         </van-action-sheet>
         </van-action-sheet>
+        <van-dialog id="van-dialog" />
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
+import Dialog from '../vant/dialog/dialog';
+import { payOrder } from '../utils/SpecialApi';
 export default {
 export default {
     data() {
     data() {
         return {
         return {
@@ -415,7 +418,9 @@ export default {
                 this.$http
                 this.$http
                     .get(
                     .get(
                         // eslint-disable-next-line prettier/prettier
                         // eslint-disable-next-line prettier/prettier
-                        `https://dealer.jetour.com.cn/api-basic/api/region/findCityByProvinceId/${e.detail.value[0].id}`,
+                        `https://dealer.jetour.com.cn/api-basic/api/region/findCityByProvinceId/${
+                            e.detail.value[0].id
+                        }`,
                         {},
                         {},
                         {
                         {
                             header: {
                             header: {
@@ -437,6 +442,7 @@ export default {
                         provinceId: this.provinceId,
                         provinceId: this.provinceId,
                         cityId: this.cityId,
                         cityId: this.cityId,
                         enabledFlag: 1,
                         enabledFlag: 1,
+                        seriesId: 'ee468f65-6110-42ae-9f48-1410ddddae54',
                         type: 1
                         type: 1
                     },
                     },
                     {
                     {

+ 255 - 0
src/pages/order/evaluation.vue

@@ -0,0 +1,255 @@
+<config>
+{
+'navigationBarTitleText': '发表评价',
+}
+</config>
+<template>
+    <div class="detail">
+        <div class="card">
+            <van-cell-group>
+                <van-cell icon="shop-o" :title="info.storeName"></van-cell>
+
+                <div class="content">
+                    <div class="start">
+                        <span class="name">描述相符</span>
+                        <van-rate
+                            :value="descScore"
+                            :size="20"
+                            color="#ee0a24"
+                            void-color="#eee"
+                            void-icon="star"
+                            @change="descScore = $event.detail"
+                        />
+                    </div>
+
+                    <div class="start">
+                        <span class="name">卖家服务</span>
+                        <van-rate
+                            :value="sellerScore"
+                            :size="20"
+                            color="#ee0a24"
+                            void-color="#eee"
+                            void-icon="star"
+                            @change="sellerScore = $event.detaill"
+                        />
+                    </div>
+                    <div class="start">
+                        <span class="name">物流服务</span>
+                        <van-rate
+                            :value="logisticsScore"
+                            :size="20"
+                            color="#ee0a24"
+                            void-color="#eee"
+                            void-icon="star"
+                            @change="logisticsScore = $event.detail"
+                        />
+                    </div>
+                </div>
+            </van-cell-group>
+        </div>
+
+        <div class="card" v-for="item in orderSkus" :key="item.skuId">
+            <div class="top">
+                <van-image width="60" height="60" :src="item.skuImage" />
+                <div class="right">
+                    <div class="name">商品满意度</div>
+                    <van-rate
+                        :value="item.score"
+                        :size="20"
+                        color="#ee0a24"
+                        void-color="#eee"
+                        void-icon="star"
+                        @change="item.score = $event.detail"
+                    />
+                </div>
+            </div>
+            <van-field
+                type="textarea"
+                placeholder="写下购买体会和使用感受来帮助其他小伙伴"
+                @change="item.comment = $event.detail"
+                :maxlength="100"
+                show-word-limit
+                :autosize="true"
+            />
+            <van-cell title="添加晒单图片(最多上传5张)" use-label-slot>
+                <div style="padding:10px 0 5px" slot="label">
+                    <van-uploader multiple :file-list="item.commentPics" :max-count="5" @after-read="afterRead" />
+                </div>
+            </van-cell>
+            <van-cell>
+                <div slot="title">
+                    <van-checkbox
+                        :checked-color="$colors.prim"
+                        shape="square"
+                        :value="item.isAnonymous"
+                        @change="item.isAnonymous = $event.detail"
+                        >匿名评价</van-checkbox
+                    >
+                </div>
+            </van-cell>
+        </div>
+
+        <div class="btnList">
+            <van-button @click="submit" block square :color="$colors.prim">发表评价</van-button>
+        </div>
+    </div>
+</template>
+<script>
+export default {
+    data() {
+        return {
+            info: {
+                storeName: ''
+            },
+            descScore: 5,
+            sellerScore: 5,
+            logisticsScore: 5,
+            orderSkus: []
+        };
+    },
+    onLoad() {
+        this.$http
+            .get('/applets/orderdetail', {
+                orderId: this.$mp.query.orderId
+            })
+            .then(res => {
+                this.info = res.data;
+
+                this.orderSkus = res.data.orderSkus.map(item => {
+                    return {
+                        skuId: item.skuId,
+                        score: 5,
+                        comment: '',
+                        isAnonymous: false,
+                        commentPics: [],
+                        skuImage: item.skuImage
+                    };
+                });
+            });
+    },
+    methods: {
+        afterRead(event) {
+            const { file } = event.detail;
+            console.log(event);
+            // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+            // wx.uploadFile({
+            //     url: 'https://example.weixin.qq.com/upload', // 仅为示例,非真实的接口地址
+            //     filePath: file.path,
+            //     name: 'file',
+            //     formData: { user: 'test' },
+            //     success(res) {
+            //         // 上传完成需要更新 fileList
+            //         const { fileList = [] } = this.data;
+            //         fileList.push({ ...file, url: res.data });
+            //         this.setData({ fileList });
+            //     }
+            // });
+        },
+        submit() {
+            let orderSkus = [...this.orderSkus];
+            orderSkus = orderSkus.map(item => {
+                return {
+                    skuId: item.skuId,
+                    score: item.score,
+                    comment: item.comment,
+                    isAnonymous: item.isAnonymous ? '1' : '0',
+                    commentPics: []
+                };
+            });
+            this.$http
+                .post(
+                    '/applets/addorderevaluation',
+                    {
+                        orderId: this.$mp.query.orderId,
+                        storeComment: {
+                            descScore: this.descScore,
+                            sellerScore: this.sellerScore,
+                            logisticsScore: this.logisticsScore
+                        },
+                        comments: [...orderSkus]
+                    },
+                    {
+                        header: {
+                            'Content-Type': 'application/json'
+                        }
+                    }
+                )
+                .then(res => {
+                    if (res.data > 0) {
+                        this.showToastError('评价发表成功', 'success');
+                        this.navigateBack(500);
+                    } else {
+                        this.showToastError('评价发表失败');
+                    }
+                });
+        }
+    }
+};
+</script>
+
+<style lang="less">
+.start {
+    display: flex;
+    align-items: center;
+    padding: 5px 15px;
+    .name {
+        margin-right: 10px;
+        font-size: 12px;
+    }
+}
+
+.detail {
+    padding: 15px;
+}
+page {
+    background: @bg2;
+}
+.card {
+    border: 1px solid #ebebeb;
+    border-radius: 5px;
+    background: #ffffff;
+    box-shadow: 0 0 10px 2px #ebebeb;
+    padding: 0 10px;
+}
+.card + .card {
+    margin-top: 10px;
+}
+.btnList {
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    display: flex;
+
+    ._van-button {
+        flex-grow: 1;
+    }
+    .van-button {
+        height: 55px;
+    }
+}
+.content {
+    padding: 10px 0;
+}
+.top {
+    display: flex;
+    align-items: center;
+    margin: 0 15px;
+    padding: 15px 0;
+    border-bottom: 1px solid #ebedf0;
+
+    ._van-image {
+        border: 1px solid #ebedf0;
+    }
+
+    .right {
+        flex-grow: 1;
+        margin-left: 15px;
+
+        .name {
+            font-size: 12px;
+            margin-bottom: 5px;
+        }
+    }
+}
+</style>

+ 247 - 0
src/pages/order/evaluationInfo.vue

@@ -0,0 +1,247 @@
+<config>
+{
+'navigationBarTitleText': '发表评价',
+}
+</config>
+<template>
+    <div class="detail">
+        <div class="card">
+            <van-cell-group>
+                <van-cell icon="shop-o" :title="storeComment.storeName"></van-cell>
+
+                <div class="content">
+                    <div class="start">
+                        <span class="name">描述相符</span>
+                        <van-rate
+                            :value="storeComment.descScore"
+                            :size="20"
+                            color="#ee0a24"
+                            void-color="#eee"
+                            void-icon="star"
+                            readonly
+                        />
+                    </div>
+
+                    <div class="start">
+                        <span class="name">卖家服务</span>
+                        <van-rate
+                            :value="storeComment.sellerScore"
+                            :size="20"
+                            color="#ee0a24"
+                            void-color="#eee"
+                            void-icon="star"
+                            readonly
+                        />
+                    </div>
+                    <div class="start">
+                        <span class="name">物流服务</span>
+                        <van-rate
+                            :value="storeComment.logisticsScore"
+                            :size="20"
+                            color="#ee0a24"
+                            void-color="#eee"
+                            void-icon="star"
+                            readonly
+                        />
+                    </div>
+                </div>
+            </van-cell-group>
+        </div>
+
+        <div class="card" v-for="item in comments" :key="item.id">
+            <div class="top">
+                <van-image width="60" height="60" :src="item.sku.url" />
+                <div class="right">
+                    <div class="name">商品满意度</div>
+                    <van-rate
+                        :value="item.score"
+                        :size="20"
+                        color="#ee0a24"
+                        readonly
+                        void-color="#eee"
+                        void-icon="star"
+                    />
+                </div>
+            </div>
+            <van-field
+                v-if="item.comment"
+                type="textarea"
+                placeholder="写下购买体会和使用感受来帮助其他小伙伴"
+                :value="item.comment"
+                :autosize="true"
+                readonly
+            />
+            <van-cell title="评价图片:" use-label-slot v-if="item.commentPics.length > 0">
+                <div style="padding:10px 0 5px" class="imgsList" slot="label">
+                    <van-image
+                        v-for="(img, index) in item.commentPics"
+                        :key="index"
+                        width="60"
+                        height="60"
+                        :src="img"
+                    />
+                </div>
+            </van-cell>
+        </div>
+    </div>
+</template>
+<script>
+export default {
+    data() {
+        return {
+            info: {}
+        };
+    },
+    computed: {
+        storeComment() {
+            return this.info.storeComment || {};
+        },
+        comments() {
+            return this.info.comments || [];
+        }
+    },
+    onLoad() {
+        this.$http
+            .get('/applets/evaluationdetail', {
+                orderId: this.$mp.query.orderId
+            })
+            .then(res => {
+                this.info = res.data;
+            });
+    },
+    methods: {
+        afterRead(event) {
+            const { file } = event.detail;
+            console.log(event);
+            // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+            // wx.uploadFile({
+            //     url: 'https://example.weixin.qq.com/upload', // 仅为示例,非真实的接口地址
+            //     filePath: file.path,
+            //     name: 'file',
+            //     formData: { user: 'test' },
+            //     success(res) {
+            //         // 上传完成需要更新 fileList
+            //         const { fileList = [] } = this.data;
+            //         fileList.push({ ...file, url: res.data });
+            //         this.setData({ fileList });
+            //     }
+            // });
+        },
+        submit() {
+            let orderSkus = [...this.orderSkus];
+            orderSkus = orderSkus.map(item => {
+                return {
+                    skuId: item.skuId,
+                    score: item.score,
+                    comment: item.comment,
+                    isAnonymous: item.isAnonymous ? '1' : '0',
+                    commentPics: []
+                };
+            });
+            this.$http
+                .post(
+                    '/applets/addorderevaluation',
+                    {
+                        orderId: this.$mp.query.orderId,
+                        storeComment: {
+                            descScore: this.descScore,
+                            sellerScore: this.sellerScore,
+                            logisticsScore: this.logisticsScore
+                        },
+                        comments: [...orderSkus]
+                    },
+                    {
+                        header: {
+                            'Content-Type': 'application/json'
+                        }
+                    }
+                )
+                .then(res => {
+                    if (res.data > 0) {
+                        this.showToastError('评价发表成功', 'success');
+                        this.navigateBack(500);
+                    } else {
+                        this.showToastError('评价发表失败');
+                    }
+                });
+        }
+    }
+};
+</script>
+
+<style lang="less">
+.start {
+    display: flex;
+    align-items: center;
+    padding: 5px 15px;
+    .name {
+        margin-right: 10px;
+        font-size: 12px;
+    }
+}
+
+.detail {
+    padding: 15px;
+}
+page {
+    background: @bg2;
+}
+.card {
+    border: 1px solid #ebebeb;
+    border-radius: 5px;
+    background: #ffffff;
+    box-shadow: 0 0 10px 2px #ebebeb;
+    padding: 0 10px;
+}
+.card + .card {
+    margin-top: 10px;
+}
+.btnList {
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    display: flex;
+
+    ._van-button {
+        flex-grow: 1;
+    }
+    .van-button {
+        height: 55px;
+    }
+}
+.content {
+    padding: 10px 0;
+}
+.top {
+    display: flex;
+    align-items: center;
+    margin: 0 15px;
+    padding: 15px 0;
+    border-bottom: 1px solid #ebedf0;
+
+    ._van-image {
+        border: 1px solid #ebedf0;
+    }
+
+    .right {
+        flex-grow: 1;
+        margin-left: 15px;
+
+        .name {
+            font-size: 12px;
+            margin-bottom: 5px;
+        }
+    }
+}
+
+.imgsList {
+    display: flex;
+    flex-wrap: wrap;
+
+    ._van-image {
+        margin-right: 10px;
+        margin-bottom: 10px;
+    }
+}
+</style>

+ 0 - 1
src/pages/order/orderDetailDefault.vue

@@ -180,7 +180,6 @@ export default {
             })
             })
             .then(res => {
             .then(res => {
                 this.info = res.data;
                 this.info = res.data;
-                console.log(this.info);
             });
             });
     }
     }
 };
 };

+ 3 - 1
src/utils/SpecialApi.js

@@ -58,4 +58,6 @@ function getLogistics(orderNo) {
     });
     });
 }
 }
 
 
-export { getFactory, getLogistics };
+function payOrder(carOrderId, carOrderCode) {}
+
+export { getFactory, getLogistics, payOrder };