init
This commit is contained in:
44
components/base/app-button/index.js
Normal file
44
components/base/app-button/index.js
Normal file
@@ -0,0 +1,44 @@
|
||||
Component({
|
||||
options: {
|
||||
multipleSlots: true
|
||||
},
|
||||
properties: {
|
||||
text: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
theme: {
|
||||
type: String,
|
||||
value: 'primary'
|
||||
},
|
||||
variant: {
|
||||
type: String,
|
||||
value: 'base'
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
value: 'medium'
|
||||
},
|
||||
block: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
shape: {
|
||||
type: String,
|
||||
value: 'rectangle'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleTap(event) {
|
||||
this.triggerEvent('tap', event.detail)
|
||||
}
|
||||
}
|
||||
})
|
||||
6
components/base/app-button/index.json
Normal file
6
components/base/app-button/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-button": "tdesign-miniprogram/button/button"
|
||||
}
|
||||
}
|
||||
14
components/base/app-button/index.wxml
Normal file
14
components/base/app-button/index.wxml
Normal file
@@ -0,0 +1,14 @@
|
||||
<t-button
|
||||
class="app-button"
|
||||
theme="{{theme}}"
|
||||
variant="{{variant}}"
|
||||
size="{{size}}"
|
||||
block="{{block}}"
|
||||
disabled="{{disabled}}"
|
||||
loading="{{loading}}"
|
||||
shape="{{shape}}"
|
||||
bind:tap="handleTap"
|
||||
>
|
||||
<block wx:if="{{text}}">{{text}}</block>
|
||||
<slot></slot>
|
||||
</t-button>
|
||||
7
components/base/app-button/index.wxss
Normal file
7
components/base/app-button/index.wxss
Normal file
@@ -0,0 +1,7 @@
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.app-button {
|
||||
width: 100%;
|
||||
}
|
||||
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