| | |
| | | </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> |
| | |
| | | </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> |
| | |
| | | }) |
| | | }, |
| | | search() { |
| | | if (!this.goodsName) return; |
| | | if (!this.goodsName) { |
| | | this.goodsList = [] |
| | | return |
| | | }; |
| | | if (!this.isSearch) { |
| | | this.isSearch = true |
| | | } |
| | |
| | | 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++ |