Просмотр исходного кода

Merge branch 'yuan' of panhui/lasuo_nft_front into dev

yuanyuan 3 лет назад
Родитель
Сommit
925ffe5f3f

+ 14 - 3
src/App.vue

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

+ 9 - 1
src/main.js

@@ -31,6 +31,14 @@ import { useCssVar } from '@vueuse/core';
 import { computed } from 'vue';
 import { computed } from 'vue';
 
 
 const appHeight = useCssVar('--app-height', document.documentElement);
 const appHeight = useCssVar('--app-height', document.documentElement);
+const onWindowResize = () => {
+    if (navigator.userAgent.includes('#cordova#')) {
+        appHeight.value = `${window.screen.height}px`;
+    } else {
+        appHeight.value = `${window.innerHeight}px`;
+    }
+};
+window.addEventListener('resize', onWindowResize);
 Toast.setDefaultOptions('loading', { duration: 0 });
 Toast.setDefaultOptions('loading', { duration: 0 });
 require('dayjs/locale/zh-cn');
 require('dayjs/locale/zh-cn');
 
 
@@ -85,7 +93,7 @@ const app = createApp(App)
     .provide('safeBottom', safeBottom)
     .provide('safeBottom', safeBottom)
     .provide('safeLeft', safeLeft)
     .provide('safeLeft', safeLeft)
     .provide('safeRight', safeRight)
     .provide('safeRight', safeRight)
-    .provide('barHeight', barHeight);
+    .provide('barHeight', barHeight.value);
 app.config.globalProperties.emitter = emitter;
 app.config.globalProperties.emitter = emitter;
 app.config.globalProperties.dayjs = dayjs;
 app.config.globalProperties.dayjs = dayjs;
 
 

+ 2 - 2
src/styles/app.less

