Initial Commit

This commit is contained in:
Rajuahamedkst 2025-09-12 16:08:17 +08:00
commit 1d71a02738
237 changed files with 64293 additions and 0 deletions

View file

@ -0,0 +1,88 @@
// pages/settings/about/about.js
const app = getApp();
Page({
data: {
version: '1.0.0',
appName: 'FindMe'
},
onLoad() {
// 页面加载时执行
console.log('关于页面加载');
},
onShow() {
// 页面显示时执行
},
// 检查更新
checkUpdate() {
wx.showLoading({
title: '检查中...',
});
// 模拟检查更新
setTimeout(() => {
wx.hideLoading();
wx.showModal({
title: '检查更新',
content: '当前已是最新版本',
showCancel: false
});
}, 1500);
},
// 显示更新日志
showUpdateLog() {
wx.navigateTo({
url: '/pages/settings/about/update-log/update-log'
});
},
// 发送日志
sendLog() {
wx.showLoading({
title: '发送中...',
});
// 模拟发送日志
setTimeout(() => {
wx.hideLoading();
wx.showToast({
title: '日志发送成功',
icon: 'success'
});
}, 2000);
},
// 打开隐私政策
openPrivacyPolicy() {
wx.navigateTo({
url: '/pages/webview/webview?url=https://www.findme.cn/privacy'
});
},
// 打开使用条款
openTermsOfService() {
wx.navigateTo({
url: '/pages/webview/webview?url=https://www.findme.cn/terms'
});
},
// 打开社区规范
openCommunityRules() {
wx.navigateTo({
url: '/pages/webview/webview?url=https://www.findme.cn/community'
});
},
// 分享功能
onShareAppMessage() {
return {
title: 'FindMe - 发现身边的朋友',
path: '/pages/map/map',
imageUrl: '/images/findme-logo.png'
};
}
});

View file

@ -0,0 +1,4 @@
{
"navigationBarTitleText": "关于我们",
"navigationBarTextStyle": "white"
}

View file

@ -0,0 +1,38 @@
<!-- pages/settings/about/about.wxml -->
<view class="about-container">
<!-- 头部Logo区域 -->
<view class="header">
<image class="app-logo" src="/images/findme-logo.png" mode="aspectFit"></image>
<text class="app-name">FindMe</text>
<text class="app-version">FindMe 1.0.0</text>
</view>
<!-- 功能入口 -->
<view class="function-list">
<view class="function-item" bindtap="checkUpdate">
<text class="function-text">检查更新</text>
<view class="arrow-right"></view>
</view>
<view class="function-item" bindtap="showUpdateLog">
<text class="function-text">更新日志</text>
<view class="arrow-right"></view>
</view>
</view>
<!-- 发送日志按钮 -->
<button class="send-log-btn" bindtap="sendLog">发送日志给FINDME</button>
<!-- 链接区域 -->
<view class="links">
<text class="link-item" bindtap="openPrivacyPolicy">《Findme服务条款》</text>
<text class="link-item" bindtap="openTermsOfService">《Findme隐私政策》</text>
<text class="link-item" bindtap="openCommunityRules">《Findme社区规范》</text>
</view>
<!-- 官网链接 -->
<view class="official-website">
<text>https://www.findme.cn</text>
</view>
</view>

View file

