取消首页列表滑动切换
parent
df73406429
commit
7aee8d4d55
|
@ -439,6 +439,14 @@ button:after{content: none!important;}
|
|||
|
||||
|
||||
|
||||
scroll-view ::-webkit-scrollbar {
|
||||
display: none !important;
|
||||
width: 0 !important;
|
||||
height: 0 !important;
|
||||
-webkit-appearance: none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -74,84 +74,10 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
dataList:[],
|
||||
dataList:[],//数据列表
|
||||
scrolViewheigh:uni.getSystemInfoSync().screenHeight - 141,
|
||||
// dataList:[
|
||||
// {
|
||||
// id:1,
|
||||
// isActive:true,
|
||||
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
// title:'于亿年宝藏中臻选1的宝石级钻石每年开采数LOVE100 星座光的原石挑选 ',
|
||||
// specs1:'颜色:白色',
|
||||
// price:2000,
|
||||
// num:1
|
||||
// },
|
||||
// {
|
||||
// id:2,
|
||||
// isActive:true,
|
||||
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
// title:'于亿年宝藏中臻选1的宝石级钻石每年开采数LOVE100 星座光的原石挑选 ',
|
||||
// specs1:'颜色:白色',
|
||||
// price:2000,
|
||||
// num:2
|
||||
// },
|
||||
// {
|
||||
// id:3,
|
||||
// isActive:false,
|
||||
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
// title:'于亿年宝藏中臻选1的宝石级钻石每年开采数LOVE100 星座光的原石挑选 ',
|
||||
// specs1:'颜色:白色',
|
||||
// price:2000,
|
||||
// num:1
|
||||
// },
|
||||
// {
|
||||
// id:4,
|
||||
// isActive:false,
|
||||
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
// title:'于亿年宝藏中臻选1的宝石级钻石每年开采数LOVE100 星座光的原石挑选 ',
|
||||
// specs1:'颜色:白色',
|
||||
// price:2000,
|
||||
// num:1
|
||||
// },
|
||||
// {
|
||||
// id:5,
|
||||
// isActive:false,
|
||||
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
// title:'于亿年宝藏中臻选1的宝石级钻石每年开采数LOVE100 星座光的原石挑选 ',
|
||||
// specs1:'颜色:白色',
|
||||
// price:2000,
|
||||
// num:1
|
||||
// },
|
||||
// {
|
||||
// id:6,
|
||||
// isActive:false,
|
||||
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
// title:'于亿年宝藏中臻选1的宝石级钻石每年开采数LOVE100 星座光的原石挑选 ',
|
||||
// specs1:'颜色:白色',
|
||||
// price:2000,
|
||||
// num:1
|
||||
// },
|
||||
// {
|
||||
// id:7,
|
||||
// isActive:false,
|
||||
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
// title:'于亿年宝藏中臻选1的宝石级钻石每年开采数LOVE100 星座光的原石挑选 ',
|
||||
// specs1:'颜色:白色',
|
||||
// price:2000,
|
||||
// num:1
|
||||
// },
|
||||
// {
|
||||
// id:8,
|
||||
// isActive:false,
|
||||
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
// title:'于亿年宝藏中臻选1的宝石级钻石每年开采数LOVE100 星座光的原石挑选 ',
|
||||
// specs1:'颜色:白色',
|
||||
// price:3000,
|
||||
// num:1
|
||||
// }
|
||||
// ],
|
||||
ifCheckAll:false,
|
||||
page:1, // 第几页
|
||||
ifCheckAll:false,//是否全选
|
||||
page:1, // 页数
|
||||
size:20, // 数量
|
||||
total:0, // 总数
|
||||
tempraryData:'',//暂时储存input数据
|
||||
|
|
|
@ -80,4 +80,11 @@
|
|||
.container-loading .loading-box span:nth-child(2){border-radius: 50% 50% 50% 0;transform-origin: bottom left;animation-delay: .5s;}
|
||||
.container-loading .loading-box span:nth-child(3){border-radius: 50% 0 50% 50%;transform-origin: top right;animation-delay: 1.5s;}
|
||||
.container-loading .loading-box span:nth-child(4){border-radius: 0 50% 50% 50%;transform-origin: top left;animation-delay: 1s;}
|
||||
scroll-view ::-webkit-scrollbar {
|
||||
display: none !important;
|
||||
width: 0 !important;
|
||||
height: 0 !important;
|
||||
-webkit-appearance: none;
|
||||
background: transparent;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<view class="disac fc posir">
|
||||
<image :src="itemo.src" :style="{width:[50,46,48,49,49][indexo]+'rpx',height:[44,40,42,44,45][indexo]+'rpx'}" class="icon-img" mode="widthFix"></image>
|
||||
<view class="mar-sx10 fon24 col0">{{itemo.title}}</view>
|
||||
<view class="posia red-num" style="right: 0;top: 0;" v-if="itemo.num!=0">{{itemo.num}}</view>
|
||||
<view class="posia red-num" style="right: 0;top: -20rpx;" v-if="itemo.num!=0">{{itemo.num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -19,42 +19,12 @@
|
|||
<swiper-pu v-if="bannerList.length" :bannerList="bannerList" :isplay="isAutoPlay" :newHeight="'230'" :newRadius="'15'" :newBottom="'10'"></swiper-pu>
|
||||
<!-- 轮播图 end -->
|
||||
</view>
|
||||
<view class="tab-nav" style="position: sticky;z-index: 10;" :style="{ top: statusBarHeight +'px'}">
|
||||
<swiper-tab id="tab" :list="classifyList" v-model="current" @input="clickTab" itemColor="#000000" lineColor="#000000">
|
||||
<!-- 自定义tabs样式 -->
|
||||
<!-- <view slot="title"></view> -->
|
||||
</swiper-tab>
|
||||
</view>
|
||||
<view class="pad-zy40" style="padding-bottom: 66px;">
|
||||
<swiper class="swiper-page pad-s40" :style="{ height: swiperHeight - (statusBarHeight + 126) +'px'}" :current="current" @change="swiperChange">
|
||||
<swiper-item v-for="(item,index) in classifyList" :key="index">
|
||||
<scroll-view :scroll-y="isScroll" @scrolltolower="scrollBottomEv" :style="{ height: swiperHeight - (statusBarHeight + 126) +'px'}">
|
||||
<!-- 活动商品 start -->
|
||||
<view v-for="(item1,index1) in dataList[index][0]" :key="index1" class="mar-x50">
|
||||
<h1 class="fon36 bold">{{item1.name}}</h1>
|
||||
<view class="colpeili fon26 mar-s20 mar-x40 clips1">{{item1.subtitle}}</view>
|
||||
<view class="posir" @tap="goDetail(item1.id)">
|
||||
<image class="radius30 animated fadeIn" :src="item1.cover" mode="aspectFill" lazy-load style="height: 425rpx;width: 100%;"></image>
|
||||
<view v-if="item1.tag!=''" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 活动商品 end -->
|
||||
|
||||
<!-- 子商品 start -->
|
||||
<view class="disjbac fw">
|
||||
<view @tap="goDetail(item2.id)" class="width47 mar-x50 posir" v-for="(item2,index2) in dataList[index][1]" :key="index2">
|
||||
<image :src="item2.cover" mode="aspectFill" lazy-load style="width: 100%;height: 312rpx;border-radius: 30rpx;"></image>
|
||||
<view class="clips2 fon30 col0 linh50" style="height: 100rpx;">{{item2.name}}</view>
|
||||
<view class="fon30 colpeili">¥{{item2.price}}</view>
|
||||
<view v-if="item2.tag!=''" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 子商品 end -->
|
||||
<!-- 暂无更多数据 -->
|
||||
<!-- <view class="tab-nav" style="position: sticky;z-index: 10;" :style="{ top: statusBarHeight +'px'}"> -->
|
||||
<swiper-tab :list="classifyList" v-model="current" @input="clickTab" itemColor="#000000" lineColor="#000000"></swiper-tab>
|
||||
<!-- </view> -->
|
||||
<view class="pad40 pad-x180">
|
||||
<listOne :list="dataList[1]" :activityList="dataList[0]"></listOne>
|
||||
<pitera v-if="noMore"></pitera>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部tab -->
|
||||
|
@ -100,7 +70,7 @@
|
|||
showTop:false, // 是否显示回到顶部
|
||||
dataList:[], // 数据列表
|
||||
page:1, // 第几页
|
||||
size:200, // 数量
|
||||
size:10, // 数量
|
||||
total:0, // 总数
|
||||
titleList:uni.getStorageSync('footTitle'), // 底部导航文字
|
||||
imgList:uni.getStorageSync('footimg'), // 底部导航图标
|
||||
|
@ -117,14 +87,6 @@
|
|||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false;
|
||||
let info = uni.createSelectorQuery().select('.tab-nav');
|
||||
info.boundingClientRect(data=>{
|
||||
if(data.top==this.statusBarHeight){
|
||||
this.isScroll = true;
|
||||
} else {
|
||||
this.isScroll = false;
|
||||
}
|
||||
}).exec();
|
||||
},
|
||||
onHide() {
|
||||
// 关闭自动轮播
|
||||
|
@ -152,6 +114,12 @@
|
|||
};
|
||||
return shareObj;
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.total != (this.dataList[0].length + this.dataList[1].length)){
|
||||
this.page++
|
||||
this.checkList();
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
// 查询是否显示视频
|
||||
this.$toolAll.tools.isVedio();
|
||||
|
@ -211,9 +179,6 @@
|
|||
if(this.classifyList.length){
|
||||
// 分类第一次加载,设置分类id
|
||||
this.classifyId = this.classifyList[0].id;
|
||||
this.classifyList.forEach(item=>{
|
||||
this.dataList.push([[],[]]);
|
||||
})
|
||||
this.$nextTick(()=>{
|
||||
//查询商品列表
|
||||
this.checkList();
|
||||
|
@ -226,17 +191,6 @@
|
|||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
},
|
||||
// 视图容器触底事件
|
||||
scrollBottomEv(){
|
||||
// 判断总数是否等于数组长度,如果相等显示暂无更多,否则继续执行列表事件
|
||||
if(this.total!=(this.dataList[this.current][0].length+this.dataList[this.current][1].length)){
|
||||
// 页数每次+1
|
||||
this.page++
|
||||
this.checkList(); // 调用列表事件
|
||||
} else {
|
||||
this.noMore = true;
|
||||
}
|
||||
},
|
||||
// 查询商品列表
|
||||
checkList(){
|
||||
let params = {
|
||||
|
@ -252,14 +206,14 @@
|
|||
this.$requst.post('/api/spu/home',params).then(res=>{
|
||||
if(res.code==0){
|
||||
if(this.page==1) {
|
||||
this.dataList[this.current] = [[],[]];
|
||||
this.dataList = [[],[]];
|
||||
}
|
||||
// 设置列表总数
|
||||
this.total = res.data.total;
|
||||
if(res.data.list.length){
|
||||
res.data.list.forEach(item=>{
|
||||
if(item.home_display=='big'){
|
||||
this.dataList[this.current][0].push(item);
|
||||
this.dataList[0].push(item);
|
||||
} else {
|
||||
let twoObj = {
|
||||
amount: item.amount,
|
||||
|
@ -273,11 +227,11 @@
|
|||
subtitle: item.subtitle,
|
||||
tag: item.tag
|
||||
}
|
||||
this.dataList[this.current][1].push(item);
|
||||
this.dataList[1].push(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
if(this.total == (this.dataList[this.current][0].length + this.dataList[this.current][1].length)){
|
||||
if(this.total == (this.dataList[0].length + this.dataList[1].length)){
|
||||
this.noMore = true;
|
||||
}
|
||||
uni.hideLoading();
|
||||
|
@ -354,10 +308,6 @@
|
|||
clickTab(index){
|
||||
// 设置选中下标
|
||||
this.current = index;
|
||||
},
|
||||
// 列表滑动事件
|
||||
swiperChange(e){
|
||||
this.current = e.detail.current;
|
||||
// 调用执行列表查询事件
|
||||
this.executeCheckList();
|
||||
},
|
||||
|
|
|
@ -145,7 +145,7 @@
|
|||
methods: {
|
||||
// 查询佣金信息
|
||||
checkCommissionEv(){
|
||||
this.$requst.post('/api/user/commission').then(res=>{
|
||||
this.$requst.post('/api/user/commission',{page:this.page,size:this.size}).then(res=>{
|
||||
if(res.code==0){
|
||||
if(this.page==1) this.dataList = [];
|
||||
// 分销中心数字信息
|
||||
|
|
Loading…
Reference in New Issue