diff --git a/src/app.config.ts b/src/app.config.ts index e219154..4726a01 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -55,6 +55,7 @@ export default defineAppConfig({ "new_follow/index", // 新增关注 "favorites/index", // 收藏页 "ntrp-evaluate/index", // NTRP评估页 + "enable_notification/index", // 开启消息通知 ], }, ], diff --git a/src/components/SubscribeNotificationTip/index.scss b/src/components/SubscribeNotificationTip/index.scss new file mode 100644 index 0000000..48cc498 --- /dev/null +++ b/src/components/SubscribeNotificationTip/index.scss @@ -0,0 +1,51 @@ +.subscribe_notification_tip { + margin: 0 12px; + padding: 12px 16px; + background: rgba(14, 238, 193, 0.04); + border: 0.5px solid rgba(0, 0, 0, 0.08); + border-radius: 12px; + box-shadow: 0px 4px 36px 0px rgba(0, 0, 0, 0.06); + opacity: 0.8; + cursor: pointer; + transition: all 0.2s; + + &:active { + transform: scale(0.98); + opacity: 0.95; + } + + &__content { + display: flex; + justify-content: space-between; + align-items: center; + height: 20px; + } + + &__title { + font-family: 'PingFang SC'; + font-weight: 600; + font-size: 15px; + line-height: 1.33; + color: #000000; + } + + &__action { + display: flex; + align-items: center; + gap: 4px; + } + + &__action_text { + font-family: 'PingFang SC'; + font-weight: 400; + font-size: 12px; + line-height: 1.4; + color: rgba(0, 0, 0, 0.25); + } + + &__arrow { + width: 16px; + height: 16px; + } +} + diff --git a/src/components/SubscribeNotificationTip/index.tsx b/src/components/SubscribeNotificationTip/index.tsx new file mode 100644 index 0000000..ea36889 --- /dev/null +++ b/src/components/SubscribeNotificationTip/index.tsx @@ -0,0 +1,41 @@ +import React from 'react'; +import { View, Text, Image } from '@tarojs/components'; +import { navigateTo } from '@/utils/navigation'; +import './index.scss'; + +interface SubscribeNotificationTipProps { + // 自定义样式类名 + className?: string; +} + +const SubscribeNotificationTip: React.FC = ({ + className = '', +}) => { + // 处理点击跳转 + const handle_click = () => { + navigateTo({ + url: '/other_pages/enable_notification/index', + }).catch((err) => { + console.error('跳转失败:', err); + }); + }; + + return ( + + + 不想错过约球邀请? + + 开启消息通知 + + + + + ); +}; + +export default SubscribeNotificationTip; + diff --git a/src/main_pages/components/MessagePageContent.module.scss b/src/main_pages/components/MessagePageContent.module.scss index 69525a3..17f616f 100644 --- a/src/main_pages/components/MessagePageContent.module.scss +++ b/src/main_pages/components/MessagePageContent.module.scss @@ -92,6 +92,12 @@ } } + // 通知提示框容器 + .notificationTipWrapper { + padding: 0 12px; + margin-bottom: 8px; + } + // 消息列表 // .messageList { // flex: 1; diff --git a/src/main_pages/components/MessagePageContent.tsx b/src/main_pages/components/MessagePageContent.tsx index 339323e..73140cd 100644 --- a/src/main_pages/components/MessagePageContent.tsx +++ b/src/main_pages/components/MessagePageContent.tsx @@ -1,6 +1,7 @@ import { useState, useEffect } from "react"; import { View, Text, Image, ScrollView } from "@tarojs/components"; import { EmptyState } from "@/components"; +import SubscribeNotificationTip from "@/components/SubscribeNotificationTip"; import noticeService from "@/services/noticeService"; import { formatRelativeTime } from "@/utils/timeUtils"; import Taro from "@tarojs/taro"; @@ -167,6 +168,11 @@ const MessagePageContent = () => { + {/* 通知提示框 */} + + + + { + const { statusNavbarHeightInfo } = useGlobalState() || {}; + const { totalHeight = 98 } = statusNavbarHeightInfo || {}; + + // 示例消息数据 + const exampleMessages = [ + { + id: '1', + avatar: require('@/static/userInfo/default_avatar.svg'), + name: 'Albert', + content: '发现一家宝藏新球场,周末一起去试试吗?', + }, + { + id: '2', + avatar: require('@/static/userInfo/default_avatar.svg'), + name: 'Evelyn', + content: '周五晚混双比赛,寻找NTRP 3.5队友!', + }, + { + id: '3', + avatar: require('@/static/userInfo/default_avatar.svg'), + name: 'CiCi', + content: '我也在黄浦,明早8点晨练打球吗?', + }, + ]; + + return ( + + + + + + {/* 示例消息卡片 */} + + {exampleMessages.map((message) => ( + + + + {message.name} + {message.content} + + + ))} + + + {/* 标题区域 */} + + 开启消息通知 + 请放心,我们只会在必要时提醒你 + + + {/* 二维码区域 */} + + + + + 长按关注👆开启提醒 + + + + + ); +}; + +export default EnableNotificationPage; + diff --git a/src/static/other_pages/qr_code.svg b/src/static/other_pages/qr_code.svg new file mode 100644 index 0000000..aa9a36f --- /dev/null +++ b/src/static/other_pages/qr_code.svg @@ -0,0 +1,6 @@ + + + + 二维码占位图 + + diff --git a/src/test_pages/index.scss b/src/test_pages/index.scss index b98eccb..f04a4f4 100644 --- a/src/test_pages/index.scss +++ b/src/test_pages/index.scss @@ -19,5 +19,10 @@ border-radius: 44rpx; font-size: 32rpx; } + + &__tip_wrapper { + width: 100%; + margin-top: 40rpx; + } }