|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<view class="goods-list">
|
|
<view class="goods-list">
|
|
<view class="goods-item" v-for="item in list" :key="item.id">
|
|
<view class="goods-item" v-for="item in list" :key="item.id">
|
|
- <view class="goods-imgs" @click="toDetail(item)">
|
|
|
|
|
|
+ <view class="goods-imgs" @tap="toDetail(item)">
|
|
<view v-if="item.inventoryQty == 0" class="goods-staus">已售罄</view>
|
|
<view v-if="item.inventoryQty == 0" class="goods-staus">已售罄</view>
|
|
<view v-if="item.delFlage == 0 || item.state == 0" class="goods-staus">已失效</view>
|
|
<view v-if="item.delFlage == 0 || item.state == 0" class="goods-staus">已失效</view>
|
|
<u-lazy-load
|
|
<u-lazy-load
|
|
@@ -12,13 +12,13 @@
|
|
:error-img="errorImg">
|
|
:error-img="errorImg">
|
|
</u-lazy-load>
|
|
</u-lazy-load>
|
|
</view>
|
|
</view>
|
|
- <view class="name ellipsis-two" @click="toDetail(item)">{{item.name}}</view>
|
|
|
|
|
|
+ <view class="name ellipsis-two" @tap="toDetail(item)">{{item.name}}</view>
|
|
<view class="price">
|
|
<view class="price">
|
|
<view>
|
|
<view>
|
|
<text>{{item.sellGold}}</text>
|
|
<text>{{item.sellGold}}</text>
|
|
<u-image mode="scaleToFill" width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
|
|
<u-image mode="scaleToFill" width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
|
|
</view>
|
|
</view>
|
|
- <view @click="addCart(item)" v-if="item.inventoryQty > 0">
|
|
|
|
|
|
+ <view @tap="addCart(item)" v-if="item.inventoryQty > 0">
|
|
<u-image mode="scaleToFill" width="45rpx" height="45rpx" src="/static/addCart.png"></u-image>
|
|
<u-image mode="scaleToFill" width="45rpx" height="45rpx" src="/static/addCart.png"></u-image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -50,13 +50,15 @@
|
|
errorImg: '/static/imgError.png',
|
|
errorImg: '/static/imgError.png',
|
|
timer: null,
|
|
timer: null,
|
|
finger: {x:0,y:0},
|
|
finger: {x:0,y:0},
|
|
- linePos: null
|
|
|
|
|
|
+ linePos: null,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 加入购物车
|
|
// 加入购物车
|
|
addCart(item) {
|
|
addCart(item) {
|
|
- uni.$emit("addCart",{goodsNo:item.goodsNo,buyQty:1})
|
|
|
|
|
|
+ this.$bindClick(function(){
|
|
|
|
+ uni.$emit("addCart",{goodsNo:item.goodsNo,buyQty:1})
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 商品详情
|
|
// 商品详情
|
|
toDetail(item){
|
|
toDetail(item){
|