feat(components): 新增分页、选择器和标签栏组件并优化插件页面
- 添加 pagination-plugin 组件,包含完整的分页功能和页面跳转选择 - 添加 select-plugin 组件,支持单选和多选模式的选择弹窗 - 添加 tab-bar-plugin 组件,提供底部导航栏功能 - 在 page-plugin 中集成 t-loading 组件替换原有的加载逻辑 - 移除页面中的登录状态监听逻辑和相关订阅功能 - 修改页面样式传递方式,将 style 属性改为 customStyle - 更新组件依赖配置文件,添加新的组件引用
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
"usingComponents": {
|
||||
"t-button": "tdesign-miniprogram/button/button",
|
||||
"t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
|
||||
"t-divider": "tdesign-miniprogram/divider/divider",
|
||||
"t-link": "tdesign-miniprogram/link/link"
|
||||
"t-link": "tdesign-miniprogram/link/link",
|
||||
"t-loading": "tdesign-miniprogram/loading/loading",
|
||||
"no-auth-plugin": "/pages/components/no-auth-plugin/no-auth-plugin"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { base, defaultAvatarUrl } from "@/utils/config";
|
||||
import { Subscribe } from "@/utils/subscribe";
|
||||
import { getCurrentPageRoute, getStorage, setStorage } from "@/utils/util";
|
||||
import { setStorage } from "@/utils/util";
|
||||
// import { IStorage } from "@/utils/storage";
|
||||
|
||||
// const app = getApp();
|
||||
@@ -12,22 +12,22 @@ Component({
|
||||
isLogin: Boolean,
|
||||
loading: Boolean,
|
||||
isAuth: null,
|
||||
style: null,
|
||||
customStyle: null,
|
||||
},
|
||||
|
||||
attached() {
|
||||
this.setData({ isLogin: getStorage("isLogin") == 1 });
|
||||
// attached() {
|
||||
// this.setData({ isLogin: getStorage("isLogin") == 1 });
|
||||
|
||||
console.log("attached");
|
||||
Subscribe.on("isLogin", getCurrentPageRoute(), () => {
|
||||
this.setData({ isLogin: getStorage("isLogin") == 1 });
|
||||
console.log("监听到 isLogin 变化:");
|
||||
});
|
||||
},
|
||||
detached() {
|
||||
console.log("detached");
|
||||
Subscribe.off("isLogin", getCurrentPageRoute());
|
||||
},
|
||||
// console.log("attached");
|
||||
// Subscribe.on("isLogin", getCurrentPageRoute(), () => {
|
||||
// this.setData({ isLogin: getStorage("isLogin") == 1 });
|
||||
// console.log("监听到 isLogin 变化:");
|
||||
// });
|
||||
// },
|
||||
// detached() {
|
||||
// console.log("detached");
|
||||
// Subscribe.off("isLogin", getCurrentPageRoute());
|
||||
// },
|
||||
|
||||
data: {
|
||||
avatarUrl: defaultAvatarUrl,
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<block wx:if="{{isLogin}}">
|
||||
<view wx:if="{{!isAuth}}" style="padding: 12px;padding-bottom: env(safe-area-inset-bottom);{{style ||''}}">
|
||||
<view wx:if="{{isAuth}}" style="padding: 12px;padding-bottom: env(safe-area-inset-bottom);{{customStyle ||''}}">
|
||||
<slot></slot>
|
||||
</view>
|
||||
<no-auth-plugin wx:else />
|
||||
</block>
|
||||
<block wx:else>
|
||||
<!-- <loading_plugin wx:if="{{loading}}" /> -->
|
||||
<view style="padding: 0 16px;height: 100vh;justify-content: center;display: flex;flex-direction: column;">
|
||||
<t-loading wx:if="{{loading}}" theme="spinner" fullscreen text="加载中..." layout="vertical" />
|
||||
<view wx:else style="padding: 0 16px;height: 100vh;justify-content: center;display: flex;flex-direction: column;">
|
||||
<view style="display: flex;justify-content: center;">
|
||||
<view style="width: 80px;height: 80px;overflow: hidden;border-radius: 80px;">
|
||||
<image style="width: 100%;height: 100%;object-fit: cover;" src="{{avatarUrl}}" mode="cover"></image>
|
||||
<image style="width: 100%;height: 100%;object-fit: cover;" src="{{avatarUrl}}" mode="cover" />
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding: 20px 0">
|
||||
@@ -27,11 +27,12 @@
|
||||
<t-checkbox borderless style="padding: 0;margin: 1em 0;" value="{{isAgree}}" bind:change="changeAgreementCheck">
|
||||
我已阅读并同意
|
||||
</t-checkbox>
|
||||
<!-- <t-divider /> -->
|
||||
<t-link theme="primary" bindtap="navAgreement" data-type="user" style="margin-bottom: 8px;">
|
||||
《{{appletName}}平台用户服务协议》</t-link>
|
||||
《{{appletName}}平台用户服务协议》
|
||||
</t-link>
|
||||
<t-link theme="primary" bindtap="navAgreement" data-type="privacy" style="margin-bottom: 8px;">
|
||||
《{{appletName}}隐私权政策》</t-link>
|
||||
|
||||
《{{appletName}}隐私权政策》
|
||||
</t-link>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user