Merge branch 'develop' of git.yoho.cn:fe/xianyu-ufo-app-web into develop
Showing
11 changed files
with
50 additions
and
24 deletions
1 | <template> | 1 | <template> |
2 | - <div id="app"> | 2 | + <div id="app" :style="{height: windowHeight }"> |
3 | <keep-alive :max="20"> | 3 | <keep-alive :max="20"> |
4 | <router-view :key="routerViewKey"></router-view> | 4 | <router-view :key="routerViewKey"></router-view> |
5 | </keep-alive> | 5 | </keep-alive> |
@@ -11,6 +11,11 @@ import { mapState, mapMutations, mapActions } from 'vuex'; | @@ -11,6 +11,11 @@ import { mapState, mapMutations, mapActions } from 'vuex'; | ||
11 | 11 | ||
12 | export default { | 12 | export default { |
13 | name: 'App', | 13 | name: 'App', |
14 | + data() { | ||
15 | + return { | ||
16 | + windowHeight: '100%', | ||
17 | + }; | ||
18 | + }, | ||
14 | computed: { | 19 | computed: { |
15 | ...mapState(['yoho']), | 20 | ...mapState(['yoho']), |
16 | routerViewKey() { | 21 | routerViewKey() { |
@@ -19,7 +24,7 @@ export default { | @@ -19,7 +24,7 @@ export default { | ||
19 | } else { | 24 | } else { |
20 | return this.$route.fullPath; | 25 | return this.$route.fullPath; |
21 | } | 26 | } |
22 | - }, | 27 | + } |
23 | }, | 28 | }, |
24 | mounted() { | 29 | mounted() { |
25 | if (this.yoho.context.needLogin) { | 30 | if (this.yoho.context.needLogin) { |
@@ -41,13 +46,22 @@ export default { | @@ -41,13 +46,22 @@ export default { | ||
41 | }); | 46 | }); |
42 | 47 | ||
43 | this.getZkConfig(); | 48 | this.getZkConfig(); |
49 | + if (typeof window !== 'undefined') { | ||
50 | + if (window.screen.availHeight - window.innerHeight > 100) { | ||
51 | + this.windowHeight = (window.screen.availHeight - 88) + 'px'; | ||
52 | + } else { | ||
53 | + this.windowHeight = window.innerHeight + 'px'; | ||
54 | + } | ||
55 | + } else { | ||
56 | + this.windowHeight = '100%'; | ||
57 | + } | ||
44 | }, | 58 | }, |
45 | watch: { | 59 | watch: { |
46 | 'yoho.context.needLogin': function(newVal) { | 60 | 'yoho.context.needLogin': function(newVal) { |
47 | if (newVal) { | 61 | if (newVal) { |
48 | this.$yoho.auth({ needLogin: newVal }); | 62 | this.$yoho.auth({ needLogin: newVal }); |
49 | } | 63 | } |
50 | - }, | 64 | + } |
51 | }, | 65 | }, |
52 | methods: { | 66 | methods: { |
53 | ...mapMutations(['SET_LOGIN_INFO']), | 67 | ...mapMutations(['SET_LOGIN_INFO']), |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | <div | 2 | <div |
3 | ref="layout" | 3 | ref="layout" |
4 | class="layout" | 4 | class="layout" |
5 | + :class="noSafeArea ? 'no-safe-area': ''" | ||
5 | @touchstart="webviewScrollStart" | 6 | @touchstart="webviewScrollStart" |
6 | @touchmove="webviewScrollMove" | 7 | @touchmove="webviewScrollMove" |
7 | @touchend="webviewScrollEnd"> | 8 | @touchend="webviewScrollEnd"> |
@@ -50,7 +51,8 @@ export default { | @@ -50,7 +51,8 @@ export default { | ||
50 | isStop: { | 51 | isStop: { |
51 | type: Boolean, | 52 | type: Boolean, |
52 | default: false | 53 | default: false |
53 | - } | 54 | + }, |
55 | + noSafeArea: Boolean | ||
54 | }, | 56 | }, |
55 | data() { | 57 | data() { |
56 | return { | 58 | return { |
@@ -97,6 +99,7 @@ export default { | @@ -97,6 +99,7 @@ export default { | ||
97 | display: flex; | 99 | display: flex; |
98 | flex-direction: column; | 100 | flex-direction: column; |
99 | background-color: #fff; | 101 | background-color: #fff; |
102 | + box-sizing: border-box; | ||
100 | 103 | ||
101 | .layout-context { | 104 | .layout-context { |
102 | flex: 1; | 105 | flex: 1; |
1 | <template> | 1 | <template> |
2 | - <LayoutApp :title="title" > | 2 | + <LayoutApp :title="title" :no-safe-area="true" > |
3 | <div ref="wrapper" class="activity-wrapper"> | 3 | <div ref="wrapper" class="activity-wrapper"> |
4 | <div class="activity-container"> | 4 | <div class="activity-container"> |
5 | <ul id="page_ul"> | 5 | <ul id="page_ul"> |
1 | <template> | 1 | <template> |
2 | - <LayoutApp title="秒杀AJ" :show-back="true" :back-action="goBack"> | 2 | + <LayoutApp title="秒杀AJ" :show-back="true" :no-safe-area="true" :back-action="goBack"> |
3 | <ul> | 3 | <ul> |
4 | <li v-for="(item, index) in productList" :key="index"> | 4 | <li v-for="(item, index) in productList" :key="index"> |
5 | <div v-if="item.urls && item.urls.length > 0" class="link-container"> | 5 | <div v-if="item.urls && item.urls.length > 0" class="link-container"> |
@@ -66,7 +66,6 @@ export default { | @@ -66,7 +66,6 @@ export default { | ||
66 | rule: productData.imageList[0].rule, | 66 | rule: productData.imageList[0].rule, |
67 | more: productData.imageList[0].more | 67 | more: productData.imageList[0].more |
68 | }; | 68 | }; |
69 | - console.log(this.productList) | ||
70 | } | 69 | } |
71 | }; | 70 | }; |
72 | </script> | 71 | </script> |
@@ -74,13 +73,15 @@ export default { | @@ -74,13 +73,15 @@ export default { | ||
74 | <style lang="scss" scoped> | 73 | <style lang="scss" scoped> |
75 | ul { | 74 | ul { |
76 | width: 100%; | 75 | width: 100%; |
76 | + height: 100%; | ||
77 | list-style: none; | 77 | list-style: none; |
78 | margin: 0; | 78 | margin: 0; |
79 | padding: 0; | 79 | padding: 0; |
80 | background-image: url("//ad.yoho.cn/html5/2019/10/activity/008/base/repeat_bg.jpg?imageslim"); | 80 | background-image: url("//ad.yoho.cn/html5/2019/10/activity/008/base/repeat_bg.jpg?imageslim"); |
81 | background-repeat: repeat-y; | 81 | background-repeat: repeat-y; |
82 | background-size: 100% auto; | 82 | background-size: 100% auto; |
83 | - overflow: hidden; | 83 | + overflow-x: hidden; |
84 | + overflow-y: scroll; | ||
84 | -webkit-overflow-scrolling: touch; | 85 | -webkit-overflow-scrolling: touch; |
85 | 86 | ||
86 | li { | 87 | li { |
1 | <template> | 1 | <template> |
2 | - <LayoutApp :show-back="true" :hideHeader="hideHeader"> | 2 | + <LayoutApp :show-back="true" :hideHeader="hideHeader" :no-safe-area="true"> |
3 | <div class="root-content"> | 3 | <div class="root-content"> |
4 | <div class="left-content"> | 4 | <div class="left-content"> |
5 | <Scroll> | 5 | <Scroll> |
1 | <template> | 1 | <template> |
2 | - <LayoutApp class="yohoufo-channel-page" :show-back="true" :hide-header="hideHeader" :title="title"> | 2 | + <LayoutApp class="yohoufo-channel-page" :show-back="true" :hide-header="hideHeader" :title="title" :no-safe-area="true"> |
3 | <div class="fixed-nav scroll-nav-wrap" :class="{'hidden': !isShow}" v-if="navList.length"> | 3 | <div class="fixed-nav scroll-nav-wrap" :class="{'hidden': !isShow}" v-if="navList.length"> |
4 | <ScrollNav :list="navList" :current="active" @transfer="getIndex"></ScrollNav> | 4 | <ScrollNav :list="navList" :current="active" @transfer="getIndex"></ScrollNav> |
5 | </div> | 5 | </div> |
@@ -169,7 +169,7 @@ export default { | @@ -169,7 +169,7 @@ export default { | ||
169 | const {url = ''} = firstNav; | 169 | const {url = ''} = firstNav; |
170 | this.selectedCategory = queryString.parse(url); | 170 | this.selectedCategory = queryString.parse(url); |
171 | } | 171 | } |
172 | - | 172 | + |
173 | this.refreshProductList(this.active); | 173 | this.refreshProductList(this.active); |
174 | }, | 174 | }, |
175 | methods: { | 175 | methods: { |
@@ -442,12 +442,21 @@ export default { | @@ -442,12 +442,21 @@ export default { | ||
442 | } | 442 | } |
443 | .scroll-nav-wrap { | 443 | .scroll-nav-wrap { |
444 | position: relative; | 444 | position: relative; |
445 | - background-color: #fefefe; | 445 | + |
446 | + &:after { | ||
447 | + content: ""; | ||
448 | + position: absolute; | ||
449 | + width: 100%; | ||
450 | + height: 100px; | ||
451 | + box-shadow: 0 0 120px 100px #f2f2f2 !important; | ||
452 | + z-index: -1; | ||
453 | + } | ||
446 | 454 | ||
447 | &.fixed-nav { | 455 | &.fixed-nav { |
448 | width: 100%; | 456 | width: 100%; |
449 | position: absolute; | 457 | position: absolute; |
450 | z-index: 10; | 458 | z-index: 10; |
459 | + background-color: #fefefe; | ||
451 | overflow: hidden; | 460 | overflow: hidden; |
452 | } | 461 | } |
453 | } | 462 | } |
@@ -103,13 +103,9 @@ export default { | @@ -103,13 +103,9 @@ export default { | ||
103 | background-color: white; | 103 | background-color: white; |
104 | } | 104 | } |
105 | 105 | ||
106 | -@supports (bottom: env(safe-area-inset-bottom)) { | ||
107 | - .content { | ||
108 | - height: calc(env(safe-area-inset-bottom) + 100% + 88px); | ||
109 | - } | ||
110 | - | 106 | +/*@supports (bottom: env(safe-area-inset-bottom)) { |
111 | .footer { | 107 | .footer { |
112 | height: calc(env(safe-area-inset-bottom) + 100px); | 108 | height: calc(env(safe-area-inset-bottom) + 100px); |
113 | } | 109 | } |
114 | -} | 110 | +}*/ |
115 | </style> | 111 | </style> |
1 | <template> | 1 | <template> |
2 | - <LayoutApp :show-back="true" title="我的" :hideHeader="hideHeader"> | 2 | + <LayoutApp :show-back="true" title="我的" :no-safe-area="true" :hideHeader="hideHeader"> |
3 | <div class="body" ref="body"> | 3 | <div class="body" ref="body"> |
4 | <div v-for="(value, key) in getMineList" :key="key"> | 4 | <div v-for="(value, key) in getMineList" :key="key"> |
5 | <tab-item v-if="key === 'board'" :data="value" noLine icon="cubeic-notification" small grey> | 5 | <tab-item v-if="key === 'board'" :data="value" noLine icon="cubeic-notification" small grey> |
1 | <template> | 1 | <template> |
2 | - <LayoutApp title="闲鱼潮玩转攻略" :show-back="true" :back-action="goBack"> | 2 | + <LayoutApp title="闲鱼潮玩转攻略" :show-back="true" :no-safe-area="true" :back-action="goBack"> |
3 | <div class="body-warpper"> | 3 | <div class="body-warpper"> |
4 | <ul> | 4 | <ul> |
5 | <li v-for="(item, index) in dataList" :key="index"> | 5 | <li v-for="(item, index) in dataList" :key="index"> |
@@ -554,11 +554,14 @@ body { | @@ -554,11 +554,14 @@ body { | ||
554 | margin-bottom: env(safe-area-inset-bottom); | 554 | margin-bottom: env(safe-area-inset-bottom); |
555 | } | 555 | } |
556 | 556 | ||
557 | - #app { | ||
558 | - height: calc(100% + env(safe-area-inset-bottom)); | 557 | + .layout { |
558 | + padding-bottom: env(safe-area-inset-bottom); | ||
559 | } | 559 | } |
560 | -} | ||
561 | 560 | ||
561 | + .layout.no-safe-area { | ||
562 | + padding-bottom: 0; | ||
563 | + } | ||
564 | +} | ||
562 | /* stylelint-disable */ | 565 | /* stylelint-disable */ |
563 | 566 | ||
564 | ::-webkit-scrollbar { | 567 | ::-webkit-scrollbar { |
-
Please register or login to post a comment