瀏覽代碼

滑动问题

xiongzhu 4 年之前
父節點
當前提交
b63c639409

+ 1 - 0
package.json

@@ -50,6 +50,7 @@
         "@vue/cli-plugin-vuex": "~4.5.0",
         "@vue/cli-service": "~4.5.0",
         "@vue/compiler-sfc": "^3.0.0",
+        "@vue/composition-api": "^1.6.1",
         "@vue/eslint-config-prettier": "^6.0.0",
         "babel-eslint": "^10.1.0",
         "eslint": "^6.7.2",

+ 1 - 0
src/App.vue

@@ -84,6 +84,7 @@ export default {
 <style lang="less" scoped>
 .scroll-content {
     min-height: 100vh;
+    min-height: var(--app-height);
     box-sizing: border-box;
     // padding-top: 46px;
 }

+ 7 - 0
src/main.js

@@ -28,6 +28,13 @@ import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
 import customParseFormat from 'dayjs/plugin/customParseFormat';
 import { Toast, Dialog } from 'vant';
 
+const appHeight = () => {
+    const doc = document.documentElement;
+    doc.style.setProperty('--app-height', `${window.innerHeight}px`);
+};
+window.addEventListener('resize', appHeight);
+appHeight();
+
 Toast.setDefaultOptions('loading', { duration: 0 });
 require('dayjs/locale/zh-cn');
 

+ 5 - 7
src/styles/app.less

@@ -58,9 +58,10 @@ textarea {
 body {
     font-family: BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', miui,
         'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
-}
-body {
     -webkit-text-size-adjust: none;
+    font-size: 14px;
+    color: var(--van-text-color);
+    background-color: #272b2e;
 }
 html,
 body,
@@ -69,6 +70,7 @@ body,
     padding: 0;
     margin: 0;
     height: 100vh;
+    height: var(--app-height);
     overflow: hidden;
     -webkit-overflow-scrolling: touch;
     -webkit-font-smoothing: antialiased;
@@ -81,11 +83,6 @@ body,
     display: none;
     opacity: 0;
 }
-body {
-    font-size: 14px;
-    color: var(--van-text-color);
-}
-
 input:-webkit-autofill {
     box-shadow: 0 0 0px 1000px @bg inset;
     -webkit-text-fill-color: @text0;
@@ -228,6 +225,7 @@ input:-webkit-autofill {
     position: fixed;
     width: 100vw;
     height: 100vh;
+    height: var(--app-height);
     top: 0;
     left: 0;
     right: 0;

+ 1 - 0
src/views/Creator.vue

@@ -113,6 +113,7 @@ export default {
     background-color: @bg3;
     padding-bottom: 100px;
     min-height: 100vh;
+    min-height: var(--app-height);
 }
 
 /deep/.van-tab {

+ 1 - 1
src/views/Discover.vue

@@ -106,7 +106,7 @@
                 ></van-tab>
             </van-tabs>
             <van-list
-                style="padding-bottom: 100px;"
+                style="padding-bottom: 100px"
                 class="box-list"
                 v-model:loading="loading"
                 :finished="finished"

+ 2 - 2
src/views/Mine.vue

@@ -37,7 +37,7 @@
                     />
                     <div class="text">
                         <div class="text1">
-                            <span class="van-ellipsis" style="max-width: 120px;">{{ userInfo.nickname }}</span>
+                            <span class="van-ellipsis" style="max-width: 120px">{{ userInfo.nickname }}</span>
                         </div>
                         <div class="text2">
                             <span> 用户ID:{{ userInfo.id }} </span>
@@ -108,7 +108,7 @@
 
                     <div class="text">
                         <div class="text1" @click="$router.push('/login')">点击登录</div>
-                        <div class="text2" style="padding-bottom: 16px;">立即登录获取精彩服务</div>
+                        <div class="text2" style="padding-bottom: 16px">立即登录获取精彩服务</div>
                     </div>
                 </div>
             </div>

+ 3 - 1
src/views/Store.vue

@@ -514,6 +514,7 @@ export default {
 .discover {
     background-color: #0f0f0f;
     min-height: 100vh;
+    min-height: var(--app-height);
     box-sizing: border-box;
 }
 .grid-img {
@@ -596,7 +597,8 @@ export default {
 .goTop {
     position: fixed;
     right: 16px;
-    bottom: 30vh;
+    bottom: 70px;
+    bottom: calc(env(safe-area-inset-bottom) + 70px);
     width: 44px;
     height: 44px;
     display: block;

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

@@ -223,6 +223,7 @@ export default {
 }
 .loginHeight {
     min-height: calc(100vh - 46px);
+    min-height: calc(var(--app-height) - 46px);
 }
 /deep/input:-webkit-autofill {
     box-shadow: 0 0 0px 1000px #101010 inset;

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

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

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

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

+ 4 - 0
src/views/hall/Detail.vue

@@ -583,6 +583,7 @@ export default {
     overflow: auto;
     width: 100vw;
     height: 100vh;
+    height: var(--app-height);
 }
 .swiper-content {
     position: relative;
@@ -592,6 +593,7 @@ export default {
         flex-shrink: 0;
     }
     height: 100vh;
+    height: var(--app-height);
 }
 .user-bg {
     background-size: 100% 100%;
@@ -948,6 +950,7 @@ export default {
     }
     .img-bg {
         min-height: calc(100vh - 95vw);
+        min-height: calc(var(--app-height) - 95vh);
     }
     .user-bg-img {
         height: 100vw;
@@ -1039,6 +1042,7 @@ export default {
         bottom: 0;
         left: auto;
         height: 100vh;
+        height: var(--app-height);
         width: 40px;
         flex-direction: column;
         right: 5px;

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

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

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

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

+ 2 - 0
src/views/product/HopeMarket.vue

@@ -419,6 +419,7 @@ export default {
     padding: 8px;
     box-sizing: border-box;
     min-height: calc(100vh - 200px);
+    min-height: calc(var(--app-height) - 200px);
 }
 .top {
     background-color: #222426;
@@ -597,6 +598,7 @@ export default {
     position: absolute;
     width: 100vw;
     height: 100vh;
+    height: var(--app-height);
     background-color: transparent;
     top: 0;
     left: 0;

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

@@ -264,6 +264,7 @@ export default {
     padding: 8px;
     box-sizing: border-box;
     min-height: calc(100vh - 200px);
+    height: calc(var(--app-height) - 200px);
 }
 .top {
     background-color: @bg;

+ 1 - 0
src/views/product/Tasks.vue

@@ -313,6 +313,7 @@ export default {
 .bg {
     display: block;
     min-height: 100vh;
+    min-height: var(--app-height);
 }
 .box {
     width: calc(100vw - 40px);

+ 1 - 0
src/views/user/Rank.vue

@@ -80,6 +80,7 @@ export default {
     }
     padding: 48vw 10px 0;
     min-height: calc(100vh - 46px);
+    min-height: calc(var(--app-height) - 46px);
 
     .top-text {
         position: absolute;

+ 6 - 187
src/views/user/Wallet.vue

@@ -1,192 +1,11 @@
 <template>
-    <div class="wallet">
-        <div class="top">
-            <div class="text1">个人账户余额</div>
-            <div class="text2">
-                <img src="@assets/svgs/icon_jiage.svg" alt="" />
-                <span>0</span>
-            </div>
-            <div class="btns">
-                <van-button @click="wait" plain round color="#939599" size="mini">提现</van-button>
-                <van-button @click="wait" plain round type="primary" size="mini">充值</van-button>
-            </div>
-            <img src="@assets/svgs/topBg.svg" class="top-img" alt="" />
-        </div>
-
-        <div class="title">
-            <span>收入明细</span>
-            <van-popover v-model:show="showPopover" :actions="actions" theme="dark" @select="onSelect">
-                <template #reference>
-                    <van-button
-                        class="select"
-                        size="mini"
-                        color="#1C1E25"
-                        icon-position="right"
-                        :icon="require('@assets/svgs/icon_shaixuan_sanjiao.svg')"
-                        >2021年9月</van-button
-                    >
-                </template>
-            </van-popover>
-        </div>
-        <div class="list">
-            <!-- <div class="info">
-                <div class="info-text">
-                    <div class="text1">提现</div>
-                    <div class="text2">奶盖</div>
-                    <div class="text2">09-03 09:56</div>
-                </div>
-                <div class="text3">-320</div>
-            </div>
-            <div class="info">
-                <div class="info-text">
-                    <div class="text1">提现</div>
-                    <div class="text2">奶盖</div>
-                    <div class="text2">09-03 09:56</div>
-                </div>
-                <div class="text3">-320</div>
-            </div> -->
-            <van-empty :image="require('@assets/kong_png_yongyoude  (1).png')" description="暂时没有任何记录哦~" />
-        </div>
-    </div>
+    <div></div>
 </template>
-
 <script>
-import { ref } from 'vue';
-export default {
-    setup() {
-        const showPopover = ref(false);
+import { defineComponent } from '@vue/composition-api';
 
-        // 通过 actions 属性来定义菜单选项
-        const actions = [{ text: '2021年9月' }];
-
-        return {
-            actions,
-            showPopover
-        };
-    },
-    methods: {
-        onSelect(action) {
-            console.log(action);
-        }
-    }
-};
+export default defineComponent({
+    setup() {}
+});
 </script>
-
-<style lang="less" scoped>
-.top {
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-    padding: 50px 16px 53px;
-    background-color: @bg3;
-    position: relative;
-    .text1 {
-        font-size: 13px;
-        color: #939599;
-        line-height: 18px;
-    }
-    .text2 {
-        span {
-            font-size: 36px;
-            font-family: DIN;
-            font-weight: bold;
-            color: #fdfb60;
-            line-height: 44px;
-            background: linear-gradient(135deg, #fdfb60 0%, #ff8f3e 100%);
-            background-clip: text;
-            -webkit-background-clip: text;
-            -webkit-text-fill-color: transparent;
-        }
-    }
-
-    .btns {
-        margin-top: 20px;
-        .van-button {
-            width: 90px;
-
-            &.van-button--primary {
-                border: solid 0px transparent;
-                padding: 1px;
-                background-image: linear-gradient(@bg, @bg), linear-gradient(135deg, #fdfb60, #ff8f3e);
-                background-origin: border-box;
-                box-sizing: border-box;
-                background-clip: content-box, border-box;
-            }
-        }
-
-        .van-button + .van-button {
-            margin-left: 32px;
-        }
-    }
-}
-
-.top-img {
-    display: block;
-    width: 100%;
-    position: absolute;
-    bottom: 0;
-    left: 0;
-}
-
-.title {
-    padding: 20px 16px;
-    font-size: 16px;
-    font-weight: bold;
-    color: @text0;
-    line-height: 22px;
-    display: flex;
-    justify-content: space-between;
-}
-.select {
-    min-width: 100px;
-    height: 32px;
-    color: #939599 !important;
-
-    /deep/.van-icon__image {
-        width: 20px;
-        height: 20px;
-        display: block;
-    }
-}
-
-.info {
-    display: flex;
-    padding: 0 16px;
-    height: 90px;
-    align-items: center;
-    position: relative;
-    .info-text {
-        flex-grow: 1;
-        .text1 {
-            font-size: 14px;
-            color: @text0;
-            line-height: 20px;
-            margin-bottom: 4px;
-        }
-
-        .text2 {
-            font-size: 12px;
-            color: #969799;
-            line-height: 17px;
-            margin-bottom: 2px;
-        }
-    }
-
-    .text3 {
-        font-size: 16px;
-        font-weight: bold;
-        color: @text0;
-        line-height: 24px;
-    }
-
-    &::before {
-        content: '';
-        position: absolute;
-        left: 16px;
-        right: 16px;
-        top: 0;
-        height: 1px;
-        background-color: #202122;
-    }
-}
-</style>
+<style lang="less" scoped></style>

+ 5 - 0
yarn.lock

@@ -1621,6 +1621,11 @@
   optionalDependencies:
     prettier "^1.18.2 || ^2.0.0"
 
+"@vue/composition-api@^1.6.1":
+  version "1.6.1"
+  resolved "https://registry.npmmirror.com/@vue/composition-api/-/composition-api-1.6.1.tgz#3b809802979af9ec06678437bead7617f0f85be5"
+  integrity sha512-QNeduwRllSRzo9ZOzZjtzCeGUx0sEfrEDHmQlf+goLw4calBPBbpYWf8ueh6VSBrWJGQRJPsRPmTVEeTKRKBMg==
+
 "@vue/devtools-api@^6.0.0-beta.11", "@vue/devtools-api@^6.0.0-beta.18":
   version "6.0.11"
   resolved "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.0.11.tgz#f855e49fb4dc8b4f368488d300dde793f434dcbe"