6
0
Fork 0
jiqu-library-miniprogram/src/components/goods-item/goods-item.vue

63 lines
1.9 KiB
Vue

<template>
<view class="rounded-xs box-show" @tap.stop="$u.route('/pages/product_details/index', { skuId: goods.id,showShrough:showShrough })">
<!-- <u-image width="100%" height="345rpx" :src="goods.cover" :lazy-load="true"></u-image> -->
<cu-image :borderTopLeftRadius="24" :borderTopRightRadius="24" width="100%" height="345rpx" :src="`${goods.cover}?x-oss-process=image/resize,h_375,m_lfit`" :lazy-load="true"></cu-image>
<view class="px-base">
<view class="text-txBase line-2 mt-10rpx">{{ goods.name }}</view>
<view class="text-md text-txBase flex items-center justify-between">
<view>{{ goods.sell_price }}</view>
<block v-if="showShrough">
<view v-if="goods['market_price']!=undefined && goods.market_price" class="fontFam line-through text-txGray text-20rpx">¥{{goods.market_price}}</view>
</block>
</view>
<view class="flex items-center justify-between">
<view class="flex items-center">
<view class="text-lg -mt-5rpx text-txSvip">¥{{ goods.vip_price }}</view>
<image class="w-58rpx h-58rpx ml-10rpx" src="/static/svg/svip.svg" mode=""></image>
</view>
<!-- 收藏按钮 -->
<view v-if="isCollection">
<u-icon size="36" color="#f0ad4e" name="star-fill"></u-icon>
</view>
</view>
</view>
</view>
</template>
<script>
//obj[key]==undefined
export default {
props: {
//是否显示收藏
isCollection: {
type: Boolean,
default: false,
},
//数据
goods: {
type: Object,
default: () => {},
},
//是否显示店铺直通车才显示删除的市场价格
showShrough:{
type:Boolean,
default:false
}
},
data() {
return {};
},
methods: {},
};
</script>
<style lang="scss" scoped>
.box-show {
box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.12);
}
.fontFam{
/* #ifdef APP-PLUS */
font-family: "宋体";
/* #endif */
}
</style>