金诚优选前端代码
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.
 
 
 
 
 

111 lines
2.0 KiB

<template>
<view class="content">
<view class="title" v-if="showTitle" @click="$url('/pages/index/category/category')">{{ title }}</view>
<view class="flex-box">
<view class="item" v-for="(item, index) in list" :key="index"
@click="$url('/pages/shop/shopdetail?id='+ item.associate.id)">
<image class="bg-img" :src="item.image"></image>
<view class="shop">
<image :src="item.associate.logo"></image>
<view class="lf-line-1">{{ item.associate.name }}</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
list: {
type: Array,
default: []
},
showTitle: {
type: [Number, Boolean],
default: 1
},
title: {
type: String,
default: '大牌不停推'
}
},
data(){
return {
}
},
created(){
},
methods: {
}
}
</script>
<style lang="scss" scoped="scoped">
.content{
width: 750rpx;
height: max-content;
box-sizing: border-box;
padding: 60rpx 32rpx 0;
.title{
font-size: 36rpx;
font-weight: bold;
text-align: center;
color: #222222;
margin-bottom: 30rpx;
}
.flex-box{
display: flex;
flex-wrap: wrap;
.item{
width: 165rpx;
height: 165rpx;
border: 1rpx solid #979797;
margin-right: 9rpx;
position: relative;
overflow: hidden;
border-radius: 5rpx;
&:nth-child(4n){
margin-right: 0rpx;
}
&:nth-child(n+5){
margin-top: 8rpx;
}
.bg-img{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.shop{
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.1);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
z-index: 2;
&>image{
width: 70rpx;
height: 70rpx;
border-radius: 50%;
background-color: #FFFFFF;
}
&>view{
font-size: 24rpx;
color: #FFFFFF;
margin-top: 4rpx;
width: 100%;
text-align: center;
}
}
}
}
}
</style>