panhui 3 лет назад
Родитель
Сommit
55dea089db
5 измененных файлов с 82 добавлено и 72 удалено
  1. 13 2
      src/App.vue
  2. 1 1
      src/main.js
  3. 28 30
      src/views/Creator.vue
  4. 2 1
      src/views/creator/Detail.vue
  5. 38 38
      src/views/creator/List.vue

+ 13 - 2
src/App.vue

@@ -3,7 +3,7 @@
         <app-bar ref="bar"></app-bar>
         <router-view v-slot="{ Component }">
             <keep-alive :include="keeps">
-                <component :is="Component" class="scroll-content" ref="content" />
+                <component :is="Component" class="scroll-content" ref="content" :style="scrollStyle"/>
             </keep-alive>
         </router-view>
     </div>
@@ -18,7 +18,7 @@ export default {
     provide() {
         return {
             setKeeps: this.setKeeps,
-            bar: computed(() => this.$refs.bar),
+            bar: computed(() => this.barValue),
             content: computed(() => this.$refs.content),
             scrollWrapper: computed(() => this.$el),
             changeScroll: this.changeScroll,
@@ -27,6 +27,17 @@ export default {
         };
     },
     inject: ['barHeight'],
+    computed: {
+        barValue() {
+            return this.$refs.bar;
+        },
+        scrollStyle() {
+            return {
+                boxSizing: 'border-box',
+                minHeight: `calc(100vh - ${(this.barHeight || '0') + 'px'})`
+            };
+        }
+    },
     data() {
         return {
             checkEvent: null,

+ 1 - 1
src/main.js

@@ -85,7 +85,7 @@ const app = createApp(App)
     .provide('safeBottom', safeBottom)
     .provide('safeLeft', safeLeft)
     .provide('safeRight', safeRight)
-    .provide('barHeight', barHeight);
+    .provide('barHeight', barHeight.value);
 app.config.globalProperties.emitter = emitter;
 app.config.globalProperties.dayjs = dayjs;
 

+ 28 - 30
src/views/Creator.vue

@@ -1,36 +1,34 @@
 <template>
-    <div class="discover">
-        <van-sticky ref="top" :offset-top="barHeight">
-            <div class="top">
-                <div class="top-btn">
-                    <div class="btn" @click="$router.replace('/discover')">收藏探索</div>
-                    <div class="btn active">铸造者</div>
-                </div>
-                <div class="search" @click="$router.push('/creatorSearch')">
-                    <img src="@assets/svgs/search.svg" alt="" />
-                </div>
+    <van-sticky ref="top" :offset-top="barHeight">
+        <div class="top">
+            <div class="top-btn">
+                <div class="btn" @click="$router.replace('/discover')">收藏探索</div>
+                <div class="btn active">铸造者</div>
             </div>
+            <div class="search" @click="$router.push('/creatorSearch')">
+                <img src="@assets/svgs/search.svg" alt="" />
+            </div>
+        </div>
 
-            <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>
-        <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>
+        <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>
+    <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>
 </template>
 
 <script>

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

@@ -303,6 +303,7 @@ export default {
     padding-top: 35vw;
     position: relative;
     background-color: @bg;
+    padding-bottom: 45px;
 
     .history {
         position: absolute;
@@ -490,7 +491,7 @@ export default {
     height: 36px;
     align-items: center;
     padding: 0 16px;
-    margin-top: 45px;
+    // margin-top: 45px;
     // border-bottom: 1px solid #202122;
     background-color: @bg;
     .menu-item {

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

@@ -6,37 +6,37 @@
             class="follow_search"
             @click="$router.push('/productSearch')"
         /> -->
-        <van-sticky ref="top" :offset-top="barHeight">
-            <van-tabs v-model:active="sort" :ellipsis="false" line-width="16" line-height="2" @change="getData(true)">
-                <van-tab
-                    :title="item.label"
-                    :name="
-                        item.type === 'select' ? (sort === item.value[0] ? item.value[1] : item.value[0]) : item.value
-                    "
-                    :title-class="item.type === 'select' && sort === item.value[0] ? '' : 'asc'"
-                    :key="index"
-                    v-for="(item, index) in sourceOptions"
-                >
-                    <template v-if="item.type === 'select'" #title>
-                        <div class="tab">
-                            <span>{{ item.label }}</span>
-                            <van-icon size="8" name="arrow-up" />
-                            <van-icon size="8" name="arrow-down" />
-                        </div>
-                    </template>
-                </van-tab>
-            </van-tabs>
-        </van-sticky>
-        <van-list class="list" v-model:loading="loading" :finished="finished" finished-text="- 更多藏品敬请期待 -" @load="getData">
-            <template v-for="(item, index) in list" :key="index">
-                <creator-info v-model:info="list[index]"></creator-info>
-            </template>
-            <van-empty
-                :image="require('@assets/kong_png_yongyoude  (1).png')"
-                v-if="empty"
-                description="没有任何藏品哦~"
-            />
-        </van-list>
+    <van-sticky :offset-top="barHeight">
+        <van-tabs v-model:active="sort" :ellipsis="false" line-width="16" line-height="2" @change="getData(true)">
+            <van-tab
+                :title="item.label"
+                :name="item.type === 'select' ? (sort === item.value[0] ? item.value[1] : item.value[0]) : item.value"
+                :title-class="item.type === 'select' && sort === item.value[0] ? '' : 'asc'"
+                :key="index"
+                v-for="(item, index) in sourceOptions"
+            >
+                <template v-if="item.type === 'select'" #title>
+                    <div class="tab">
+                        <span>{{ item.label }}</span>
+                        <van-icon size="8" name="arrow-up" />
+                        <van-icon size="8" name="arrow-down" />
+                    </div>
+                </template>
+            </van-tab>
+        </van-tabs>
+    </van-sticky>
+    <van-list
+        class="list"
+        v-model:loading="loading"
+        :finished="finished"
+        finished-text="- 更多藏品敬请期待 -"
+        @load="getData"
+    >
+        <template v-for="(item, index) in list" :key="index">
+            <creator-info v-model:info="list[index]"></creator-info>
+        </template>
+        <van-empty :image="require('@assets/kong_png_yongyoude  (1).png')" v-if="empty" description="没有任何藏品哦~" />
+    </van-list>
     <!-- </div> -->
 </template>
 
@@ -46,7 +46,7 @@ import list from '../../mixins/list';
 export default {
     name: 'creatorList',
     components: { CreatorInfo },
-    inject: ['bar', 'setKeeps', 'scrollWrapper', 'changeScroll','barHeight'],
+    inject: ['bar', 'setKeeps', 'scrollWrapper', 'changeScroll', 'barHeight'],
     mixins: [list],
     data() {
         return {
@@ -122,7 +122,7 @@ export default {
     border-color: @tabBorder;
     justify-content: space-between;
 }
-/deep/ .van-tabs__line{
+/deep/ .van-tabs__line {
     width: 0px !important;
     height: 0px !important;
     // z-index: -1;
@@ -165,23 +165,23 @@ export default {
         }
     }
 }
-.van-tab--active.asc .tab .van-icon-arrow-up{
+.van-tab--active.asc .tab .van-icon-arrow-up {
     color: #ffffff;
 }
-/deep/ .van-tab{
+/deep/ .van-tab {
     flex: 0 !important;
     font-size: 16px;
 }
-/deep/ .van-tabs__wrap{
+/deep/ .van-tabs__wrap {
     height: 36px;
 }
-/deep/ .van-tab--grow{
+/deep/ .van-tab--grow {
     padding: 0px !important;
 }
 .van-tabs {
     background-color: @bg;
 }
-.list{
+.list {
     margin-bottom: 80px;
 }
 </style>