init
This commit is contained in:
31
components/biz/entry-card/index.js
Normal file
31
components/biz/entry-card/index.js
Normal file
@@ -0,0 +1,31 @@
|
||||
Component({
|
||||
properties: {
|
||||
title: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
badge: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
actionText: {
|
||||
type: String,
|
||||
value: '进入'
|
||||
},
|
||||
actionPath: {
|
||||
type: String,
|
||||
value: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleAction() {
|
||||
this.triggerEvent('action', {
|
||||
path: this.properties.actionPath
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
7
components/biz/entry-card/index.json
Normal file
7
components/biz/entry-card/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"app-button": "../../base/app-button/index",
|
||||
"t-tag": "tdesign-miniprogram/tag/tag"
|
||||
}
|
||||
}
|
||||
14
components/biz/entry-card/index.wxml
Normal file
14
components/biz/entry-card/index.wxml
Normal file
@@ -0,0 +1,14 @@
|
||||
<view class="entry-card panel">
|
||||
<view class="entry-card__head">
|
||||
<view class="entry-card__copy">
|
||||
<text class="entry-card__title">{{title}}</text>
|
||||
<text class="entry-card__description">{{description}}</text>
|
||||
</view>
|
||||
<t-tag wx:if="{{badge}}" theme="primary" variant="light">{{badge}}</t-tag>
|
||||
</view>
|
||||
|
||||
<view class="entry-card__footer">
|
||||
<slot></slot>
|
||||
<app-button text="{{actionText}}" variant="outline" bind:tap="handleAction"></app-button>
|
||||
</view>
|
||||
</view>
|
||||
38
components/biz/entry-card/index.wxss
Normal file
38
components/biz/entry-card/index.wxss
Normal file
@@ -0,0 +1,38 @@
|
||||
.entry-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 24rpx;
|
||||
padding: 28rpx;
|
||||
}
|
||||
|
||||
.entry-card__head {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.entry-card__copy {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.entry-card__title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.entry-card__description {
|
||||
font-size: 24rpx;
|
||||
line-height: 1.7;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.entry-card__footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user