[更新发现模块]

This commit is contained in:
zhangmanman
2022-01-11 11:25:41 +08:00
parent 6d4971bc5e
commit 906745fc14
33 changed files with 1806 additions and 76 deletions

View File

View File

@@ -0,0 +1,115 @@
<template>
<view>
<view class="menu--item" v-for="(item, index) in lists" :key="index" @click="$emit('onMenu', item)" :style="btnStyle">
<view class="menu--block">
<view class="menu--number" v-if="isNumber">
{{ index + 1 }}
</view>
<image class="menu--picture" :src="item.cover ? item.cover : '/static/find/default_img.png'" mode="aspectFill"></image>
</view>
<view class="menu--label">
<view class="nowrap menu--name">
{{ item.name }}
</view>
<view class="nowrap menu--text">
{{ isType ? item.weight + '克' : item.sub_title }}
</view>
</view>
</view>
</view>
</template>
<script>
export default{
props:{
lists: {
type : Array,
required: true,
default : () => {
return []
}
},
// 列表底部距离
btnStyle: {
type : Object,
default : () => {
return {}
}
},
// 是否显示排行数字
isNumber: {
type: Boolean,
default: false
},
// 是否是详情
isType: {
type: Boolean,
default: false
}
},
mounted() {
}
}
</script>
<style lang="scss" scoped>
.menu--item {
background-color: white;
border-radius: $radius;
position: relative;
display: flex;
margin-bottom: $margin - 10;
&:last-child {
margin-bottom: 0;
}
.menu--block {
position: relative;
width: 110rpx;
height: 110rpx;
border-radius: $radius;
overflow: hidden;
.menu--number {
top: 0;
left: 0;
position: absolute;
z-index: 9;
font-size: $title-size-sm;
padding: 0 $padding - 20;
background-color: $text-gray-m;
border-radius: $radius 0 $radius 0;
color: #FFFFFF;
}
.menu--picture {
z-index: 1;
top: 0;
left: 0;
position: absolute;
width: 100%;
height: 100%;
}
}
&:nth-child(1) .menu--number,
&:nth-child(2) .menu--number,
&:nth-child(3) .menu--number{
background-color: $text-price;
}
.menu--label {
width: calc(100% - 140rpx);
margin: 10rpx 0 0 30rpx;
&:last-child {
margin-bottom: 0!important;
}
.menu--name {
font-size: $title-size-lg;
margin-bottom: $margin - 20;
font-weight: bold;
color: $text-color;
}
.menu--text {
color: $text-gray;
font-size: $title-size-m;
}
}
}
</style>

View File

@@ -0,0 +1,80 @@
{
"id": "oct-menu",
"displayName": "oct-menu",
"version": "1.0.0",
"description": "oct-menu",
"keywords": [
"oct-menu"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

View File

@@ -0,0 +1 @@
# oct-menu