You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

179 lines
4.1 KiB

<template>
<view class="themes-recommend">
<themes-chunk-title-two title="精选商品"></themes-chunk-title-two>
<block
class="themes-recommend__list"
v-for="(item, idx) in shopProduct"
:key="idx"
>
<view
class="themes-recommend__item"
@click="goto"
:data-url="item.pic ? '/pages/shop/product?id=' + item.proid : ''"
>
<view class="themes-recommend__item-tab" :style="'background: url(' + event_rul + '/static/images/img/tag-bg1.svg);background-size: contain;background-repeat:no-repeat;'">抢鲜价</view>
<view class="themes-recommend__item-hd">
<image
class="themes-recommend__item-img"
:src="item.pic"
mode="aspectFill"
></image>
</view>
<view class="themes-recommend__item-bd">
<view class="themes-recommend__item-title">{{ item.name }}</view>
<view class="themes-recommend__item-price">
<text class="themes-recommend__item-symbol">¥</text>
<text class="themes-recommend__item-num">{{ item.sell_price }}</text>
</view>
<view
class="themes-recommend__item-btn"
@click.stop="buydialogChange"
:data-proid="item.proid"
>立即抢购</view
>
</view>
</view>
</block>
<buydialog
v-if="buydialogShow"
:proid="proid"
@addcart="addcart"
@buydialogChange="buydialogChange"
:menuindex="menuindex"
></buydialog>
</view>
</template>
<script>
import themesChunkTitleTwo from './themes-chunk-title-two.vue'
var app = getApp();
export default {
components: {
themesChunkTitleTwo
},
props: {
shopProduct: {
type: Array,
default: function() {
return [];
},
},
menuindex: {
default: -1,
},
},
data() {
return {
buydialogShow: false,
proid: 14,
event_rul: app.globalData.event_url,
};
},
mounted() {
// console.log(this.shopProduct)
},
methods: {
buydialogChange(e) {
if (!this.buydialogShow) {
this.proid = e.currentTarget.dataset.proid;
}
this.buydialogShow = !this.buydialogShow;
},
addcart: function () {
this.$emit("addcart");
},
},
};
</script>
<style lang="scss" scoped>
.themes-recommend {
&__list {
border-radius: 10rpx;
overflow: hidden;
&:not(last-child) {
margin-top: 28rpx;
}
}
&__item {
display: flex;
position: relative;
height: 296rpx;
margin-top: 6rpx;
background: #ffffff;
box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(0, 0, 0, 0.03);
border-radius: 10rpx;
padding: 40rpx 28rpx 0 30rpx;
overflow: hidden;
&-tab {
position: absolute;
top: 24rpx;
left: 0;
width: 128rpx;
height: 34rpx;
font-size: 24rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 26rpx;
padding: 4rpx 10rpx;
z-index: 1;
}
&-hd {
width: 242rpx;
height: 242rpx;
flex-shrink: 0;
}
&-img {
width: 100%;
height: 100%;
}
&-bd {
flex: 1;
padding: 0 0 40rpx 36rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
&-title {
font-size: 26rpx;
font-weight: 500;
color: #333333;
line-height: 36rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
/* autoprefixer: ignore next */
-webkit-box-orient: vertical;
text-align: justify;
white-space: pre-wrap;
word-break: break-all;
}
&-price {
font-size: 36rpx;
font-weight: 500;
color: #FF6400;
line-height: 50rpx;
}
&-symbol {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 6rpx;
}
&-btn {
position: absolute;
bottom: 28rpx;
right: 28rpx;
background: linear-gradient(to right, #269DD1 0%, #5487D7 100%);
font-size: 24rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 50rpx;
border-radius: 25rpx;
padding: 0 22rpx;
}
}
}
</style>