Authored by 沈志敏

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

@@ -13,13 +13,26 @@ @@ -13,13 +13,26 @@
13 -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 13 -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
14 } 14 }
15 15
16 -html,  
17 -body { 16 +html {
  17 + height: 100%;
18 width: 100%; 18 width: 100%;
19 - font-size: 24px;  
20 - font-family: "PingFang SC", Helvetica, Roboto, "Heiti SC", "黑体", Arial;  
21 - line-height: 1.4; 19 + overflow: hidden;
  20 +
  21 + body {
  22 + width: 100%;
  23 + height: 100%;
  24 + overflow-y: scroll;
  25 + font-size: 24px;
  26 + font-family: "PingFang SC", Helvetica, Roboto, "Heiti SC", "黑体", Arial;
  27 + line-height: 1.4;
  28 + }
  29 +}
  30 +
  31 +/* stylelint-disable */
  32 +.app::-webkit-scrollbar {
  33 + display: none;
22 } 34 }
  35 +/* stylelint-enable */
23 36
24 a { 37 a {
25 outline: none; 38 outline: none;
@@ -140,14 +140,16 @@ @@ -140,14 +140,16 @@
140 let ghost2 = false; 140 let ghost2 = false;
141 let ghost3 = false; 141 let ghost3 = false;
142 142
143 - if (window.scrollY > 40) { 143 + let myHeaderTop = $('.my-header').offset().top;
  144 +
  145 + if (myHeaderTop < -40) {
144 ghost = false; 146 ghost = false;
145 ghost2 = false; 147 ghost2 = false;
146 ghost3 = false; 148 ghost3 = false;
147 - } else if (window.scrollY > 25) { 149 + } else if (myHeaderTop < -25) {
148 ghost = false; 150 ghost = false;
149 ghost3 = true; 151 ghost3 = true;
150 - } else if (window.scrollY > 10) { 152 + } else if (myHeaderTop < -10) {
151 ghost = false; 153 ghost = false;
152 ghost2 = true; 154 ghost2 = true;
153 } 155 }
@@ -165,15 +167,17 @@ @@ -165,15 +167,17 @@
165 return false; 167 return false;
166 }); 168 });
167 169
168 - window.addEventListener('touchmove', () => { 170 + let body = $('body');
  171 +
  172 + body.on('touchmove', () => {
169 this.toggle(); 173 this.toggle();
170 }); 174 });
171 175
172 - window.addEventListener('scroll', () => { 176 + body.on('scroll', () => {
173 this.toggle(); 177 this.toggle();
174 }); 178 });
175 179
176 - document.addEventListener('visibilitychange', () => { 180 + body.on('visibilitychange', () => {
177 if (!document.hidden) { 181 if (!document.hidden) {
178 this.reload(); 182 this.reload();
179 } 183 }
@@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
19 <script> 19 <script>
20 const yoho = require('yoho'); 20 const yoho = require('yoho');
21 const cheader = require('component/header.vue'); 21 const cheader = require('component/header.vue');
  22 + const $ = require('jquery');
22 23
23 module.exports = { 24 module.exports = {
24 data() { 25 data() {
@@ -45,15 +46,15 @@ @@ -45,15 +46,15 @@
45 }, 46 },
46 47
47 created() { 48 created() {
48 - window.onscroll = () => { 49 + $('body').on('scroll', () => {
49 let transparent = true; 50 let transparent = true;
50 51
51 - if (window.scrollY > 20 ) { 52 + if ($('.image-carousel').offset().top < -20) {
52 transparent = false; 53 transparent = false;
53 } 54 }
54 55
55 this.$refs.header.$el.classList.toggle('ghost', transparent); 56 this.$refs.header.$el.classList.toggle('ghost', transparent);
56 - } 57 + });
57 } 58 }
58 }; 59 };
59 </script> 60 </script>
1 <template> 1 <template>
2 - <div v-if="shopInfo.isBlkShop" class="brand-top-box" v-lazy:background-image="shopInfo.shopBg | resize 750 478"> 2 + <div v-if="shopInfo.isBlkShop" class="brand-top-box" v-bind:style="{ background: 'url(' + shopInfo.shopBg + ')' }">
3 <div class="brand-bottom"> 3 <div class="brand-bottom">
4 - <img v-if="shopInfo.shopLogo" v-lazy="shopInfo.shopLogo.split('?')[0] + '?imageMogr2/thumbnail/{width}x{height}' | resize 120 80" alt="{{ shopInfo.shopName }}"> 4 + <img v-if="shopInfo.shopLogo" :src="shopInfo.shopLogo.split('?')[0] + '?imageMogr2/thumbnail/{width}x{height}' | resize 120 80" alt="{{ shopInfo.shopName }}">
5 <div v-else class="brand-title">{{ shopInfo.shopName }}</div> 5 <div v-else class="brand-title">{{ shopInfo.shopName }}</div>
6 <hr> 6 <hr>
7 <div v-show="showMore" transition="brand-intro" :class="{ 'brand-short': !showMore }">{{ shopInfo.shopIntro }}</div> 7 <div v-show="showMore" transition="brand-intro" :class="{ 'brand-short': !showMore }">{{ shopInfo.shopIntro }}</div>
1 <template> 1 <template>
2 <cheader :title="title" :class="{ghost: shareData.isBlkShop}" :fixed="shareData.isBlkShop" v-ref:header> 2 <cheader :title="title" :class="{ghost: shareData.isBlkShop}" :fixed="shareData.isBlkShop" v-ref:header>
3 - <template slot="right"> 3 + <template slot="right" v-on:scroll="">
4 <span v-if="shareData.isBlkShop" v-show="shareData.isFav" class="icon" @click="collectShop()">&#xe60d;</span> 4 <span v-if="shareData.isBlkShop" v-show="shareData.isFav" class="icon" @click="collectShop()">&#xe60d;</span>
5 <span v-if="shareData.isBlkShop" v-show="!shareData.isFav" class="icon" @click="collectShop()">&#xe60c;</span> 5 <span v-if="shareData.isBlkShop" v-show="!shareData.isFav" class="icon" @click="collectShop()">&#xe60c;</span>
6 <span v-if="shareData.isBlkShop" class="icon" @click="goShare()">&#xe60e;</span> 6 <span v-if="shareData.isBlkShop" class="icon" @click="goShare()">&#xe60e;</span>
@@ -53,10 +53,11 @@ @@ -53,10 +53,11 @@
53 // 删除两个多余的参数,两个参数是收藏时使用的 53 // 删除两个多余的参数,两个参数是收藏时使用的
54 delete this.shareData.shopId; 54 delete this.shareData.shopId;
55 delete this.shareData.isFav; 55 delete this.shareData.isFav;
56 - yoho.goShare(this.shareData, function() {}, function() {}); 56 + yoho.goShare(this.shareData);
57 }, 57 },
  58 +
58 goBack() { 59 goBack() {
59 - yoho.goBack({}, function() {}, function() {}); 60 + yoho.goBack();
60 }, 61 },
61 62
62 /* 收藏或者取消收藏店铺 */ 63 /* 收藏或者取消收藏店铺 */
@@ -85,9 +86,9 @@ @@ -85,9 +86,9 @@
85 }, 86 },
86 changeTopStatus() { 87 changeTopStatus() {
87 let topChange = true; 88 let topChange = true;
88 - let topHeight = document.body.scrollTop; 89 + let topHeight = $('.brand-top-box').offset().top;
89 90
90 - if (topHeight > 100) { 91 + if (topHeight < -200) {
91 topChange = false; 92 topChange = false;
92 } 93 }
93 94
@@ -98,7 +99,7 @@ @@ -98,7 +99,7 @@
98 this.domain = this.shareData.domain; 99 this.domain = this.shareData.domain;
99 100
100 if (this.shareData.isBlkShop) { 101 if (this.shareData.isBlkShop) {
101 - window.onscroll = this.changeTopStatus; 102 + $('body').on('scroll', this.changeTopStatus);
102 } 103 }
103 } 104 }
104 }; 105 };