@ -0,0 +1,122 @@
/* pages/settings/about/about.wxss */
/* 页面容器 */
.about-container {
min-height: 100vh;
background-color: #000000;
padding: 40rpx;
display: flex;
flex-direction: column;
align-items: center;
}
/* 头部区域 */
.header {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 60rpx;
margin-top: 120rpx;
}
.app-logo {
width: 200rpx;
height: 200rpx;
border-radius: 30rpx;
margin-bottom: 30rpx;
}
.app-name {
font-size: 44rpx;
font-weight: bold;
color: #ffffff;
margin-bottom: 10rpx;
}
.app-version {
font-size: 28rpx;
color: #999999;
}
/* 功能列表 */
.function-list {
width: 100%;
margin-bottom: 60rpx;
}
.function-item {
width: 100%;
height: 100rpx;
background-color: #1a1a1a;
border-radius: 16rpx;
padding: 0 30rpx;
margin-bottom: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.function-text {
font-size: 32rpx;
color: #ffffff;
}
.arrow-right {
width: 20rpx;
height: 20rpx;
border-top: 2rpx solid #999999;
border-right: 2rpx solid #999999;
transform: rotate(45deg);
}
/* 发送日志按钮 */
.send-log-btn {
width: 100%;
height: 90rpx;
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
color: #ffffff;
font-size: 32rpx;
border-radius: 45rpx;
margin-bottom: 80rpx;
display: flex;
justify-content: center;
align-items: center;
border: none;
}
/* 链接区域 */
.links {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 40rpx;
}
.link-item {
font-size: 28rpx;
color: #667eea;
margin-bottom: 20rpx;
}
/* 官网链接 */
.official-website {
width: 100%;
text-align: center;
margin-top: 40rpx;
}
.official-website text {
font-size: 26rpx;
color: #999999;
}
/* 版权信息 */
.copyright {
font-size: 24rpx;
color: #999999;
text-align: center;
margin-top: auto;
margin-bottom: 40rpx;
}

View file

@ -0,0 +1,176 @@
// pages/settings/about/update-log/update-log.js
const app = getApp();
Page({
data: {
currentVersion: 'v1.0.0',
currentVersionDate: '2023-10-15',
updateLogs: [],
hasMoreLogs: true,
page: 1,
pageSize: 5,
isRefreshing: false, // 可保留但不再使用
isLoading: false,
menuButtonInfo: {
height: 32,
width: 32,
left: 20,
top: 20
},
statusBarHeight: 0
},
onLoad: function() {
try {
const systemInfo = wx.getSystemInfoSync();
const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
this.setData({
statusBarHeight: systemInfo.statusBarHeight,
menuButtonInfo: menuButtonInfo || this.data.menuButtonInfo
});
} catch (e) {
console.error('获取系统信息失败:', e);
}
this.loadUpdateLogs();
},
onShow: function() {
// 页面显示
},
// 移除下拉刷新相关方法
// onPullDownRefresh: function() {
// this.setData({
// isRefreshing: true,
// page: 1
// });
//
// // 模拟网络请求
// setTimeout(() => {
// this.loadUpdateLogs();
// wx.stopPullDownRefresh();
// this.setData({ isRefreshing: false });
// }, 1000);
// },
onReachBottom: function() {
if (!this.data.hasMoreLogs || this.data.isLoading) {
return;
}
this.loadMoreLogs();
},
loadUpdateLogs: function() {
const logs = [
{
version: 'v1.0.0',
date: '2023-10-15',
newFeatures: [
'• 初始版本发布',
'• 实现位置共享功能',
'• 新增消息推送机制'
],
improvements: [
'• 优化地图加载速度',
'• 提升用户界面响应速度'
],
fixes: [
'• 修复已知的兼容性问题',
'• 解决部分机型的闪退问题'
]
},
{
version: 'v0.9.0',
date: '2023-09-20',
newFeatures: [
'• 测试版本发布',
'• 核心功能开发完成'
],
improvements: [
'• 优化用户体验',
'• 提升系统稳定性'
],
fixes: []
},
{
version: 'v0.8.5',
date: '2023-08-15',
newFeatures: [],
improvements: [
'• 改进定位精度',
'• 优化电池使用效率'
],
fixes: [
'• 修复消息发送失败问题',
'• 解决地图显示异常'
]
}
];
this.setData({
updateLogs: logs,
hasMoreLogs: logs.length >= this.data.pageSize
});
},
loadMoreLogs: function() {
if (this.data.isLoading || !this.data.hasMoreLogs) {
return;
}
this.setData({ isLoading: true });
setTimeout(() => {
const moreLogs = [
{
version: 'v0.8.0',
date: '2023-07-10',
newFeatures: [
'• 新增聊天功能',
'• 添加好友系统'
],
improvements: [
'• 优化应用启动速度',
'• 改进用户界面布局'
],
fixes: []
},
{
version: 'v0.7.0',
date: '2023-06-05',
newFeatures: [
'• 基础地图功能上线',
'• 用户注册登录系统'
],
improvements: [],
fixes: []
}
];
const updatedLogs = [...this.data.updateLogs, ...moreLogs];
this.setData({
updateLogs: updatedLogs,
hasMoreLogs: false,
isLoading: false,
page: this.data.page + 1
});
}, 1500);
},
navigateBack: function() {
wx.navigateBack();
},
onShareAppMessage: function() {
return {
title: 'FindMe 更新日志',
path: '/pages/settings/about/update-log',
imageUrl: '/images/findme-logo.png'
};
}
});

View file

@ -0,0 +1,7 @@
{
"navigationStyle": "custom",
"backgroundColor": "#F2F2F7",
"backgroundTextStyle": "dark",
"enablePullDownRefresh": false,
"onReachBottomDistance": 50
}

View file

@ -0,0 +1,92 @@
<!-- pages/settings/about/update-log/update-log.wxml -->
<view class="update-log-container">
<!-- 自定义导航栏 -->
<view class="custom-nav-bar" style="height: {{menuButtonInfo.height}}px; top: {{statusBarHeight}}px; width: 100%;">
<!-- 左侧返回按钮 -->
<view class="nav-left" bindtap="navigateBack" style="width: {{menuButtonInfo.width}}px; height: {{menuButtonInfo.height}}px; line-height: {{menuButtonInfo.height}}px;">
<text class="back-icon">↩</text>
</view>
<!-- 中间标题 -->
<view class="nav-title" style="position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);">
更新日志
</view>
<!-- 右侧占位区 -->
<view class="nav-right" style="width: {{menuButtonInfo.width}}px; height: {{menuButtonInfo.height}}px;"></view>
</view>
<!-- 内容区域 - 关键修改:将样式合并到一行 -->
<scroll-view class="content-area" scroll-y style="padding-top: {{statusBarHeight + menuButtonInfo.height + 30}}px; height: calc(100vh - {{statusBarHeight + menuButtonInfo.height + 30}}px);">
<!-- 当前版本信息 -->
<view class="current-version-card">
<text class="current-version-badge">当前版本</text>
<view class="current-version-info">
<text class="current-version-name">{{currentVersion}}</text>
<text class="current-version-date">{{currentVersionDate}}</text>
</view>
</view>
<!-- 更新日志列表 -->
<view class="log-list">
<!-- 版本项 -->
<view class="version-item" wx:for="{{updateLogs}}" wx:key="version">
<!-- 版本头部 -->
<view class="version-header">
<text class="version-name">{{item.version}}</text>
<text class="version-date">{{item.date}}</text>
</view>
<!-- 版本内容 -->
<view class="version-content">
<!-- 特性更新 -->
<view class="update-section" wx:if="{{item.newFeatures && item.newFeatures.length > 0}}">
<view class="section-title">
<text class="section-icon">✨</text>
<text class="section-text">新功能</text>
</view>
<view class="section-items">
<text class="update-item" wx:for="{{item.newFeatures}}" wx:key="index" wx:for-item="feature">{{feature}}</text>
</view>
</view>
<!-- 优化改进 -->
<view class="update-section" wx:if="{{item.improvements && item.improvements.length > 0}}">
<view class="section-title">
<text class="section-icon">⚡</text>
<text class="section-text">优化改进</text>
</view>
<view class="section-items">
<text class="update-item" wx:for="{{item.improvements}}" wx:key="index" wx:for-item="improvement">{{improvement}}</text>
</view>
</view>
<!-- 问题修复 -->
<view class="update-section" wx:if="{{item.fixes && item.fixes.length > 0}}">
<view class="section-title">
<text class="section-icon">🔧</text>
<text class="section-text">问题修复</text>
</view>
<view class="section-items">
<text class="update-item" wx:for="{{item.fixes}}" wx:key="index" wx:for-item="fix">{{fix}}</text>
</view>
</view>
</view>
</view>
<!-- 加载更多提示 -->
<view class="load-more" wx:if="{{hasMoreLogs}}" bindtap="loadMoreLogs">
<text class="load-more-text">加载更多历史版本</text>
<text class="load-more-icon">↓</text>
</view>
<!-- 没有更多内容提示 -->
<view class="no-more" wx:else>
<text class="no-more-text">已经到底啦~</text>
</view>
</view>
<!-- 底部安全区域 -->
<view class="bottom-space"></view>
</scroll-view>
</view>

View file

@ -0,0 +1,326 @@
/* pages/settings/about/update-log/update-log.wxss */
/* CSS变量定义 */
page {
/* --primary-color: #b10026;
--primary-light: #b801a8;
--primary-dark: #82009c; */
--background-color: #ff3333;
--surface-color: #09094d;
--text-primary: #FFFFFF;
--text-secondary: #8E8E93;
--text-tertiary: #48484A;
--border-color: #38383A;
--shadow-light: 0 1rpx 3rpx rgba(0, 0, 0, 0.3);
--shadow-medium: 0 4rpx 12rpx rgba(0, 0, 0, 0.4);
--radius-small: 8rpx;
--radius-medium: 12rpx;
--radius-large: 20rpx;
}
/* 页面容器 */
.update-log-container {
height: 100vh;
display: flex;
flex-direction: column;
/* background-color: var(--background-color); */
color: var(--text-primary);
width: 100%;
background: linear-gradient(to bottom, #00607e, #800064,#190220);
/* color: #ffffff; */
}
/* 自定义导航栏 */
.custom-nav-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
display: flex;
align-items: center;
/* background-color: #1a1a1a; */
/* border-bottom: 1px solid #333333; */
z-index: 10;
box-sizing: content-box; /* 确保padding不会影响总高度计算 */
}
.nav-content {
width: 48px;
display: flex;
align-items: center;
justify-content: center;
}
/* 左侧返回按钮*/
.nav-left {
display: flex;
align-items: center;
/* justify-content: flex-start; */
justify-content: center;
}
.back-icon {
font-size: 20px;
color: #ffffff;
}
/* 中间标题 - 确保居中显示 */
.nav-center {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.nav-title {
font-size: 36rpx;
font-weight: 600;
color: white;
white-space: nowrap;
}
/* 右侧占位区 - 保持布局平衡 */
.nav-right {
display: flex;
align-items: center;
justify-content: flex-end;
}
/* 内容区域样式强化 */
.content-area {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
padding: 24rpx;
box-sizing: border-box; /* 确保padding不会增加元素总宽度 */
/* 移除可能存在的margin-top避免与padding-top冲突 */
margin-top: 0;
}
/* 当前版本卡片 */
.current-version-card {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
color: white;
border-radius: var(--radius-large);
padding: 36rpx;
margin-bottom: 32rpx;
box-shadow: var(--shadow-medium);
animation: fadeIn 0.5s ease;
}
.current-version-badge {
background: rgba(255, 255, 255, 0.2);
padding: 8rpx 16rpx;
border-radius: 16rpx;
font-size: 24rpx;
display: inline-block;
margin-bottom: 16rpx;
}
.current-version-info {
display: flex;
align-items: baseline;
gap: 16rpx;
}
.current-version-name {
font-size: 40rpx;
font-weight: 700;
}
.current-version-date {
font-size: 28rpx;
opacity: 0.9;
}
/* 日志列表 */
.log-list {
display: flex;
flex-direction: column;
gap: 24rpx;
}
/* 版本项 */
.version-item {
background: var(--surface-color);
border-radius: var(--radius-medium);
padding: 32rpx;
box-shadow: var(--shadow-light);
border: 1rpx solid var(--border-color);
transition: all 0.3s ease;
animation: slideUp 0.4s ease;
}
.version-item:active {
transform: scale(0.98);
box-shadow: var(--shadow-medium);
}
/* 版本头部 */
.version-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid var(--border-color);
}
/* 版本名称 */
.version-name {
font-size: 32rpx;
font-weight: 600;
color: var(--primary-color);
}
/* 版本日期 */
.version-date {
font-size: 24rpx;
color: var(--text-secondary);
}
/* 版本内容 */
.version-content {
display: flex;
flex-direction: column;
gap: 24rpx;
}
/* 更新区域 */
.update-section {
display: flex;
flex-direction: column;
gap: 16rpx;
}
/* 区域标题 */
.section-title {
display: flex;
align-items: center;
gap: 8rpx;
margin-bottom: 8rpx;
}
.section-icon {
font-size: 28rpx;
}
.section-text {
font-size: 28rpx;
font-weight: 500;
color: var(--text-primary);
}
/* 区域内容 */
.section-items {
padding-left: 36rpx;
}
/* 更新项 */
.update-item {
font-size: 26rpx;
color: var(--text-secondary);
display: block;
margin-bottom: 16rpx;
line-height: 1.6;
position: relative;
}
.update-item:last-child {
margin-bottom: 0;
}
/* 加载更多 */
.load-more {
text-align: center;
padding: 32rpx;
font-size: 28rpx;
color: var(--text-secondary);
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
cursor: pointer;
transition: all 0.2s ease;
}
.load-more:active {
color: var(--primary-color);
transform: scale(0.96);
}
.load-more-icon {
font-size: 24rpx;
}
/* 没有更多内容 */
.no-more {
text-align: center;
padding: 48rpx 32rpx;
font-size: 26rpx;
color: var(--text-tertiary);
}
/* 动画效果 */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-10rpx);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20rpx);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* 响应式设计 */
@media screen and (max-width: 375px) {
.current-version-name {
font-size: 36rpx;
}
.current-version-date {
font-size: 24rpx;
}
.version-name {
font-size: 28rpx;
}
.section-text {
font-size: 26rpx;
}
.update-item {
font-size: 24rpx;
}
}
/* 加载动画 */
.loading {
display: inline-block;
width: 20rpx;
height: 20rpx;
border: 2rpx solid var(--border-color);
border-radius: 50%;
border-top-color: var(--primary-color);
animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}

