Authored by 陈轩

fix

@@ -33,6 +33,7 @@ @@ -33,6 +33,7 @@
33 .blk-header { 33 .blk-header {
34 background-color: transparent; 34 background-color: transparent;
35 transition: 0.3s all; 35 transition: 0.3s all;
  36 + border-bottom: 0;
36 } 37 }
37 } 38 }
38 .blk-header { 39 .blk-header {
1 <template> 1 <template>
2 - <cheader title="商品详情" class="top-nav"> 2 + <cheader title="商品详情" class="product-header ghost" v-ref:header>
3 <i class="icon icon-share" slot="right" @click="share()"></i> 3 <i class="icon icon-share" slot="right" @click="share()"></i>
4 </cheader> 4 </cheader>
5 </template> 5 </template>
6 <style> 6 <style>
7 - .top-nav {  
8 - .blk-header {  
9 - background-color: transparent;  
10 - border-bottom: 0;  
11 - }  
12 - 7 + .product-header {
13 .blk-header-gap { 8 .blk-header-gap {
14 display: none; 9 display: none;
15 } 10 }
@@ -41,6 +36,18 @@ @@ -41,6 +36,18 @@
41 url: location.href 36 url: location.href
42 }); 37 });
43 } 38 }
  39 + },
  40 +
  41 + created() {
  42 + window.onscroll = () => {
  43 + let transparent = true;
  44 +
  45 + if (window.scrollY > 20 ) {
  46 + transparent = false;
  47 + }
  48 +
  49 + this.$refs.header.$el.classList.toggle('ghost', transparent);
  50 + }
44 } 51 }
45 }; 52 };
46 </script> 53 </script>