| | |
| | | .act_header{ |
| | | z-index: 200; width: 100%; background: no-repeat top; background-size: 100% auto; |
| | | display: flex; align-items: center; justify-content: space-between; |
| | | background: linear-gradient(90deg, #fbe7e2 0%, #fbe7e2 100%) 0% 0% / 100%; |
| | | background: linear-gradient(#FF451F, #fbe7e2); |
| | | color: #fff; |
| | | max-width: 800px; |
| | | } |
| | | .act_header .centent{ |
| | | text-align: center; |
| | | background: #FF451F; |
| | | |
| | | padding-top: 0.6rem; |
| | | } |
| | | .act_header .centent img{ |
| | |
| | | } |
| | | .appback |
| | | { |
| | | width: 100%; |
| | | height: 0.5rem; |
| | | position: absolute; |
| | | top: 0.4rem; |
| | | top: 0.5rem; |
| | | left: 0.4rem; |
| | | } |
| | | .appback-img |
| | | { |
| | | height: 100%; |
| | | } |
| | | .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 style="background: #fbe7e2;"> |
| | | <div class="box"> |
| | | <div class="list"> |
| | | <div id="appMain" > |
| | | <div class="appback"> |
| | | <image v-on:click="topBack()" class="appback-img" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/h5return_backIcon.png"></image> |
| | |
| | | <header class="act_header"> |
| | | <div></div> |
| | | <div class="centent"><img src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/xinrengoubanner.png" alt=""></div> |
| | | |
| | | </header> |
| | | |
| | | |
| | | <div class="sort"> |
| | | <ul class="sort-list"> |
| | | <li v-for="item in fristOrderSort" v-bind:class="{'sort-active': item.number == sortNumber}" |
| | |
| | | <span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </body> |
| | | |
| | |
| | | isUniReady:false, |
| | | plat:'tb', |
| | | //posturl:"http://dfg.shop.com" |
| | | posturl:"http://appapitest.ushopvip.com" |
| | | //posturl:"http://appapitest.ushopvip.com" |
| | | //posturl:"http://dfgapp.ushopvip.com" |
| | | }, |
| | | 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) |
| | | } |
| | | }) |
| | | }, |
| | | Infoformat: function(info){ |
| | | let formatObj = info.replace(/\%/g,"%25") |
| | | formatObj = info.replace(/\#/g,"%23") |
| | | formatObj = info.replace(/\&/g,"%26") |
| | | formatObj = info.replace(/\?/g,"%3F") |
| | | return formatObj; |
| | | info = info.replace(/\%/g,"%25") |
| | | info = info.replace(/\#/g,"%23") |
| | | info = info.replace(/\&/g,"%26") |
| | | info = info.replace(/\?/g,"%3F") |
| | | return info; |
| | | }, |
| | | targetItem:function(item){ |
| | | switch(this.plat) |
| | |
| | | }); |
| | | break; |
| | | case "dy": |
| | | case "jd": |
| | | var itemsStr=this.Infoformat(JSON.stringify(item)); |
| | | uni.navigateTo({ |
| | | url: '/pages/goods/goodsDetail?sourcefrom=freebuy&info=' + itemsStr+'&frompage=freebuy' |
| | |
| | | if(r !=null)return unescape(r[2]); |
| | | return null; |
| | | }, |
| | | //获取京东商品 |
| | | getJdGoodsList:function(){ |
| | | var _this=this; |
| | | $.ajax({ |
| | | headers:{ |
| | | "token":_this.getUrlPar("token") |
| | | }, |
| | | url:'/api/taoke/get_first_free_jd_goods', |
| | | type:"post", |
| | | dataType:"json", |
| | | data:{ |
| | | } |
| | | }).done(function(res){ |
| | | _this.lists=[].concat([],res.data.list); |
| | | _this.loading = false; |
| | | }) |
| | | }, |
| | | //获取抖音商品 |
| | | getDyGoodsList:function(){ |
| | | var _this=this; |
| | |
| | | headers:{ |
| | | "token":_this.getUrlPar("token") |
| | | }, |
| | | url:_this.posturl+'/api/taoke/get_first_free_dy_goods', |
| | | url:'/api/taoke/get_first_free_dy_goods', |
| | | type:"post", |
| | | dataType:"json", |
| | | data:{ |
| | | page: 1, |
| | | pageSize:40, |
| | | } |
| | | }).done(function(res){ |
| | | _this.lists=[].concat([],res.data.list); |
| | |
| | | headers:{ |
| | | "token":_this.getUrlPar("token") |
| | | }, |
| | | url:_this.posturl+'/api/taoke/get_first_free_goods', |
| | | url:'/api/taoke/get_first_free_goods', |
| | | type:"post", |
| | | dataType:"json", |
| | | data:{ |
| | |
| | | { |
| | | switch(plat) |
| | | { |
| | | case "tb": |
| | | case "tb": |
| | | this.getTbGoodsList(); |
| | | break; |
| | | case "dy": |
| | | this.getDyGoodsList(); |
| | | break; |
| | | case"jd": |
| | | this.getJdGoodsList(); |
| | | break; |
| | | } |
| | | }, |
| | |
| | | headers:{ |
| | | "token":_this.getUrlPar("token") |
| | | }, |
| | | url:_this.posturl+'/api/user/check_isfirst_free', |
| | | url:'/api/user/check_isfirst_free', |
| | | type:"post", |
| | | dataType:"json", |
| | | data:{ |
| | |
| | | mounted: function () { |
| | | this.getIsSd(); |
| | | var that=this; |
| | | this.touch(); |
| | | document.addEventListener('UniAppJSBridgeReady', function() { |
| | | that.isUniReady=true; |
| | | }); |