<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="UTF-8" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta name="App-Config" content="fullscreen=yes,useHistoryState=yes,transition=yes" />
|
<meta content="yes" name="apple-mobile-web-app-capable" />
|
<meta content="yes" name="apple-touch-fullscreen" />
|
<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://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/clipboard.min.js"></script>
|
<script type="text/javascript" src="https://p1static.dataoke.com/web/js/layer/layer.js?t=202104191256"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"
|
integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous">
|
</script>
|
<script type="text/javascript" src="https://img.ushopvip.com/js/uni-webview-js.js"></script>
|
|
<!-- <script src="js/clipboard.min.js"></script> -->
|
<title>好物发现</title>
|
<script>
|
var _config = {
|
appKey: 'kowwtb', //此处替换成用户appKey
|
// 需要自行接入点击商品后的逻辑 (非必填)
|
// jumpGoodsUrl: function (items) { // 替换为详细页面的地址或转链逻辑
|
// window.open('https://xxxx&gid=' + items.goodsid);
|
// }
|
};
|
</script>
|
<style>
|
a,
|
abbr,
|
acronym,
|
address,
|
applet,
|
article,
|
aside,
|
audio,
|
b,
|
big,
|
blockquote,
|
body,
|
canvas,
|
caption,
|
center,
|
cite,
|
code,
|
dd,
|
del,
|
details,
|
dfn,
|
div,
|
dl,
|
dt,
|
em,
|
embed,
|
fieldset,
|
figcaption,
|
figure,
|
footer,
|
form,
|
h1,
|
h2,
|
h3,
|
h4,
|
h5,
|
h6,
|
header,
|
hgroup,
|
html,
|
i,
|
iframe,
|
img,
|
ins,
|
kbd,
|
label,
|
legend,
|
li,
|
mark,
|
menu,
|
nav,
|
object,
|
ol,
|
output,
|
p,
|
pre,
|
q,
|
ruby,
|
s,
|
samp,
|
section,
|
small,
|
span,
|
strike,
|
strong,
|
sub,
|
summary,
|
sup,
|
table,
|
tbody,
|
td,
|
tfoot,
|
th,
|
thead,
|
time,
|
tr,
|
tt,
|
u,
|
ul,
|
var,
|
video {
|
margin: 0;
|
padding: 0;
|
border: 0;
|
font-size: 100%;
|
font: inherit;
|
vertical-align: baseline;
|
-webkit-tap-highlight-color: transparent;
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
tap-highlight-color: transparent;
|
box-sizing: border-box;
|
}
|
|
article,
|
aside,
|
details,
|
figcaption,
|
figure,
|
footer,
|
header,
|
hgroup,
|
menu,
|
nav,
|
section {
|
display: block;
|
}
|
|
html {
|
font-family: Arial, PingFang SC, -apple-system, BlinkMacSystemFont,
|
Segoe UI, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica,
|
sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
|
}
|
|
ol,
|
ul {
|
list-style: none;
|
}
|
|
blockquote,
|
q {
|
quotes: none;
|
}
|
|
blockquote:after,
|
blockquote:before,
|
q:after,
|
q:before {
|
content: '';
|
content: none;
|
}
|
|
#appMain {
|
position: relative;
|
margin: auto;
|
font-size: 0.28rem;
|
font-family: PingFangSC-Regular;
|
z-index: 1;
|
/* overflow: hidden; */
|
}
|
|
.bybt-layout {
|
/* min-height: 100vh; */
|
width: 100%;
|
background: #f5f5f5;
|
text-align: center;
|
font-family: PingFang SC;
|
}
|
|
.bybt-layout .banner {
|
background: url('https://sr.ffquan.cn/dtk_www/20210414/c1r4aiv6vrkae65jvbs00.png') no-repeat center top #f52157;
|
background-size: 100% auto;
|
width: 100%;
|
text-align: center;
|
padding-top: 2.3rem;
|
}
|
|
.tabber {
|
display: flex;
|
/* justify-content: space-around; */
|
background-color: white;
|
padding-bottom: 2px;
|
white-space: nowrap;
|
overflow: scroll;
|
/* box-sizing: border-box; */
|
|
}
|
|
.tab {
|
padding: 12px;
|
cursor: pointer;
|
display: inline-block;
|
}
|
|
.tabber::-webkit-scrollbar {
|
display: none;
|
}
|
|
.tabActive {
|
color: #FE555D;
|
font-weight: bold;
|
border-bottom: 2px solid #FE555D;
|
}
|
|
.sort {
|
display: flex;
|
justify-content: space-between;
|
padding: 12px 4px;
|
background-color: white;
|
}
|
|
.sort .signal {
|
padding: 2px;
|
cursor: pointer;
|
}
|
|
.sort .sortActive {
|
color: #FE555D;
|
font-weight: bold;
|
}
|
|
.sort .tblist_icon {
|
display: flex;
|
flex-direction: column;
|
margin-left: 4px;
|
justify-content: space-between;
|
height: 20px;
|
}
|
|
.sort .triangle_up {
|
border: 4px solid transparent;
|
border-bottom-color: #d8d8d8;
|
}
|
|
.sort .activeup {
|
border-bottom-color: #FE555D !important;
|
}
|
|
.sort .activedown {
|
border-top-color: #FE555D !important;
|
}
|
|
.sort .triangle_down {
|
border: 4px solid transparent;
|
border-top-color: #d8d8d8;
|
}
|
|
.goodslist {
|
width: 100%;
|
padding: 0.24rem 0.25rem 0.1rem;
|
margin: 0;
|
overflow: scroll;
|
height: 68vh;
|
}
|
|
.goodslist .list {
|
width: 100%;
|
background: #fff;
|
border-radius: 0.08rem;
|
overflow: hidden;
|
/* display: flex; */
|
margin-bottom: 0.25rem;
|
padding: 0.2rem;
|
}
|
|
.goodslist .list .top {
|
display: flex;
|
position: relative;
|
}
|
|
.goodslist .list .top .pic {
|
width: .8rem;
|
height: .8rem;
|
}
|
|
|
|
.goodslist .list .top .pic img {
|
width: 100%;
|
display: block;
|
}
|
|
.goodslist .list .top .center {
|
display: flex;
|
flex-direction: column;
|
justify-content: space-between;
|
text-align: left;
|
margin-left: 0.2rem;
|
|
}
|
|
.goodslist .list .top .center .name {
|
font-weight: blod;
|
}
|
|
.goodslist .list .top .center .time {
|
color: gray;
|
font-size: 14px;
|
}
|
|
.goodslist .list .top .buy {
|
position: absolute;
|
top: 0.05rem;
|
right: 0.2rem;
|
background: linear-gradient(90deg, #ff856f, #fe305c);
|
color: white;
|
width: 1.6rem;
|
height: 0.6rem;
|
line-height: 0.6rem;
|
border-radius: 0.1rem;
|
cursor: pointer;
|
}
|
|
.goodslist .list .centerDetail .pics {
|
/* margin-left: 1rem; */
|
display: flex;
|
width: 8rem;
|
flex-wrap: wrap;
|
|
}
|
|
.goodslist .list .centerDetail .detail {
|
text-align: left;
|
margin-top: 0.2rem;
|
font-size: 0.25rem;
|
font-weight: 500;
|
/* padding-left: 1rem; */
|
}
|
|
.goodslist .list .centerDetail .pics .pic {
|
list-style: none;
|
width: 2rem;
|
height: 2rem;
|
margin-right: 0.2rem;
|
margin-top: 0.2rem;
|
position: relative;
|
}
|
|
.goodslist .list .centerDetail .pics .pic .picprice {
|
position: absolute;
|
bottom: 0;
|
left: 50%;
|
background: linear-gradient(90deg, #FF856F, #FE305C);
|
padding: 0.06rem 0.14rem;
|
transform: translateX(-50%);
|
color: white;
|
border-radius: 0.1rem;
|
}
|
|
.goodslist .list .centerDetail .pics .pic img {
|
width: 100%;
|
display: block;
|
}
|
|
.goodslist .list .bottom {
|
/* margin-left: 1rem; */
|
margin-top: 0.4rem;
|
display: flex;
|
background-color: #f9f9f9;
|
padding: 0.1rem;
|
border: 1px solid #dedede;
|
border-radius: 4px;
|
}
|
|
.goodslist .list .bottom .left {
|
position: relative;
|
}
|
|
.goodslist .list .bottom .left .pic {
|
width: 1rem;
|
height: 1rem;
|
}
|
|
.goodslist .list .bottom .left .pic img {
|
width: 100%;
|
display: block;
|
}
|
|
.goodslist .list .bottom .right {
|
width: calc(100% - 1.8rem);
|
position: relative;
|
z-index: 0;
|
margin-left: 0.17rem;
|
/* padding-top: 0.18rem; */
|
text-align: left;
|
display: flex;
|
}
|
|
.goodslist .list .bottom .right h4 {
|
height: 0.37rem;
|
text-overflow: ellipsis;
|
overflow: hidden;
|
white-space: nowrap;
|
font-size: 0.26rem;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #17233d;
|
line-height: 0.37rem;
|
margin-bottom: 0.16rem;
|
}
|
|
.goodslist .list .bottom .right h4 img {
|
width: 0.24rem;
|
height: 0.24rem;
|
position: relative;
|
top: 0.02rem;
|
margin-right: 0.1rem;
|
}
|
|
.goodslist .list .bottom .right .tag {
|
height: 0.32rem;
|
margin-bottom: 0.24rem;
|
text-overflow: ellipsis;
|
overflow: hidden;
|
white-space: nowrap;
|
}
|
|
.goodslist .list .bottom .right .tag span {
|
height: 0.3rem;
|
display: inline-block;
|
padding: 0 0.1rem;
|
background: #fff2ed;
|
border: 1px solid #ffccba;
|
border-radius: 0.03rem;
|
font-family: PingFangSC-Regular;
|
font-size: 0.24rem;
|
color: #ff4400;
|
letter-spacing: 0;
|
line-height: 0.32rem;
|
text-align: center;
|
margin-right: 0.1rem;
|
}
|
|
.goodslist .list .bottom .right .tag img {
|
height: 0.3rem;
|
display: inline-block;
|
margin-right: 0.1rem;
|
}
|
|
.goodslist .list .bottom .left .sales {
|
height: 0.4rem;
|
width: 1rem;
|
position: absolute;
|
bottom: 0;
|
left: 0;
|
background-color: rgba(0, 0, 0, 0.4);
|
color: white;
|
font-size: 10px;
|
white-space: nowrap;
|
text-align: center;
|
line-height: 0.4rem;
|
}
|
|
.goodslist .list .bottom .right .sales span {
|
display: block;
|
float: left;
|
/* padding-left: 0.3rem; */
|
font-family: PingFangSC-Regular;
|
font-size: 0.24rem;
|
color: #333;
|
letter-spacing: 0;
|
line-height: 0.32rem;
|
text-align: center;
|
}
|
|
|
|
.goodslist .list .bottom .right .btns {
|
position: absolute;
|
bottom: 0rem;
|
left: 0;
|
z-index: 10;
|
width: 100%;
|
display: flex;
|
}
|
|
|
.goodslist .list .bottom .right .btns .ml {
|
color: #ff4443;
|
font-size: 0.2rem;
|
line-height: 0.37rem;
|
/* padding-top: 0.21rem; */
|
white-space: nowrap;
|
}
|
|
.goodslist .list .bottom .right .btns .ml b {
|
margin-left: 0.04rem;
|
font-size: 0.3rem;
|
font-family: Arial-BoldMT;
|
}
|
|
.goodslist .list .bottom .right .btns .ml small {
|
font-size: 0.2rem;
|
font-family: PingFangSC-Semibold;
|
}
|
|
.goodslist .list .bottom .right .btns .line {
|
text-decoration: line-through;
|
/* margin-top: 0.08rem; */
|
margin-left: 0.1rem;
|
font-size: 0.12rem;
|
display: flex;
|
align-items: center;
|
}
|
|
.goodslist .list .bottom .right .btns .coupon {
|
background: linear-gradient(90deg, #ff856f, #fe305c);
|
border-radius: 0.05rem;
|
font-size: 0.12rem;
|
font-weight: 400;
|
color: white;
|
padding: 0 0.1rem;
|
position: relative;
|
margin-left: 0.2rem;
|
display: flex;
|
align-items: center;
|
/* position: absolute;
|
left: 56%;
|
bottom: 0.08rem; */
|
}
|
|
.goodslist .list .bottom .right .btns .coupon::after {
|
content: '';
|
width: 0;
|
height: 0;
|
border-style: solid;
|
border-width: 0.1rem 0.12rem 0.1rem 0;
|
border-color: transparent #ff856f transparent transparent;
|
position: absolute;
|
top: 25%;
|
left: -6px;
|
}
|
|
.goodslist .list .bottom .icon {
|
color: gray;
|
align-items: center;
|
padding: 0.38rem 0 0 0.25rem;
|
}
|
|
.goodslist .list .bottom .right .btns .fanli {
|
background: linear-gradient(-90deg, rgb(118, 25, 236), rgb(164, 41, 243));
|
border-radius: 0.05rem;
|
font-size: 0.12rem;
|
font-weight: 400;
|
color: white;
|
padding: 0 0.1rem;
|
position: relative;
|
margin-left: 0.2rem;
|
display: flex;
|
align-items: center;
|
/* position: absolute;
|
left: 56%;
|
bottom: 0.08rem; */
|
}
|
|
.loading {
|
line-height: 1rem;
|
text-align: center;
|
font-size: 0.3rem;
|
color: #999;
|
}
|
|
.sys {
|
width: 100%;
|
height: 100vh;
|
position: fixed;
|
z-index: 9999999;
|
background: rgba(0, 0, 0, 0.6) url('https://sr.ffquan.cn/dtk_yunying/20210803/c44albf6vrkd4bd59itg0.png') center center no-repeat;
|
background-size: 2.4rem auto;
|
}
|
|
.back_home {
|
width: 30px;
|
height: 30px;
|
position: fixed;
|
right: 0.3rem;
|
bottom: 1.2rem;
|
border-radius: 50%;
|
background: rgba(0, 0, 0, 0.5);
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
|
.back_home img {
|
width: 15px;
|
height: 15px;
|
}
|
</style>
|
</head>
|
|
<body>
|
<script type="text/javascript" src="https://public.ffquan.cn/lib/taobaoCode/taobaoCode.js?v=1.3.2"></script>
|
<div id="appMain">
|
<div v-if="sys == null" class="sys"></div>
|
|
<div class="bybt-layout">
|
<div class="banner"></div>
|
<div id='inp'></div>
|
<!-- <div class="tabber">
|
<div class="tab" :class="tab==1?'tabActive':''" @click="tabclick(1)">精选单品</div>
|
<div class="tab" :class="tab==2?'tabActive':''" @click="tabclick(2)">好货专场</div>
|
</div> -->
|
<div class="tabber" id="tabber">
|
<div v-for="(item,index) in tabList" class="tab" :class="tab==item.cid?'tabActive':''"
|
@click="tabclick(item.cid,index)">
|
{{item.name}}
|
</div>
|
</div>
|
<div class="sort">
|
<div class="signal" :class="sort==0?'sortActive':''" @click="getGoodsList(1,tab,0)">综合排序</div>
|
<div class="signal" :class="sort==2?'sortActive':''" @click="getGoodsList(1,tab,2)">销量</div>
|
<div class="signal" :class="sort==3?'sortActive':''" @click="getGoodsList(1,tab,3)">领券量</div>
|
<div class="signal" :class="sort==4?'sortActive':''" @click="getGoodsList(1,tab,4)">返利比例</div>
|
<div class="signal" style="display: flex;" :class="sort==5?'sortActive':''"
|
@click="getGoodsList(1,tab,sort==5?6:5)">价格
|
<div class="tblist_icon">
|
<div class="triangle_up" :class="sort==6?'activeup':''"></div>
|
<div class="triangle_down" :class="sort==5?'activedown':''"></div>
|
</div>
|
</div>
|
</div>
|
<div class="goodslist">
|
<div v-for="(item, index) in goodsList1" :key="index" class="list" :id="'goodsList'+index">
|
<div class="top">
|
<div class="pic"><img style="border-radius: 50%;" :src="imgFomate(item.mainPic)" /></div>
|
<div class="center">
|
<div class="name">{{item.shopName}}</div>
|
<div class="time">{{item.showtime}}</div>
|
</div>
|
<div class="buy" @click="targetGoods(item)">
|
立即抢购
|
</div>
|
</div>
|
<div class="centerDetail">
|
<div class="detail" v-html="item.circleText"></div>
|
<ul class="pics">
|
<li v-if="item.shipaiPicCount" class="pic" v-for="(item2,index2) in item.pics">
|
<!-- src="https://img.bc.fqapps.com/fudai13cae4ae6ef16739ed3b100a2ec39e97.gif" -->
|
<img class="itempics" style="width: 2rem;height: 2rem;" :src="item2" />
|
|
</li>
|
</ul>
|
|
</div>
|
<div class="bottom" @click="targetGoods(item)">
|
<div class="left">
|
<div class="pic"><img style="width: 1rem;height: 1rem;"
|
:src="imgFomate(item.mainPic)" /></div>
|
<div class="sales">
|
<span>已售{{digitalAbbNumber({ num: item.monthSales, unit:'万'})}}</span>
|
</div>
|
</div>
|
<div class="right">
|
<h4>
|
<img src="https://duomaipublic.oss-cn-zhangjiakou.aliyuncs.com/下载.png"
|
alt="" />{{item.dtitle}}
|
</h4>
|
<div class="btns">
|
<div class="ml">
|
<span v-if="item.couponPrice">券后</span>
|
¥<b>{{item.actualPrice.toString().split('.')[0]}}</b><small
|
v-if="item.actualPrice.toString().split('.')[1]">.{{item.actualPrice.toString().split('.')[1]}}</small>
|
</div>
|
<div class="line" v-if="item.couponPrice">
|
{{item.originalPrice}}
|
</div>
|
<div class="coupon" v-if="item.couponPrice">
|
{{item.couponPrice}}元券
|
</div>
|
<div class="fanli" v-if="item.fanli">
|
返{{item.fanli}}元
|
</div>
|
|
</div>
|
</div>
|
<div class="icon">
|
〉
|
</div>
|
</div>
|
|
</div>
|
</div>
|
</div>
|
|
<!-- <div ref="reference" class="loading">加载中...</div> -->
|
|
<div class="back_home" v-if="scrollTop>=70" @click="back_home">
|
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAwCAYAAAC4wJK5AAACs0lEQVRoQ+3ZTYhOURzH8e9vYWFnqcTGQsnaxmJY2WFD3kkk8pKXRFIGpSkJk5KSlBRjIkqkiNSUUoqNTCmhFClJKfXT0X007pznuc9zn3Onmeme3XNfzvl/7jnn/s+5j5gERZPAwF+E7R3AOmB+hno8jnGLgLfAoKRDIU7ZPgYcGcdBtwrtjqSlAfETmDpBESHsBQFxBtg9QRFPJfU05sRxYAMwcwTmzTiEzcli+gHcBPZL+lrZ28n2UaAHWAj0Sgq/KymVIJq8LAYkrahCkRxh+wRwuEmwlUCSImyfBA4WPO3kkGQI233AgTaHS1JIEoTtU8C+NgGNy5JBukbYPg3s6RCQFNIVwvZZYFcE8BqYlzs+ACyPXNt1j5RG2O4HwsIxX15mPZNfRPYCc6uAlELYPg9sjwBeAGuB6cAoREh4tm+khnSMsH0B2BoBPAfWSBq2HbJ0FBHuSw3pCGH7IrAlAhjKAO+yIFsiUkPaRti+BGyKAJ5lgPeNc0U9MeK6JEOrLYTty8DGCOBJBvg48ly7iFQ9UoiwfQVYHwE8AlZL+pw/1wkiBaQlwvbV8KQjgIcZ4EssyXWK6BbSFGH7GrAqEuSDcFzSt2ZZugyiG0gUYfs6EFv738sA31stM8oiykJGIWzvBM5FgrwLrJQUPiy0LN0gCiDRHWIMcQtYlovydgb4VQRoN08U1dMkIX6SNCN/bwyR3xcMZoDfRQ13mieK6otA+iWNWnDGELOy3dk2IHxh65PkogbL5omiem3vBcIQfyVpSez6wjxR1EiqV2yZdhr31IjUeaJsb9Q9UfdE2bETua8eTvVwqofT/0+gnhP1nKjnxNjMidnAcO5hb5YUvl0lL5VM7Gx3dx9Y/G+5LFXWVmUV256W/XM6BRiS9CF5F2QVVoaoKuAx29mNJSC09QfRuW93lvvKnQAAAABJRU5ErkJggg=="
|
alt="" />
|
</div>
|
</div>
|
</body>
|
</html>
|
|
<script>
|
(function() {
|
var size =
|
document.body.clientWidth || document.documentElement.clientWidth;
|
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',
|
attempt: 1,
|
});
|
new Vue({
|
el: '#appMain',
|
data: {
|
sys: false,
|
time: '',
|
goodsList1: [],
|
loading: false,
|
linkKZL: '',
|
scrollTop: 0,
|
canScroll: false,
|
loadData: false,
|
nowPage: 1,
|
tab: 0,
|
tabindex: 0,
|
pageSize: 10,
|
pageId: 1,
|
tabList: [{
|
cid: 0,
|
name: '全部'
|
},{
|
cid: 6,
|
name: '美食'
|
}, {
|
cid: 4,
|
name: '居家日用'
|
}, {
|
cid: 1,
|
name: '女装'
|
},
|
{
|
cid: 8,
|
name: '数码家电'
|
}, {
|
cid: 5,
|
name: '鞋品'
|
}, {
|
cid: 9,
|
name: '男装'
|
}, {
|
cid: 10,
|
name: '内衣'
|
},
|
{
|
cid: 2,
|
name: '母婴'
|
}, {
|
cid: 14,
|
name: '家装家纺'
|
}, {
|
cid: 7,
|
name: '文娱车品'
|
}, {
|
cid: 12,
|
name: '配饰'
|
},
|
{
|
cid: 11,
|
name: '箱包'
|
}, {
|
cid: 13,
|
name: '户外运动'
|
},
|
],
|
sort: 0,
|
},
|
methods: {
|
targetGoods:function(items){
|
items.faction='t';
|
let imgs=[];
|
if(items.shipaiPicCount>0){
|
imgs.push(items.shangchaoPic)
|
}
|
else{
|
imgs.push(items.mainPic)
|
}
|
items.imgs=imgs;
|
uni.navigateTo({
|
// url: '/pages/goods/goodsDetail?id=' + items.itemid
|
url: '/pages/goods/shareGoods?info=' + encodeURIComponent(JSON.stringify(items))
|
});
|
},
|
tabclick(num, index) {
|
let type = index > this.tabindex ? 1 : index < this.tabindex ? 2 : 0
|
let count = Math.abs(index - this.tabindex)
|
this.tab = num
|
this.pageId = 1
|
this.tabindex = index
|
this.sort = 0
|
this.getGoodsList(1, num, 0)
|
this.scrollTab(type, count * 40)
|
|
},
|
isStart(item) {
|
if (this.getTime(item.activityStartTime) >= new Date()) {
|
layer.msg('抢购暂未开始');
|
return false;
|
}
|
},
|
back_home() {
|
$('.goodslist').scrollTop(0);
|
},
|
digitalAbbNumber: function({
|
num = 0,
|
unit
|
}) {
|
num = Number(num)
|
var param = {};
|
var k = 10000,
|
sizes = ['', '万', '亿', '万亿'],
|
i;
|
if (num < k) {
|
return num;
|
} else {
|
i = Math.floor(Math.log(num) / Math.log(k));
|
param.value = parseFloat((num / Math.pow(k, i)).toFixed(1));
|
param.unit = sizes[i];
|
}
|
return param.value + (unit || param.unit);
|
},
|
getTime: function(time) {
|
var newTime = new Date(time.replace(/-/g, '/'));
|
return newTime;
|
},
|
handleClipboard: function(text) {
|
var _this = this;
|
var clipboardImg = new Clipboard('.buy', {
|
text: function() {
|
return text;
|
},
|
});
|
clipboardImg.on('success', function(e) {
|
layer.msg(
|
text ? '复制成功,快分享给小伙伴吧~' : '口令复制成功,打开手淘抢购'
|
);
|
e.clearSelection();
|
});
|
|
clipboardImg.on('error', function(e) {
|
layer.msg('口令复制失败,请联系推择者');
|
});
|
},
|
|
// 获取分类
|
getcategory: function(res, isGoods) {
|
var _this = this;
|
var result = '';
|
|
$.ajax({
|
url: 'https://openapi.dataoke.com/api/category/get-super-category',
|
type: 'get',
|
data: {
|
appKey: '641129ab40767',
|
version: 'v1.3.0',
|
},
|
async: false,
|
}).done(function(res) {
|
_this.tabList = res.data
|
});
|
},
|
|
getGoodsList: function(page, cid, sort) {
|
var _this = this;
|
// if(_this.sort==sort&&page==1&&sort!==5&&sort!==6){return;}
|
let newsort = sort ?? 0
|
_this.sort = newsort
|
let url = 'http://dfgapp.ushopvip.com/api/taoke/friends_circle_list'
|
$.ajax({
|
headers:{
|
"token":this.getUrlPar("token")
|
},
|
url: url,
|
type: 'post',
|
dataType:'json',
|
data: {
|
//appKey: '641129ab40767',
|
//version: 'v1.3.0',
|
pageSize: 10,
|
pageId: page ?? (_this.pageId + 1),
|
sort: sort ?? 0,
|
//0-综合排序,1-商品上架时间从高到低,2-销量从高到低,3-领券量从高到低,4-佣金比例从高到低,5-价格(券后价)从高到低,6-价格(券后价)从低到高
|
cid: cid==0?'':cid,
|
subcid: '',
|
pre: 0,
|
// freeshipRemoteDistrict: null,
|
// goodsId: '',
|
},
|
}).done(function(res) {
|
var list = res.data.list.list;
|
_this.min_id = res.data.min_id;
|
_this.pageId = page ?? _this.pageId + 1;
|
if (page) {
|
_this.back_home()
|
}
|
list.map(item => {
|
item.showtime = _this.gettime(item.createTime)
|
item.circleText = item.circleText.replaceAll(`\n\n`, '<br>')
|
.replaceAll(`\n`, '<br>')
|
|
if (item.shipaiPicCount) {
|
item.pics = JSON.parse(item.shipaiPic)[0]
|
}
|
})
|
if (_this.loadData == true) {
|
res.data ?
|
(_this.goodsList1 = _this.goodsList1.concat(list)) :
|
'';
|
} else {
|
res.data ? (_this.goodsList1 = list) : '';
|
}
|
|
_this.loadData = false;
|
if (res.data && res.data.list.length != 0) {
|
_this.canScroll = true;
|
}
|
|
});
|
},
|
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;
|
},
|
getTaoWord: function(item) {
|
var _this = this;
|
let query = {
|
appKey: '641129ab40767',
|
version: 'v1.3.1',
|
goodsId: item.goodsId,
|
}
|
$.ajax({
|
url: 'https://openapi.dataoke.com/api/tb-service/get-privilege-link',
|
type: 'get',
|
data: query,
|
async: false,
|
success: function(res) {
|
if (res.data) {
|
_this.handleClipboard(
|
res.data.longTpwd
|
);
|
}
|
}
|
})
|
// .done(function(res) {
|
// // debugger
|
|
// if(res.data){
|
// _this.handleClipboard(
|
// res.data.tao_code
|
// );
|
// }
|
|
|
// })
|
},
|
scrollLoad: function() {
|
//
|
var _this = this;
|
var range = 800; //距下边界长度/单位px
|
var totalheight = 0;
|
$('.goodslist').scroll(function() {
|
var scroll = document.getElementsByClassName('goodslist')
|
var srollPos = $('.goodslist').scrollTop(); //滚动条距顶部距离(页面超出窗口的高度)
|
totalheight = parseFloat($('.goodslist').height()) + parseFloat(srollPos);
|
_this.scrollTop = srollPos
|
var scrollH = scroll[0].scrollHeight
|
// debugger
|
// console.log('scrollH - range',scrollH - range,'srollPos',srollPos)
|
if (scrollH - range <= srollPos) {
|
if (_this.canScroll) {
|
_this.nowPage++;
|
_this.canScroll = false;
|
_this.loadData = true;
|
_this.getGoodsList(undefined,_this.tab);
|
}
|
}
|
});
|
},
|
scrollTab: function(type, num) {
|
// debugger
|
let div = document.querySelector('#tabber')
|
document.getElementById('tabber').scrollLeft = type == 1 ? div.scrollLeft + num : type ==
|
2 ? div.scrollLeft - num : div.scrollLeft
|
},
|
imgFomate: function(imgurl) {
|
// if (imgurl.indexOf('http') != '-1') {
|
return imgurl;
|
// } else {
|
// return 'https:' + imgurl;
|
// }
|
},
|
jump: function(url) {
|
window.location.href = url
|
},
|
imgLoad: function() {
|
let imgs = document.getElementsByClassName('itempics')
|
console.log('imgs', imgs)
|
debugger
|
// if (imgs.HTMLCollection.length == 0) {
|
// return;
|
// }
|
for (var i = 0; i < imgs.length; i++) {
|
var img = imgs[i];
|
debugger
|
if (img.complete) {
|
// img.src = img.dataset.src;
|
}
|
}
|
|
},
|
gettime: function(arr) {
|
// let tt = new Date(Number(arr) * 1000);
|
let tt = new Date(arr)
|
let cc = new Date()
|
let inter = parseInt((cc.getTime() - tt.getTime()) / 1000 / 60);
|
if (inter == 0) {
|
return "刚刚"
|
} else if (inter < 60) {
|
return inter.toString() + "分钟前"
|
} else if (inter < 60 * 24) {
|
return parseInt(inter / 60).toString() + "小时前";
|
} //本年度内,日期不同,取日期+时间 格式如 06-13 22:11
|
else if (cc.getFullYear() == tt.getFullYear()) {
|
return (tt.getMonth() + 1).toString() + "-" +
|
tt.getDate().toString() + " " +
|
tt.getHours() + ":" +
|
(tt.getMinutes() < 10 ? ('0' + tt.getMinutes()) : tt.getMinutes());
|
} else {
|
return tt.getFullYear().toString().substring(2, 4) +
|
"-" +
|
(tt.getMonth() + 1).toString() + "-" +
|
tt.getDate().toString() + " " +
|
tt.getHours() + ":" +
|
tt.getMinutes();
|
}
|
},
|
touch: function() {
|
var mybody = document.getElementsByClassName('tabber')[0];
|
var _this = this;
|
//滑动处理
|
mybody.addEventListener('touchstart', function(e) {
|
// e.preventDefault();
|
startX = e.touches[0].pageX;
|
startY = e.touches[0].pageY;
|
});
|
mybody.addEventListener('touchmove', function(e) {
|
|
moveEndX = e.changedTouches?.[0].pageX;
|
moveEndY = e.changedTouches?.[0].pageY;
|
X = moveEndX - startX;
|
Y = moveEndY - startY;
|
if (Math.abs(X) > Math.abs(Y) && X > 0) {
|
_this.scrollTab(2, Math.abs(X))
|
// console.log('向右');
|
} else if (Math.abs(X) > Math.abs(Y) && X < 0) {
|
_this.scrollTab(1, Math.abs(X))
|
// console.log('向左');
|
} else if (Math.abs(Y) > Math.abs(X) && Y > 0) {
|
console.log('向下');
|
} else if (Math.abs(Y) > Math.abs(X) && Y < 0) {
|
console.log('向上');
|
} else {
|
console.log('没滑动');
|
}
|
// e.preventDefault();
|
});
|
|
}
|
},
|
mounted: function() {
|
var startX, startY, moveEndX, moveEndY, X, Y;
|
var _this = this;
|
// _this.touch()
|
_this.getGoodsList(1, 0);
|
_this.scrollLoad();
|
_this.touch()
|
window.onscroll = function() {
|
_this.scrollTop =
|
document.documentElement.scrollTop || document.body.scrollTop;
|
// debugger
|
// let l =document.getElementsByClassName('goodslist')[0].scrollTop
|
// _this.scrollTop=l
|
};
|
// window.onload=_this.imgLoad()
|
},
|
});
|
</script>
|