Merge pull request '拼团列表加载更多' (#398) from zhy into master

Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/398
This commit is contained in:
hansu 2020-11-25 09:02:42 +08:00
commit ad68dd81d4

View File

@ -6,12 +6,12 @@
</view> </view>
<swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{height: swiperHeight}"> <swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{height: swiperHeight}">
<swiper-item class="swiper-item" v-for="(_, index) in tabList" :key="index"> <swiper-item class="swiper-item" v-for="(_, index) in tabList" :key="index">
<scroll-view scroll-y style="width: 100%;" @scrolltolower="onreachBottom"> <scroll-view scroll-y style="width: 100%;height: 100%;" @scrolltolower="onreachBottom">
<view v-if="pinTuanList[index]"> <view v-if="pinTuanList[index]">
<SpecialGoods v-for="(item, index) in pinTuanList[index]" :key="index" :item="item" type='group'></SpecialGoods> <SpecialGoods v-for="(item, index) in pinTuanList[index]" :key="index" :item="item" type='group'></SpecialGoods>
</view> </view>
<u-empty text="暂无商品" mode="list" color="#000" margin-top="120" v-if="!pinTuanList[index] || !pinTuanList[index].length"></u-empty> <u-empty text="暂无商品" mode="list" color="#000" margin-top="120" v-if="!pinTuanList[index] || !pinTuanList[index].length"></u-empty>
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" v-if="pinTuanList[index] && pinTuanList[index].length>=pageSize" @loadmore="onreachBottom"></u-loadmore> <u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" v-if="pinTuanList[index]" @loadmore="onreachBottom"></u-loadmore>
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@ -22,7 +22,6 @@ import SpecialGoods from "../../components/shop/special-shop/index";
export default { export default {
data() { data() {
return { return {
pageSize: 6,
tabList: [], tabList: [],
current: -1, current: -1,
swiperCurrent: 0, swiperCurrent: 0,
@ -42,6 +41,7 @@ export default {
}, },
watch: { watch: {
current(index) { current(index) {
this.page = 0;
this.getPinTuanList({ id: this.tabList[index].gc_id, load: 'reload' }); this.getPinTuanList({ id: this.tabList[index].gc_id, load: 'reload' });
} }
}, },
@ -56,7 +56,7 @@ export default {
}) })
}, },
// //
async getPinTuanList({ id, page, load }) { async getPinTuanList({ id, load }) {
const res = await this.$u.api.getPinTuanList({ const res = await this.$u.api.getPinTuanList({
page: this.page, page: this.page,
gc_id: id, gc_id: id,