View file

@ -0,0 +1,115 @@
// 账号与安全页面逻辑
Page({
/**
* 页面的初始数据
*/
data: {
phone: '+86 18500006666',
wechatStatus: '已绑定',
email: 'annabk666@gmail.com',
// 初始化默认值避免null导致的错误
menuButtonInfo: {
height: 32, // 默认高度
width: 32, // 默认宽度
top: 0
},
statusBarHeight: 0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
console.log('账号与安全页面加载');
try {
// 获取系统信息,用于导航栏定位
const systemInfo = wx.getSystemInfoSync();
const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
this.setData({
statusBarHeight: systemInfo.statusBarHeight,
menuButtonInfo: menuButtonInfo,
// 计算导航栏高度 = 胶囊按钮底部距离 - 状态栏高度
navbarHeight: menuButtonInfo.bottom - systemInfo.statusBarHeight
});
} catch (error) {
console.error('获取系统信息失败:', error);
// 如果获取失败,使用默认值
this.setData({
statusBarHeight: 20,
navbarHeight: 44
});
}
},
/**
* 返回上一页
*/
navigateBack: function() {
wx.navigateBack({
delta: 1
});
},
/**
* 查看手机号码
*/
viewPhone: function() {
wx.showModal({
title: '手机号码',
content: this.data.phone,
showCancel: false
});
},
/**
* 查看微信绑定
*/
viewWechat: function() {
wx.showModal({
title: '微信绑定',
content: '您的账号已绑定微信',
showCancel: false
});
},
/**
* 查看邮箱
*/
viewEmail: function() {
wx.showModal({
title: '邮箱',
content: this.data.email,
showCancel: false
});
},
/**
* 推荐给好友
*/
recommendToFriend: function() {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
});
},
/**
* 查看已屏蔽账户
*/
viewBlockedAccounts: function() {
wx.navigateTo({
url: '/pages/settings/account-security/blocked-accounts'
});
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
return {
title: 'FindMe - 账号与安全',
path: '/pages/settings/account-security/account-security'
};
}
});

View file

@ -0,0 +1,8 @@
{
"navigationBarTitleText": "账户与安全",
"navigationBarBackgroundColor": "#000000",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"backgroundColor": "#000000",
"disableScroll": false
}

View file

@ -0,0 +1,63 @@
<!-- 账号与安全页面 -->
<view class="container">
<!-- 顶部导航栏 - 使用动态高度 -->
<view class="navbar" style="height: {{navbarHeight}}px; padding-top: {{statusBarHeight}}px;">
<view class="back-btn" bindtap="navigateBack">
<text class="icon">←</text>
</view>
<view class="title">账户与安全</view>
<view class="back-btn"></view>
</view>
<!-- 主内容区 -->
<scroll-view class="content" scroll-y style="padding-top: {{statusBarHeight + navbarHeight}}px;">
<!-- 隐私部分 -->
<view class="section">
<text class="section-title">隐私</text>
<view class="item" bindtap="viewPhone">
<view class="item-icon phone">📞</view>
<view class="item-content">
<text class="item-title">电话</text>
<text class="item-value">{{phone}}</text>
</view>
<view class="item-arrow"></view>
</view>
<view class="item" bindtap="viewWechat">
<view class="item-icon wechat">📱</view>
<view class="item-content">
<text class="item-title">微信</text>
<text class="item-value">{{wechatStatus}}</text>
</view>
<view class="item-arrow"></view>
</view>
<view class="item" bindtap="viewEmail">
<view class="item-icon email">📧</view>
<view class="item-content">
<text class="item-title">邮箱</text>
<text class="item-value">{{email}}</text>
</view>
<view class="item-arrow"></view>
</view>
</view>
<!-- 社交账户部分 -->
<view class="section">
<text class="section-title">社交账户</text>
<view class="item" bindtap="recommendToFriend">
<view class="item-icon recommend">👥</view>
<view class="item-content">
<text class="item-title">推荐给好友</text>
</view>
<view class="item-arrow"></view>
</view>
<view class="item" bindtap="viewBlockedAccounts">
<view class="item-icon blocked">🚫</view>
<view class="item-content">
<text class="item-title">已屏蔽账户</text>
</view>
<view class="item-arrow"></view>
</view>
</view>
</scroll-view>
</view>

View file

@ -0,0 +1,159 @@
/* 账号与安全页面样式 - 深色主题 */
.container {
width: 100%;
min-height: 100vh;
background-color: #000000;
color: #ffffff;
}
/* 导航栏样式 - 移除固定高度设置由JS动态控制 */
.navbar {
position: fixed;
top: 0;
left: 0;
right: 0;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #1a1a1a;
padding: 0 16px;
z-index: 10;
box-sizing: content-box; /* 确保padding不会影响总高度计算 */
}
.back-btn {
width: 48px;
display: flex;
align-items: center;
justify-content: center;
}
.icon {
font-size: 20px;
color: #ffffff;
}
.title {
flex: 1;
text-align: center;
font-size: 34rpx;
font-weight: 500;
color: #ffffff;
}
/* 主内容区 */
.content {
width: 100%;
box-sizing: border-box;
padding: 16px;
padding-top: calc(44px + env(safe-area-inset-top) + 16px);
min-height: 100vh;
}
/* 分区样式 */
.section {
margin-bottom: 24px;
background-color: #1a1a1a;
border-radius: 12px;
overflow: hidden;
}
.section-title {
display: block;
padding: 16px;
font-size: 14px;
color: #888888;
background-color: #121212;
}
/* 列表项样式 */
.item {
display: flex;
align-items: center;
padding: 16px;
border-bottom: 1px solid #333333;
}
.item:last-child {
border-bottom: none;
}
.item-icon {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
margin-right: 16px;
}
.item-content {
flex: 1;
}
.item-title {
font-size: 16px;
color: #ffffff;
margin-bottom: 4px;
display: block;
}
.item-value {
font-size: 14px;
color: #aaaaaa;
}
.item-arrow {
font-size: 16px;
color: #888888;
}
/* 开关样式 */
.switch-container {
display: flex;
align-items: center;
justify-content: flex-end;
flex: 1;
}
/* 图标颜色 */
.phone {
color: #07c160;
}
.wechat {
color: #07c160;
}
.email {
color: #1aad19;
}
.password {
color: #07c160;
}
.twofactor {
color: #07c160;
}
.recommend {
color: #07c160;
}
.blocked {
color: #ff4d4f;
}
/* 安全区域适配 */
@media screen and (device-width: 375px) and (device-height: 812px) {
.navbar {
padding-top: 44px;
height: 88px;
}
.content {
padding-top: 104px;
}
}

