1
This commit is contained in:
@ -1,26 +1,30 @@
|
||||
<template>
|
||||
<view class="goods-item" @click.stop="jumpToDetails">
|
||||
<view class="goods-item" >
|
||||
<image class="goods-img" :src="data.product_pic" mode="aspectFill" />
|
||||
<view class=" fs-24 app-fc-main goods-name">
|
||||
{{ data.product_name || "" }}
|
||||
</view>
|
||||
<view class="flex-row-start label">
|
||||
<!-- <view class="flex-row-start label">
|
||||
<image class="hot-icon" :src="`${imgPrefix}mall-hot.png`"></image>
|
||||
<view class="fs-20 app-fc-main label-name">{{data.sales}}人买过</view>
|
||||
</view>
|
||||
<view class="flex-row-start" style="margin-top: 12rpx;">
|
||||
<text class="fs-28" style="color: #3D3D3D;">
|
||||
¥
|
||||
<text class="fs-28">{{
|
||||
data.prices[0].actual_price || 0
|
||||
}}</text>
|
||||
</text>
|
||||
<!-- <text class="fs-24 origin-price">
|
||||
¥{{ minPrice.price_shichang || 0 }}
|
||||
</text> -->
|
||||
</view> -->
|
||||
<view class="flex-row-between" style="margin-top: 12rpx; align-items: baseline;">
|
||||
<view class="price-wrapper">
|
||||
<text class="fs-28" style="color: #3D3D3D;">
|
||||
¥
|
||||
<text class="fs-28">{{
|
||||
data.prices[0].actual_price || 0
|
||||
}}</text>
|
||||
</text>
|
||||
<!-- <text class="fs-24 origin-price">
|
||||
¥{{ minPrice.price_shichang || 0 }}
|
||||
</text> -->
|
||||
</view>
|
||||
<view class="buy-now-btn" @click.stop="handleBuyNow">
|
||||
立即购买
|
||||
</view>
|
||||
</view>
|
||||
<!-- <text class="fs-20 good-salenum">已售{{ data.xiaoliang || 0 }}</text> -->
|
||||
<!-- <image class="add-cart-icon" src="@/static/images/cart-icon.png" @click.stop="$emit('addToCar', data)" /> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -46,29 +50,20 @@
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// minPrice() {
|
||||
// let minPrice = {};
|
||||
// let minPriceValue = 0;
|
||||
// this.data.price_list.map((v) => {
|
||||
// if (!minPriceValue || minPriceValue > +v.price) {
|
||||
// minPriceValue = +v.price;
|
||||
// minPrice = {
|
||||
// ...v
|
||||
// };
|
||||
// }
|
||||
// });
|
||||
// return minPrice;
|
||||
// },
|
||||
labelList() {
|
||||
return (this.data?.label || "").split(",").filter((v) => !!v);
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
jumpToDetails() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/client/shop/details?product_id=${this.data.product_id}`,
|
||||
});
|
||||
// jumpToDetails() {
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/client/shop/details?product_id=${this.data.product_id}`,
|
||||
// });
|
||||
// },
|
||||
handleBuyNow() {
|
||||
// 触发购买事件,通知父组件
|
||||
this.$emit('addToCar', this.data);
|
||||
},
|
||||
},
|
||||
};
|
||||
@ -153,6 +148,26 @@
|
||||
right: 20rpx;
|
||||
}
|
||||
|
||||
.flex-row-between {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.price-wrapper {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.buy-now-btn {
|
||||
background: #FF19A0;
|
||||
color: #fff;
|
||||
font-size: 20rpx;
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius:30rpx;
|
||||
font-weight: 500;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user