Authored by shuaiguo

Merge branch 'feature/ufo-activitys' into 'develop'

iphoneX适配



See merge request !9
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']),
@@ -99,6 +99,7 @@ export default { @@ -99,6 +99,7 @@ export default {
99 display: flex; 99 display: flex;
100 flex-direction: column; 100 flex-direction: column;
101 background-color: #fff; 101 background-color: #fff;
  102 + box-sizing: border-box;
102 103
103 .layout-context { 104 .layout-context {
104 flex: 1; 105 flex: 1;
@@ -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 {
@@ -102,4 +102,10 @@ export default { @@ -102,4 +102,10 @@ export default {
102 width: 100%; 102 width: 100%;
103 background-color: white; 103 background-color: white;
104 } 104 }
  105 +
  106 +/*@supports (bottom: env(safe-area-inset-bottom)) {
  107 + .footer {
  108 + height: calc(env(safe-area-inset-bottom) + 100px);
  109 + }
  110 +}*/
105 </style> 111 </style>
@@ -554,10 +554,6 @@ body { @@ -554,10 +554,6 @@ 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));  
559 - }  
560 -  
561 .layout { 557 .layout {
562 padding-bottom: env(safe-area-inset-bottom); 558 padding-bottom: env(safe-area-inset-bottom);
563 } 559 }
@@ -566,7 +562,6 @@ body { @@ -566,7 +562,6 @@ body {
566 padding-bottom: 0; 562 padding-bottom: 0;
567 } 563 }
568 } 564 }
569 -  
570 /* stylelint-disable */ 565 /* stylelint-disable */
571 566
572 ::-webkit-scrollbar { 567 ::-webkit-scrollbar {