| | |
| | | <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 id="app" v-cloak> |
| | | <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 class="banenr" v-on:click="openDirect"> |
| | |
| | | </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 src="http://img.bc.haodanku.com/cms/1627703910"> |
| | | <p>店铺:{{item.shopname}}</p> |
| | | </div> |
| | | <div class="ticket" v-if="item.couponurl"><span class="name">券</span><span |
| | | class="value">¥{{item.couponmoney}}</span></div> |
| | | <div> |
| | | <div class="ticket" v-if="item.couponurl"><span class="name" style="height: 0.3rem;">券</span><span |
| | | class="value" style="height: 0.3rem;">¥{{item.couponmoney}}</span></div> |
| | | <div class="ticket" v-if="item.couponurl"><span class="name" style="height: 0.3rem;background:linear-gradient(180deg,#b21db6,#ad25d1)">返</span><span |
| | | class="value" style="border:1px solid #b817ce;color:#b817ce;height: 0.3rem;">¥{{item.fanli}}</span></div> |
| | | </div> |
| | | |
| | | <div class="shop-b"> |
| | | <div class="shop-b-l"> |
| | | <p class="shop-b-m"><i>券后价</i>¥{{parseFloat(item.itemendprice)}}</p> |
| | |
| | | </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> |
| | | <script src="https://cdn.staticfile.org/vue-lazyload/1.3.3/vue-lazyload.js"></script> |
| | |
| | | el: "#app", |
| | | data: function() { |
| | | return { |
| | | //posturl:"http://dfg.shop.com", |
| | | posturl:"http://appapitest.ushopvip.com", |
| | | showDirect: false, |
| | | codeId: vmRequest("code"), |
| | | |
| | |
| | | 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; |
| | | } |
| | | SpaUtils.copy(this.sign_info.tpwd, "复制口令成功,请打开淘宝浏览领取签到红包"); |
| | | }, |
| | | getUrlPar:function(name) |
| | | { |
| | | var reg=new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); |
| | | var r=window.location.search.substr(1).match(reg); |
| | | if(r !=null)return unescape(r[2]); |
| | | return null; |
| | | }, |
| | | arrowBtn: function(val) { |
| | | this[val] = !this[val]; |
| | | this.arrowTop(); |
| | |
| | | document.body.scrollTop = that.outerHeight; |
| | | } |
| | | $.ajax({ |
| | | type: "Get", |
| | | url: that.vmHttp + "://v2.api.haodanku.com/sign_red_pack_goods", |
| | | data: { |
| | | apikey: '0F92EBA7AADA', //必填 |
| | | min_size: 20, |
| | | sort: that.sortId, |
| | | min_id: that.page, |
| | | keyword: that.keyword, |
| | | pure_tpwd: vmRequest("pure_tpwd") ? 1 : undefined |
| | | }, |
| | | dataType: "json", |
| | | timeout: 5000, |
| | | success: function(data) { |
| | | if(data.code == "200") { |
| | | that.help_info = data.help_info || []; |
| | | that.sign_info = data.sign_info || {}; |
| | | if(that.sigclick) { |
| | | that.fristOrderItems = data.data; |
| | | } else { |
| | | that.fristOrderItems = that.fristOrderItems.concat(data.data); |
| | | } |
| | | that.topArr = data.top_data; |
| | | if(that.page != data.min_id) { |
| | | that.loadmsg = true; |
| | | that.loadshow = true; |
| | | that.page = data.min_id; |
| | | } else { |
| | | that.loadmsg = false; |
| | | that.loadshow = false; |
| | | } |
| | | that.$nextTick(function() { |
| | | that.sigclick = false; |
| | | if(cb) { |
| | | $(".newtop").scrollToFixed(); |
| | | headers:{ |
| | | "token":that.getUrlPar("token") |
| | | }, |
| | | url:that.posturl+'/api/activity/signRed', |
| | | type:"post", |
| | | dataType:"json", |
| | | data:{ |
| | | apikey: '0F92EBA7AADA', //必填 |
| | | min_size: 20, |
| | | sort: that.sortId, |
| | | min_id: that.page, |
| | | keyword: that.keyword, |
| | | pure_tpwd: vmRequest("pure_tpwd") ? 1 : undefined |
| | | } |
| | | }).done(function(res){ |
| | | var data=res.data; |
| | | if(res.code == 0) { |
| | | that.help_info = data.help_info || []; |
| | | that.sign_info = data.sign_info || {}; |
| | | if(that.sigclick) { |
| | | that.fristOrderItems = data.data; |
| | | } else { |
| | | that.fristOrderItems = that.fristOrderItems.concat(data.data); |
| | | } |
| | | that.topArr = data.top_data; |
| | | if(that.page != data.min_id) { |
| | | that.loadmsg = true; |
| | | that.loadshow = true; |
| | | that.page = data.min_id; |
| | | } else { |
| | | that.loadmsg = false; |
| | | that.loadshow = false; |
| | | } |
| | | that.$nextTick(function() { |
| | | that.sigclick = false; |
| | | if(cb) { |
| | | $(".newtop").scrollToFixed(); |
| | | } |
| | | |
| | | }); |
| | | } else { |
| | | that.loadmsg = false; |
| | | that.loadshow = false; |
| | | that.sigclick = false; |
| | | layer.msg(data.msg, { |
| | | time: 2000, |
| | | shade: 0.1, |
| | | shadeClose: true |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | error: function() { |
| | | that.msgFun("网络错误,请检查网络重试"); |
| | | } |
| | | }); |
| | | }, |
| | | }); |
| | | } else { |
| | | that.loadmsg = false; |
| | | that.loadshow = false; |
| | | that.sigclick = false; |
| | | layer.msg(data.msg, { |
| | | time: 2000, |
| | | shade: 0.1, |
| | | shadeClose: true |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | handleSort: function(item) { |
| | | if(this.sortNumber == item.number) { |
| | | if(item.min === item.max) { |
| | |
| | | success: function(data) { |
| | | layer.close(load); |
| | | if(data.code == "1") { |
| | | if(!isCoupon) { |
| | | } |
| | | that.taoToken = data.data.taoword; |
| | | if(isCoupon) { |
| | | //that.popupFun(".tokenbox1"); |
| | |
| | | tburl:data.data.link |
| | | } |
| | | }) |
| | | |
| | | |
| | | } else { |
| | | that.openSnappedUpDialog(); |
| | | } |