rk
2026-03-11 0e4b49f4bee160790b1830e6a8606e739b32fc3b
mini-program/pages/search/search.vue
@@ -12,7 +12,7 @@
      </view>
      <template v-if="isSearch">
         <view class="list">
            <image class="list-notfund" v-if="goodsList.length === 0" src="/static/images/default_nodata_white.png" mode="widthFix"></image>
            <image class="list-notfund" v-if="goodsList.length === 0" src="/static/images/default_nodata_grey.png" mode="widthFix"></image>
            <view class="commodity-item" v-for="(item, i) in goodsList" :key="i" v-else @click="jumpDetails(item.id)">
               <view class="commodity-item-image">
                  <image :src="item.imgurl" mode="widthFix"></image>
@@ -31,7 +31,7 @@
                     </view>
                  </view>
                  <view class="commodity-item-shou">
                     <text>已售{{item.saleNum + item.realSaleNum}}</text>
                     <text>已售{{item.shou}}</text>
                     <view class="commodity-item-shou-add" @click.stop="addCard(item)">+</view>
                  </view>
               </view>
@@ -114,7 +114,10 @@
            })
         },
         search() {
            if (!this.goodsName) return;
            if (!this.goodsName) {
               this.goodsList = []
               return
            };
            if (!this.isSearch) {
               this.isSearch = true
            }
@@ -141,6 +144,7 @@
                  this.gethistary()
                  res.data.records.forEach(item => {
                     item.minPrice = item.minPrice.toFixed(2).split('.')
                     item.shou = (item.saleNum || 0) + (item.realSaleNum || 0)
                  })
                  this.goodsList.push(...res.data.records)
                  this.page++