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.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
<!-- 分类展示 : second - one 风格 -- >
< template >
< view >
<!-- 一级分类的名字 -- >
< view class = "title-box ss-flex ss-col-center ss-row-center ss-p-b-30" >
< view class = "title-line-left" / >
< view class = "title-text ss-p-x-20" > { { props . data [ activeMenu ] . name } } < / view >
< view class = "title-line-right" / >
< / view >
<!-- 二级分类的名字 -- >
< view class = "goods-item-box ss-flex ss-flex-wrap ss-p-b-20" >
< view
class = "goods-item"
v-for ="item in props.data[activeMenu].children"
:key="item.id"
@tap="
sheep.$router.go('/pages/goods/list', {
categoryId: item.id,
})
"
>
<image class="goods-img" :src="item.picUrl" mode="aspectFill" />
<view class="ss-p-10">
<view class="goods-title ss-line-1" > {{ item.name }} < / view >
< / view >
< / view >
< / view >
< / view >
< / template >
< script setup >
import sheep from '@/sheep' ;
const props = defineProps ( {
data : {
type : Object ,
default : ( ) => ( { } ) ,
} ,
activeMenu : [ Number , String ] ,
} ) ;
< / script >
< style lang = "scss" scoped >
. title - box {
. title - line - left ,
. title - line - right {
width : 15 px ;
height : 1 px ;
background : # d2d2d2 ;
}
}
. goods - item {
width : calc ( ( 100 % - 20 px ) / 3 ) ;
margin - right : 10 px ;
margin - bottom : 10 px ;
& : nth - of - type ( 3 n ) {
margin - right : 0 ;
}
. goods - img {
width : calc ( ( 100 vw - 140 px ) / 3 ) ;
height : calc ( ( 100 vw - 140 px ) / 3 ) ;
}
. goods - title {
font - size : 26 rpx ;
font - weight : bold ;
color : # 333333 ;
line - height : 40 rpx ;
text - align : center ;
}
. goods - price {
color : $red ;
line - height : 40 rpx ;
}
}
< / style >