| | |
| | | <script> |
| | | document.write("<link rel=\"stylesheet\" href=\"https://img.bc.haodanku.com/cms/signin.css?t=" + (Date.now() - Date.now() % (60 * 1000 * 30)) + "\"/>"); |
| | | </script> |
| | | <style> |
| | | .box |
| | | { |
| | | position:absolute; |
| | | width: 100%; |
| | | height: 100%; |
| | | background: url(https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/h5loading.gif) no-repeat fixed top; |
| | | background-size: 70px 70px; |
| | | } |
| | | .list{ |
| | | position: relative; |
| | | top: 0; |
| | | width: 100%; |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="box"> |
| | | <div class="list"> |
| | | <div id="app" style="background-color:#F10F04;padding-top:0.5rem" v-cloak> |
| | | <template v-if="isexplain && issource"> |
| | | <div class="main"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <ul class="shoplist" v-if="fristOrderItems.length>0"> |
| | | <ul class="shoplist contscore" v-if="fristOrderItems.length>0"> |
| | | <li v-for="(item,index) in fristOrderItems"> |
| | | <img class="shop-img" v-lazy="item.itempic" v-if="item.itempic"> |
| | | <img class="shop-img" src="http://img.bc.haodanku.com/haodanku-activity/1596092443" v-else> |
| | |
| | | <img style="width: 6rem;" src="http://img-haodanku-com.cdn.fudaiapp.com/FhYQl6NqvQIycYZS1DM9DLBELA72" alt=""> |
| | | </div> |
| | | </van-overlay> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="https://cdn.staticfile.org/jquery/2.2.4/jquery.min.js"></script> |
| | | <script src="https://cdn.staticfile.org/vue/2.6.10/vue.min.js"></script> |
| | |
| | | mounted: function() { |
| | | this.outerHeight = $(".banenr").outerHeight(true) + $(".secret-wrapper").outerHeight(true) + $(".list-wrapper>h6").outerHeight(true) + 2; |
| | | this.taobaoscroll(); |
| | | this.touch(); |
| | | }, |
| | | methods: { |
| | | touch:function() |
| | | { |
| | | const box = document.querySelector('.box') |
| | | const list = document.querySelector('.list'); |
| | | // 按下屏幕的位置 |
| | | let touchStartPosition = 0 |
| | | |
| | | // touchstart事件 |
| | | box.addEventListener('touchstart', function (e) { |
| | | let touch = e.touches[0] |
| | | touchStartPosition = touch.pageY |
| | | }) |
| | | // touchmove事件 |
| | | box.addEventListener('touchmove', function (e) { |
| | | |
| | | let touch = e.touches[0] |
| | | // 列表的top值等于列表相对于box的偏移量+滑动的距离 |
| | | let pySize= list.offsetTop + touch.pageY - touchStartPosition; |
| | | if(pySize>=110) |
| | | { |
| | | return; |
| | | } |
| | | if(pySize<0) |
| | | { |
| | | return; |
| | | } |
| | | var scroll = document.getElementsByClassName('contscore') |
| | | var srollPos = $('.contscore').scrollTop(); //滚动条距顶部距离(页面超出窗口的高度) |
| | | if(srollPos>0) |
| | | { |
| | | return; |
| | | } |
| | | list.style.top =pySize + 'px'; |
| | | // 实现平滑的滑动 |
| | | touchStartPosition = touch.pageY |
| | | }) |
| | | // touchend事件 |
| | | box.addEventListener('touchend', function (e) { |
| | | let top = list.offsetTop |
| | | |
| | | if (top > 70) { |
| | | // 在此处调用刷新后的回调 |
| | | console.log('刷新'); |
| | | location.reload(); |
| | | } |
| | | |
| | | if(top<0) |
| | | { |
| | | list.style.top=0; |
| | | } |
| | | if (top > 0) { |
| | | // 通过定时器平滑的将list的top = 0 |
| | | let timer = setInterval(() => { |
| | | top=top-5; |
| | | list.style.top = top + 'px' |
| | | if (top <= 0) { |
| | | list.style.top=0; |
| | | clearInterval(timer) |
| | | } |
| | | },1) |
| | | } |
| | | }) |
| | | }, |
| | | toSignIn: function() { |
| | | if(!this.sign_info.tpwd) { |
| | | return; |