feat(components): 新增分页、选择器和标签栏组件并优化插件页面

- 添加 pagination-plugin 组件,包含完整的分页功能和页面跳转选择
- 添加 select-plugin 组件,支持单选和多选模式的选择弹窗
- 添加 tab-bar-plugin 组件,提供底部导航栏功能
- 在 page-plugin 中集成 t-loading 组件替换原有的加载逻辑
- 移除页面中的登录状态监听逻辑和相关订阅功能
- 修改页面样式传递方式,将 style 属性改为 customStyle
- 更新组件依赖配置文件,添加新的组件引用
This commit is contained in:
zhengw
2026-01-12 16:29:53 +08:00
parent f0c68126dc
commit 0d58fc80f4
15 changed files with 365 additions and 25 deletions

View File

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

View File

@@ -0,0 +1,64 @@
Component({
options: { multipleSlots: true },
/**
* 组件的属性列表
*/
properties: {
mode: {
type: String,
value: "single",
},
title: {
type: String,
value: "请选择",
},
options: {
type: Array,
value: [],
},
value: {
type: null,
value: [],
},
},
observers: {
"value,mode": function (v, m) {
if (m == "multiple") {
this.setData({ val: Array.isArray(v) ? [...v] : [] });
} else {
this.setData({ val: v });
}
},
},
/**
* 组件的初始数据
*/
data: {
visible: false,
val: [] as any[] | string | number,
},
/**
* 组件的方法列表
*/
methods: {
click() {
this.setData({ visible: true });
},
close() {
this.setData({ visible: false });
},
radioChange(e: any) {
this.setData({ val: e.detail.value });
},
checkboxChange(e: any) {
this.setData({ val: e.detail.value });
},
ok() {
this.setData({ visible: false });
this.triggerEvent("change", { value: this.data.val });
},
},
});

View File

@@ -0,0 +1,30 @@
<view style="display: contents" bindtap="click">
<slot/>
</view>
<popup-plugin visible="{{visible}}" bind:close="close" title="{{title}}">
<view>
<t-radio-group
wx:if="{{mode == 'single'}}"
bind:change="radioChange"
allow-uncheck
value="{{val}}"
options="{{options}}"
/>
<t-checkbox-group wx:else value="{{val}}" bind:change="checkboxChange">
<t-checkbox
wx:for="{{options}}"
icon="rectangle"
wx:key="index"
value="{{item.value}}"
>{{item.label}}
</t-checkbox>
</t-checkbox-group>
</view>
<view class="footer">
<t-button size="small" theme="primary" bindtap="ok">确定</t-button>
</view>
</popup-plugin>

View File

@@ -0,0 +1,10 @@
.footer {
display: flex;
align-items: center;
justify-content: center;
position: sticky;
bottom: 0;
background: #fff;
z-index: 1;
padding-top: 12px;
}