添加组件

This commit is contained in:
zhengw
2026-01-08 17:13:44 +08:00
parent 55523a761f
commit 8a3d3ac60e
16 changed files with 51 additions and 12 deletions

View File

@@ -13,7 +13,8 @@
"componentFramework": "glass-easel", "componentFramework": "glass-easel",
"lazyCodeLoading": "requiredComponents", "lazyCodeLoading": "requiredComponents",
"usingComponents": { "usingComponents": {
"page-plugin": "pages/components/page-plugin", "page-plugin": "pages/components/page-plugin/page-plugin",
"no-auth-plugin": "pages/components/no-auth-plugin/no-auth-plugin",
"t-button": "tdesign-miniprogram/button/button" "t-button": "tdesign-miniprogram/button/button"
}, },
"tabBar": { "tabBar": {
@@ -44,4 +45,4 @@
"resolveAlias": { "resolveAlias": {
"@/*": "/*" "@/*": "/*"
} }
} }

View File

@@ -0,0 +1,22 @@
Component({
/**
* 组件的属性列表
*/
properties: {},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
navIndex: function () {
wx.switchTab({
url: "/pages/index/index",
});
},
},
});

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"t-empty": "tdesign-miniprogram/empty/empty"
}
}

View File

@@ -0,0 +1,10 @@
<view style="min-height: 95vh;display: flex;justify-content: center;flex-direction: column;">
<t-empty icon="info-circle-filled">
<view slot="description" style="color: #000;">
<view>抱歉!您当前没有权限访问该页面</view>
<view>如果您是主账号,请购买相应的增值包</view>
<view>如果您是子账号,请联系管理员进行相应的授权</view>
</view>
<t-button theme="primary" slot="action" bind:tap="navIndex">前往首页</t-button>
</t-empty>
</view>

View File

@@ -1 +0,0 @@
/* components/page-plugin/index.wxss */

View File

@@ -2,7 +2,7 @@
<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);{{style ||''}}">
<slot></slot> <slot></slot>
</view> </view>
<no_auth_plugin wx:else /> <no-auth-plugin wx:else />
</block> </block>
<block wx:else> <block wx:else>
<!-- <loading_plugin wx:if="{{loading}}" /> --> <!-- <loading_plugin wx:if="{{loading}}" /> -->
@@ -34,4 +34,4 @@
《{{appletName}}隐私权政策》</t-link> 《{{appletName}}隐私权政策》</t-link>
</view> </view>
</block> </block>

View File

@@ -0,0 +1 @@

View File

@@ -1,4 +1,3 @@
// pages/components/popup-plugin/index.ts
Component({ Component({
/** /**
* *

View File

@@ -5,4 +5,4 @@
<view style="max-height: 70vh;overflow: auto;"> <view style="max-height: 70vh;overflow: auto;">
<slot></slot> <slot></slot>
</view> </view>
</t-popup> </t-popup>

View File

@@ -0,0 +1 @@

View File

@@ -4,6 +4,6 @@
"t-input": "tdesign-miniprogram/input/input", "t-input": "tdesign-miniprogram/input/input",
"t-checkbox": "tdesign-miniprogram/checkbox/checkbox", "t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
"t-icon": "tdesign-miniprogram/icon/icon", "t-icon": "tdesign-miniprogram/icon/icon",
"popup-plugin": "/pages/components/popup-plugin/index" "popup-plugin": "/pages/components/popup-plugin/popup-plugin"
} }
} }

View File

@@ -63,7 +63,7 @@
{{item.msg}} {{item.msg}}
</view> </view>
</view> </view>
<popup-plugin visible="{{ show }}" round bind:close="onClose" title="订单流程完成"> <popup-plugin visible="{{ show }}" bind:close="onClose" title="订单流程完成">
<!-- <view wx:for="{{orders}}" wx:key="rel_order_no" <!-- <view wx:for="{{orders}}" wx:key="rel_order_no"
style="border: 1rpx solid #ddd;border-radius: 4px;display: flex;flex-direction: column;margin-bottom: 12px;"> style="border: 1rpx solid #ddd;border-radius: 4px;display: flex;flex-direction: column;margin-bottom: 12px;">
<view style="padding: 8px;"> <view style="padding: 8px;">
@@ -98,7 +98,7 @@
<view wx:for="{{defaultBonusConfig[key]}}" class="tr" wx:key="key"> <view wx:for="{{defaultBonusConfig[key]}}" class="tr" wx:key="key">
<view class="td">{{item.key}}</view> <view class="td">{{item.key}}</view>
<view class="td">{{item.bonus_code}}</view> <view class="td">{{item.bonus_code}}</view>
<view class="td"> <view class="td">
<t-button size="small" type="primary" data-order_no="{{key}}" data-key="{{item.bonus_code}}" <t-button size="small" type="primary" data-order_no="{{key}}" data-key="{{item.bonus_code}}"
bind:tap="onSelectBonus">选择</t-button> bind:tap="onSelectBonus">选择</t-button>
@@ -108,4 +108,4 @@
</view> </view>
</popup-plugin> --> </popup-plugin> -->
</view> </view>
</page-plugin> </page-plugin>