浏览代码

bug 修复

lilei 4 年之前
父节点
当前提交
1f8551ff1a
共有 3 个文件被更改,包括 15 次插入3 次删除
  1. 8 1
      components/uni-coods/uni-coods.vue
  2. 2 2
      pages/goods/index.vue
  3. 5 0
      pages/index/index.vue

+ 8 - 1
components/uni-coods/uni-coods.vue

@@ -3,7 +3,14 @@
 		<view class="goods-item" v-for="item in list" :key="item.id">
 			<view class="goods-imgs"  @click="toDetail(item)">
 				<view v-if="item.inventoryQty == 0" class="goods-staus">已售罄</view>
-				<u-lazy-load img-mode="scaleToFill" :height="imgHeight" :image="item.homeImage" :loading-img="loadingImg" :error-img="errorImg"></u-lazy-load>
+				<view v-if="item.delFlage == 0 || item.state == 0" class="goods-staus">已失效</view>
+				<u-lazy-load 
+				img-mode="scaleToFill" 
+				:height="imgHeight" 
+				:image="item.homeImage+'?x-oss-process=image/resize,m_pad,h_252,w_325,color_ffffff'" 
+				:loading-img="loadingImg" 
+				:error-img="errorImg">
+				</u-lazy-load>
 			</view>
 			<view class="name ellipsis-two"  @click="toDetail(item)">{{item.name}}</view>
 			<view class="price">

+ 2 - 2
pages/goods/index.vue

@@ -91,10 +91,10 @@
 				getGoodsList({pageNo:1,pageSize:item.popularizeGoodsLimit,goodsTypeNo:item.goodsTypeNo}).then(res => {
 					console.log(res,'goodsList')
 					if(res.status == 200&&res.data.list&&res.data.list.length){
-						this.goodsList.push({
+						this.goodsList[index] = {
 							type: item,
 							list: res.data.list
-						})
+						}
 						this.goodsList.splice()
 					}
 				})

+ 5 - 0
pages/index/index.vue

@@ -197,6 +197,10 @@
 			},
 			// 添加购物车
 			addGoodToCart(item){
+				uni.showLoading({
+					mask: true,
+					title: "加入购物车中..."
+				})
 				addGoodsToCart(item).then(res => {
 					if(res.status == 200){
 						uni.showToast({
@@ -206,6 +210,7 @@
 						// 刷新购物车
 						this.getCartList()
 					}
+					uni.hideLoading()
 				})
 			},
 			// 删除购物车