修复了切换类型时图片有概率不更新的bug

This commit is contained in:
weipengfei 2023-10-09 19:13:50 +08:00
parent 2429f37789
commit 7322947eca
2 changed files with 1517 additions and 1524 deletions

View File

@ -122,7 +122,8 @@
</view> </view>
<view class="goods" @click="goodDetail(item)" v-else v-for="(item, index) in goodsList"> <view class="goods" @click="goodDetail(item)" v-else v-for="(item, index) in goodsList">
<view class="left"> <view class="left">
<u--image :showLoading="true" :src="item.image" width="192.76rpx" height="192.76rpx"></u--image> <!-- <u--image :showLoading="true" :src="item.image" width="192.76rpx" height="192.76rpx"></u--image> -->
<image lazy-load style="height: 192.76rpx;width: 192.76rpx;" :src="item.image"></image>
</view> </view>
<view class="right"> <view class="right">
<view class="tit"> <view class="tit">
@ -737,16 +738,18 @@
getList() { getList() {
this.showLoading = true this.showLoading = true
this.status = "loading" this.status = "loading"
this.page_num = 1;
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 || "",
order: this.type, order: this.type,
keyword: this.keyword, keyword: this.keyword,
page_num: this.page_num page_num: this.page_num
}).then(res => { }).then(res => {
this.goodsList = res.data.list this.goodsList = res.data.list;
this.showLoading = false this.showLoading = false;
if (res.data.list.length < 10) this.status = 'nomore';
else this.status = 'loadmore';
this.goodsList.forEach(item => { this.goodsList.forEach(item => {
this.trnList.push({ this.trnList.push({
left: 0, left: 0,

View File

@ -19,17 +19,15 @@
<view class=""> <view class="">
<view class=""> <view class="">
<view v-if="showtit"> <view v-if="showtit">
<view :class="{'head':true,'show':showtit}" <view :class="{'head':true,'show':showtit}" style="padding-top: var(--status-bar-height);display: block;">
style="padding-top: var(--status-bar-height);display: block;">
<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>
<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 class="iconfont icon-xiangzuo" v-if="cloudList.length>0" <i class="iconfont icon-xiangzuo" v-if="cloudList.length>0" style="font-size: 40rpx;text-align: left;"
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> @click='goBack'></i>
<i class="iconfont icon-xiangzuo" v-else style="font-size: 40rpx;text-align: left;" @click='goBack'></i>
<view class="head_tit" style="font-size: 36.8rpx;font-weight: 700;transform: skewX(-10deg);" <view class="head_tit" style="font-size: 36.8rpx;font-weight: 700;transform: skewX(-10deg);"
:style="{color:cloudList.length>0?'':'black'}" :style="{color:cloudList.length>0?'':'black'}"
@ -80,16 +78,16 @@
<view class="dw_cls" @click="showFn" :style="`top:${headTop1+5}px`"> <view class="dw_cls" @click="showFn" :style="`top:${headTop1+5}px`">
<view class="dw_text"> <view class="dw_text">
<u--image :showLoading="true" v-if="cloudList.length>0" src="/static/images/LHYC/DWB.png" <u--image :showLoading="true" v-if="cloudList.length>0" src="/static/images/LHYC/DWB.png" width="50.82rpx"
width="50.82rpx" height="50.82rpx"></u--image> height="50.82rpx"></u--image>
<u--image :showLoading="true" v-else src="/static/images/LHYC/DWB1.png" width="50.82rpx" <u--image :showLoading="true" v-else src="/static/images/LHYC/DWB1.png" width="50.82rpx"
height="50.82rpx"></u--image> height="50.82rpx"></u--image>
<view class="town_name" :style="{color:cloudList.length>0?'':'black'}" @click="showpick"> <view class="town_name" :style="{color:cloudList.length>0?'':'black'}" @click="showpick">
{{street}} {{street}}
</view> </view>
<view class="sl" :class="{actsl:showSelect}"> <view class="sl" :class="{actsl:showSelect}">
<u--image :showLoading="true" style="transform: rotate(180deg);" <u--image :showLoading="true" style="transform: rotate(180deg);" src="/static/images/GXSC/XL.png"
src="/static/images/GXSC/XL.png" width="31.54rpx" height="31.54rpx"></u--image> width="31.54rpx" height="31.54rpx"></u--image>
</view> </view>
</view> </view>
</view> </view>
@ -117,8 +115,7 @@
<!-- <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 class="iconfont icon-xiangzuo" style="font-size: 40rpx;text-align: left;" <i class="iconfont icon-xiangzuo" style="font-size: 40rpx;text-align: left;" @click='goBack'></i>
@click='goBack'></i>
</view> </view>
<view class="" style="font-size: 40rpx;transform: skewX(-10deg);"> <view class="" style="font-size: 40rpx;transform: skewX(-10deg);">
供销综合云商品 供销综合云商品
@ -126,8 +123,8 @@
</view> </view>
<view style="position: relative;width: 289.14rpx;"> <view style="position: relative;width: 289.14rpx;">
<u-search borderColor="#FF6D20" bgColor="white" :showAction="false" placeholder="请输入..." <u-search borderColor="#FF6D20" bgColor="white" :showAction="false" placeholder="请输入..." v-model="keyword"
v-model="keyword" class="serch_cls" style="height: 56.82rpx;"></u-search> class="serch_cls" style="height: 56.82rpx;"></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>
@ -146,9 +143,8 @@
<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 :autoplay="false" :active-class="activeClass" :interval="3000" class="swipers" <swiper :autoplay="false" :active-class="activeClass" :interval="3000" class="swipers" :circular="true"
:circular="true" previous-margin='0rpx' next-margin='0rpx' :current="current" previous-margin='0rpx' next-margin='0rpx' :current="current" :disable-touch="true">
:disable-touch="true">
<swiper-item v-for="(item,index) in cloudList"> <swiper-item v-for="(item,index) in cloudList">
<u--image :showLoading="true" :src="item.cover" :class="act_img" width="750rpx" <u--image :showLoading="true" :src="item.cover" :class="act_img" width="750rpx"
height="718.46rpx"></u--image> height="718.46rpx"></u--image>
@ -161,13 +157,12 @@
<view class="menu" v-if="showtit" style="transition: 1s;"> <view class="menu" v-if="showtit" style="transition: 1s;">
<swiper :autoplay="false" :active-class="activeClass" :interval="3000" class="swiper" <swiper :autoplay="false" :active-class="activeClass" :interval="3000" class="swiper" :circular="true"
:circular="true" previous-margin='280rpx' next-margin='280rpx' :current="current" previous-margin='280rpx' next-margin='280rpx' :current="current" @change="test">
@change="test">
<swiper-item v-for="(item,index) in cloudList" :key="index" @click="clickSwiperFn(index)"> <swiper-item v-for="(item,index) in cloudList" :key="index" @click="clickSwiperFn(index)">
<view class="swiper_item" :class="{swiper_item_act:index==current}"> <view class="swiper_item" :class="{swiper_item_act:index==current}">
<u--image :showLoading="true" :src="item.background" class="swiper_b" <u--image :showLoading="true" :src="item.background" class="swiper_b" width="140.19rpx"
width="140.19rpx" height="140.19rpx"></u--image> height="140.19rpx"></u--image>
</view> </view>
</swiper-item> </swiper-item>
@ -180,10 +175,8 @@
@click="screenGoods(item.screen,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 name="arrow-up" :color="item.price&&item.act?'#FF6D20':'black'" <u-icon name="arrow-up" :color="item.price&&item.act?'#FF6D20':'black'" size="10"></u-icon>
size="10"></u-icon> <u-icon name="arrow-down" :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>
@ -193,8 +186,10 @@
</view> </view>
<view class="goods" @click="goodDetail(item)" v-else v-for="item,index in goodsList"> <view class="goods" @click="goodDetail(item)" v-else v-for="item,index in goodsList">
<view class="left"> <view class="left">
<u--image :showLoading="true" :src="item.image" width="192.76rpx" <!-- <u--image :showLoading="true" :src="item.image" width="192.76rpx"
height="192.76rpx"></u--image> height="192.76rpx"></u--image> -->
<image lazy-load style="height: 192.76rpx;width: 192.76rpx;" :src="item.image"></image>
</view> </view>
<view class="right"> <view class="right">
<view class="tit"> <view class="tit">
@ -208,8 +203,7 @@
</view> </view>
<view class="good_price"> <view class="good_price">
<view class="good_price_l"> <view class="good_price_l">
<view class="" <view class="" style="color: #F84221;font-size: 22.78rpx;font-weight: bold;">
style="color: #F84221;font-size: 22.78rpx;font-weight: bold;">
<text style="font-size: 30rpx;">{{item.price}}</text> <text style="font-size: 30rpx;">{{item.price}}</text>
</view> </view>
<view class="old_price"> <view class="old_price">
@ -222,8 +216,7 @@
@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]?trnList[index].left:0}px);transition:${trnList[index]?trnList[index].bottom:0?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>
</view> </view>
@ -252,8 +245,7 @@
<view class="card" :style="`bottom:${appInfo.bottom}px`" <view class="card" :style="`bottom:${appInfo.bottom}px`"
@click="navgo('/pages/order_addcart/order_addcart')"> @click="navgo('/pages/order_addcart/order_addcart')">
<view class="left"> <view class="left">
<view class="cart" :class="{act_cart:act_cart}" <view class="cart" :class="{act_cart:act_cart}" style="position: relative;z-index: 9999999;">
style="position: relative;z-index: 9999999;">
<u--image :showLoading="true" src="/static/images/LHYC/GWC.png" width="63.09rpx" <u--image :showLoading="true" src="/static/images/LHYC/GWC.png" width="63.09rpx"
height="63.09rpx"></u--image> height="63.09rpx"></u--image>
@ -285,16 +277,15 @@
<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 :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx" <u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx" height="50.82rpx"
height="50.82rpx" @click='showPop=false'></u--image> @click='showPop=false'></u--image>
<view class="head_tit"> <view class="head_tit">
里海云仓 里海云仓
</view> </view>
</view> </view>
<view class="pop_content" v-if="cloudList.length"> <view class="pop_content" v-if="cloudList.length">
<view class="pop_li" @click="all(index)" v-for="item,index in cloudList" :key="index"> <view class="pop_li" @click="all(index)" v-for="item,index in cloudList" :key="index">
<u--image :showLoading="true" :src="item.background" width="84.11rpx" <u--image :showLoading="true" :src="item.background" width="84.11rpx" height="84.11rpx"></u--image>
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}}云仓服务
@ -333,8 +324,7 @@
<view style="padding: 10rpx;"> <view style="padding: 10rpx;">
<view class="info"> <view class="info">
<u--image :showLoading="true" src="/static/images/noCart.png" width="400.09rpx" <u--image :showLoading="true" src="/static/images/noCart.png" width="400.09rpx" height="400.09rpx"></u--image>
height="400.09rpx"></u--image>
<view class="" style="text-align: center;color:#999"> <view class="" style="text-align: center;color:#999">
当前区域暂无云仓 当前区域暂无云仓
</view> </view>
@ -361,8 +351,7 @@
<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 :showLoading="true" :src="skuform.image" width="200.09rpx" <u--image :showLoading="true" :src="skuform.image" width="200.09rpx" height="200.09rpx"></u--image>
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">
@ -383,8 +372,8 @@
尺码 尺码
</view> </view>
<view class=""> <view class="">
<text class="size_li" :class="{act_size_li:item.sku==skusize}" <text class="size_li" :class="{act_size_li:item.sku==skusize}" v-for="(item,index) in skuform.sku"
v-for="(item,index) in skuform.sku" @click="skusizechange(item.sku)">{{item.sku}}</text> @click="skusizechange(item.sku)">{{item.sku}}</text>
</view> </view>
</view> </view>
@ -839,6 +828,7 @@
getList() { getList() {
this.showLoading = true this.showLoading = true
this.status = "loading" this.status = "loading"
this.page_num = 1;
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 || "",
@ -929,7 +919,7 @@
test(e) { test(e) {
// (e.target.current) // (e.target.current)
this.current = e.target.current this.current = e.target.current
// (e)
this.getList() this.getList()
}, },