@@ -81,7 +81,7 @@ body,
 .scroll-wrapper {
 .scroll-wrapper {
     padding: 0;
     padding: 0;
     margin: 0;
     margin: 0;
-    height: 100vh;
+    height: var(--app-height);
     overflow: hidden;
     overflow: hidden;
     -webkit-overflow-scrolling: touch;
     -webkit-overflow-scrolling: touch;
     -webkit-font-smoothing: antialiased;
     -webkit-font-smoothing: antialiased;
@@ -259,7 +259,7 @@ input:-webkit-autofill {
 .splash-screen {
 .splash-screen {
     position: fixed;
     position: fixed;
     width: 100vw;
     width: 100vw;
-    height: 100vh;
+    height: var(--app-height);
     top: 0;
     top: 0;
     left: 0;
     left: 0;
     right: 0;
     right: 0;

+ 29 - 31
src/views/Creator.vue

@@ -1,36 +1,34 @@
 <template>
 <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>
+            <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>
 </template>
 
 
 <script>
 <script>
@@ -112,7 +110,7 @@ export default {
 .discover {
 .discover {
     background-color: @bg3;
     background-color: @bg3;
     padding-bottom: 100px;
     padding-bottom: 100px;
-    min-height: 100vh;
+    min-height: var(--app-height);
 }
 }
 
 
 /deep/.van-tab {
 /deep/.van-tab {

+ 4 - 4
src/views/Hall.vue

@@ -219,7 +219,7 @@ export default {
     padding-top: 7.72vh;
     padding-top: 7.72vh;
 }
 }
 /deep/.swiper-wrapper {
 /deep/.swiper-wrapper {
-    height: calc(100vh - 7.72vh);
+    height: calc(var(--app-height) - 7.72vh);
 }
 }
 
 
 .windowHorizontal {
 .windowHorizontal {
@@ -254,7 +254,7 @@ export default {
     }
     }
 
 
     /deep/.swiper-wrapper {
     /deep/.swiper-wrapper {
-        height: calc(100vh - 7.72vw);
+        height: calc(var(--app-height) - 7.72vw);
     }
     }
 
 
     .bottom {
     .bottom {
@@ -279,7 +279,7 @@ export default {
 
 
     .imgs {
     .imgs {
         width: calc(12.6vw + 120px);
         width: calc(12.6vw + 120px);
-        height: 100vh;
+        height: var(--app-height);
         box-sizing: border-box;
         box-sizing: border-box;
         .icon {
         .icon {
             padding: 6.3vw;
             padding: 6.3vw;
@@ -315,7 +315,7 @@ export default {
     }
     }
 
 
     /deep/.swiper-wrapper {
     /deep/.swiper-wrapper {
-        height: 100vh;
+        height: var(--app-height);
         align-items: flex-end;
         align-items: flex-end;
     }
     }
 
 

+ 0 - 7
src/views/Home.vue

@@ -316,15 +316,8 @@ export default {
         let that = this;
         let that = this;
         // that.getList();
         // that.getList();
         that.getBanner();
         that.getBanner();
-        // location.reload()
         // that.getUser();
         // that.getUser();
     },
     },
-    noReloaded: function () {
-        if (location.href.indexOf('#reloaded') == -1) {
-            location.href = location.href + '#reloaded';
-            window.location.reload();
-        }
-    },
     activated() {
     activated() {
         this.$nextTick(() => {
         this.$nextTick(() => {
             this.changeScroll(this.scrollTop);
             this.changeScroll(this.scrollTop);

+ 1 - 7
src/views/Mine.vue

@@ -265,12 +265,6 @@ export default {
         //         this.$el.parentNode.childNodes[1].className.replace(/ bgBack/, '') + ' bgBack';
         //         this.$el.parentNode.childNodes[1].className.replace(/ bgBack/, '') + ' bgBack';
         // });
         // });
     },
     },
-    noReloaded: function () {
-        if (location.href.indexOf('#reloaded') == -1) {
-            location.href = location.href + '#reloaded';
-            window.location.reload();
-        }
-    },
     methods: {
     methods: {
         // 复制
         // 复制
         copy() {
         copy() {
@@ -352,7 +346,7 @@ export default {
 <style lang="less" scoped>
 <style lang="less" scoped>
 .content {
 .content {
     width: 100%;
     width: 100%;
-    height: calc(100vh);
+    height: calc(var(--app-height));
     // position: absolute;
     // position: absolute;
     // margin-top: 44px;
     // margin-top: 44px;
     background: @bg;
     background: @bg;

+ 1 - 1
src/views/Store.vue

@@ -432,7 +432,7 @@ export default {
         padding: 0px 15px 16px;
         padding: 0px 15px 16px;
         box-sizing: border-box;
         box-sizing: border-box;
         // background: #0F0F27;
         // background: #0F0F27;
-        min-height: calc(100vh - 100px);
+        min-height: calc(var(--app-height) - 100px);
         margin-bottom: 80px;
         margin-bottom: 80px;
         .data_display_fanter {
         .data_display_fanter {
             width: 100%;
             width: 100%;

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

@@ -272,7 +272,7 @@ export default {
     }
     }
 }
 }
 .loginHeight {
 .loginHeight {
-    min-height: calc(100vh - 46px);
+    min-height: calc(var(--app-height) - 46px);
     min-height: calc(var(--app-height) - 46px);
     min-height: calc(var(--app-height) - 46px);
 }
 }
 /deep/input:-webkit-autofill {
 /deep/input:-webkit-autofill {

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

@@ -225,7 +225,7 @@ export default {
     background-size: 100% 100%;
     background-size: 100% 100%;
 }
 }
 .loginHeight {
 .loginHeight {
-    min-height: calc(100vh - 46px);
+    min-height: calc(var(--app-height) - 46px);
 }
 }
 .tabs {
 .tabs {
     display: flex;
     display: flex;

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

@@ -184,7 +184,7 @@ export default {
 
 
 .discover {
 .discover {
     background-color: @bg3;
     background-color: @bg3;
-    min-height: 100vh;
+    min-height: var(--app-height);
     box-sizing: border-box;
     box-sizing: border-box;
 }
 }
 
 

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

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

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

@@ -6,37 +6,37 @@
             class="follow_search"
             class="follow_search"
             @click="$router.push('/productSearch')"
             @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> -->
     <!-- </div> -->
 </template>
 </template>
 
 
@@ -46,7 +46,7 @@ import list from '../../mixins/list';
 export default {
 export default {
     name: 'creatorList',
     name: 'creatorList',
     components: { CreatorInfo },
     components: { CreatorInfo },
-    inject: ['bar', 'setKeeps', 'scrollWrapper', 'changeScroll','barHeight'],
+    inject: ['bar', 'setKeeps', 'scrollWrapper', 'changeScroll', 'barHeight'],
     mixins: [list],
     mixins: [list],
     data() {
     data() {
         return {
         return {
@@ -122,7 +122,7 @@ export default {
     border-color: @tabBorder;
     border-color: @tabBorder;
     justify-content: space-between;
     justify-content: space-between;
 }
 }
-/deep/ .van-tabs__line{
+/deep/ .van-tabs__line {
     width: 0px !important;
     width: 0px !important;
     height: 0px !important;
     height: 0px !important;
     // z-index: -1;
     // 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;
     color: #ffffff;
 }
 }
-/deep/ .van-tab{
+/deep/ .van-tab {
     flex: 0 !important;
     flex: 0 !important;
     font-size: 16px;
     font-size: 16px;
 }
 }
-/deep/ .van-tabs__wrap{
+/deep/ .van-tabs__wrap {
     height: 36px;
     height: 36px;
 }
 }
-/deep/ .van-tab--grow{
+/deep/ .van-tab--grow {
     padding: 0px !important;
     padding: 0px !important;
 }
 }
 .van-tabs {
 .van-tabs {
     background-color: @bg;
     background-color: @bg;
 }
 }
-.list{
+.list {
     margin-bottom: 80px;
     margin-bottom: 80px;
 }
 }
 </style>
 </style>

+ 5 - 5
src/views/hall/Detail.vue

@@ -477,7 +477,7 @@ export default {
     padding-top: 7.72vh;
     padding-top: 7.72vh;
 }
 }
 /deep/.swiper-wrapper {
 /deep/.swiper-wrapper {
-    height: calc(100vh - 7.72vh);
+    height: calc(var(--app-height) - 7.72vh);
 }
 }
 
 
 .top {
 .top {
@@ -551,7 +551,7 @@ export default {
     }
     }
 
 
     /deep/.swiper-wrapper {
     /deep/.swiper-wrapper {
-        height: calc(100vh - 7.72vw);
+        height: calc(var(--app-height) - 7.72vw);
     }
     }
 
 
     .bottom {
     .bottom {
@@ -576,7 +576,7 @@ export default {
 
 
     .imgs {
     .imgs {
         width: calc(12.6vw + 120px);
         width: calc(12.6vw + 120px);
-        height: 100vh;
+        height: var(--app-height);
         box-sizing: border-box;
         box-sizing: border-box;
         .icon {
         .icon {
             padding: 6.3vw;
             padding: 6.3vw;
@@ -615,7 +615,7 @@ export default {
     }
     }
 
 
     /deep/.swiper-wrapper {
     /deep/.swiper-wrapper {
-        height: 100vh;
+        height: var(--app-height);
         align-items: flex-end;
         align-items: flex-end;
     }
     }
 
 
@@ -639,7 +639,7 @@ export default {
         top: 0;
         top: 0;
         bottom: 0;
         bottom: 0;
         left: auto;
         left: auto;
-        height: 100vh;
+        height: var(--app-height);
         width: 40px;
         width: 40px;
         flex-direction: column;
         flex-direction: column;
         right: 20px;
         right: 20px;

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

@@ -149,7 +149,7 @@ export default {
 
 
 .discover {
 .discover {
     background-color: @bg3;
     background-color: @bg3;
-    min-height: 100vh;
+    min-height: var(--app-height);
 }
 }
 
 
 .list {
 .list {

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

@@ -323,7 +323,7 @@ export default {
 
 
 .discover {
 .discover {
     background-color: @bg3;
     background-color: @bg3;
-    min-height: 100vh;
+    min-height: var(--app-height);
 }
 }
 
 
 /deep/.van-tabs__nav--line.van-tabs__nav--complete {
 /deep/.van-tabs__nav--line.van-tabs__nav--complete {