添加图标和组件

This commit is contained in:
zhengw
2026-01-29 11:46:28 +08:00
parent 8960c8ea73
commit df67413bf8
9 changed files with 66 additions and 2 deletions

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg viewBox="0 0 1030 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="64.375" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M217.088 289.28c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6l357.888-1.536c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6l-357.888 1.536zM217.6 454.144c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6l357.888-1.536c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6l-357.888 1.536zM579.584 1006.592c-14.336 0-25.6-11.264-25.6-25.6l-1.536-295.936c0-14.336 11.264-25.6 25.6-25.6l379.392-1.536c6.656 0 13.312 2.56 17.92 7.168 4.608 4.608 7.68 11.264 7.68 17.92l1.536 295.936c0 14.336-11.264 25.6-25.6 25.6l-379.392 2.048c0.512 0 0.512 0 0 0z m24.576-295.936l1.024 244.736 328.192-1.536-1.024-244.736-328.192 1.536z" fill="#13227a"></path><path d="M578.56 710.656c-9.216 0-17.408-4.608-22.016-12.288-4.608-7.68-5.12-17.408-0.512-25.088l56.832-105.472c4.608-8.192 12.8-13.312 22.528-13.312l260.096-1.024c9.216 0 17.408 4.608 22.016 12.288l62.464 104.96c4.608 7.68 4.608 17.92 0.512 25.6-4.608 8.192-12.8 12.8-22.016 12.8l-379.904 1.536z m72.192-105.472l-29.184 54.272 291.84-1.536-32.256-54.272-230.4 1.536zM226.816 719.36c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6l181.76-1.024c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6l-181.76 1.024z" fill="#13227a"></path><path d="M380.416 787.968c-6.656 0-13.312-2.56-17.92-7.68-10.24-10.24-10.24-26.112 0-36.352l51.2-51.2-51.712-51.2c-10.24-9.728-10.24-26.112 0-36.352 9.728-10.24 26.112-10.24 36.352 0l70.144 69.12c4.608 4.608 7.68 11.264 7.68 17.92s-2.56 13.312-7.68 17.92L399.36 779.776c-5.632 5.632-12.288 8.192-18.944 8.192z" fill="#13227a"></path><path d="M45.568 1007.104c-6.656 0-13.312-2.56-17.92-7.168-4.608-4.608-7.68-11.264-7.68-17.92L15.872 37.888c0-6.656 2.56-13.312 7.168-17.92S34.304 12.288 40.96 12.288l733.696-3.072c6.656 0 13.312 2.56 17.92 7.168 4.608 4.608 7.68 11.264 7.68 17.92l1.024 276.992c0 14.336-11.264 25.6-25.6 25.6s-25.6-11.264-25.6-25.6l-1.024-251.392-681.984 3.584 4.096 892.416 253.44-1.024c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6l-279.04 1.024z" fill="#13227a"></path></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="64" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M861 62.16H159a64.19 64.19 0 0 0-64 64v767.68a64.19 64.19 0 0 0 64 64h702a64.19 64.19 0 0 0 64-64V126.16a64.19 64.19 0 0 0-64-64z m0 831.58l-0.11 0.11H159.12l-0.11-0.11V126.27l0.11-0.11h701.76l0.11 0.11z" fill="#0052d9"></path><path d="M317.06 286.24h383.27a32 32 0 0 0 0-64H317.06a32 32 0 1 0 0 64zM317.06 414.08h383.27a32 32 0 0 0 0-64H317.06a32 32 0 0 0 0 64zM445.09 479.29h-128a32 32 0 0 0 0 64h128a32 32 0 1 0 0-64zM785.11 739.4v-36.92h-98v-21.06h-25.24l27.3-9.88c-2.08-12.48-9.88-30.16-18.2-43.68l-34.32 12c6.76 13 13 29.64 15.34 41.6h-5.2v21.06h-95.93v36.88h67.86c-20.8 19.5-48.88 36.66-77.22 47.32 9.1 8.32 21.84 24.18 28.34 34.32 28.08-13.52 54.86-33.54 77-57.2v62.66h40.3v-64.22c22.36 23.92 49.66 44.46 77.74 57.72 6.5-10.4 19.24-26.26 28.34-34.32-27.87-10.68-56.22-27.3-77.53-46.28z" fill="#0052d9"></path><path d="M562.81 633.32c69.16-1.82 149.24-7.54 214-18.46l-29.9-34.58c-49.92 8.84-125.06 15.08-193.44 17.16 3.63 8.85 8.53 25.49 9.34 35.88zM733.89 699.88c12.22-15.6 27.56-39.26 40.82-62.14l-39-14.82c-7.8 20.54-21.84 46.54-33.54 63.18zM591.41 697.8L626 683c-3.9-13.52-14.56-32.24-25.22-46.28l-32 13.52c10.15 14.76 19.78 34.56 22.63 47.56z" fill="#0052d9"></path></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -2,6 +2,7 @@
<view slot="note" style="display: flex;align-items: center;column-gap: 12rpx;"> <view slot="note" style="display: flex;align-items: center;column-gap: 12rpx;">
<view>{{value || ''}}</view> <view>{{value || ''}}</view>
<t-icon wx:if="{{value}}" name="close-circle-filled" catch:tap="onClear"></t-icon> <t-icon wx:if="{{value}}" name="close-circle-filled" catch:tap="onClear"></t-icon>
<text wx:else>{{placeholder || title || '选择日期'}}</text>
</view> </view>
</t-cell> </t-cell>
<!-- 年月日时分 --> <!-- 年月日时分 -->

View File

@@ -0,0 +1,10 @@
{
"component": true,
"usingComponents": {
"t-cell": "tdesign-miniprogram/cell/cell",
"t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
"t-checkbox-group": "tdesign-miniprogram/checkbox-group/checkbox-group",
"t-radio": "tdesign-miniprogram/radio/radio",
"t-radio-group": "tdesign-miniprogram/radio-group/radio-group"
}
}

View File

@@ -0,0 +1,26 @@
Component({
options: { multipleSlots: true },
/**
* 组件的属性列表
*/
properties: {
title: null,
mode: null,
options: null,
value: null,
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
onOptionsChange(e: any) {
this.triggerEvent('change', e.detail);
},
},
});

View File

@@ -0,0 +1,21 @@
<!-- 选项组件 -->
<t-cell title="{{title || ''}}">
<t-checkbox-group wx:if="{{mode == 'checkbox'}}" slot="note" bind:change="onOptionsChange"
value="{{value||[]}}">
<block wx:for="{{options}}" wx:key="index">
<t-checkbox icon="rectangle" borderless="{{true}}" block="{{false}}" value="{{item.value}}"
style="margin-right: 16rpx;">
{{item.label}}
</t-checkbox>
</block>
</t-checkbox-group>
<t-radio-group wx:elif="{{mode == 'radio'}}" slot="note" bind:change="onOptionsChange"
value="{{value}}">
<block wx:for="{{options}}" wx:key="index">
<t-radio borderless="{{true}}" block="{{false}}" value="{{item.value}}"
style="margin-right: 16rpx;">
{{item.label}}
</t-radio>
</block>
</t-radio-group>
</t-cell>

View File

@@ -3,7 +3,10 @@ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { label: null }, properties: {
label: null,
placeholder: null,
},
/** /**
* 组件的初始数据 * 组件的初始数据

View File

@@ -1 +1,2 @@
<t-input label="{{label}}" bind:change="onChange" bind:clear="onClear" clearable /> <t-input label="{{label||''}}" placeholder="{{placeholder || label || '' }}" bind:change="onChange"
bind:clear="onClear" clearable />