diff --git a/src/app.config.ts b/src/app.config.ts index 74e3ad2..164f5af 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -1,5 +1,6 @@ export default defineAppConfig({ pages: [ + // "test_pages/index", //测试页 "home_pages/index", //中转页 "main_pages/index", // 主容器页面(合并三个tab) "login_pages/index/index", @@ -59,7 +60,7 @@ export default defineAppConfig({ "favorites/index", // 收藏页 "ntrp-evaluate/index", // NTRP评估页 ], - } + }, ], "preloadRule": { diff --git a/src/test_pages/1.md b/src/test_pages/1.md new file mode 100644 index 0000000..964311d --- /dev/null +++ b/src/test_pages/1.md @@ -0,0 +1,28 @@ +模板ID +TRw1earo9xJ2cyyMBTN4qIOdM6YDLw6VBYm89uZ8-uk +模板编号 +512 +标题 +签到提醒 +类目 +办公 +操作人 +m****Om 2025-07-11 添加 +详细内容 +活动名称 +{{thing1.DATA}} + +日期 +{{date4.DATA}} + +时间 +{{time5.DATA}} + +签到地点 +{{thing14.DATA}} + +温馨提示 +{{thing16.DATA}} + +场景说明 +球局演示 \ No newline at end of file diff --git a/src/test_pages/index.config.ts b/src/test_pages/index.config.ts new file mode 100644 index 0000000..0f9b16d --- /dev/null +++ b/src/test_pages/index.config.ts @@ -0,0 +1,6 @@ +export default definePageConfig({ + navigationBarTitleText: '测试页面', + enablePullDownRefresh: false, + backgroundTextStyle: 'dark', +}); + diff --git a/src/test_pages/index.scss b/src/test_pages/index.scss new file mode 100644 index 0000000..b98eccb --- /dev/null +++ b/src/test_pages/index.scss @@ -0,0 +1,23 @@ +.test_page { + width: 100%; + min-height: 100vh; + background-color: #fafafa; + padding: 40rpx; + + &__content { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding-top: 200rpx; + } + + &__button { + width: 400rpx; + height: 88rpx; + line-height: 88rpx; + border-radius: 44rpx; + font-size: 32rpx; + } +} + diff --git a/src/test_pages/index.tsx b/src/test_pages/index.tsx new file mode 100644 index 0000000..16a6f19 --- /dev/null +++ b/src/test_pages/index.tsx @@ -0,0 +1,53 @@ +import React from 'react'; +import { View, Button } from '@tarojs/components'; +import Taro from '@tarojs/taro'; +import './index.scss'; + +const TestPage: React.FC = () => { + // 请求订阅消息 + const handle_request_subscribe_message = () => { + Taro.requestSubscribeMessage({ + tmplIds: ['TRw1earo9xJ2cyyMBTN4qIOdM6YDLw6VBYm89uZ8-uk'], + success(res) { + console.log('授权结果:', res); + if (res['TRw1earo9xJ2cyyMBTN4qIOdM6YDLw6VBYm89uZ8-uk'] === 'accept') { + console.log('用户允许订阅'); + Taro.showToast({ + title: '订阅成功', + icon: 'success', + }); + } else if (res['TRw1earo9xJ2cyyMBTN4qIOdM6YDLw6VBYm89uZ8-uk'] === 'reject') { + console.log('用户拒绝订阅'); + Taro.showToast({ + title: '已取消订阅', + icon: 'none', + }); + } + }, + fail(err) { + console.error('订阅失败:', err); + Taro.showToast({ + title: '订阅失败', + icon: 'error', + }); + }, + }); + }; + + return ( + + + + + + ); +}; + +export default TestPage; +