View file

@ -0,0 +1,109 @@
// 反馈页面逻辑
Page({
/**
* 页面的初始数据
*/
data: {
feedbackTypes: ['功能建议', 'Bug反馈', '内容纠错', '其他问题'],
selectedType: 0,
content: '',
contact: '',
navbarHeight: 0, // 导航栏高度
statusBarHeight: 0, // 状态栏高度
menuButtonInfo: {} // 胶囊按钮信息
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
console.log('反馈页面加载');
// 获取系统信息,用于导航栏定位
const systemInfo = wx.getSystemInfoSync();
const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
this.setData({
statusBarHeight: systemInfo.statusBarHeight,
menuButtonInfo: menuButtonInfo,
// 计算导航栏高度 = 胶囊按钮底部距离 - 状态栏高度
navbarHeight: menuButtonInfo.bottom - systemInfo.statusBarHeight
});
},
/**
* 返回上一页
*/
navigateBack: function() {
wx.navigateBack({
delta: 1
});
},
/**
* 选择反馈类型
*/
onTypeChange: function(e) {
this.setData({
selectedType: e.detail.value
});
},
/**
* 输入反馈内容
*/
onContentChange: function(e) {
this.setData({
content: e.detail.value
});
},
/**
* 输入联系方式
*/
onContactChange: function(e) {
this.setData({
contact: e.detail.value
});
},
/**
* 提交反馈
*/
submitFeedback: function() {
const { selectedType, content, contact } = this.data;
const selectedTypeText = this.data.feedbackTypes[selectedType];
// 验证反馈内容
if (!content.trim()) {
wx.showToast({
title: '请输入反馈内容',
icon: 'none'
});
return;
}
// 显示加载提示
wx.showLoading({
title: '提交中...',
});
// 模拟提交反馈
setTimeout(() => {
wx.hideLoading();
// 显示成功提示
wx.showToast({
title: '反馈提交成功',
icon: 'success',
duration: 2000,
success: () => {
// 延迟返回上一页
setTimeout(() => {
this.navigateBack();
}, 1500);
}
});
}, 1000);
}
});

View file

@ -0,0 +1,8 @@
{
"navigationBarTitleText": "意见反馈",
"navigationBarBackgroundColor": "#000000",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"backgroundColor": "#000000",
"disableScroll": false
}

View file

@ -0,0 +1,56 @@
<!-- 反馈页面 -->
<view class="container">
<!-- 顶部导航栏 - 使用动态高度 -->
<view class="navbar" style="height: {{navbarHeight}}px; padding-top: {{statusBarHeight}}px;">
<view class="back-btn" bindtap="navigateBack" style="height: {{menuButtonInfo.height}}px; line-height: {{menuButtonInfo.height}}px;">
<text class="icon">↩</text>
</view>
<view class="title" style="line-height: {{menuButtonInfo.height}}px;">意见反馈</view>
<view class="back-btn" style="line-height: {{menuButtonInfo.height}}px;"></view>
</view>
<!-- 主内容区 - 根据导航栏总高度调整顶部距离 -->
<view class="content" style="padding-top: {{navbarHeight + statusBarHeight}}px;">
<!-- 反馈表单 -->
<view class="form-section">
<view class="form-item">
<text class="label">反馈类型</text>
<picker mode="selector" range="{{feedbackTypes}}" value="{{selectedType}}" bindchange="onTypeChange">
<view class="picker-view">
{{feedbackTypes[selectedType] || '请选择反馈类型'}}
</view>
</picker>
</view>
<view class="form-item">
<text class="label">反馈内容</text>
<textarea
placeholder="请输入您的反馈内容..."
value="{{content}}"
bindinput="onContentChange"
class="textarea"
></textarea>
</view>
<view class="form-item">
<text class="label">联系方式</text>
<input
placeholder="请输入您的联系方式(选填)"
value="{{contact}}"
bindinput="onContactChange"
class="input"
></input>
</view>
<!-- 提交按钮 -->
<view class="submit-container">
<view class="submit-button gradient" bindtap="submitFeedback" wx:if="{{!isSubmitting}}">
<text class="submit-text">提交</text>
</view>
<view class="submit-button submitting" wx:else>
<text class="submit-text">提交中...</text>
</view>
</view>
</view>
</view>
</view>

View file

