Bläddra i källkod

Merge branch 'master' of http://git.izouma.com/xiongzhu/raex_front into dev

panhui 3 år sedan
förälder
incheckning
97479a6a16

+ 1 - 1
.gitignore

@@ -23,4 +23,4 @@ pnpm-debug.log*
 *.sw?
 
 publicPath
-**/._*
+**/._*

+ 1 - 0
package.json

@@ -16,6 +16,7 @@
         "axios": "^0.21.4",
         "better-scroll": "^2.4.2",
         "clipboard": "^2.0.8",
+        "compressorjs": "^1.1.1",
         "core-js": "^3.6.5",
         "crypto-js": "^4.1.1",
         "date-fns": "^2.27.0",

BIN
src/assets/close3.png


BIN
src/assets/icon_kefu.png


BIN
src/assets/icon_kefuliuyan.png


BIN
src/assets/png-tijiaochenggong.png


+ 27 - 0
src/router/index.js

@@ -246,6 +246,33 @@ const routes = [
             pageType: Page.Every
         }
     },
+    {
+        path: '/message',
+        name: 'message',
+        component: () => import('../views/account/Message.vue'),
+        meta: {
+            pageType: Page.Every,
+            title: '客服留言'
+        }
+    },
+    {
+        path: '/messageAdd',
+        name: 'messageAdd',
+        component: () => import('../views/account/MessageAdd.vue'),
+        meta: {
+            pageType: Page.Every,
+            title: '反馈问题'
+        }
+    },
+    {
+        path: '/messageDetail',
+        name: 'messageDetail',
+        component: () => import('../views/account/MessageDetail.vue'),
+        meta: {
+            pageType: Page.Every,
+            title: '反馈记录'
+        }
+    },
     {
         path: '/introduction',
         name: 'introduction',

+ 2 - 2
src/views/Mine.vue

@@ -164,9 +164,9 @@
                     <van-icon :name="require('@assets/icon-dianzan1.png')" class="search-icon" />
                 </template>
             </van-grid-item>
-            <van-grid-item text="通知广播" @click="wait" v-if="!$store.state.review">
+            <van-grid-item text="客服留言" :to="{ path: '/message' }" v-if="!$store.state.review">
                 <template #icon>
-                    <van-icon :name="require('@assets/icon_tongzhi.png')" class="search-icon" />
+                    <van-icon :name="require('@assets/icon_kefuliuyan.png')" class="search-icon" />
                 </template>
             </van-grid-item>
             <van-grid-item text="交易历史" :to="{ path: '/mineExchange' }">

+ 2 - 1
src/views/Submit.vue

@@ -272,7 +272,8 @@ export default {
                 .post(
                     '/userCoupon/all',
                     {
-                        query: { userId: this.$store.state.userInfo.id, used: false }
+                        query: { userId: this.$store.state.userInfo.id, used: false },
+                        size: 999
                     },
                     { body: 'json' }
                 )

+ 4 - 4
src/views/account/About.vue

@@ -15,7 +15,7 @@
                 }"
             />
             <van-cell title="隐私政策" is-link :to="{ path: '/agreement' }" />
-            <van-cell title="联系客服" @click="show = true" is-link />
+            <!-- <van-cell title="客服留言" :to="{ path: '/message' }" is-link /> -->
         </van-cell-group>
 
         <van-overlay :show="show" @click="show = false">
@@ -39,9 +39,9 @@ export default {
         };
     },
     mounted() {
-        this.$http.get('/sysConfig/get/customer_group').then(res => {
-            this.getImgBase64(res.value, 'codeImg');
-        });
+        // this.$http.get('/sysConfig/get/customer_group').then(res => {
+        //     this.getImgBase64(res.value, 'codeImg');
+        // });
     },
     methods: {
         getImgBase64(img2, key) {

+ 139 - 0
src/views/account/Message.vue

@@ -0,0 +1,139 @@
+<template>
+    <van-pull-refresh
+        success-text="加载成功"
+        success-duration="500"
+        class="page"
+        v-model="isLoading"
+        @refresh="onRefresh"
+    >
+        <van-sticky>
+            <van-tabs v-model:active="reply" line-width="16" line-height="2" @change="getData(true)">
+                <van-tab title="全部" name=""></van-tab>
+                <van-tab title="待反馈" :name="false"></van-tab>
+                <van-tab title="已反馈" :name="true"></van-tab>
+            </van-tabs>
+        </van-sticky>
+        <van-list v-model:loading="loading" :finished="finished" finished-text="" @load="getData">
+            <router-link
+                class="message"
+                :to="{
+                    path: 'messageDetail',
+                    query: {
+                        id: item.id
+                    }
+                }"
+                v-for="(item, index) in list"
+                :key="index"
+            >
+                <div class="top">
+                    <div class="status" :class="{ prim: item.reply }">{{ item.reply ? '已反馈' : '待反馈' }}</div>
+                    <div class="text van-ellipsis">{{ item.detail }}</div>
+                </div>
+                <div class="time">
+                    {{ item.createdAt }}
+                </div>
+            </router-link>
+            <van-empty v-if="empty" description="什么留言都没有哦~" :image="require('@assets/kong_png_wusousuo.png')" />
+        </van-list>
+        <div class="bottom">
+            <van-button type="primary" @click="$router.push('/messageAdd')" round block>新建反馈</van-button>
+        </div>
+    </van-pull-refresh>
+</template>
+
+<script>
+import list from '../../mixins/list';
+export default {
+    mixins: [list],
+    data() {
+        return {
+            reply: '',
+            list: [],
+            empty: false,
+            url: '/message/my'
+        };
+    },
+    methods: {
+        beforeData() {
+            return {
+                query: {
+                    reply: this.reply
+                }
+            };
+        },
+        onRefresh() {
+            this.getData(true).then(() => {
+                this.isLoading = false;
+            });
+        }
+    }
+};
+</script>
+
+<style lang="less" scoped>
+.page {
+    background-color: @bg3;
+}
+
+/deep/.van-tab {
+    margin-right: 0 !important;
+    flex-grow: 1 !important;
+}
+
+.van-list {
+    padding: 16px;
+    box-sizing: border-box;
+    min-height: calc(100vh - 94px);
+}
+
+.bottom {
+    padding: 9px 52px;
+    .bottom(9px);
+    background-color: #fff;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    right: 0;
+}
+.message {
+    background: #ffffff;
+    border-radius: 8px;
+    padding: 12px 10px;
+    // margin: 8px;
+    display: block;
+    .top {
+        .flex();
+        .status {
+            background: rgba(255, 127, 31, 0.1);
+            border-radius: 4px;
+            padding: 0 10px;
+            font-size: 12px;
+            color: #ff7f1f;
+            line-height: 20px;
+            white-space: nowrap;
+
+            &.prim {
+                color: #3ab200;
+                background: rgba(58, 178, 0, 0.1);
+            }
+        }
+
+        .text {
+            font-size: 14px;
+            color: #000000;
+            line-height: 24px;
+            margin-left: 10px;
+        }
+    }
+
+    .time {
+        font-size: 12px;
+        color: #c8c9cc;
+        line-height: 17px;
+        margin-top: 10px;
+    }
+}
+.message + .message {
+    margin-top: 16px;
+}
+</style>

+ 219 - 0
src/views/account/MessageAdd.vue

@@ -0,0 +1,219 @@
+<template>
+    <div>
+        <van-form @submit="submit">
+            <van-field
+                class="textarea"
+                name="问题描述"
+                label="问题描述"
+                placeholder="请详细说明,以便于我们解决问题,您最多可填300字。"
+                v-model="form.detail"
+                clearable
+                rows="4"
+                autosize
+                required
+                type="textarea"
+                maxlength="300"
+                show-word-limit
+                :rules="[{ required: true, message: '请填写用户名' }]"
+            />
+            <van-field name="uploader" label="上传凭证">
+                <template #label>
+                    <div class="title">
+                        <span>上传凭证</span>
+                        <span>最多上传3张</span>
+                    </div>
+                </template>
+                <template #input>
+                    <van-uploader :max-count="3" v-model="form.pic" :after-read="afterRead" />
+                </template>
+            </van-field>
+            <div class="bottom">
+                <van-button round block type="primary" native-type="submit">提交</van-button>
+            </div>
+        </van-form>
+
+        <van-dialog v-model:show="show" @closed="closed" :showConfirmButton="false" closeOnClickOverlay>
+            <div class="dialog-box">
+                <img src="@assets/png-tijiaochenggong.png" alt="" />
+                <div class="dialog-title">提交成功</div>
+                <div class="dialog-text">
+                    感谢您的宝贵意见与建议,我们将于24小时内给您相关答案,感谢您的耐心,愿您有美好的一天!
+                </div>
+                <img src="@assets/close3.png" @click="show = false" class="close" alt="" />
+            </div>
+        </van-dialog>
+    </div>
+</template>
+
+<script>
+import Compressor from 'compressorjs';
+export default {
+    setup() {
+        const beforeRead = file =>
+            new Promise(resolve => {
+                // compressorjs 默认开启 checkOrientation 选项
+                // 会将图片修正为正确方向
+                new Compressor(file, {
+                    success: resolve,
+                    error(err) {
+                        console.log(err.message);
+                    }
+                });
+            });
+
+        return {
+            beforeRead
+        };
+    },
+    data() {
+        return {
+            form: {
+                detail: '',
+                pic: []
+            },
+            show: false
+        };
+    },
+    methods: {
+        closed() {
+            this.$router.back();
+        },
+        submit() {
+            this.$toast.loading({
+                message: '加载中...',
+                forbidClick: true
+            });
+            let form = { ...this.form };
+            form.pic = form.pic.map(item => {
+                return item.url;
+            });
+            this.$http
+                .post('/message/create', form, { body: 'json' })
+                .then(res => {
+                    this.$toast.clear();
+                    this.show = true;
+                })
+                .catch(e => {
+                    this.$toast(e.error);
+                });
+        },
+        afterRead(file, e) {
+            this.updateFile(file, 'id', 1000).then(img => {
+                console.log(img);
+                file.url = img;
+            });
+        }
+    }
+};
+</script>
+
+<style lang="less" scoped>
+/deep/.van-cell {
+    flex-direction: column;
+
+    .van-field__label {
+        color: #000000;
+        line-height: 24px;
+        margin-bottom: 10px;
+    }
+}
+/deep/.textarea {
+    .van-field__body {
+        background: #f5f7fa;
+        border-radius: 8px 8px 0 0;
+        padding: 10px;
+    }
+    .van-field__control {
+        font-size: 12px;
+    }
+
+    .van-field__word-limit {
+        font-size: 12px;
+        color: #c8c9cc;
+        line-height: 17px;
+        background: #f5f7fa;
+        margin-top: 0;
+        padding: 10px;
+        border-radius: 0 0 8px 8px;
+    }
+}
+
+/deep/ .van-uploader__upload {
+    border: 1px dashed #c8c9cc;
+    border-radius: 8px;
+    width: 100px;
+    height: 100px;
+}
+
+/deep/.van-uploader__preview-image {
+    border-radius: 8px;
+    width: 100px;
+    height: 100px;
+}
+
+.bottom {
+    padding: 9px 52px;
+    .bottom(9px);
+    position: fixed;
+    left: 0;
+    bottom: 0;
+    right: 0;
+    background-color: #fff;
+    border-top: 1px solid #f2f3f5;
+}
+
+/deep/.van-cell__title {
+    width: auto;
+}
+.title {
+    span {
+        font-size: 14px;
+        font-weight: normal;
+        color: #000000;
+        line-height: 24px;
+
+        &:nth-child(2) {
+            font-size: 12px;
+            color: #aaabad;
+            margin-left: 2px;
+        }
+    }
+}
+
+.dialog-box {
+    background: linear-gradient(180deg, #ffeddd 0%, #fff9f4 100%);
+    .flex-col();
+    align-items: center;
+    padding: 24px 16px;
+    position: relative;
+    img {
+        width: 128px;
+        display: block;
+    }
+    .dialog-title {
+        font-size: 16px;
+        font-weight: bold;
+        color: #000000;
+        line-height: 22px;
+        padding: 12px;
+    }
+    .dialog-text {
+        font-size: 14px;
+        color: #939599;
+        line-height: 20px;
+        text-align: center;
+    }
+
+    .close {
+        width: 24px;
+        height: 24px;
+        position: absolute;
+        right: 16px;
+        top: 16px;
+    }
+}
+
+/deep/.van-dialog {
+    width: 260px;
+}
+</style>

+ 140 - 0
src/views/account/MessageDetail.vue

@@ -0,0 +1,140 @@
+<template>
+    <div class="page">
+        <div class="message">
+            <div class="message-top">
+                <van-image round width="36" height="36" :src="userInfo.avatar" />
+                <div class="message-user">
+                    <div class="text1">{{ info.nickname }}</div>
+                    <div class="text2">{{ info.createdAt }}</div>
+                </div>
+            </div>
+            <div class="message-text">
+                {{ info.detail }}
+            </div>
+            <div class="message-imgs" v-if="info.pic && info.pic.length > 0">
+                <van-image
+                    width="66"
+                    height="66"
+                    v-for="(item, index) in info.pic"
+                    :key="index"
+                    :src="item"
+                    fit="cover"
+                    radius="8"
+                    @click="preview(index, info.pic)"
+                />
+            </div>
+        </div>
+
+        <div class="message" v-if="info.reply">
+            <div class="message-top">
+                <van-image round width="36" height="36" :src="require('@assets/icon_kefu.png')" />
+                <div class="message-user">
+                    <div class="text1">客服留言</div>
+                    <div class="text2">{{ info.repliedAt }}</div>
+                </div>
+                <div class="status">已反馈</div>
+            </div>
+            <div class="message-text">
+                {{ info.replyDetail }}
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+import { mapState } from 'vuex';
+import { ImagePreview } from 'vant';
+export default {
+    data() {
+        return {
+            id: 0,
+            info: {}
+        };
+    },
+    computed: {
+        ...mapState(['userInfo'])
+    },
+    mounted() {
+        if (this.$route.query.id) {
+            this.id = this.$route.query.id;
+        }
+        this.getDetail();
+    },
+    methods: {
+        getDetail() {
+            this.$http.get('/message/get/' + this.id).then(res => {
+                this.info = res;
+            });
+        },
+        preview(index = 0, list = []) {
+            ImagePreview({
+                images: [...list],
+                startPosition: index
+            });
+        }
+    }
+};
+</script>
+
+<style lang="less" scoped>
+.page {
+    background-color: @bg3;
+    padding: 16px;
+}
+
+.message {
+    background: #ffffff;
+    border-radius: 8px;
+    padding: 12px 10px;
+
+    .message-top {
+        position: relative;
+        .flex();
+
+        .message-user {
+            margin-left: 6px;
+            .text1 {
+                font-size: 14px;
+                color: #000000;
+                line-height: 20px;
+            }
+
+            .text2 {
+                font-size: 12px;
+                color: #878d99;
+                line-height: 17px;
+            }
+        }
+
+        .status {
+            font-size: 12px;
+            color: #3ab200;
+            line-height: 20px;
+            background: rgba(58, 178, 0, 0.1);
+            border-radius: 4px;
+            position: absolute;
+            right: 0;
+            top: 0;
+            padding: 0 10px;
+        }
+    }
+
+    .message-text {
+        font-size: 14px;
+        color: #000000;
+        line-height: 20px;
+        margin-top: 10px;
+    }
+
+    .message-imgs {
+        margin-top: 6px;
+        .flex();
+        .van-image + .van-image {
+            margin-left: 16px;
+        }
+    }
+}
+.message + .message {
+    margin-top: 16px;
+}
+</style>

+ 20 - 2
src/views/product/Search.vue

@@ -154,7 +154,8 @@ export default {
                 }
             ],
             salable: '',
-            showAction: false
+            showAction: false,
+            showHall: false
         };
     },
     watch: {
@@ -197,6 +198,19 @@ export default {
             this.search = this.$route.query.search;
             this.getSearch(this.search);
         }
+
+        this.$http
+            .get('/sysConfig/get/hall_show')
+            .then(res => {
+                if (res.value === true || res.value === '1') {
+                    this.showHall = true;
+                } else {
+                    return Promise.reject();
+                }
+            })
+            .catch(() => {
+                this.showHall = false;
+            });
     },
     methods: {
         changeSort() {
@@ -227,10 +241,14 @@ export default {
             if (sort == 'price') {
                 sort = 'price,' + this.sortDes;
             }
+            let type = this.type;
+            if (!type && !this.showHall) {
+                type = 'DEFAULT,BLIND_BOX';
+            }
             return {
                 query: {
                     onShelf: true,
-                    type: this.type,
+                    type: type,
                     source: this.source,
                     minterId: this.minterId,
                     del: false,

+ 44 - 13
src/views/user/Rank.vue

@@ -46,19 +46,50 @@ export default {
         };
     },
     mounted() {
-        this.$toast.loading({
-            message: '加载中...',
-            forbidClick: true
-        });
-        this.$http.get('/statistic/weekTop').then(res => {
-            this.$toast.clear();
-            this.list = res;
-        });
-
-        this.time =
-            this.dayjs().add(-7, 'days').startOf('week').format('YYYY-MM-DD HH:mm:ss') +
-            ' ~ ' +
-            this.dayjs().startOf('week').format('MM-DD HH:mm:ss');
+        this.$http
+            .get('sysConfig/get/fixed_top')
+            .then(res => {
+                if (res.value === '1' || res.value === 'boolean') {
+                    this.getFixed();
+                } else {
+                    return Promise.reject();
+                }
+            })
+            .catch(() => {
+                this.getWeek();
+            });
+    },
+    methods: {
+        getFixed() {
+            this.$toast.loading({
+                message: '加载中...',
+                forbidClick: true
+            });
+            this.$http.get('/statistic/fixedTop').then(res => {
+                this.$toast.clear();
+                this.list = res;
+            });
+
+            this.time =
+                this.dayjs('2022-05-30 20:00:00').format('YYYY-MM-DD HH:mm:ss') +
+                ' ~ ' +
+                this.dayjs().startOf('day').format('MM-DD HH:mm:ss');
+        },
+        getWeek() {
+            this.$toast.loading({
+                message: '加载中...',
+                forbidClick: true
+            });
+            this.$http.get('/statistic/weekTop').then(res => {
+                this.$toast.clear();
+                this.list = res;
+            });
+
+            this.time =
+                this.dayjs().add(-7, 'days').startOf('week').format('YYYY-MM-DD HH:mm:ss') +
+                ' ~ ' +
+                this.dayjs().startOf('week').format('MM-DD HH:mm:ss');
+        }
     }
 };
 </script>

+ 18 - 0
yarn.lock

@@ -2368,6 +2368,11 @@ bluebird@^3.1.1, bluebird@^3.5.5:
   resolved "https://registry.npmmirror.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
   integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
 
+blueimp-canvas-to-blob@^3.29.0:
+  version "3.29.0"
+  resolved "https://registry.yarnpkg.com/blueimp-canvas-to-blob/-/blueimp-canvas-to-blob-3.29.0.tgz#d965f06cb1a67fdae207a2be56683f55ef531466"
+  integrity sha512-0pcSSGxC0QxT+yVkivxIqW0Y4VlO2XSDPofBAqoJ1qJxgH9eiUDLv50Rixij2cDuEfx4M6DpD9UGZpRhT5Q8qg==
+
 bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9:
   version "4.12.0"
   resolved "https://registry.npmmirror.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88"
@@ -3020,6 +3025,14 @@ compression@^1.7.4:
     safe-buffer "5.1.2"
     vary "~1.1.2"
 
+compressorjs@^1.1.1:
+  version "1.1.1"
+  resolved "https://registry.yarnpkg.com/compressorjs/-/compressorjs-1.1.1.tgz#54c147cf37fb38828b08c48646d0258d52faf050"
+  integrity sha512-SysRuUPfmUNoq+RviE0iMFVUmoX2q/x+7PkEPUmk6NGkd85hDrmvujx0Qtp8UCGA6KMe5kuodsylPQcNaLf60w==
+  dependencies:
+    blueimp-canvas-to-blob "^3.29.0"
+    is-blob "^2.1.0"
+
 concat-map@0.0.1:
   version "0.0.1"
   resolved "https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
@@ -5426,6 +5439,11 @@ is-binary-path@~2.1.0:
   dependencies:
     binary-extensions "^2.0.0"
 
+is-blob@^2.1.0:
+  version "2.1.0"
+  resolved "https://registry.yarnpkg.com/is-blob/-/is-blob-2.1.0.tgz#e36cd82c90653f1e1b930f11baf9c64216a05385"
+  integrity sha512-SZ/fTft5eUhQM6oF/ZaASFDEdbFVe89Imltn9uZr03wdKMcWNVYSMjQPFtg05QuNkt5l5c135ElvXEQG0rk4tw==
+
 is-boolean-object@^1.1.0:
   version "1.1.2"
   resolved "https://registry.npmmirror.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719"