Selaa lähdekoodia

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

panhui 4 vuotta sitten
vanhempi
commit
951ca38c10

+ 2 - 1
src/mixins/common.js

@@ -46,12 +46,13 @@ export default {
                     });
             }
         },
-        updateFile(e, type, size = 2000) {
+        updateFile(e, type, size = 1000) {
             const formData = new FormData();
             formData.append('file', e.file, e.file.name);
             formData.append('type', type);
             formData.append('width', size);
             formData.append('height', size);
+            formData.append('size', size);
             return http.axios.post('/upload/user', formData).then(res => {
                 return Promise.resolve(res.data);
             });

+ 1 - 1
src/views/Discover.vue

@@ -1,7 +1,7 @@
 <template>
     <van-pull-refresh
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         class="discover"
         v-model="isLoading"
         @refresh="onRefresh"

+ 1 - 1
src/views/Home.vue

@@ -2,7 +2,7 @@
     <van-pull-refresh
         class="home"
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         v-model="isLoading"
         :head-height="80"
         @refresh="onRefresh"

+ 11 - 5
src/views/Mine.vue

@@ -1,7 +1,7 @@
 <template>
     <van-pull-refresh
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         class="mine"
         v-model="isLoading"
         @refresh="onRefresh"
@@ -10,7 +10,7 @@
             <van-image
                 width="100%"
                 height="52vw"
-                :src="userInfo.bg || require('@assets/creatorBg.png')"
+                :src="userInfo.bg ? userInfo.bg + '?r=' + refreshFlag : require('@assets/creatorBg.png')"
                 loading-icon=""
                 fit="cover"
                 class="top-img"
@@ -26,8 +26,11 @@
                         round
                         width="150"
                         height="150"
-                        radius="100"
-                        :src="userInfo.avatar || require('@assets/img_default_photo.png')"
+                        :src="
+                            userInfo.avatar
+                                ? userInfo.avatar + '?r=' + refreshFlag
+                                : require('@assets/img_default_photo.png')
+                        "
                         fit="cover"
                         :class="{ activeAvatar: isLogin && userInfo.useCollectionPic }"
                         @click="$router.push('/setting')"
@@ -209,7 +212,8 @@ export default {
             shareProduct: {
                 openQuota: false
             },
-            shareMoney: 0
+            shareMoney: 0,
+            refreshFlag: Number(localStorage.getItem('refreshFlag') || '0')
         };
     },
     components: { Level, Post },
@@ -318,6 +322,8 @@ export default {
                 });
         },
         onRefresh() {
+            this.refreshFlag++;
+            localStorage.setItem('refreshFlag', this.refreshFlag);
             return this.getInit(true)
                 .then(() => {
                     this.isLoading = false;

+ 1 - 1
src/views/Store.vue

@@ -1,7 +1,7 @@
 <template>
     <van-pull-refresh
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         class="discover"
         v-model="isLoading"
         @refresh="onRefresh"

+ 2 - 2
src/views/account/Setting.vue

@@ -91,7 +91,7 @@ export default {
                 message: '加载中...',
                 forbidClick: true
             });
-            this.updateFile(e, 'avatar', 500).then(img => {
+            this.updateFile(e, 'avatar', 300).then(img => {
                 this.updateUser({ avatar: img, useCollectionPic: false }).then(res => {
                     this.$toast.clear();
                 });
@@ -102,7 +102,7 @@ export default {
                 message: '加载中...',
                 forbidClick: true
             });
-            this.updateFile(e, 'bg', 2000).then(img => {
+            this.updateFile(e, 'bg', 1200).then(img => {
                 this.updateUser({ bg: img }).then(res => {
                     this.$toast.clear();
                 });

+ 1 - 1
src/views/account/Verified.vue

@@ -182,7 +182,7 @@ export default {
                 });
         },
         afterRead(file, e) {
-            this.updateFile(file, 'id').then(img => {
+            this.updateFile(file, 'id', 1000).then(img => {
                 this.form[e.name] = img;
             });
         },

+ 1 - 1
src/views/account/VerifiedSucs.vue

@@ -263,7 +263,7 @@ export default {
                 });
         },
         afterRead(file, e) {
-            this.updateFile(file, 'id').then(img => {
+            this.updateFile(file, 'id', 1000).then(img => {
                 this.form[e.name] = img;
             });
         },

+ 60 - 48
src/views/activity/ChooseProduct.vue

@@ -16,47 +16,54 @@
                 </div>
             </div>
         </van-sticky>
+        <van-pull-refresh
+            success-text="刷新成功"
+            success-duration="500"
+            class="discover"
+            v-model="refreshing"
+            @refresh="onRefresh"
+        >
+            <van-empty
+                v-if="empty"
+                description="没有符合兑换的藏品哦~"
+                :image="require('../../assets/kong_png_yongyoude  (1).png')"
+            />
 
-        <van-empty
-            v-if="empty"
-            description="没有符合兑换的藏品哦~"
-            :image="require('../../assets/kong_png_yongyoude  (1).png')"
-        />
-
-        <div class="list">
-            <div
-                class="product"
-                :class="{ active: chooseIds.includes(item.id) }"
-                v-for="item in list"
-                :key="item.id"
-                @click="choose(item.id)"
-            >
-                <img
-                    class="icon"
-                    :src="
-                        chooseIds.includes(item.id)
-                            ? require('../../assets/icon_gouxuan_pre.png')
-                            : require('../../assets/icon_gouxuan_huise.png')
-                    "
-                    alt=""
-                />
-                <div class="product-content">
-                    <van-image
-                        width="60"
-                        height="60"
-                        radius="6"
-                        :src="getImg(changeImgs(item.pic, 600))"
-                        fit="contain"
+            <div class="list">
+                <div
+                    class="product"
+                    :class="{ active: chooseIds.includes(item.id) }"
+                    v-for="item in list"
+                    :key="item.id"
+                    @click="choose(item.id)"
+                >
+                    <img
+                        class="icon"
+                        :src="
+                            chooseIds.includes(item.id)
+                                ? require('../../assets/icon_gouxuan_pre.png')
+                                : require('../../assets/icon_gouxuan_huise.png')
+                        "
+                        alt=""
                     />
-                    <div class="product-info">
-                        <div class="text1 van-ellipsis">{{ item.name }}</div>
-                        <div class="flex1"></div>
-                        <div class="text2" v-if="item.category">{{ item.category }}</div>
-                        <div class="text2" v-if="item.number">编号:{{ item.number }}</div>
+                    <div class="product-content">
+                        <van-image
+                            width="60"
+                            height="60"
+                            radius="6"
+                            :src="getImg(changeImgs(item.pic, 600))"
+                            fit="contain"
+                        />
+                        <div class="product-info">
+                            <div class="text1 van-ellipsis">{{ item.name }}</div>
+                            <div class="flex1"></div>
+                            <div class="text2" v-if="item.category">{{ item.category }}</div>
+                            <div class="text2" v-if="item.number">编号:{{ item.number }}</div>
+                        </div>
                     </div>
                 </div>
             </div>
-        </div>
+        </van-pull-refresh>
 
         <div class="tips" v-if="showTips">当前可兑换藏品不足</div>
 
@@ -80,7 +87,8 @@ export default {
             needChoose: 3,
             search: '',
             activityId: 0,
-            info: {}
+            info: {},
+            refreshing: false
         };
     },
     computed: {
@@ -113,24 +121,22 @@ export default {
         }
     },
     methods: {
-        getList() {
+        getList(refresh, done) {
             this.$http
-                .post(
-                    '/asset/all',
-                    {
-                        page: 0,
-                        size: 999,
-                        query: { status: 'NORMAL,TRADING,GIFTING', userId: this.$store.state.userInfo.id },
-                        search: this.search
-                    },
-                    { body: 'json' }
-                )
+                .get('/asset/assetsForMint', {
+                    page: 0,
+                    size: 999,
+                    mintActivityId: this.activityId,
+                    refresh
+                })
                 .then(res => {
                     this.list = res.content;
                     this.empty = res.empty;
+                    done && done();
                 })
                 .then(() => {
                     this.$toast.clear();
+                    done && done();
                 });
         },
         choose(id) {
@@ -180,6 +186,12 @@ export default {
                     }
                 });
             });
+        },
+        onRefresh() {
+            this.refreshing = true;
+            this.getList(true, () => {
+                this.refreshing = false;
+            });
         }
     }
 };

+ 1 - 1
src/views/activity/List1.vue

@@ -1,7 +1,7 @@
 <template>
     <van-pull-refresh
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         class="search"
         v-model="isLoading"
         :head-height="80"

+ 34 - 11
src/views/asset/Detail.vue

@@ -2,7 +2,7 @@
 <template>
     <van-pull-refresh
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         class="detail"
         v-model="isLoading"
         :head-height="80"
@@ -639,6 +639,7 @@ export default {
                 if (res.status == 'GIFTED' || res.status === 'TRANSFERRED') {
                     this.emitter.emit('refreash');
                 }
+                // res.source = 'GIFT';
                 this.info = res;
 
                 if (res.orderId) {
@@ -680,21 +681,43 @@ export default {
                 });
                 console.log(init);
                 if (init && !this.$store.state.reviewPay) {
-                    if (this.info.holdDays) {
-                        this.holdDays = Number(this.info.holdDays);
-                        this.getTime();
-                    } else {
-                        this.$http.get('/sysConfig/get/hold_days').then(res => {
-                            this.holdDays = Number(res.value);
-                            // this.holdDays = 10;
-                            this.getTime();
-                        });
-                    }
+                    this.setHolds();
                 } else {
                     this.$toast.clear();
                 }
             });
         },
+        setHolds() {
+            let holdDays = 0;
+            let _this = this;
+
+            function getHolds() {
+                if (_this.info.holdDays) {
+                    holdDays = Number(_this.info.holdDays);
+                    return Promise.resolve();
+                } else {
+                    return _this.$http.get('/sysConfig/get/hold_days').then(res => {
+                        holdDays = Number(res.value);
+                        return Promise.resolve();
+                    });
+                }
+            }
+            getHolds()
+                .then(() => {
+                    if (this.info.source === 'GIFT') {
+                        return this.$http.get('/sysConfig/get/gift_days').then(res => {
+                            holdDays = Number(res.value);
+                            return Promise.resolve();
+                        });
+                    } else {
+                        return Promise.resolve();
+                    }
+                })
+                .then(() => {
+                    this.holdDays = holdDays;
+                    this.getTime();
+                });
+        },
         openBlindBox() {
             this.$refs.box.show = true;
         },

+ 1 - 1
src/views/creator/Detail.vue

@@ -1,7 +1,7 @@
 <template>
     <van-pull-refresh
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         class="mine"
         v-model="isLoading"
         :head-height="80"

+ 1 - 1
src/views/creator/List.vue

@@ -1,7 +1,7 @@
 <template>
     <van-pull-refresh
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         class="follow"
         v-model="isLoading"
         :head-height="80"

+ 1 - 1
src/views/hall/List.vue

@@ -1,7 +1,7 @@
 <template>
     <van-pull-refresh
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         class="list"
         v-model="isLoading"
         @refresh="onRefresh"

+ 1 - 1
src/views/order/ActivityDetail.vue

@@ -1,7 +1,7 @@
 <template>
     <van-pull-refresh
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         class="order"
         v-model="isLoading"
         :head-height="80"

+ 1 - 1
src/views/order/ActivityOrders.vue

@@ -1,7 +1,7 @@
 <template>
     <van-pull-refresh
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         class="discover"
         v-model="isLoading"
         :head-height="80"

+ 1 - 1
src/views/order/Detail.vue

@@ -2,7 +2,7 @@
     <van-pull-refresh
         class="order"
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         v-model="isLoading"
         :head-height="80"
         @refresh="onRefresh"

+ 1 - 1
src/views/order/Orders.vue

@@ -1,7 +1,7 @@
 <template>
     <van-pull-refresh
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         class="discover"
         v-model="isLoading"
         :head-height="80"

+ 3 - 2
src/views/product/Detail.vue

@@ -1,7 +1,7 @@
 <template>
     <van-pull-refresh
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         class="detail"
         v-model="isLoading"
         @refresh="onRefresh"
@@ -597,7 +597,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' }
                 )

+ 1 - 1
src/views/product/HopeMarket.vue

@@ -98,7 +98,7 @@
 
         <van-pull-refresh
             success-text="加载成功"
-            success-duration="1000"
+            success-duration="500"
             v-model="isLoading"
             :head-height="80"
             @refresh="onRefresh"

+ 1 - 1
src/views/product/List.vue

@@ -1,7 +1,7 @@
 <template>
     <van-pull-refresh
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         class="follow"
         v-model="isLoading"
         @refresh="onRefresh"

+ 1 - 1
src/views/product/Search.vue

@@ -2,7 +2,7 @@
     <van-pull-refresh
         class="search"
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         :style="{ backgroundColor: isSearch ? $colors.bg3 : $colors.bg }"
         v-model="isLoading"
         @refresh="onRefresh"

+ 1 - 1
src/views/user/Exchange.vue

@@ -1,7 +1,7 @@
 <template>
     <van-pull-refresh
         success-text="加载成功"
-        success-duration="1000"
+        success-duration="500"
         class="search"
         v-model="isLoading"
         :head-height="80"