修复无法分页与商品列表返回错误的bug

This commit is contained in:
weipengfei 2023-10-09 18:19:42 +08:00
parent 83d548fd58
commit 2429f37789
2 changed files with 1163 additions and 1363 deletions

View File

@ -3,10 +3,7 @@
<view class=""> <view class="">
<view class=""> <view class="">
<view v-if="showtit"> <view v-if="showtit">
<view <view :class="{ head: true, show: showtit }" style="padding-top: var(--status-bar-height)">
:class="{ head: true, show: showtit }"
style="padding-top: var(--status-bar-height)"
>
<view style="display: flex; align-items: center"> <view style="display: flex; align-items: center">
<!-- <u--image :showLoading="true" v-if="cloudList.length>0" src="/static/images/LHYC/FH.png" <!-- <u--image :showLoading="true" v-if="cloudList.length>0" src="/static/images/LHYC/FH.png"
width="50.82rpx" height="50.82rpx" @click='goBack'></u--image> width="50.82rpx" height="50.82rpx" @click='goBack'></u--image>
@ -14,117 +11,65 @@
<u--image v-else :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx" <u--image v-else :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx"
height="50.82rpx" @click='goBack'></u--image> --> height="50.82rpx" @click='goBack'></u--image> -->
<i <i class="iconfont icon-xiangzuo" v-if="cloudList.length > 0" style="font-size: 40rpx; text-align: left"
class="iconfont icon-xiangzuo" @click="goBack"></i>
v-if="cloudList.length > 0" <i class="iconfont icon-xiangzuo" v-else style="font-size: 40rpx; text-align: left" @click="goBack"></i>
style="font-size: 40rpx; text-align: left"
@click="goBack"
></i>
<i
class="iconfont icon-xiangzuo"
v-else
style="font-size: 40rpx; text-align: left"
@click="goBack"
></i>
<view <view class="head_tit" v-if="cloudList.length" style="
class="head_tit"
v-if="cloudList.length"
style="
font-size: 40rpx; font-size: 40rpx;
transform: skewX(-10deg); transform: skewX(-10deg);
font-weight: bold; font-weight: bold;
" " :style="{ color: cloudList.length > 0 ? '' : 'black' }">
:style="{ color: cloudList.length > 0 ? '' : 'black' }"
>
{{ town }}里海云仓 {{ town }}里海云仓
</view> </view>
</view> </view>
<view class="" style="display: flex; align-items: center"> <view class="" style="display: flex; align-items: center">
<view <view class="head_r" @click="showPop = true" v-if="cloudList.length > 0">
class="head_r" <u--image v-if="cloudList.length > 0" :showLoading="true" src="/static/images/LHYC/QB.png"
@click="showPop = true" width="50.82rpx" height="50.82rpx"></u--image>
v-if="cloudList.length > 0" <u--image v-else :showLoading="true" src="/static/images/LHYC/QB1.png" width="50.82rpx"
> height="50.82rpx"></u--image>
<u--image
v-if="cloudList.length > 0"
:showLoading="true"
src="/static/images/LHYC/QB.png"
width="50.82rpx"
height="50.82rpx"
></u--image>
<u--image
v-else
:showLoading="true"
src="/static/images/LHYC/QB1.png"
width="50.82rpx"
height="50.82rpx"
></u--image>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 滚动 --> <!-- 滚动 -->
<view <view :class="{ heads: true, show: !showtit }" style="padding-top: var(--status-bar-height)">
:class="{ heads: true, show: !showtit }" <view style="
style="padding-top: var(--status-bar-height)"
>
<view
style="
align-items: center; align-items: center;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
" ">
>
<view class="" style="display: flex; align-items: center"> <view class="" style="display: flex; align-items: center">
<view class="back" style="margin-right: 17rpx"> <view class="back" style="margin-right: 17rpx">
<!-- <u--image :showLoading="true" src="/static/images/LHYC/FH.png" width="50.82rpx" <!-- <u--image :showLoading="true" src="/static/images/LHYC/FH.png" width="50.82rpx"
height="50.82rpx" @click='goBack'></u--image> --> height="50.82rpx" @click='goBack'></u--image> -->
<i <i class="iconfont icon-xiangzuo" style="font-size: 40rpx; text-align: left" @click="goBack"></i>
class="iconfont icon-xiangzuo"
style="font-size: 40rpx; text-align: left"
@click="goBack"
></i>
</view> </view>
<!-- <view class="" style="font-size: 40rpx;transform: skewX(-10deg);font-weight: 700;"> <!-- <view class="" style="font-size: 40rpx;transform: skewX(-10deg);font-weight: 700;">
{town}} {town}}
</view> --> </view> -->
<view <view class="head_tit" v-if="cloudList.length" style="
class="head_tit"
v-if="cloudList.length"
style="
font-size: 40rpx; font-size: 40rpx;
transform: skewX(-10deg); transform: skewX(-10deg);
font-weight: bold; font-weight: bold;
" " :style="{ color: cloudList.length > 0 ? '' : 'black' }">
:style="{ color: cloudList.length > 0 ? '' : 'black' }"
>
{{ town }}里海云仓 {{ town }}里海云仓
</view> </view>
</view> </view>
<view style="position: relative; width: 289.14rpx"> <view style="position: relative; width: 289.14rpx">
<u-search <u-search borderColor="#FF6D20" bgColor="white" :showAction="false" placeholder="请输入..." v-model="keyword"
borderColor="#FF6D20" class="serch_cls"></u-search>
bgColor="white"
:showAction="false"
placeholder="请输入..."
v-model="keyword"
class="serch_cls"
></u-search>
<!-- <u--image class="img_cls" :showLoading="true" src="/static/images/GXSC/SSBT.png" <!-- <u--image class="img_cls" :showLoading="true" src="/static/images/GXSC/SSBT.png"
width="115.65rpx" height="56.82rpx" @click="serch"></u--image> --> width="115.65rpx" height="56.82rpx" @click="serch"></u--image> -->
<view class="serchbtn img_cls" @click="serch">搜索</view> <view class="serchbtn img_cls" @click="serch">搜索</view>
</view> </view>
<view class="head_r" @click="showPop = true"> <view class="head_r" @click="showPop = true">
<u--image <u--image :showLoading="true" src="/static/images/LHYC/QB.png" width="50.82rpx"
:showLoading="true" height="50.82rpx"></u--image>
src="/static/images/LHYC/QB.png"
width="50.82rpx"
height="50.82rpx"
></u--image>
<text class="" style="height: 5px"></text> <text class="" style="height: 5px"></text>
<view class="flags"> </view> <view class="flags"> </view>
</view> </view>
@ -133,62 +78,27 @@
<view class="box" v-if="cloudList.length > 0"> <view class="box" v-if="cloudList.length > 0">
<view :class="act_swiper"> <view :class="act_swiper">
<swiper <swiper :autoplay="false" :active-class="activeClass" :interval="3000" class="swipers" :circular="true"
:autoplay="false" previous-margin="0rpx" next-margin="0rpx" :current="current" :disable-touch="true">
:active-class="activeClass"
:interval="3000"
class="swipers"
:circular="true"
previous-margin="0rpx"
next-margin="0rpx"
:current="current"
:disable-touch="true"
>
<swiper-item v-for="(item, index) in cloudList"> <swiper-item v-for="(item, index) in cloudList">
<u--image <u--image :showLoading="true" :src="item.cover" :class="act_img" width="750rpx"
:showLoading="true" height="718.46rpx"></u--image>
:src="item.cover"
:class="act_img"
width="750rpx"
height="718.46rpx"
></u--image>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
<view class="" style="height: 718.46rpx" v-if="act_swiper"> </view> <view class="" style="height: 718.46rpx" v-if="act_swiper"> </view>
<view class="menu" v-if="showtit" style="transition: 1s"> <view class="menu" v-if="showtit" style="transition: 1s">
<swiper <swiper :autoplay="false" :active-class="activeClass" :interval="3000" class="swiper" :circular="true"
:autoplay="false" previous-margin="280rpx" next-margin="280rpx" :current="current" @change="test">
:active-class="activeClass" <swiper-item v-for="(item, index) in cloudList" :key="index" @click="clickSwiperFn(index)">
:interval="3000" <view class="swiper_item" :class="{
class="swiper"
:circular="true"
previous-margin="280rpx"
next-margin="280rpx"
:current="current"
@change="test"
>
<swiper-item
v-for="(item, index) in cloudList"
:key="index"
@click="clickSwiperFn(index)"
>
<view
class="swiper_item"
:class="{
swiper_item_act: index == current, swiper_item_act: index == current,
swiper_item_act2: swiper_item_act2:
index == current - 1 || index == current + 1, index == current - 1 || index == current + 1,
}" }">
> <u--image :showLoading="true" :src="item.background" class="swiper_b" width="140.19rpx"
<u--image height="140.19rpx"></u--image>
:showLoading="true"
:src="item.background"
class="swiper_b"
width="140.19rpx"
height="140.19rpx"
></u--image>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@ -196,53 +106,23 @@
<!-- 商品列表 --> <!-- 商品列表 -->
<view class="content"> <view class="content">
<view <view class="content_sift" :style="{ position: pocls, top: headtop + 'px' }" v-if="!showtit">
class="content_sift" <view :class="{ act: item.act, price_sift: true }" v-for="(item, index) in actList" :key="index"
:style="{ position: pocls, top: headtop + 'px' }" @click="screenGoods(item.screen, index)">
v-if="!showtit"
>
<view
:class="{ act: item.act, price_sift: true }"
v-for="(item, index) in actList"
:key="index"
@click="screenGoods(item.screen, index)"
>
{{ item.tit }} {{ item.tit }}
<view class="" v-if="index == 2" style="margin-left: 10rpx"> <view class="" v-if="index == 2" style="margin-left: 10rpx">
<u-icon <u-icon name="arrow-up" :color="item.price && item.act ? '#FF6D20' : 'black'" size="10"></u-icon>
name="arrow-up" <u-icon name="arrow-down" :color="!item.price && item.act ? '#FF6D20' : 'black'" size="10"></u-icon>
:color="item.price && item.act ? '#FF6D20' : 'black'"
size="10"
></u-icon>
<u-icon
name="arrow-down"
:color="!item.price && item.act ? '#FF6D20' : 'black'"
size="10"
></u-icon>
</view> </view>
</view> </view>
</view> </view>
<view class="goods_list" v-if="goodsList.length > 0"> <view class="goods_list" v-if="goodsList.length > 0">
<view class="empty" v-if="showLoading"> <view class="empty" v-if="showLoading">
<u-loading-icon <u-loading-icon v-if="showLoading" text="加载中" textSize="18"></u-loading-icon>
v-if="showLoading"
text="加载中"
textSize="18"
></u-loading-icon>
</view> </view>
<view <view class="goods" @click="goodDetail(item)" v-else v-for="(item, index) in goodsList">
class="goods"
@click="goodDetail(item)"
v-else
v-for="(item, index) in goodsList"
>
<view class="left"> <view class="left">
<u--image <u--image :showLoading="true" :src="item.image" width="192.76rpx" height="192.76rpx"></u--image>
:showLoading="true"
:src="item.image"
width="192.76rpx"
height="192.76rpx"
></u--image>
</view> </view>
<view class="right"> <view class="right">
<view class="tit"> <view class="tit">
@ -258,14 +138,11 @@
</view> </view>
<view class="good_price"> <view class="good_price">
<view class="good_price_l"> <view class="good_price_l">
<view <view class="" style="
class=""
style="
color: #f84221; color: #f84221;
font-size: 22.78rpx; font-size: 22.78rpx;
font-weight: bold; font-weight: bold;
" ">
>
<text style="font-size: 30rpx">{{ <text style="font-size: 30rpx">{{
item.price item.price
}}</text> }}</text>
@ -273,31 +150,22 @@
<view class="old_price"> 30.00 </view> <view class="old_price"> 30.00 </view>
</view> </view>
<view class="good_price_r"> <view class="good_price_r">
<view <view :class="{ x_tra: trnList[index]?trnList[index].bottom:0 }" :style="`transform:translateY(${
:class="{ x_tra: trnList[index].bottom }" trnList[index]?trnList[index].bottom:0
:style="`transform:translateY(${
trnList[index].bottom
}px);transition:${ }px);transition:${
trnList[index].bottom ? 1 : 0 trnList[index]?trnList[index].bottom:0 ? 1 : 0
}s cubic-bezier(0.4, -0.9, 0.75, 1);`" }s cubic-bezier(0.4, -0.9, 0.75, 1);`" @click.stop="addcart(item, index)">
@click.stop="addcart(item, index)" <u--image :class="'act_class' + index" :style="`transform:translateX(${
> trnList[index]?trnList[index].left:0
<u--image }px);transition:${trnList[index]?trnList[index].bottom:0 ? 1 : 0}s `"
:class="'act_class' + index" src="/static/images/LHYC/J.png" width="49.07rpx" height="49.07rpx"></u--image>
:style="`transform:translateX(${
trnList[index].left
}px);transition:${trnList[index].bottom ? 1 : 0}s `"
src="/static/images/LHYC/J.png"
width="49.07rpx"
height="49.07rpx"
></u--image>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view style="height: 100rpx"> <view style="height: 180rpx">
<u-loadmore :status="status" /> <u-loadmore :status="status" />
</view> </view>
</view> </view>
@ -305,12 +173,8 @@
<view v-else> <view v-else>
<view class="empty"> <view class="empty">
<view class="info"> <view class="info">
<u--image <u--image :showLoading="true" src="/static/images/noCart.png" width="400.09rpx"
:showLoading="true" height="400.09rpx"></u--image>
src="/static/images/noCart.png"
width="400.09rpx"
height="400.09rpx"
></u--image>
<view class="" style="text-align: center; color: #999"> <view class="" style="text-align: center; color: #999">
暂无商品 暂无商品
</view> </view>
@ -318,23 +182,12 @@
</view> </view>
</view> </view>
<!-- 购物车 --> <!-- 购物车 -->
<view <view class="card" :style="`bottom:${appInfo.bottom}px`"
class="card" @click="navgo('/pages/order_addcart/order_addcart')">
:style="`bottom:${appInfo.bottom}px`"
@click="navgo('/pages/order_addcart/order_addcart')"
>
<view class="left"> <view class="left">
<view <view class="cart" :class="{ act_cart: act_cart }" style="position: relative; z-index: 9999999">
class="cart" <u--image :showLoading="true" src="/static/images/LHYC/GWC.png" width="63.09rpx"
:class="{ act_cart: act_cart }" height="63.09rpx"></u--image>
style="position: relative; z-index: 9999999"
>
<u--image
:showLoading="true"
src="/static/images/LHYC/GWC.png"
width="63.09rpx"
height="63.09rpx"
></u--image>
<view class="badge" v-show="goodsNum"> <view class="badge" v-show="goodsNum">
{{ goodsNum }} {{ goodsNum }}
@ -352,37 +205,17 @@
</view> </view>
<!-- 组件 --> <!-- 组件 -->
<view class="" v-if="showPop"> <view class="" v-if="showPop">
<u-popup <u-popup mode="right" :show="showPop" @close="showPop = false" @open="showPop = true">
mode="right"
:show="showPop"
@close="showPop = false"
@open="showPop = true"
>
<view class="pop"> <view class="pop">
<view style="height: var(--status-bar-height)"></view> <view style="height: var(--status-bar-height)"></view>
<view class="pop_head" style="display: flex"> <view class="pop_head" style="display: flex">
<u--image <u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx" height="50.82rpx"
:showLoading="true" @click="showPop = false"></u--image>
src="/static/images/LHYC/PFH.png"
width="50.82rpx"
height="50.82rpx"
@click="showPop = false"
></u--image>
<view class="head_tit"> 里海云仓 </view> <view class="head_tit"> 里海云仓 </view>
</view> </view>
<view class="pop_content" v-if="cloudList.length"> <view class="pop_content" v-if="cloudList.length">
<view <view class="pop_li" @click="all(index)" v-for="(item, index) in cloudList" :key="index">
class="pop_li" <u--image :showLoading="true" :src="item.background" width="84.11rpx" height="84.11rpx"></u--image>
@click="all(index)"
v-for="(item, index) in cloudList"
:key="index"
>
<u--image
:showLoading="true"
:src="item.background"
width="84.11rpx"
height="84.11rpx"
></u--image>
<view class="" style="margin-left: 20rpx"> <view class="" style="margin-left: 20rpx">
<view style="font-size: 33.29rpx; color: black"> <view style="font-size: 33.29rpx; color: black">
{{ item.category_name }}云仓服务 {{ item.category_name }}云仓服务
@ -399,12 +232,8 @@
@click='goBack'></u--image> @click='goBack'></u--image>
</view> --> </view> -->
<view class="yuncangempty"> <view class="yuncangempty">
<u--image <u--image :showLoading="true" src="/static/images/noCart.png" width="400.09rpx"
:showLoading="true" height="400.09rpx"></u--image>
src="/static/images/noCart.png"
width="400.09rpx"
height="400.09rpx"
></u--image>
<view class="" style="text-align: center; color: #999"> <view class="" style="text-align: center; color: #999">
当前区域暂无云仓 当前区域暂无云仓
</view> </view>
@ -420,12 +249,7 @@
<view style="padding: 10rpx"> <view style="padding: 10rpx">
<view class="info"> <view class="info">
<u--image <u--image :showLoading="true" src="/static/images/noCart.png" width="400.09rpx" height="400.09rpx"></u--image>
:showLoading="true"
src="/static/images/noCart.png"
width="400.09rpx"
height="400.09rpx"
></u--image>
<view class="" style="text-align: center; color: #999"> <view class="" style="text-align: center; color: #999">
当前区域暂无云仓 当前区域暂无云仓
</view> </view>
@ -434,39 +258,21 @@
<!-- 多规格购物车 --> <!-- 多规格购物车 -->
<authorize <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse">
@onLoadFun="onLoadFun"
:isAuto="isAuto"
:isShowAuth="isShowAuth"
@authColse="authColse"
>
</authorize> </authorize>
<view class="" :style="`height:${appInfo.bottom}px;`"> </view> <view class="" :style="`height:${appInfo.bottom}px;`"> </view>
</view> </view>
<view class=""> <view class="">
<u-picker <u-picker :defaultIndex="defaInd" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
:defaultIndex="defaInd" @cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
:show="showPicker"
ref="uPicker"
:columns="columnData"
@confirm="confirm"
@cancel="showPicker = false"
@change="changeHandler"
keyName="name"
></u-picker>
</view> </view>
<view class="" v-if="showcartpop"> <view class="" v-if="showcartpop">
<u-popup :show="showcartpop" @close="closecartpop" @open="opencartpop"> <u-popup :show="showcartpop" @close="closecartpop" @open="opencartpop">
<view class="sku"> <view class="sku">
<view class="sku_head"> <view class="sku_head">
<view class="sku_head_l"> <view class="sku_head_l">
<u--image <u--image :showLoading="true" :src="skuform.image" width="200.09rpx" height="200.09rpx"></u--image>
:showLoading="true"
:src="skuform.image"
width="200.09rpx"
height="200.09rpx"
></u--image>
</view> </view>
<view class="sku_head_r"> <view class="sku_head_r">
<view class="sku_goods_tit"> <view class="sku_goods_tit">
@ -483,22 +289,14 @@
<view class="sku_size"> <view class="sku_size">
<view class="" style="margin-bottom: 10rpx"> 尺码 </view> <view class="" style="margin-bottom: 10rpx"> 尺码 </view>
<view class=""> <view class="">
<text <text class="size_li" :class="{ act_size_li: item.sku == skusize }" v-for="(item, index) in skuform.sku"
class="size_li" @click="skusizechange(item.sku)">{{ item.sku }}</text>
:class="{ act_size_li: item.sku == skusize }"
v-for="(item, index) in skuform.sku"
@click="skusizechange(item.sku)"
>{{ item.sku }}</text
>
</view> </view>
</view> </view>
<view class="sku_num"> <view class="sku_num">
<view class=""> 数量 </view> <view class=""> 数量 </view>
<view class=""> <view class="">
<u-number-box <u-number-box v-model="skuNumber" @change="valChange"></u-number-box>
v-model="skuNumber"
@change="valChange"
></u-number-box>
</view> </view>
</view> </view>
<view class="skuaddcart" @click="skuaddcart"> 确定 </view> <view class="skuaddcart" @click="skuaddcart"> 确定 </view>
@ -657,7 +455,7 @@ export default {
if (this.flag || !this.goodsList.length) return if (this.flag || !this.goodsList.length) return
this.status = "loading" this.status = "loading"
this.page_num += 1 this.page_num += 1
this.flag = true // this.flag = true
cloudWarehouse({ cloudWarehouse({
street_code: this.street_code, street_code: this.street_code,
category_id: this.cloudList[this.current]?.category_id || "", category_id: this.cloudList[this.current]?.category_id || "",
@ -666,16 +464,16 @@ export default {
page_num: this.page_num page_num: this.page_num
}).then(res => { }).then(res => {
// console.log(res.data.list[0].product_id, this.goodsList[0].product_id)
if (res.data.list[0].product_id == this.goodsList[0].product_id) {
this.status = "nomore"
this.flag = false
} else {
if (res.data.list.length == 0) { if (res.data.list.length == 0) {
this.status = "nomore" this.status = "nomore"
this.flag = true
return return
} }
this.goodsList = this.goodsList.concat(res.data.list) if (res.data.list[0].product_id == this.goodsList[0].product_id) {
this.status = "nomore"
this.flag = true
} else {
this.goodsList = this.goodsList.concat(res.data.list);
} }
}) })
// this.getList().then(res => { // this.getList().then(res => {
@ -1069,6 +867,7 @@ export default {
opacity: 0; opacity: 0;
} }
} }
.serchbtn { .serchbtn {
// position: absolute; // position: absolute;
// right: 5rpx; // right: 5rpx;
@ -1081,6 +880,7 @@ export default {
// background-color: #FEAB00; // background-color: #FEAB00;
background: linear-gradient(to right, #f84221, #ff6d20); background: linear-gradient(to right, #f84221, #ff6d20);
} }
.selected-list { .selected-list {
padding: 24rpx 14rpx; padding: 24rpx 14rpx;
border-radius: 10.51rpx 10.51rpx 10.51rpx 10.51rpx; border-radius: 10.51rpx 10.51rpx 10.51rpx 10.51rpx;
@ -1198,6 +998,7 @@ export default {
.swiper_item_act { .swiper_item_act {
transform: scale(1.2); transform: scale(1.2);
} }
.swiper_item_act2 { .swiper_item_act2 {
transform: scale(1.1); transform: scale(1.1);
} }

View File

@ -217,11 +217,11 @@
</view> </view>
</view> </view>
<view class="good_price_r"> <view class="good_price_r">
<view :class="{x_tra:trnList[index].bottom }" <view :class="{x_tra:trnList[index]?trnList[index].bottom:0 }"
:style="`transform:translateY(${trnList[index].bottom}px);transition:${trnList[index].bottom?1:0}s cubic-bezier(0.4, -0.9, 0.75, 1);`" :style="`transform:translateY(${trnList[index]?trnList[index].bottom:0}px);transition:${trnList[index]?trnList[index].bottom:0?1:0}s cubic-bezier(0.4, -0.9, 0.75, 1);`"
@click.stop="addcart(item,index)"> @click.stop="addcart(item,index)">
<u--image :class="'act_class'+index" <u--image :class="'act_class'+index"
:style="`transform:translateX(${trnList[index].left}px);transition:${trnList[index].bottom?1:0}s `" :style="`transform:translateX(${trnList[index]?trnList[index].left:0}px);transition:${trnList[index]?trnList[index].bottom:0?1:0}s `"
src="/static/images/LHYC/J.png" width="49.07rpx" src="/static/images/LHYC/J.png" width="49.07rpx"
height="49.07rpx"></u--image> height="49.07rpx"></u--image>
</view> </view>
@ -232,7 +232,7 @@
</view> </view>
</view> </view>
</view> </view>
<view style="height: 100rpx;"> <view style="height: 180rpx;">
<!-- <u-loadmore :status="status" /> --> <!-- <u-loadmore :status="status" /> -->
</view> </view>
</view> </view>
@ -531,8 +531,6 @@
this.Area() this.Area()
let that = this let that = this
setTimeout(() => { setTimeout(() => {
uni.createSelectorQuery() uni.createSelectorQuery()
.in(this) .in(this)
.select('.flags1') .select('.flags1')
@ -556,10 +554,10 @@
}, },
// //
onReachBottom() { onReachBottom() {
if (this.flag || !this.goodsList.length) return if (this.flag || !this.goodsList.length) return;
this.status = "loading" this.status = "loading"
this.page_num += 1 this.page_num += 1
this.flag = true // this.flag = true
cloudWarehouse({ cloudWarehouse({
street_code: this.street_code, street_code: this.street_code,
category_id: this.cloudList[this.current]?.category_id || "", category_id: this.cloudList[this.current]?.category_id || "",
@ -568,15 +566,16 @@
page_num: this.page_num page_num: this.page_num
}).then(res => { }).then(res => {
if (res.data.list[0].product_id == this.goodsList[0].product_id) {
this.status = "nomore"
this.flag = false
} else {
if (res.data.list.length == 0) { if (res.data.list.length == 0) {
this.status = "nomore" this.status = "nomore"
this.flag = true
return return
} }
this.goodsList = this.goodsList.concat(res.data.list) if (res.data.list[0].product_id == this.goodsList[0].product_id) {
this.status = "nomore"
this.flag = true
} else {
this.goodsList = this.goodsList.concat(res.data.list);
} }
}) })
@ -589,7 +588,7 @@
.select('.flags') .select('.flags')
.boundingClientRect(rect => { .boundingClientRect(rect => {
this.headtop = rect.top this.headtop = rect.top
console.log(rect.top) // console.log(rect.top)
}) })
.exec(); .exec();
uni.createSelectorQuery() uni.createSelectorQuery()