取消首页列表滑动切换

master
chen 2022-03-01 15:23:56 +08:00
parent df73406429
commit 7aee8d4d55
6 changed files with 37 additions and 146 deletions

View File

@ -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;
}

View File

@ -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:'亿1LOVE100 ',
// specs1:'',
// price:2000,
// num:1
// },
// {
// id:2,
// isActive:true,
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
// title:'亿1LOVE100 ',
// specs1:'',
// price:2000,
// num:2
// },
// {
// id:3,
// isActive:false,
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
// title:'亿1LOVE100 ',
// specs1:'',
// price:2000,
// num:1
// },
// {
// id:4,
// isActive:false,
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
// title:'亿1LOVE100 ',
// specs1:'',
// price:2000,
// num:1
// },
// {
// id:5,
// isActive:false,
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
// title:'亿1LOVE100 ',
// specs1:'',
// price:2000,
// num:1
// },
// {
// id:6,
// isActive:false,
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
// title:'亿1LOVE100 ',
// specs1:'',
// price:2000,
// num:1
// },
// {
// id:7,
// isActive:false,
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
// title:'亿1LOVE100 ',
// specs1:'',
// price:2000,
// num:1
// },
// {
// id:8,
// isActive:false,
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
// title:'亿1LOVE100 ',
// specs1:'',
// price:3000,
// num:1
// }
// ],
ifCheckAll:false,
page:1, //
ifCheckAll:false,//
page:1, //
size:20, //
total:0, //
tempraryData:'',//input

View File

@ -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>

View File

@ -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>

View File

@ -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 -->
<!-- 暂无更多数据 -->
<pitera v-if="noMore"></pitera>
</scroll-view>
</swiper-item>
</swiper>
<!-- <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>
</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();
},

View File

@ -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 = [];
//