@ -0,0 +1,169 @@
/* 深色主题反馈页面样式 */
.container {
width: 100%;
min-height: 100vh;
background: linear-gradient(to bottom, #23013a, #000000);
/* color: #ffffff; */
}
/* 导航栏样式 - 移除固定高度设置由JS动态控制 */
.navbar {
position: fixed;
top: 0;
left: 0;
right: 0;
display: flex;
align-items: center;
/* background-color: #1a1a1a; */
/* border-bottom: 1px solid #333333; */
z-index: 10;
box-sizing: content-box; /* 确保padding不会影响总高度计算 */
}
.back-btn {
width: 48px;
display: flex;
align-items: center;
justify-content: center;
}
.icon {
font-size: 20px;
color: #ffffff;
}
.title {
flex: 1;
text-align: center;
font-size: 34rpx;
font-weight: 500;
color: #ffffff;
}
/* 主内容区 - 移除固定padding-top由JS动态控制 */
.content {
width: 100%;
box-sizing: border-box;
}
/* 表单区域 */
.form-section {
padding: 20px 16px;
background-color: #1a1a1a;
margin: 10px;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.form-item {
margin-bottom: 24px;
}
.label {
display: block;
margin-bottom: 10px;
font-size: 15px;
color: #cccccc;
font-weight: 500;
}
/* 选择器样式 */
.picker-view {
width: 100%;
height: 48px;
line-height: 48px;
padding: 0 12px;
border: 1px solid #444444;
border-radius: 8px;
box-sizing: border-box;
color: #ffffff;
background-color: #2a2a2a;
}
/* 输入框样式 */
.textarea {
width: 100%;
min-height: 150px;
padding: 12px;
border: 1px solid #444444;
border-radius: 8px;
box-sizing: border-box;
font-size: 14px;
line-height: 1.6;
color: #ffffff;
background-color: #2a2a2a;
resize: none;
}
.textarea::placeholder {
color: #888888;
}
.input {
width: 100%;
height: 48px;
padding: 0 12px;
border: 1px solid #444444;
border-radius: 8px;
box-sizing: border-box;
font-size: 14px;
color: #ffffff;
background-color: #2a2a2a;
}
.input::placeholder {
color: #888888;
}
/* 提交按钮样式 */
/* 提交按钮容器 */
.submit-container {
display: flex;
justify-content: center;
padding: 0 30rpx;
margin-top: 60rpx;
}
/* 提交按钮 - 渐变效果更贴近设计图 */
.submit-button {
width: 100%;
height: 90rpx;
border-radius: 45rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
font-weight: 600;
transition: all 0.3s ease;
}
.submit-text {
color: #ffffff;
font-weight: 600;
}
/* 渐变效果 - 更接近设计图的粉蓝渐变 */
.gradient {
background: linear-gradient(90deg, #FF55C9 0%, #00B8FF 100%);
background-size: 200% 200%;
animation: gradientFlow 3s ease infinite;
}
@keyframes gradientFlow {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
/* 提交中状态 */
.submitting {
background-color: #333333;
color: #999999;
}
/* 触摸效果 */
.submit-button:active:not(.submitting) {
transform: scale(0.98);
opacity: 0.9;
}

View file

@ -0,0 +1,592 @@
// 🔔 通知设置页面逻辑
const notificationManager = require('../../../utils/notification-manager.js');
Page({
data: {
// 系统信息
statusBarHeight: 44,
navBarHeight: 88,
// 通知设置
notificationSettings: {
enabled: true,
message: {
enabled: true,
showPreview: true,
sound: true,
vibrate: true,
groupByChat: true
},
group: {
enabled: true,
mentionOnly: false,
sound: true,
vibrate: true
},
friend: {
enabled: true,
sound: true
},
system: {
enabled: true
}
},
// 免打扰设置
doNotDisturb: {
enabled: false,
startTime: '22:00',
endTime: '08:00',
allowUrgent: true,
allowMentions: true
},
// 未读计数
unreadCount: 0,
// 时间选择器
showTimePicker: false,
selectedTime: '22:00',
timePickerType: 'start', // start, end
// 加载状态
loading: false
},
onLoad(options) {
console.log('🔔 通知设置页面加载');
// 获取系统信息
this.getSystemInfo();
// 加载通知设置
this.loadNotificationSettings();
// 加载未读计数
this.loadUnreadCount();
},
onShow() {
console.log('🔔 通知设置页面显示');
// 刷新未读计数
this.loadUnreadCount();
},
// 获取系统信息
getSystemInfo() {
try {
const windowInfo = wx.getWindowInfo();
this.setData({
statusBarHeight: windowInfo.statusBarHeight || 44,
navBarHeight: 88
});
} catch (error) {
console.error('获取系统信息失败:', error);
this.setData({
statusBarHeight: 44,
navBarHeight: 88
});
}
},
// 加载通知设置
loadNotificationSettings() {
try {
// 从通知管理器获取设置
const settings = notificationManager.getStatus();
if (settings.notificationSettings) {
this.setData({
notificationSettings: {
...this.data.notificationSettings,
...settings.notificationSettings
}
});
}
// 加载免打扰设置
const doNotDisturbSettings = wx.getStorageSync('doNotDisturbSettings');
if (doNotDisturbSettings) {
this.setData({
doNotDisturb: {
...this.data.doNotDisturb,
...doNotDisturbSettings
}
});
}
console.log('✅ 通知设置加载完成');
} catch (error) {
console.error('❌ 加载通知设置失败:', error);
}
},
// 加载未读计数
loadUnreadCount() {
try {
const totalUnread = notificationManager.getTotalUnreadCount();
this.setData({
unreadCount: totalUnread
});
} catch (error) {
console.error('❌ 加载未读计数失败:', error);
}
},
// 🔔 ===== 通知设置变更 =====
// 通知总开关变更
onNotificationEnabledChange(e) {
const enabled = e.detail.value;
console.log('🔔 通知总开关变更:', enabled);
this.setData({
'notificationSettings.enabled': enabled
});
this.saveNotificationSettings();
},
// 消息通知变更
onMessageNotificationChange(e) {
const enabled = e.detail.value;
console.log('💬 消息通知变更:', enabled);
this.setData({
'notificationSettings.message.enabled': enabled
});
this.saveNotificationSettings();
},
// 消息预览变更
onMessagePreviewChange(e) {
const enabled = e.detail.value;
console.log('👁️ 消息预览变更:', enabled);
this.setData({
'notificationSettings.message.showPreview': enabled
});
this.saveNotificationSettings();
},
// 消息提示音变更
onMessageSoundChange(e) {
const enabled = e.detail.value;
console.log('🔊 消息提示音变更:', enabled);
this.setData({
'notificationSettings.message.sound': enabled
});
this.saveNotificationSettings();
},
// 消息震动变更
onMessageVibrateChange(e) {
const enabled = e.detail.value;
console.log('📳 消息震动变更:', enabled);
this.setData({
'notificationSettings.message.vibrate': enabled
});
this.saveNotificationSettings();
},
// 消息分组变更
onMessageGroupChange(e) {
const enabled = e.detail.value;
console.log('📂 消息分组变更:', enabled);
this.setData({
'notificationSettings.message.groupByChat': enabled
});
this.saveNotificationSettings();
},
// 群聊通知变更
onGroupNotificationChange(e) {
const enabled = e.detail.value;
console.log('👥 群聊通知变更:', enabled);
this.setData({
'notificationSettings.group.enabled': enabled
});
this.saveNotificationSettings();
},
// 群聊仅@提醒变更
onGroupMentionOnlyChange(e) {
const enabled = e.detail.value;
console.log('@ 群聊仅@提醒变更:', enabled);
this.setData({
'notificationSettings.group.mentionOnly': enabled
});
this.saveNotificationSettings();
},
// 群聊提示音变更
onGroupSoundChange(e) {
const enabled = e.detail.value;
console.log('🔊 群聊提示音变更:', enabled);
this.setData({
'notificationSettings.group.sound': enabled
});
this.saveNotificationSettings();
},
// 群聊震动变更
onGroupVibrateChange(e) {
const enabled = e.detail.value;
console.log('📳 群聊震动变更:', enabled);
this.setData({
'notificationSettings.group.vibrate': enabled
});
this.saveNotificationSettings();
},
// 好友通知变更
onFriendNotificationChange(e) {
const enabled = e.detail.value;
console.log('👤 好友通知变更:', enabled);
this.setData({
'notificationSettings.friend.enabled': enabled
});
this.saveNotificationSettings();
},
// 好友提示音变更
onFriendSoundChange(e) {
const enabled = e.detail.value;
console.log('🔊 好友提示音变更:', enabled);
this.setData({
'notificationSettings.friend.sound': enabled
});
this.saveNotificationSettings();
},
// 系统通知变更
onSystemNotificationChange(e) {
const enabled = e.detail.value;
console.log('⚙️ 系统通知变更:', enabled);
this.setData({
'notificationSettings.system.enabled': enabled
});
this.saveNotificationSettings();
},
// 🔕 ===== 免打扰设置 =====
// 免打扰模式变更
onDoNotDisturbChange(e) {
const enabled = e.detail.value;
console.log('🔕 免打扰模式变更:', enabled);
this.setData({
'doNotDisturb.enabled': enabled
});
this.saveDoNotDisturbSettings();
},
// 选择开始时间
selectStartTime() {
console.log('⏰ 选择开始时间');
this.setData({
showTimePicker: true,
selectedTime: this.data.doNotDisturb.startTime,
timePickerType: 'start'
});
},
// 选择结束时间
selectEndTime() {
console.log('⏰ 选择结束时间');
this.setData({
showTimePicker: true,
selectedTime: this.data.doNotDisturb.endTime,
timePickerType: 'end'
});
},
// 时间选择变更
onTimeChange(e) {
const time = e.detail.value;
console.log('⏰ 时间选择变更:', time, this.data.timePickerType);
if (this.data.timePickerType === 'start') {
this.setData({
'doNotDisturb.startTime': time,
showTimePicker: false
});
} else {
this.setData({
'doNotDisturb.endTime': time,
showTimePicker: false
});
}
this.saveDoNotDisturbSettings();
},
// 取消时间选择
onTimeCancel() {
this.setData({
showTimePicker: false
});
},
// 允许紧急通知变更
onAllowUrgentChange(e) {
const enabled = e.detail.value;
console.log('🚨 允许紧急通知变更:', enabled);
this.setData({
'doNotDisturb.allowUrgent': enabled
});
this.saveDoNotDisturbSettings();
},
// 允许@提醒变更
onAllowMentionsChange(e) {
const enabled = e.detail.value;
console.log('@ 允许@提醒变更:', enabled);
this.setData({
'doNotDisturb.allowMentions': enabled
});
this.saveDoNotDisturbSettings();
},
// 📋 ===== 通知管理 =====
// 查看通知历史
viewNotificationHistory() {
console.log('📋 查看通知历史');
wx.navigateTo({
url: '/pages/settings/notification-history/notification-history'
});
},
// 清空通知历史
clearNotificationHistory() {
console.log('🗑️ 清空通知历史');
wx.showModal({
title: '清空通知历史',
content: '确定要删除所有通知记录吗?此操作不可恢复。',
confirmText: '清空',
confirmColor: '#FF3B30',
success: (res) => {
if (res.confirm) {
this.performClearHistory();
}
}
});
},
// 执行清空历史
performClearHistory() {
try {
// 清空通知历史
wx.removeStorageSync('notificationHistory');
// 重置未读计数
notificationManager.reset();
this.setData({
unreadCount: 0
});
wx.showToast({
title: '历史已清空',
icon: 'success'
});
console.log('✅ 通知历史清空完成');
} catch (error) {
console.error('❌ 清空通知历史失败:', error);
wx.showToast({
title: '清空失败',
icon: 'none'
});
}
},
// 📱 ===== 订阅消息 =====
// 请求订阅消息权限
async requestSubscribeMessage() {
console.log('📝 请求订阅消息权限');
try {
const templateIds = [
'template_id_1', // 新消息通知
'template_id_2', // 好友请求通知
'template_id_3' // 系统通知
];
const result = await notificationManager.requestSubscribeMessage(templateIds);
if (result) {
wx.showToast({
title: '权限设置完成',
icon: 'success'
});
} else {
wx.showToast({
title: '权限设置失败',
icon: 'none'
});
}
} catch (error) {
console.error('❌ 请求订阅消息权限失败:', error);
wx.showToast({
title: '权限设置失败',
icon: 'none'
});
}
},
// 查看订阅状态
viewSubscribeStatus() {
console.log('📊 查看订阅状态');
wx.showToast({
title: '功能开发中',
icon: 'none'
});
},
// ⚙️ ===== 设置管理 =====
// 保存通知设置
saveNotificationSettings() {
try {
// 更新通知管理器设置
notificationManager.updateNotificationSettings(this.data.notificationSettings);
console.log('✅ 通知设置保存成功');
} catch (error) {
console.error('❌ 保存通知设置失败:', error);
}
},
// 保存免打扰设置
saveDoNotDisturbSettings() {
try {
wx.setStorageSync('doNotDisturbSettings', this.data.doNotDisturb);
console.log('✅ 免打扰设置保存成功');
} catch (error) {
console.error('❌ 保存免打扰设置失败:', error);
}
},
// 重置设置
resetSettings() {
console.log('🔄 重置设置');
wx.showModal({
title: '重置通知设置',
content: '确定要将所有通知设置恢复为默认值吗?',
confirmText: '重置',
confirmColor: '#FF3B30',
success: (res) => {
if (res.confirm) {
this.performResetSettings();
}
}
});
},
// 执行重置设置
performResetSettings() {
try {
// 重置为默认设置
this.setData({
notificationSettings: {
enabled: true,
message: {
enabled: true,
showPreview: true,
sound: true,
vibrate: true,
groupByChat: true
},
group: {
enabled: true,
mentionOnly: false,
sound: true,
vibrate: true
},
friend: {
enabled: true,
sound: true
},
system: {
enabled: true
}
},
doNotDisturb: {
enabled: false,
startTime: '22:00',
endTime: '08:00',
allowUrgent: true,
allowMentions: true
}
});
// 保存设置
this.saveNotificationSettings();
this.saveDoNotDisturbSettings();
wx.showToast({
title: '设置已重置',
icon: 'success'
});
console.log('✅ 通知设置重置完成');
} catch (error) {
console.error('❌ 重置通知设置失败:', error);
wx.showToast({
title: '重置失败',
icon: 'none'
});
}
},
// 🧭 ===== 页面导航 =====
// 返回上一页
goBack() {
wx.navigateBack();
}
});

View file

@ -0,0 +1,7 @@
{
"navigationStyle": "custom",
"backgroundColor": "#F2F2F7",
"backgroundTextStyle": "dark",
"enablePullDownRefresh": false,
"onReachBottomDistance": 50
}

View file

@ -0,0 +1,312 @@
<!-- 🔔 通知设置页面 -->
<view class="notification-settings-container">
<!-- 自定义导航栏 -->
<view class="custom-navbar" style="padding-top: {{statusBarHeight}}px;">
<view class="navbar-content" style="height: {{navBarHeight}}px;">
<view class="navbar-left" bindtap="goBack">
<text class="back-icon"></text>
</view>
<view class="navbar-title">
<text class="title-text">通知设置</text>
</view>
<view class="navbar-right"></view>
</view>
</view>
<!-- 页面内容 -->
<scroll-view class="page-content" scroll-y="true">
<!-- 通知总开关 -->
<view class="settings-section">
<view class="section-header">
<text class="section-title">通知总开关</text>
</view>
<view class="setting-item">
<view class="item-info">
<text class="item-title">接收通知</text>
<text class="item-desc">关闭后将不会收到任何通知</text>
</view>
<switch class="setting-switch"
checked="{{notificationSettings.enabled}}"
bindchange="onNotificationEnabledChange" />
</view>
</view>
<!-- 消息通知 -->
<view class="settings-section" wx:if="{{notificationSettings.enabled}}">
<view class="section-header">
<text class="section-title">消息通知</text>
</view>
<view class="setting-item">
<view class="item-info">
<text class="item-title">新消息通知</text>
<text class="item-desc">收到新消息时显示通知</text>
</view>
<switch class="setting-switch"
checked="{{notificationSettings.message.enabled}}"
bindchange="onMessageNotificationChange" />
</view>
<view class="setting-item" wx:if="{{notificationSettings.message.enabled}}">
<view class="item-info">
<text class="item-title">消息预览</text>
<text class="item-desc">在通知中显示消息内容</text>
</view>
<switch class="setting-switch"
checked="{{notificationSettings.message.showPreview}}"
bindchange="onMessagePreviewChange" />
</view>
<view class="setting-item" wx:if="{{notificationSettings.message.enabled}}">
<view class="item-info">
<text class="item-title">消息提示音</text>
<text class="item-desc">收到消息时播放提示音</text>
</view>
<switch class="setting-switch"
checked="{{notificationSettings.message.sound}}"
bindchange="onMessageSoundChange" />
</view>
<view class="setting-item" wx:if="{{notificationSettings.message.enabled}}">
<view class="item-info">
<text class="item-title">消息震动</text>
<text class="item-desc">收到消息时震动提醒</text>
</view>
<switch class="setting-switch"
checked="{{notificationSettings.message.vibrate}}"
bindchange="onMessageVibrateChange" />
</view>
<view class="setting-item" wx:if="{{notificationSettings.message.enabled}}">
<view class="item-info">
<text class="item-title">按聊天分组</text>
<text class="item-desc">将同一聊天的消息合并显示</text>
</view>
<switch class="setting-switch"
checked="{{notificationSettings.message.groupByChat}}"
bindchange="onMessageGroupChange" />
</view>
</view>
<!-- 群聊通知 -->
<view class="settings-section" wx:if="{{notificationSettings.enabled}}">
<view class="section-header">
<text class="section-title">群聊通知</text>
</view>
<view class="setting-item">
<view class="item-info">
<text class="item-title">群聊消息</text>
<text class="item-desc">收到群聊消息时显示通知</text>
</view>
<switch class="setting-switch"
checked="{{notificationSettings.group.enabled}}"
bindchange="onGroupNotificationChange" />
</view>
<view class="setting-item" wx:if="{{notificationSettings.group.enabled}}">
<view class="item-info">
<text class="item-title">仅@我的消息</text>
<text class="item-desc">只有@我的群聊消息才通知</text>
</view>
<switch class="setting-switch"
checked="{{notificationSettings.group.mentionOnly}}"
bindchange="onGroupMentionOnlyChange" />
</view>
<view class="setting-item" wx:if="{{notificationSettings.group.enabled}}">
<view class="item-info">
<text class="item-title">群聊提示音</text>
<text class="item-desc">收到群聊消息时播放提示音</text>
</view>
<switch class="setting-switch"
checked="{{notificationSettings.group.sound}}"
bindchange="onGroupSoundChange" />
</view>
<view class="setting-item" wx:if="{{notificationSettings.group.enabled}}">
<view class="item-info">
<text class="item-title">群聊震动</text>
<text class="item-desc">收到群聊消息时震动提醒</text>
</view>
<switch class="setting-switch"
checked="{{notificationSettings.group.vibrate}}"
bindchange="onGroupVibrateChange" />
</view>
</view>
<!-- 好友通知 -->
<view class="settings-section" wx:if="{{notificationSettings.enabled}}">
<view class="section-header">
<text class="section-title">好友通知</text>
</view>
<view class="setting-item">
<view class="item-info">
<text class="item-title">好友请求</text>
<text class="item-desc">收到好友请求时显示通知</text>
</view>
<switch class="setting-switch"
checked="{{notificationSettings.friend.enabled}}"
bindchange="onFriendNotificationChange" />
</view>
<view class="setting-item" wx:if="{{notificationSettings.friend.enabled}}">
<view class="item-info">
<text class="item-title">好友提示音</text>
<text class="item-desc">收到好友通知时播放提示音</text>
</view>
<switch class="setting-switch"
checked="{{notificationSettings.friend.sound}}"
bindchange="onFriendSoundChange" />
</view>
</view>
<!-- 系统通知 -->
<view class="settings-section" wx:if="{{notificationSettings.enabled}}">
<view class="section-header">
<text class="section-title">系统通知</text>
</view>
<view class="setting-item">
<view class="item-info">
<text class="item-title">系统消息</text>
<text class="item-desc">接收系统通知和公告</text>
</view>
<switch class="setting-switch"
checked="{{notificationSettings.system.enabled}}"
bindchange="onSystemNotificationChange" />
</view>
</view>
<!-- 免打扰模式 -->
<view class="settings-section" wx:if="{{notificationSettings.enabled}}">
<view class="section-header">
<text class="section-title">免打扰模式</text>
</view>
<view class="setting-item">
<view class="item-info">
<text class="item-title">开启免打扰</text>
<text class="item-desc">在指定时间段内不接收通知</text>
</view>
<switch class="setting-switch"
checked="{{doNotDisturb.enabled}}"
bindchange="onDoNotDisturbChange" />
</view>
<view class="setting-item" wx:if="{{doNotDisturb.enabled}}">
<view class="item-info">
<text class="item-title">开始时间</text>
<text class="item-desc">免打扰开始时间</text>
</view>
<view class="item-action" bindtap="selectStartTime">
<text class="action-text">{{doNotDisturb.startTime}}</text>
<text class="action-arrow"></text>
</view>
</view>
<view class="setting-item" wx:if="{{doNotDisturb.enabled}}">
<view class="item-info">
<text class="item-title">结束时间</text>
<text class="item-desc">免打扰结束时间</text>
</view>
<view class="item-action" bindtap="selectEndTime">
<text class="action-text">{{doNotDisturb.endTime}}</text>
<text class="action-arrow"></text>
</view>
</view>
<view class="setting-item" wx:if="{{doNotDisturb.enabled}}">
<view class="item-info">
<text class="item-title">允许紧急通知</text>
<text class="item-desc">免打扰期间仍接收紧急通知</text>
</view>
<switch class="setting-switch"
checked="{{doNotDisturb.allowUrgent}}"
bindchange="onAllowUrgentChange" />
</view>
<view class="setting-item" wx:if="{{doNotDisturb.enabled}}">
<view class="item-info">
<text class="item-title">允许@提醒</text>
<text class="item-desc">免打扰期间仍接收@提醒</text>
</view>
<switch class="setting-switch"
checked="{{doNotDisturb.allowMentions}}"
bindchange="onAllowMentionsChange" />
</view>
</view>
<!-- 通知历史 -->
<view class="settings-section">
<view class="section-header">
<text class="section-title">通知管理</text>
</view>
<view class="setting-item" bindtap="viewNotificationHistory">
<view class="item-info">
<text class="item-title">通知历史</text>
<text class="item-desc">查看最近的通知记录</text>
</view>
<view class="item-action">
<text class="unread-badge" wx:if="{{unreadCount > 0}}">{{unreadCount}}</text>
<text class="action-arrow"></text>
</view>
</view>
<view class="setting-item" bindtap="clearNotificationHistory">
<view class="item-info">
<text class="item-title">清空通知历史</text>
<text class="item-desc">删除所有通知记录</text>
</view>
<text class="action-arrow"></text>
</view>
</view>
<!-- 订阅消息 -->
<view class="settings-section">
<view class="section-header">
<text class="section-title">订阅消息</text>
</view>
<view class="setting-item" bindtap="requestSubscribeMessage">
<view class="item-info">
<text class="item-title">订阅消息权限</text>
<text class="item-desc">允许应用发送订阅消息</text>
</view>
<text class="action-arrow"></text>
</view>
<view class="setting-item" bindtap="viewSubscribeStatus">
<view class="item-info">
<text class="item-title">订阅状态</text>
<text class="item-desc">查看当前订阅消息状态</text>
</view>
<text class="action-arrow"></text>
</view>
</view>
<!-- 重置设置 -->
<view class="settings-section">
<view class="setting-item danger" bindtap="resetSettings">
<view class="item-info">
<text class="item-title danger">重置通知设置</text>
<text class="item-desc">恢复所有通知设置为默认值</text>
</view>
<text class="action-arrow"></text>
</view>
</view>
</scroll-view>
</view>
<!-- 时间选择器 -->
<picker wx:if="{{showTimePicker}}"
mode="time"
value="{{selectedTime}}"
bindchange="onTimeChange"
bindcancel="onTimeCancel">
</picker>

View file

@ -0,0 +1,582 @@
/* 🔔 通知设置页面样式 */
/* CSS变量定义 */
page {
--primary-color: #007AFF;
--primary-light: #5AC8FA;
--primary-dark: #0051D5;
--success-color: #34C759;
--danger-color: #FF3B30;
--warning-color: #FF9500;
--background-color: #F2F2F7;
--surface-color: #FFFFFF;
--text-primary: #000000;
--text-secondary: #8E8E93;
--text-tertiary: #C7C7CC;
--border-color: #E5E5EA;
--shadow-light: 0 1rpx 3rpx rgba(0, 0, 0, 0.1);
--shadow-medium: 0 4rpx 12rpx rgba(0, 0, 0, 0.15);
--radius-small: 8rpx;
--radius-medium: 12rpx;
--radius-large: 20rpx;
}
/* 🌙 深色模式支持 */
@media (prefers-color-scheme: dark) {
page {
--primary-color: #0A84FF;
--primary-light: #64D2FF;
--primary-dark: #0056CC;
--success-color: #30D158;
--danger-color: #FF453A;
--warning-color: #FF9F0A;
--background-color: #000000;
--surface-color: #1C1C1E;
--text-primary: #FFFFFF;
--text-secondary: #8E8E93;
--text-tertiary: #48484A;
--border-color: #38383A;
--shadow-light: 0 1rpx 3rpx rgba(0, 0, 0, 0.3);
--shadow-medium: 0 4rpx 12rpx rgba(0, 0, 0, 0.4);
}
}
.notification-settings-container {
height: 100vh;
background: var(--background-color);
display: flex;
flex-direction: column;
}
/* 🎨 自定义导航栏 */
.custom-navbar {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
box-shadow: var(--shadow-medium);
z-index: 1000;
}
.navbar-content {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
}
.navbar-left, .navbar-right {
width: 80rpx;
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: var(--radius-medium);
transition: all 0.3s ease;
}
.navbar-left:active {
background: rgba(255, 255, 255, 0.2);
transform: scale(0.95);
}
.back-icon {
font-size: 48rpx;
color: white;
font-weight: 300;
}
.navbar-title {
flex: 1;
text-align: center;
}
.title-text {
font-size: 36rpx;
font-weight: 600;
color: white;
}
/* 🎨 页面内容 */
.page-content {
flex: 1;
padding: 32rpx 0;
}
/* 🎨 设置分组 */
.settings-section {
margin-bottom: 32rpx;
}
.section-header {
padding: 0 32rpx 16rpx;
}
.section-title {
font-size: 26rpx;
font-weight: 600;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 1rpx;
}
/* 🎨 设置项 */
.setting-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 32rpx;
background: var(--surface-color);
border-bottom: 1rpx solid var(--border-color);
transition: all 0.2s ease;
}
.setting-item:first-child {
border-top-left-radius: var(--radius-medium);
border-top-right-radius: var(--radius-medium);
}
.setting-item:last-child {
border-bottom: none;
border-bottom-left-radius: var(--radius-medium);
border-bottom-right-radius: var(--radius-medium);
}
.setting-item:active {
background: var(--background-color);
}
.setting-item.danger {
background: rgba(255, 59, 48, 0.05);
}
.setting-item.danger:active {
background: rgba(255, 59, 48, 0.1);
}
.item-info {
flex: 1;
min-width: 0;
}
.item-title {
font-size: 32rpx;
font-weight: 500;
color: var(--text-primary);
display: block;
margin-bottom: 8rpx;
}
.item-title.danger {
color: var(--danger-color);
}
.item-desc {
font-size: 26rpx;
color: var(--text-secondary);
line-height: 1.4;
}
.item-action {
display: flex;
align-items: center;
gap: 16rpx;
}
.action-text {
font-size: 30rpx;
color: var(--primary-color);
font-weight: 500;
}
.action-arrow {
font-size: 32rpx;
color: var(--text-tertiary);
font-weight: 300;
}
.unread-badge {
min-width: 40rpx;
height: 40rpx;
border-radius: 20rpx;
background: var(--danger-color);
color: white;
font-size: 24rpx;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
padding: 0 8rpx;
}
/* 🎨 开关控件 */
.setting-switch {
transform: scale(0.8);
transition: all 0.3s ease;
}
.setting-switch:active {
transform: scale(0.75);
}
/* 🎨 时间选择器样式 */
.time-picker-container {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 9999;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: flex-end;
animation: fadeIn 0.3s ease-out;
}
.time-picker-content {
width: 100%;
background: var(--surface-color);
border-radius: var(--radius-large) var(--radius-large) 0 0;
box-shadow: var(--shadow-medium);
animation: slideUp 0.3s ease-out;
overflow: hidden;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slideUp {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
}
.time-picker-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 32rpx;
border-bottom: 1rpx solid var(--border-color);
}
.time-picker-title {
font-size: 36rpx;
font-weight: 600;
color: var(--text-primary);
}
.time-picker-btn {
font-size: 30rpx;
color: var(--primary-color);
font-weight: 500;
transition: all 0.2s ease;
}
.time-picker-btn:active {
opacity: 0.7;
}
.time-picker-btn.cancel {
color: var(--text-secondary);
}
.time-picker-body {
padding: 32rpx;
}
/* 🎨 状态指示器 */
.status-indicator {
display: flex;
align-items: center;
gap: 16rpx;
}
.status-dot {
width: 16rpx;
height: 16rpx;
border-radius: 8rpx;
background: var(--text-tertiary);
}
.status-dot.active {
background: var(--success-color);
}
.status-dot.inactive {
background: var(--text-tertiary);
}
.status-dot.error {
background: var(--danger-color);
}
.status-text {
font-size: 26rpx;
color: var(--text-secondary);
}
/* 🎨 通知预览 */
.notification-preview {
background: var(--surface-color);
border: 1rpx solid var(--border-color);
border-radius: var(--radius-medium);
padding: 24rpx;
margin: 24rpx 32rpx;
box-shadow: var(--shadow-light);
}
.preview-header {
display: flex;
align-items: center;
gap: 16rpx;
margin-bottom: 16rpx;
}
.preview-icon {
width: 48rpx;
height: 48rpx;
border-radius: 24rpx;
background: var(--primary-color);
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: white;
}
.preview-title {
font-size: 28rpx;
font-weight: 600;
color: var(--text-primary);
}
.preview-time {
font-size: 24rpx;
color: var(--text-tertiary);
margin-left: auto;
}
.preview-content {
font-size: 26rpx;
color: var(--text-secondary);
line-height: 1.4;
}
/* 🎨 提示信息 */
.tip-container {
background: rgba(0, 122, 255, 0.1);
border: 1rpx solid rgba(0, 122, 255, 0.3);
border-radius: var(--radius-small);
padding: 24rpx;
margin: 24rpx 32rpx;
}
.tip-text {
font-size: 26rpx;
color: var(--primary-color);
line-height: 1.4;
}
.tip-icon {
font-size: 28rpx;
margin-right: 12rpx;
}
/* 🎨 空状态 */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 120rpx 40rpx;
text-align: center;
}
.empty-icon {
font-size: 120rpx;
margin-bottom: 24rpx;
opacity: 0.5;
}
.empty-text {
font-size: 28rpx;
color: var(--text-secondary);
margin-bottom: 32rpx;
}
.empty-action {
padding: 24rpx 48rpx;
background: var(--primary-color);
color: white;
border-radius: var(--radius-medium);
font-size: 28rpx;
font-weight: 500;
transition: all 0.3s ease;
}
.empty-action:active {
background: var(--primary-dark);
transform: scale(0.98);
}
/* 🎨 加载状态 */
.loading-container {
display: flex;
align-items: center;
justify-content: center;
padding: 80rpx;
}
.loading-spinner {
width: 60rpx;
height: 60rpx;
border: 4rpx solid var(--border-color);
border-top: 4rpx solid var(--primary-color);
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.loading-text {
font-size: 28rpx;
color: var(--text-secondary);
margin-left: 24rpx;
}
/* 📱 响应式设计 */
@media screen and (max-width: 375px) {
.page-content {
padding: 24rpx 0;
}
.settings-section {
margin-bottom: 24rpx;
}
.section-header {
padding: 0 24rpx 12rpx;
}
.setting-item {
padding: 24rpx;
}
.notification-preview,
.tip-container {
margin: 16rpx 24rpx;
padding: 16rpx;
}
}
@media screen and (min-width: 414px) {
.page-content {
padding: 40rpx 0;
}
.settings-section {
margin-bottom: 40rpx;
}
.section-header {
padding: 0 40rpx 20rpx;
}
.setting-item {
padding: 40rpx;
}
.notification-preview,
.tip-container {
margin: 32rpx 40rpx;
padding: 32rpx;
}
}
/* 🎨 动画效果 */
.setting-item {
transition: all 0.2s ease;
}
.setting-item:hover {
background: var(--background-color);
}
.setting-switch {
transition: all 0.3s ease;
}
.action-text {
transition: all 0.2s ease;
}
.action-text:active {
opacity: 0.7;
}
/* 🎨 特殊状态 */
.setting-item.disabled {
opacity: 0.5;
pointer-events: none;
}
.setting-item.highlighted {
background: rgba(0, 122, 255, 0.05);
border-color: rgba(0, 122, 255, 0.3);
}
.setting-item.warning {
background: rgba(255, 149, 0, 0.05);
}
.setting-item.warning .item-title {
color: var(--warning-color);
}
/* 🎨 分隔线 */
.divider {
height: 1rpx;
background: var(--border-color);
margin: 0 32rpx;
}
.divider.thick {
height: 16rpx;
background: var(--background-color);
margin: 0;
}
/* 🎨 标签 */
.tag {
display: inline-block;
padding: 8rpx 16rpx;
border-radius: var(--radius-small);
font-size: 24rpx;
font-weight: 500;
line-height: 1;
}
.tag.primary {
background: rgba(0, 122, 255, 0.1);
color: var(--primary-color);
}
.tag.success {
background: rgba(52, 199, 89, 0.1);
color: var(--success-color);
}
.tag.warning {
background: rgba(255, 149, 0, 0.1);
color: var(--warning-color);
}
.tag.danger {
background: rgba(255, 59, 48, 0.1);
color: var(--danger-color);
}