| | |
| | | <meta content="telephone=no,email=no" name="format-detection"> |
| | | <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"> |
| | | <script type="text/javascript" src="https://public.ffquan.cn/lib/jquery-1.12.4.min.js"></script> |
| | | <script type="text/javascript" src="https://public.ffquan.cn/lib/vue/vue@2.6.11.min.js"></script> |
| | | <script type="text/javascript" src="https://cdn.staticfile.org/vue/2.6.11/vue.min.js"></script> |
| | | <script type="text/javascript" src="https://public.ffquan.cn/lib/vue-lazyload.js"></script> |
| | | <script type="text/javascript" src="https://public.ffquan.cn/lib/swiper/js/swiper.min.js"></script> |
| | | <script type="text/javascript" src="https://public.ffquan.cn/lib/taobaoCode/taobaoCode.js?v=1.2.1"></script> |
| | | <script type="text/javascript" src="https://public.ffquan.cn/lib/clipboard.min.js"></script> |
| | | |
| | | <script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script> |
| | | <script type="text/javascript" src="https://img.ushopvip.com/js/uni-webview-js.js"></script> |
| | | <title>新人专享</title> |
| | | <script> |
| | | |
| | |
| | | margin: auto; max-width: 800px; font-size: .28rem; overflow: hidden; position: relative; z-index: 1; |
| | | overflow: hidden; |
| | | } |
| | | #appMain:before { |
| | | content: "";display: block;position: absolute;top: 0;left: -20%;height: 3.88rem;width: 140%;background: linear-gradient(90deg,#fbe7e2,#fbe7e2) no-repeat;background-size: 100%; |
| | | border-radius: 0 0 50% 50%;z-index: -1; |
| | | } |
| | | |
| | | |
| | | .h3bt { |
| | | width: 1.66rem; |
| | |
| | | .act_header{ |
| | | z-index: 200; width: 100%; background: no-repeat top; background-size: 100% auto; |
| | | display: flex; align-items: center; justify-content: space-between; |
| | | position: fixed;background: linear-gradient(90deg, #fbe7e2 0%, #fbe7e2 100%) 0% 0% / 100%; |
| | | background: linear-gradient(90deg, #fbe7e2 0%, #fbe7e2 100%) 0% 0% / 100%; |
| | | color: #fff; |
| | | max-width: 800px; |
| | | } |
| | |
| | | |
| | | |
| | | .list-section{ |
| | | display: -webkit-flex;display: flex;-webkit-flex-wrap: wrap;flex-wrap: wrap;-webkit-justify-content: space-between;justify-content: space-between;padding: 0 1.87%; |
| | | display: -webkit-flex;display: flex;-webkit-flex-wrap: wrap;flex-wrap: wrap;-webkit-justify-content: space-between;justify-content: space-between;padding: 0 1.87%;margin-top: 0.05rem; |
| | | } |
| | | .list-section .listTmp{ |
| | | width: 49%;background: #fff;border-radius: .08rem;margin-bottom: .14rem;box-sizing: border-box; |
| | |
| | | } |
| | | |
| | | .loading{ |
| | | line-height: 1rem; text-align: center; font-size: .3rem; color: #999; |
| | | line-height: 2rem; text-align: center; font-size: .3rem; color: #999; |
| | | } |
| | | .sys{ |
| | | width: 100%; |
| | |
| | | center center no-repeat; |
| | | background-size: 2.4rem auto; |
| | | } |
| | | |
| | | .sort { |
| | | background-color: #ea2424; |
| | | border-radius: .2rem .2rem 0 0; |
| | | } |
| | | |
| | | .sort-list { |
| | | display: flex; |
| | | border-bottom: .02rem solid #eb3a15; |
| | | color: #ff8f78; |
| | | justify-content: space-between |
| | | } |
| | | |
| | | .sort-list>li { |
| | | width: 25%; |
| | | font-size: .26rem; |
| | | font-weight: 500; |
| | | color: #ff8f78; |
| | | display: inline-flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | padding: .24rem 0 |
| | | } |
| | | |
| | | .sort-list>li.sort-active { |
| | | color: #fff |
| | | } |
| | | |
| | | .sort-list>li span { |
| | | position: relative; |
| | | height: .16rem; |
| | | margin-left: .06rem |
| | | } |
| | | |
| | | .sort-list>li span i { |
| | | position: absolute; |
| | | width: 0; |
| | | height: 0; |
| | | border-color: #b92709 transparent transparent; |
| | | border-style: solid; |
| | | border-width: .06rem .06rem 0 |
| | | } |
| | | |
| | | .sort-list>li span i:first-child { |
| | | transform: rotate(180deg) |
| | | } |
| | | |
| | | .sort-list>li span i:nth-child(2) { |
| | | bottom: 0 |
| | | } |
| | | |
| | | .sort-list>li span i.arrow-active { |
| | | border-color: #f2f2f2 transparent transparent |
| | | } |
| | | .appback |
| | | { |
| | | width: 100%; |
| | | height: 0.5rem; |
| | | position: absolute; |
| | | top: 10px; |
| | | left: 10px; |
| | | } |
| | | .appback-img |
| | | { |
| | | height: 100%; |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body > |
| | | <body style="background: #fbe7e2;"> |
| | | <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> |
| | | </div> |
| | | <header class="act_header"> |
| | | <div></div> |
| | | <div class="centent"><img src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/xinrengoubanner.png" alt=""></div> |
| | | <div class="share"> |
| | | <!-- <a href="">分享</a> --> |
| | | </div> |
| | | |
| | | </header> |
| | | |
| | | <div :style="{ height: (twoNav && twoNav.length > 0) ? '2.3rem' : '2.3rem'}"></div> |
| | | |
| | | <div class="sort"> |
| | | <ul class="sort-list"> |
| | | <li v-for="item in fristOrderSort" v-bind:class="{'sort-active': item.number == sortNumber}" |
| | | v-on:click="handleSort(item)"> |
| | | {{ item.name }} |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | <div v-if="loading" v-else class="loading">加载中...</div> |
| | | |
| | | <div v-if="!loading" style="min-height: 100vh;" class=" swiper-container swiper-container-initialized swiper-container-horizontal swiper-container-free-mode swiper-container-ios"> |
| | | <div v-else style="min-height: 100vh; background: #fbe7e2;" class=" swiper-container swiper-container-initialized swiper-container-horizontal swiper-container-free-mode swiper-container-ios"> |
| | | <div class="swiper-wrapper" style="transform: translate3d(0px, 0px, 0px);"> |
| | | <div class="swiper-slide list-section"> |
| | | <div class="listTmp " v-for="(data,key) in lists" :key="key" v-on:click="targetItem(data)"> |
| | | <div class="productImg"> |
| | | <img :src="data.mainPic + '_310x310.jpg'" class="fadeIn " height="200" width="200"> |
| | | <img :src="data.mainPic + (plat=='tb'?'_310x310.jpg':'')" class="fadeIn " height="200" width="200"> |
| | | </div> |
| | | <div class="productInfo"> |
| | | <div class="title"> |
| | | <div class="shoplabel "> |
| | | <img src=""> |
| | | </div> |
| | | |
| | | <div class="title"> |
| | | |
| | | <span>{{data.dtitle}}</span> |
| | | </div> |
| | | |
| | |
| | | <div class="swiper-pagination"></div> |
| | | <span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span> |
| | | </div> |
| | | <div v-else class="loading">加载中...</div> |
| | | |
| | | |
| | | </div> |
| | | </body> |
| | | |
| | |
| | | <script src="https://polyfill.io/v2/polyfill.min.js?features=IntersectionObserver"></script> |
| | | <script> |
| | | (function(){ |
| | | var size = (document.body.clientWidth || document.documentElement.clientWidth); |
| | | var size1=document.body.clientWidth; |
| | | var size2=document.documentElement.clientWidth; |
| | | var size=size1<=0?size2:size1; |
| | | size=size<=0?400:size; |
| | | document.documentElement.style.fontSize = (size > 750 ? 750 : size) / 7.5 + 'px'; |
| | | })(); |
| | | |
| | | Vue.use(VueLazyload, { |
| | | preLoad: 1.3,// |
| | | error: 'https://sr.ffquan.cn/cms_pic/20200622/bro7s7f6vrkd3jat4ujg0.png', |
| | | loading: 'https://sr.ffquan.cn/cms_pic/20200612/brhjkf76vrkcrfpi79eg0.png', |
| | | // loading: 'https://sr.ffquan.cn/cms_pic/20200612/brhjkf76vrkcrfpi79eg0.png', |
| | | attempt: 1 |
| | | }) |
| | | new Vue({ |
| | |
| | | goodsList:[], |
| | | robbingNum:0, |
| | | }, |
| | | sortNumber:'tb', |
| | | sortId:0, |
| | | fristOrderSort: [ |
| | | { |
| | | name: "淘宝", |
| | | bool: true, |
| | | max: "", |
| | | min: "", |
| | | number: 'tb' |
| | | }, |
| | | { |
| | | name: "抖音", |
| | | bool: true, |
| | | max: "", |
| | | min: "", |
| | | number: 'dy' |
| | | }, |
| | | { |
| | | name: "京东", |
| | | bool: true, |
| | | max: "", |
| | | min: "", |
| | | number: 'jd' |
| | | } |
| | | ], |
| | | goodsItem: [], |
| | | lists:[], |
| | | nav:[], |
| | | active:0, |
| | | twoNav:false, |
| | | activeTwo:undefined, |
| | | loading:false, |
| | | isUniReady:false |
| | | loading:true, |
| | | isUniReady:false, |
| | | plat:'tb', |
| | | //posturl:"http://dfg.shop.com" |
| | | posturl:"http://appapitest.ushopvip.com" |
| | | //posturl:"http://dfgapp.ushopvip.com" |
| | | }, |
| | | methods: { |
| | | |
| | | topBack:function() |
| | | { |
| | | uni.postMessage({ |
| | | data: { |
| | | action: 'back' |
| | | } |
| | | }); |
| | | }, |
| | | 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; |
| | | }, |
| | | targetItem:function(item){ |
| | | if(this.isUniReady) |
| | | switch(this.plat) |
| | | { |
| | | case "tb": |
| | | uni.navigateTo({ |
| | | url: '/pages/goods/goodsDetail?id=' + item.goodsId+'&frompage=freebuy' |
| | | }); |
| | | break; |
| | | case "dy": |
| | | var itemsStr=this.Infoformat(JSON.stringify(item)); |
| | | uni.navigateTo({ |
| | | url: '/pages/goods/goodsDetail?sourcefrom=freebuy&info=' + itemsStr+'&frompage=freebuy' |
| | | }); |
| | | break; |
| | | } |
| | | |
| | | /* if(this.isUniReady) |
| | | { |
| | | uni.postMessage({ |
| | | data: { |
| | |
| | | data:item |
| | | } |
| | | }); |
| | | } */ |
| | | }, |
| | | handleSort: function(item) { |
| | | if(this.sortNumber != item.number) { |
| | | this.loading=true; |
| | | this.lists=[]; |
| | | this.getgoodsSwitch(item.number); |
| | | this.sortNumber = item.number; |
| | | this.plat=item.number; |
| | | } |
| | | }, |
| | | |
| | | getUrlPar:function(name) |
| | | { |
| | | var reg=new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); |
| | |
| | | if(r !=null)return unescape(r[2]); |
| | | return null; |
| | | }, |
| | | getGoodsList:function(){ |
| | | //获取抖音商品 |
| | | getDyGoodsList:function(){ |
| | | var _this=this; |
| | | $.ajax({ |
| | | headers:{ |
| | | "token":_this.getUrlPar("token") |
| | | }, |
| | | url:_this.posturl+'/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); |
| | | _this.loading = false; |
| | | }) |
| | | }, |
| | | //获取淘宝商品 |
| | | getTbGoodsList:function() |
| | | { |
| | | var _this=this; |
| | | $.ajax({ |
| | | headers:{ |
| | | "token":_this.getUrlPar("token") |
| | | }, |
| | | url:_this.posturl+'/api/taoke/get_first_free_goods', |
| | | type:"post", |
| | | dataType:"json", |
| | | data:{ |
| | | page: 1, |
| | | pageSize:40, |
| | | } |
| | | }).done(function(res){ |
| | | _this.lists=[].concat([],res.data.list); |
| | | _this.loading = false; |
| | | }) |
| | | }, |
| | | getgoodsSwitch:function(plat) |
| | | { |
| | | switch(plat) |
| | | { |
| | | case "tb": |
| | | this.getTbGoodsList(); |
| | | break; |
| | | case "dy": |
| | | this.getDyGoodsList(); |
| | | break; |
| | | } |
| | | }, |
| | | //是否首单 |
| | | getIsSd:function(){ |
| | | var _this = this; |
| | | this.loading=true; |
| | | //判断是否首单 |
| | | $.ajax({ |
| | | headers:{ |
| | | "token":this.getUrlPar("token") |
| | | "token":_this.getUrlPar("token") |
| | | }, |
| | | url:'http://dfg.shop.com/index.php/api/taoke/get_nine_goods', |
| | | // url:'http://dfgapp.ushopvip.com/api/taoke/get_nine_goods', |
| | | //url:'http://appapitest.ushopvip.com/api/taoke/get_nine_goods', |
| | | url:_this.posturl+'/api/user/check_isfirst_free', |
| | | type:"post", |
| | | dataType:"json", |
| | | data:{ |
| | | nineCid:1, |
| | | page: 1, |
| | | pageSize:20, |
| | | |
| | | } |
| | | }).done(function(res){ |
| | | var newlist=[]; |
| | | res.data.list.map(function(r,k){ |
| | | var buprice=r.actualPrice-r.topFanli; |
| | | if(buprice<=3) |
| | | { |
| | | newlist.push(r); |
| | | } |
| | | }) |
| | | _this.lists=[].concat(_this.lists,newlist); |
| | | _this.loading = false; |
| | | if(res.msg.info==1) |
| | | { |
| | | _this.getgoodsSwitch(_this.plat); |
| | | } |
| | | else{ |
| | | alert("您已下过首单,不可再次购买,请浏览其他商品吧~"); |
| | | |
| | | setTimeout(function(){ |
| | | if(_this.isUniReady) |
| | | { |
| | | uni.postMessage({ |
| | | data: { |
| | | action: 'back' |
| | | } |
| | | }); |
| | | } |
| | | }, 1000 ) |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | |
| | | mounted: function () { |
| | | this.getGoodsList(); |
| | | this.getIsSd(); |
| | | var that=this; |
| | | document.addEventListener('UniAppJSBridgeReady', function() { |
| | | that.isUniReady=true; |