panhui 4 лет назад
Родитель
Сommit
ad4fbd8f26

+ 33 - 36
src/main/nine-space/public/index.html

@@ -1,40 +1,37 @@
 <!DOCTYPE html>
 <html lang="">
-  <head>
-    <meta charset="utf-8" />
-    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
-    <meta
-      name="viewport"
-      content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
-    />
-    <meta name="msapplication-tap-highlight" content="no" />
-    <meta name="format-detection" content="telphone=no" />
-    <meta name="format-detection" content="email=no" />
-    <meta name="screen-orientation" content="portrait" />
-    <meta name="x5-orientation" content="portrait" />
-    <meta name="full-screen" content="yes" />
-    <meta name="x5-fullscreen" content="true" />
-    <meta name="theme-color" content="#000000" />
-    <title><%= htmlWebpackPlugin.options.title %></title>
-  </head>
-  <body>
-    <noscript>
-      <strong>
-        We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
-        properly without JavaScript enabled. Please enable it to continue.
-      </strong>
-    </noscript>
-    <div id="app"></div>
-    <!-- built files will be auto injected -->
+    <head>
+        <meta charset="utf-8" />
+        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
+        <meta name="msapplication-tap-highlight" content="no" />
+        <meta name="format-detection" content="telphone=no" />
+        <meta name="format-detection" content="email=no" />
+        <meta name="screen-orientation" content="portrait" />
+        <meta name="x5-orientation" content="portrait" />
+        <meta name="full-screen" content="yes" />
+        <meta name="x5-fullscreen" content="true" />
+        <meta name="theme-color" content="#000000" />
+        <title>第九空间</title>
+    </head>
+    <body>
+        <noscript>
+            <strong>
+                We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
+                Please enable it to continue.
+            </strong>
+        </noscript>
+        <div id="app"></div>
+        <!-- built files will be auto injected -->
 
-    <script>
-      document.body.addEventListener(
-        'touchmove',
-        function (e) {
-          //e.preventDefault()
-        },
-        { passive: false },
-      )
-    </script>
-  </body>
+        <script>
+            document.body.addEventListener(
+                'touchmove',
+                function (e) {
+                    //e.preventDefault()
+                },
+                { passive: false }
+            );
+        </script>
+    </body>
 </html>

+ 36 - 17
src/main/nine-space/src/views/Creator.vue

@@ -3,7 +3,7 @@
         <van-sticky ref="top" @change="change">
             <div class="top">
                 <div class="top-btn">
-                    <div class="btn" @click="$router.push('/discover')">收藏探索</div>
+                    <div class="btn" @click="$router.replace('/discover')">收藏探索</div>
                     <div class="btn active">铸造者</div>
                 </div>
                 <div class="search" @click="$router.push('/creatorSearch')">
@@ -11,16 +11,25 @@
                 </div>
             </div>
 
-            <van-tabs v-model:active="sort" @change="getList" line-width="16" line-height="2">
-                <van-tab title="全部" name="createdAt,desc"></van-tab>
+            <van-tabs
+                v-model:active="sort"
+                @change="
+                    page = 0;
+                    getList();
+                "
+                line-width="16"
+                line-height="2"
+            >
+                <van-tab title="全部" name="id,desc"></van-tab>
                 <van-tab title="最新" name="createdAt,desc"></van-tab>
                 <van-tab title="人气" name="followers,desc"></van-tab>
             </van-tabs>
         </van-sticky>
-
-        <template v-for="(item, index) in miners" :key="index">
-            <creator-info v-model:info="miners[index]"></creator-info>
-        </template>
+        <van-list v-model:loading="loading" :finished="finished" finished-text="" @load="getList">
+            <template v-for="(item, index) in miners" :key="index">
+                <creator-info v-model:info="miners[index]"></creator-info>
+            </template>
+        </van-list>
     </div>
 </template>
 
