master
wangdong 3 weeks ago
parent c3b82b31f1
commit e72c9e2641
  1. 2
      pages/shopList/index.vue
  2. 56
      pages/shopList/shopPage.vue

@ -142,6 +142,7 @@
return;
}
this.loadTitle = "";
uni.showLoading();
Api.getShopList({
sort: this.activeFilter,
page: this.page++,
@ -150,6 +151,7 @@
})
.then(result => {
console.log(result);
uni.hideLoading();
const data = result.data.data;
this.shopsList = this.shopsList.concat(data);
this.finished = data.length < this.limit;

@ -78,6 +78,8 @@
:class="{ on: activeFilter === 'price' && filterDirection === 'ASC'}"></text>
</view>
</view>
<view class="content-list">
<scroll-view :scroll-top="scrollTop" class="scroll-goods-list" scroll-y="true" @scrolltolower="loadMore" @scroll="goodsListScroll">
<view class="goods-list">
<view v-for="(item, index) in goods" :key="index" class="good"
@click="onGoodDetail(item.goods_id)">
@ -96,6 +98,8 @@
<image mode="aspectFill" src="@/static/empty.png" alt="暂无商品" />
<view>暂无商品</view>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
@ -148,6 +152,8 @@
}
],
isTop: false,
scrollTop: 0,
oldScrollTop: 0,
page: 1,
limit: 10,
loadTitle: '',
@ -184,13 +190,6 @@
this.getGoodsList();
},
},
onPageScroll(e) {
if (e.scrollTop <= 200) { // true
this.isTop = false
} else {
this.isTop = true
}
},
onLoad({
id
}) {
@ -198,10 +197,10 @@
this.getShopDetail()
this.getGoodsTypeList();
},
onReachBottom() {
methods: {
loadMore() {
this.getGoodsList();
},
methods: {
back() {
let pages = getCurrentPages();
if (pages.length > 1) {
@ -231,10 +230,24 @@
this.finished = false;
this.getGoodsList();
},
goodsListScroll(e) {
this.oldScrollTop = e.detail.scrollTop;
if (this.oldScrollTop <= 200) { // true
this.isTop = false
} else {
this.isTop = true
}
},
openScrollTo() {
uni.pageScrollTo({
scrollTop: 0
})
// uni.pageScrollTo({
// scrollTop: 0
// })
//
this.scrollTop = this.oldScrollTop
// 0
this.$nextTick(() =>{
this.scrollTop = 0
});
},
toCer() {
uni.navigateTo({
@ -246,7 +259,6 @@
id: this.id
})
.then(result => {
console.log(result);
this.shopDetail = result.data.detail;
})
.finally(() => this.loading = false)
@ -292,7 +304,6 @@
.then(result => {
//
const data = result.data.list.data;
console.log(data);
this.goods = this.goods.concat(data);
this.finished = data.length < 10;
this.loadTitle = this.finished ? "我是有底线的哦~" : "上拉加载更多";
@ -350,6 +361,7 @@
flex-direction: column;
background: url(https://www.royaum.com.cn/static/shop/shop-page-bg.png) center top no-repeat;
background-size: 100% auto;
overflow-y: hidden;
.navbarContent {
display: flex;
@ -390,6 +402,7 @@
display: flex;
flex-direction: column;
padding-top: 30rpx;
overflow-y: hidden;
.shop-tip {
padding: 0 24rpx;
@ -508,6 +521,7 @@
margin-top: 30rpx;
background: #F0F4F3;
border-radius: 20rpx 20rpx 0 0;
overflow-y: hidden;
// padding-top: 24rpx;
.second-cate {
@ -548,15 +562,16 @@
.goods-content {
flex: 1;
display: flex;
overflow-y: hidden;
.first-cate {
height: 100%;
width: 120rpx;
.first-cate-tabs {
overflow-x: hidden;
overflow-y: auto;
background: #fff;
height: 100%;
.cate-item {
width: 100%;
@ -600,6 +615,7 @@
width: calc(100% - 108rpx);
display: flex;
flex-direction: column;
overflow-y: hidden;
.filter-box {
height: 88rpx;
@ -607,6 +623,7 @@
display: flex;
justify-content: space-between;
align-items: center;
flex-shrink: 0;
.filter-item {
color: #333;
@ -644,11 +661,14 @@
}
}
}
.content-list {
height: calc(100% - 88rpx);
.scroll-goods-list {
height: 100%;
}
}
.goods-list {
padding: 0 20rpx;
overflow-x: hidden;
overflow-y: auto;
display: flex;
flex-wrap: wrap;
justify-content: space-between;

Loading…
Cancel
Save