@@ -28,12 +37,16 @@
 import CreatorInfo from '../components/creator/CreatorInfo.vue';
 export default {
     components: { CreatorInfo },
-    inject: ['bs'],
+
     data() {
         return {
             miners: [],
             stiky: null,
-            sort: 'createdAt,desc'
+            sort: 'id,desc',
+            loading: false,
+            finished: false,
+            page: 0,
+            empty: false
         };
     },
     beforeUnmount() {
@@ -47,7 +60,6 @@ export default {
         this.$nextTick(() => {
             this.stiky = this.$refs.top.$el.childNodes[0];
         });
-        this.getList();
     },
     methods: {
         change(isFixed) {
@@ -60,15 +72,17 @@ export default {
             }
         },
         getList() {
-            this.$toast.loading({
-                message: '加载中...',
-                forbidClick: true
-            });
+            if (this.page === 0) {
+                this.miners = [];
+            }
+            this.loading = true;
+            this.finished = false;
+            this.empty = false;
             this.$http
                 .post(
                     '/user/all',
                     {
-                        page: 0,
+                        page: this.page,
                         query: { hasRole: 'ROLE_MINTER' },
                         size: 20,
                         sort: this.sort
@@ -76,8 +90,13 @@ export default {
                     { body: 'json' }
                 )
                 .then(res => {
-                    this.miners = res.content;
-                    this.$toast.clear();
+                    this.miners = [...this.miners, ...res.content];
+                    this.empty = res.empty;
+                    this.loading = false;
+                    this.finished = res.last;
+                    if (!this.finished) {
+                        this.page = this.page + 1;
+                    }
                 });
         }
     }

+ 31 - 10
src/main/nine-space/src/views/Discover.vue

@@ -4,7 +4,7 @@
             <div class="top">
                 <div class="top-btn">
                     <div class="btn active">收藏探索</div>
-                    <div class="btn" @click="$router.push('/creator')">铸造者</div>
+                    <div class="btn" @click="$router.replace('/creator')">铸造者</div>
                 </div>
                 <div class="search" @click="$router.push('/productSearch')">
                     <img src="../assets/svgs/search.svg" alt="" />
@@ -66,11 +66,18 @@
         </van-grid>
 
         <div class="title">本期推荐</div>
-        <div class="box-list">
+
+        <van-list
+            class="box-list"
+            v-model:loading="loading"
+            :finished="finished"
+            finished-text=""
+            @load="getList"
+        >
             <template v-for="(item, index) in list" :key="item.id">
                 <product-info v-model:info="list[index]"></product-info>
             </template>
-        </div>
+        </van-list>
 
         <div class="tabbar-placeholder"></div>
     </div>
@@ -91,7 +98,7 @@ import ProductInfo from '../components/product/productInfo.vue';
 
 export default {
     name: 'discover',
-    inject: ['bs'],
+
     components: {
         Swiper,
         SwiperSlide,
@@ -101,7 +108,11 @@ export default {
         return {
             stiky: null,
             banners: [],
-            list: []
+            list: [],
+            loading: false,
+            finished: false,
+            page: 0,
+            empty: false
         };
     },
     beforeUnmount() {
@@ -123,9 +134,7 @@ export default {
                 message: '加载中...',
                 forbidClick: true
             });
-            Promise.all([this.getBanner(), this.getList()]).then(() => {
-                this.$toast.clear();
-            });
+            this.getBanner();
         },
         getBanner() {
             this.$http
@@ -141,9 +150,16 @@ export default {
                 )
                 .then(res => {
                     this.banners = res.content;
+                    this.$toast.clear();
                 });
         },
         getList() {
+            if (this.page === 0) {
+                this.list = [];
+            }
+            this.loading = true;
+            this.finished = false;
+            this.empty = false;
             this.$http
                 .post(
                     '/collection/all',
@@ -159,8 +175,13 @@ export default {
                     { body: 'json' }
                 )
                 .then(res => {
-                    this.list = res.content;
-                    this.$toast.clear();
+                    this.list = [...this.list, ...res.content];
+                    this.empty = res.empty;
+                    this.loading = false;
+                    this.finished = res.last;
+                    if (!this.finished) {
+                        this.page = this.page + 1;
+                    }
                 });
         },
         change(isFixed) {

+ 1 - 1
src/main/nine-space/src/views/Home.vue

@@ -84,7 +84,7 @@ SwiperCore.use([EffectCoverflow]);
 
 export default {
     name: 'Home',
-    inject: ['bs'],
+
     components: {
         Swiper,
         SwiperSlide,

+ 1 - 1
src/main/nine-space/src/views/Index.vue

@@ -2,7 +2,7 @@
     <div class="index">
         <router-view class="container" />
         <van-tabbar v-model="active" z-index="20" safe-area-inset-bottom route ref="tabbar">
-            <van-tabbar-item v-for="item in menus" :name="item.name" :to="`/${item.name}`" :key="item.name">
+            <van-tabbar-item replace v-for="item in menus" :name="item.name" :to="`/${item.name}`" :key="item.name">
                 <span>{{ item.title }}</span>
                 <template #icon="props">
                     <img :src="props.active ? item.preIcon : item.icon" />

+ 31 - 25
src/main/nine-space/src/views/Store.vue

@@ -19,7 +19,13 @@
         </div> -->
             </div>
 
-            <van-tabs v-model:active="type" line-width="16" line-height="2" :ellipsis="false" @change="getList">
+            <van-tabs
+                v-model:active="type"
+                line-width="16"
+                line-height="2"
+                :ellipsis="false"
+                @change="(page = 0), getList()"
+            >
                 <van-tab
                     :title="item.label"
                     :name="item.type"
@@ -41,13 +47,13 @@
       </van-button> -->
         </van-sticky>
 
-        <div class="box-list">
+        <van-list class="box-list" v-model:loading="loading" :finished="finished" finished-text="" @load="getList">
             <template v-for="(item, index) in list" :key="index">
                 <asset-info :info="item"></asset-info>
             </template>
 
             <van-empty v-if="empty" description="您还没有任何藏品哦~" />
-        </div>
+        </van-list>
         <van-action-sheet
             ref="action"
             v-model:show="showSelect"
@@ -69,7 +75,7 @@ import asset from '../mixins/asset';
 export default {
     name: 'discover',
     mixins: [asset],
-    inject: ['bs'],
+
     components: {
         AssetInfo
     },
@@ -92,20 +98,19 @@ export default {
             ],
             showSelect: false,
             actions: [{ name: '选项一' }, { name: '选项二' }, { name: '选项三' }],
-            action: null
+            action: null,
+            loading: false,
+            finished: false,
+            page: 0
         };
     },
     mounted() {
         this.$nextTick(() => {
             this.stiky = this.$refs.top.$el.childNodes[0];
         });
-        this.checkLogin()
-            .then(() => {
-                this.getList();
-            })
-            .catch(() => {
-                this.empty = true;
-            });
+        this.checkLogin().catch(() => {
+            this.empty = true;
+        });
     },
     beforeUnmount() {
         if (this.stiky.parentNode.nodeName == 'BODY') {
@@ -121,7 +126,6 @@ export default {
         open() {
             this.$nextTick(() => {
                 this.action = document.getElementsByClassName('van-action-sheet')[0];
-                console.log(this.action);
                 document.body.appendChild(this.action);
             });
         },
@@ -129,16 +133,17 @@ export default {
             if (!this.isLogin) {
                 return;
             }
-            this.$toast.loading({
-                message: '加载中...',
-                forbidClick: true
-            });
+            if (this.page === 0) {
+                this.list = [];
+            }
+            this.loading = true;
+            this.finished = false;
             this.empty = false;
             this.$http
                 .post(
                     '/asset/all',
                     {
-                        page: 0,
+                        page: this.page,
                         size: 20,
                         query: {
                             userId: this.$store.state.userInfo.id,
@@ -149,10 +154,13 @@ export default {
                     { body: 'json' }
                 )
                 .then(res => {
-                    this.list = res.content;
+                    this.list = [...this.list, ...res.content];
                     this.empty = res.empty;
-                    this.$toast.clear();
-                    this.$toast.clear();
+                    this.loading = false;
+                    this.finished = res.last;
+                    if (!this.finished) {
+                        this.page = this.page + 1;
+                    }
                 });
         },
         change(isFixed) {
@@ -307,10 +315,8 @@ export default {
         color: @prim;
     }
 }
-/deep/.van-tabs {
-    .van-tabs__nav {
-        padding-left: 16px;
-    }
+/deep/.van-tabs__nav {
+    padding-left: 16px;
 }
 
 /deep/ .van-tabs__line {

+ 1 - 1
src/main/nine-space/src/views/Submit.vue

@@ -57,7 +57,7 @@ const path = require('path');
 import { add } from 'mathjs';
 export default {
     name: 'Submit',
-    inject: ['bs'],
+
     data() {
         return {
             info: {},

+ 0 - 1
src/main/nine-space/src/views/account/Setting.vue

@@ -9,7 +9,6 @@
                         round
                         width="36"
                         height="36"
-                        accept="image/png, image/jpeg"
                         :src="userInfo.avatar || require('../../assets/svgs/img_default_photo.svg')"
                         fit="cover"
                     />

+ 1 - 1
src/main/nine-space/src/views/account/Verified.vue

@@ -139,7 +139,7 @@ export default {
     computed: {
         ...mapState(['userInfo'])
     },
-    inject: ['bs'],
+
     mixins: [phone],
     data() {
         return {

+ 1 - 1
src/main/nine-space/src/views/asset/Detail.vue

@@ -145,7 +145,7 @@ export default {
         SwiperSlide,
         Post
     },
-    inject: ['bs'],
+
     mixins: [asset],
     data() {
         return {

+ 1 - 1
src/main/nine-space/src/views/creator/Detail.vue

@@ -94,7 +94,7 @@ export default {
     computed: {
         ...mapState(['userInfo'])
     },
-    inject: ['bs'],
+
     data() {
         return {
             info: {},

+ 35 - 19
src/main/nine-space/src/views/creator/List.vue

@@ -4,7 +4,13 @@
             <div class="top">
                 <div class="name">铸造者</div>
             </div>
-            <van-tabs v-model:active="sort" :ellipsis="false" line-width="16" line-height="2" @change="getList">
+            <van-tabs
+                v-model:active="sort"
+                :ellipsis="false"
+                line-width="16"
+                line-height="2"
+                @change="(page = 0), getList()"
+            >
                 <van-tab
                     :title="item.label"
                     :name="
@@ -24,12 +30,18 @@
                 </van-tab>
             </van-tabs>
         </van-sticky>
-        <div class="list">
+        <van-list
+            class="list"
+            v-model:loading="loading"
+            :finished="finished"
+            finished-text=""
+            @load="getList"
+        >
             <template v-for="(item, index) in list" :key="index">
                 <creator-info v-model:info="list[index]"></creator-info>
             </template>
             <van-empty v-if="empty" description="没有任何藏品哦~" />
-        </div>
+        </van-list>
     </div>
 </template>
 
@@ -37,7 +49,7 @@
 import CreatorInfo from '../../components/creator/CreatorInfo.vue';
 export default {
     components: { CreatorInfo },
-    inject: ['bs'],
+
     data() {
         return {
             list: [],
@@ -54,21 +66,23 @@ export default {
                 },
                 {
                     label: '最热',
-                    value: 'likes,desc'
+                    value: 'followers,desc'
                 },
                 {
                     label: '销量',
                     value: ['sales,desc', 'sales,asc'],
                     type: 'select'
                 }
-            ]
+            ],
+            loading: false,
+            finished: false,
+            page: 0
         };
     },
     mounted() {
         this.$nextTick(() => {
             this.stiky = this.$refs.top.$el.childNodes[0];
         });
-        this.getList();
     },
     beforeUnmount() {
         if (this.stiky.parentNode.nodeName == 'BODY') {
@@ -88,15 +102,17 @@ export default {
             }
         },
         getList() {
-            this.$toast.loading({
-                message: '加载中...',
-                forbidClick: true
-            });
+            if (this.page === 0) {
+                this.list = [];
+            }
+            this.loading = true;
+            this.finished = false;
+            this.empty = false;
             this.$http
                 .post(
                     '/user/all',
                     {
-                        page: 0,
+                        page: this.page,
                         query: { hasRole: 'ROLE_MINTER' },
                         size: 20,
                         sort: this.sort
@@ -104,9 +120,13 @@ export default {
                     { body: 'json' }
                 )
                 .then(res => {
-                    this.list = res.content;
+                    this.list = [...this.list, ...res.content];
                     this.empty = res.empty;
-                    this.$toast.clear();
+                    this.loading = false;
+                    this.finished = res.last;
+                    if (!this.finished) {
+                        this.page = this.page + 1;
+                    }
                 });
         }
     }
@@ -131,11 +151,7 @@ export default {
         line-height: 30px;
     }
 }
-/deep/.van-tabs {
-    .van-tabs__nav {
-        padding-left: 16px;
-    }
-}
+
 // /deep/.van-tab {
 // flex-grow: 0;
 // padding: 0 0 0 0;

+ 1 - 1
src/main/nine-space/src/views/order/Detail.vue

@@ -76,7 +76,7 @@
 import order from '../../mixins/order';
 export default {
     name: 'detail',
-    inject: ['bs'],
+
     data() {
         return {
             info: {}

+ 26 - 26
src/main/nine-space/src/views/order/Orders.vue

@@ -20,11 +20,10 @@
             </van-tabs>
         </van-sticky>
 
-        <div class="list">
+        <van-list class="list" v-model:loading="loading" :finished="finished" finished-text="" @load="getList">
             <order-info v-for="item in list" :key="item.id" :info="item"></order-info>
-        </div>
-
-        <van-empty v-if="empty" description="还没有订单哦~" />
+            <van-empty v-if="empty" description="还没有订单哦~" />
+        </van-list>
     </div>
 </template>
 
@@ -32,7 +31,7 @@
 import OrderInfo from '../../components/order/OrderInfo.vue';
 export default {
     name: 'discover',
-    inject: ['bs'],
+
     components: {
         OrderInfo
     },
@@ -57,7 +56,10 @@ export default {
                     name: '已完成'
                 }
             ],
-            empty: false
+            empty: false,
+            loading: false,
+            finished: false,
+            page: 0
         };
     },
     beforeUnmount() {
@@ -74,14 +76,14 @@ export default {
         this.$nextTick(() => {
             this.stiky = this.$refs.top.$el.childNodes[0];
         });
-        this.getList();
     },
     methods: {
         getList() {
-            this.$toast.loading({
-                message: '加载中...',
-                forbidClick: true
-            });
+            if (this.page === 0) {
+                this.list = [];
+            }
+            this.loading = true;
+            this.finished = false;
             this.empty = false;
             this.$http
                 .post(
@@ -93,14 +95,19 @@ export default {
                             status: this.status,
                             type: this.type
                         },
+                        page: this.page,
                         sort: 'createdAt,desc'
                     },
                     { body: 'json' }
                 )
                 .then(res => {
-                    this.list = res.content;
+                    this.list = [...this.list, ...res.content];
                     this.empty = res.empty;
-                    this.$toast.clear();
+                    this.loading = false;
+                    this.finished = res.last;
+                    if (!this.finished) {
+                        this.page = this.page + 1;
+                    }
                 });
         },
         changeStatus(name) {
@@ -111,9 +118,7 @@ export default {
                     type: this.type
                 }
             });
-            this.$nextTick(() => {
-                this.bs.value.scrollTo(0, 0);
-            });
+            this.page = 0;
             this.getList();
         },
         change(isFixed) {
@@ -125,21 +130,16 @@ export default {
                 this.$refs.top.$el.appendChild(this.stiky);
             }
         },
-        changeActive(active) {
-            if (this.type === active) {
-                return;
-            }
-            this.type = active;
+        changeActive(type) {
             this.$router.replace({
                 path: '/orders',
                 query: {
-                    type: active,
-                    status: this.status
+                    status: this.status,
+                    type: type
                 }
             });
-            this.$nextTick(() => {
-                this.bs.value.scrollTo(0, 0);
-            });
+            this.type = type;
+            this.page = 0;
             this.getList();
         }
     }

+ 1 - 1
src/main/nine-space/src/views/product/Detail.vue

@@ -129,7 +129,7 @@ export default {
         SwiperSlide,
         Post
     },
-    inject: ['bs'],
+
     data() {
         return {
             activeName: '1',

+ 32 - 18
src/main/nine-space/src/views/product/List.vue

@@ -4,7 +4,13 @@
             <div class="top">
                 <div class="name">{{ pageName }}</div>
             </div>
-            <van-tabs v-model:active="sort" :ellipsis="false" line-width="16" line-height="2" @change="getList">
+            <van-tabs
+                v-model:active="sort"
+                :ellipsis="false"
+                line-width="16"
+                line-height="2"
+                @change="(page = 0), getList()"
+            >
                 <van-tab
                     :title="item.label"
                     :name="
@@ -24,12 +30,14 @@
                 </van-tab>
             </van-tabs>
         </van-sticky>
-        <div class="list">
+
+        <van-list v-model:loading="loading" :finished="finished" finished-text="" @load="getList">
             <template v-for="(item, index) in list" :key="index">
                 <product-info v-model:info="list[index]" @update:info="init"></product-info>
             </template>
+
             <van-empty v-if="empty" description="没有任何藏品哦~" />
-        </div>
+        </van-list>
     </div>
 </template>
 
@@ -38,7 +46,7 @@ import ProductInfo from '../../components/product/productInfo.vue';
 import product from '../../mixins/product';
 export default {
     components: { ProductInfo },
-    inject: ['bs'],
+
     mixins: [product],
     data() {
         return {
@@ -64,7 +72,10 @@ export default {
                     value: ['price,desc', 'price,asc'],
                     type: 'select'
                 }
-            ]
+            ],
+            loading: false,
+            finished: false,
+            page: 0
         };
     },
     computed: {
@@ -79,7 +90,6 @@ export default {
         this.$nextTick(() => {
             this.stiky = this.$refs.top.$el.childNodes[0];
         });
-        this.getList();
     },
     beforeUnmount() {
         if (this.stiky.parentNode.nodeName == 'BODY') {
@@ -99,15 +109,17 @@ export default {
             }
         },
         getList() {
-            this.$toast.loading({
-                message: '加载中...',
-                forbidClick: true
-            });
+            if (this.page === 0) {
+                this.list = [];
+            }
+            this.loading = true;
+            this.finished = false;
+            this.empty = false;
             this.$http
                 .post(
                     '/collection/all',
                     {
-                        page: 0,
+                        page: this.page,
                         size: 20,
                         query: {
                             type: this.type,
@@ -119,9 +131,13 @@ export default {
                     { body: 'json' }
                 )
                 .then(res => {
-                    this.list = res.content;
+                    this.list = [...this.list, ...res.content];
                     this.empty = res.empty;
-                    this.$toast.clear();
+                    this.loading = false;
+                    this.finished = res.last;
+                    if (!this.finished) {
+                        this.page = this.page + 1;
+                    }
                 });
         }
     }
@@ -133,6 +149,9 @@ export default {
     background-color: #0f0f0f;
     padding-bottom: 100px;
 }
+.van-list {
+    padding: 8px;
+}
 .top {
     background-color: #181818;
     padding: 0 16px;
@@ -146,11 +165,6 @@ export default {
         line-height: 30px;
     }
 }
-/deep/.van-tabs {
-    .van-tabs__nav {
-        padding-left: 16px;
-    }
-}
 // /deep/.van-tab {
 // flex-grow: 0;
 // padding: 0 0 0 0;

+ 1 - 1
src/main/nine-space/src/views/user/Followers.vue

@@ -18,7 +18,7 @@
 import CreatorInfo from '../../components/creator/CreatorInfo.vue';
 export default {
     components: { CreatorInfo },
-    inject: ['bs'],
+
     data() {
         return {
             list: [],

+ 1 - 1
src/main/nine-space/src/views/user/Follows.vue

@@ -18,7 +18,7 @@
 import CreatorInfo from '../../components/creator/CreatorInfo.vue';
 export default {
     components: { CreatorInfo },
-    inject: ['bs'],
+
     data() {
         return {
             list: [],

+ 1 - 1
src/main/nine-space/src/views/user/Likes.vue

@@ -26,7 +26,7 @@
 import ProductInfo from '../../components/product/productInfo.vue';
 export default {
     components: { ProductInfo },
-    inject: ['bs'],
+
     data() {
         return {
             list: [],