upload project
This commit is contained in:
commit
06961cae04
422 changed files with 110626 additions and 0 deletions
88
subpackages/settings/about/about.js
Normal file
88
subpackages/settings/about/about.js
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
// pages/settings/about/about.js
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
version: '1.0.0',
|
||||
appName: 'FindMe'
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
// 页面加载时执行
|
||||
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 页面显示时执行
|
||||
},
|
||||
|
||||
// 检查更新
|
||||
checkUpdate() {
|
||||
wx.showLoading({
|
||||
title: '检查中...',
|
||||
});
|
||||
|
||||
// 模拟检查更新
|
||||
setTimeout(() => {
|
||||
wx.hideLoading();
|
||||
wx.showModal({
|
||||
title: '检查更新',
|
||||
content: '当前已是最新版本',
|
||||
showCancel: false
|
||||
});
|
||||
}, 1500);
|
||||
},
|
||||
|
||||
// 显示更新日志
|
||||
showUpdateLog() {
|
||||
wx.navigateTo({
|
||||
url: '/subpackages/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'
|
||||
};
|
||||
}
|
||||
});
|
||||
4
subpackages/settings/about/about.json
Normal file
4
subpackages/settings/about/about.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"navigationBarTitleText": "关于我们",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
36
subpackages/settings/about/about.wxml
Normal file
36
subpackages/settings/about/about.wxml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<!-- 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>
|
||||
122
subpackages/settings/about/about.wxss
Normal file
122
subpackages/settings/about/about.wxss
Normal 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;
|
||||
}
|
||||
178
subpackages/settings/about/update-log/update-log.js
Normal file
178
subpackages/settings/about/update-log/update-log.js
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
// 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: '/subpackages/settings/about/update-log/update-log',
|
||||
imageUrl: '/images/findme-logo.png'
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
7
subpackages/settings/about/update-log/update-log.json
Normal file
7
subpackages/settings/about/update-log/update-log.json
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#F2F2F7",
|
||||
"backgroundTextStyle": "dark",
|
||||
"enablePullDownRefresh": false,
|
||||
"onReachBottomDistance": 50
|
||||
}
|
||||
92
subpackages/settings/about/update-log/update-log.wxml
Normal file
92
subpackages/settings/about/update-log/update-log.wxml
Normal 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>
|
||||
326
subpackages/settings/about/update-log/update-log.wxss
Normal file
326
subpackages/settings/about/update-log/update-log.wxss
Normal 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); }
|
||||
}
|
||||
115
subpackages/settings/account-security/account-security.js
Normal file
115
subpackages/settings/account-security/account-security.js
Normal 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) {
|
||||
|
||||
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: '/subpackages/settings/account-security/account-security?tab=blocked'
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function() {
|
||||
return {
|
||||
title: 'FindMe - 账号与安全',
|
||||
path: '/subpackages/settings/account-security/account-security'
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"navigationBarTitleText": "账户与安全",
|
||||
"navigationBarBackgroundColor": "#000000",
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#000000",
|
||||
"disableScroll": false
|
||||
}
|
||||
63
subpackages/settings/account-security/account-security.wxml
Normal file
63
subpackages/settings/account-security/account-security.wxml
Normal 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>
|
||||
159
subpackages/settings/account-security/account-security.wxss
Normal file
159
subpackages/settings/account-security/account-security.wxss
Normal 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;
|
||||
}
|
||||
}
|
||||
21
subpackages/settings/chat-settings/chat-settings.js
Normal file
21
subpackages/settings/chat-settings/chat-settings.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
Page({
|
||||
data: {
|
||||
// 系统信息
|
||||
statusBarHeight: 0,
|
||||
navBarHeight: 0
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
// 获取系统信息
|
||||
const systemInfo = wx.getSystemInfoSync();
|
||||
this.setData({
|
||||
statusBarHeight: systemInfo.statusBarHeight,
|
||||
navBarHeight: systemInfo.statusBarHeight + 44
|
||||
});
|
||||
},
|
||||
|
||||
// 返回上一页
|
||||
goBack() {
|
||||
wx.navigateBack();
|
||||
}
|
||||
});
|
||||
6
subpackages/settings/chat-settings/chat-settings.json
Normal file
6
subpackages/settings/chat-settings/chat-settings.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "",
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarBackgroundColor": "#0C0C0C"
|
||||
}
|
||||
28
subpackages/settings/chat-settings/chat-settings.wxml
Normal file
28
subpackages/settings/chat-settings/chat-settings.wxml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<view class="page-container">
|
||||
<scroll-view class="content-scroll">
|
||||
<view class="settings-list">
|
||||
<!-- 默认背景 -->
|
||||
<view class="setting-item">
|
||||
<text class="setting-label">默认背景</text>
|
||||
<image src="/images//emoji/r-Return.svg" class="setting-arrow"></image>
|
||||
</view>
|
||||
|
||||
<!-- 从相册选择 -->
|
||||
<view class="setting-item">
|
||||
<text class="setting-label">从相册选择</text>
|
||||
<image src="/images//emoji/r-Return.svg" class="setting-arrow"></image>
|
||||
</view>
|
||||
|
||||
<!-- 拍照片 -->
|
||||
<view class="setting-item">
|
||||
<text class="setting-label">拍照片</text>
|
||||
<image src="/images//emoji/r-Return.svg" class="setting-arrow"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 应用于全部聊天 -->
|
||||
<view class="setting-item apply-all">
|
||||
<text class="all">应用于全部聊天</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
127
subpackages/settings/chat-settings/chat-settings.wxss
Normal file
127
subpackages/settings/chat-settings/chat-settings.wxss
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/* 基础样式 */
|
||||
page {
|
||||
background-color: #000000;
|
||||
color: #FFFFFF;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.page-container {
|
||||
min-height: 100vh;
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
/* 顶部导航栏 */
|
||||
.navbar {
|
||||
background-color: #000000;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
height: 68rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 顶部导航栏内容 */
|
||||
.navbar-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 24rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
height: 48rpx;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.nav-back {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.back-icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.nav-placeholder {
|
||||
width: 48rpx;
|
||||
}
|
||||
|
||||
.content-scroll {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* 设置列表 */
|
||||
.settings-list {
|
||||
padding: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* 设置项 */
|
||||
.setting-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid rgba(255, 255, 255, 0.1);
|
||||
background-color: #1E1E1E;
|
||||
}
|
||||
|
||||
.setting-item:first-child {
|
||||
padding-top: 30rpx;
|
||||
margin-top: 0;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.setting-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.setting-label {
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
opacity: 0.9;
|
||||
margin-left: 25rpx;
|
||||
}
|
||||
|
||||
/* 设置箭头 */
|
||||
.setting-arrow {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
opacity: 0.5;
|
||||
margin-right: 25rpx;
|
||||
}
|
||||
|
||||
/* 应用于全部聊天 */
|
||||
.setting-item.apply-all {
|
||||
justify-content: center;
|
||||
border-bottom: none;
|
||||
background-color: #1E1E1E;
|
||||
width: 100%;
|
||||
padding: 30rpx 0;
|
||||
margin-top: 20rpx;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.all {
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.setting-item.apply-all:active {
|
||||
background-color: #121212;
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.setting-item.apply-all .setting-label {
|
||||
color: #FFFFFF;
|
||||
font-weight: 600;
|
||||
}
|
||||
108
subpackages/settings/feedback/feedback.js
Normal file
108
subpackages/settings/feedback/feedback.js
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
// 反馈页面逻辑
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
feedbackTypes: ['功能建议', 'Bug反馈', '内容纠错', '其他问题'],
|
||||
selectedType: 0,
|
||||
content: '',
|
||||
contact: '',
|
||||
navbarHeight: 0, // 导航栏高度
|
||||
statusBarHeight: 0, // 状态栏高度
|
||||
menuButtonInfo: {} // 胶囊按钮信息
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
|
||||
// 获取系统信息,用于导航栏定位
|
||||
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);
|
||||
}
|
||||
});
|
||||
8
subpackages/settings/feedback/feedback.json
Normal file
8
subpackages/settings/feedback/feedback.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"navigationBarTitleText": "意见反馈",
|
||||
"navigationBarBackgroundColor": "#000000",
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#000000",
|
||||
"disableScroll": false
|
||||
}
|
||||
56
subpackages/settings/feedback/feedback.wxml
Normal file
56
subpackages/settings/feedback/feedback.wxml
Normal 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>
|
||||
169
subpackages/settings/feedback/feedback.wxss
Normal file
169
subpackages/settings/feedback/feedback.wxss
Normal 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;
|
||||
}
|
||||
|
||||
139
subpackages/settings/font-size/font-size.js
Normal file
139
subpackages/settings/font-size/font-size.js
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
Page({
|
||||
data: {
|
||||
// 系统信息
|
||||
statusBarHeight: 0,
|
||||
navbarHeight: 0,
|
||||
menuButtonInfo: { height: 32, width: 32, top: 0 },
|
||||
// 字体大小相关
|
||||
fontSizeValue: 16, // 默认字体大小
|
||||
previewFontSize: 16, // 预览区域字体大小
|
||||
currentFontSize: 'small', // 当前字体大小
|
||||
activeDotIndex: 1 // 默认字体为第二个位置
|
||||
},
|
||||
|
||||
/* 监听页面加载 */
|
||||
onLoad: function (options) {
|
||||
// 获取系统信息
|
||||
this.getSystemInfo();
|
||||
// 加载字体设置
|
||||
this.loadCurrentFontSize();
|
||||
},
|
||||
|
||||
/* 获取系统信息 */
|
||||
getSystemInfo: function() {
|
||||
const systemInfo = wx.getSystemInfoSync();
|
||||
const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
|
||||
|
||||
this.setData({
|
||||
statusBarHeight: systemInfo.statusBarHeight,
|
||||
navbarHeight: menuButtonInfo.height + (menuButtonInfo.top - systemInfo.statusBarHeight) * 2,
|
||||
menuButtonInfo: menuButtonInfo
|
||||
});
|
||||
},
|
||||
|
||||
/* 加载用字体设置 */
|
||||
loadCurrentFontSize: function() {
|
||||
try {
|
||||
// 获取聊天设置
|
||||
const chatSettings = wx.getStorageSync('chatSettings') || {};
|
||||
const fontSizeValue = chatSettings.fontSizeValue || 16;
|
||||
|
||||
// 字体大小选项
|
||||
let currentFontSize = 'medium';
|
||||
if (fontSizeValue <= 16) {
|
||||
currentFontSize = 'small';
|
||||
} else if (fontSizeValue >= 20) {
|
||||
currentFontSize = 'large';
|
||||
}
|
||||
|
||||
// 当前字体所在的位置
|
||||
const activeDotIndex = Math.min(Math.round((fontSizeValue - 14) / 2), 5);
|
||||
|
||||
// 设置滑块值和预览字体大小
|
||||
this.setData({
|
||||
currentFontSize: currentFontSize,
|
||||
fontSizeValue: fontSizeValue,
|
||||
previewFontSize: fontSizeValue,
|
||||
activeDotIndex: activeDotIndex
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('加载字体设置失败:', error);
|
||||
}
|
||||
},
|
||||
|
||||
/* 滑块值变化 */
|
||||
onSliderChange: function(e) {
|
||||
// 不处理滑块之间的点击
|
||||
},
|
||||
|
||||
/* 点击字体大小位置 */
|
||||
onDotClick: function(e) {
|
||||
const value = parseInt(e.currentTarget.dataset.value);
|
||||
|
||||
// 当前字体所在的位置
|
||||
const activeDotIndex = Math.min(Math.round((value - 14) / 2), 5);
|
||||
|
||||
// 更新预览字体大小和字体所在位置
|
||||
this.setData({
|
||||
previewFontSize: value,
|
||||
activeDotIndex: activeDotIndex,
|
||||
fontSizeValue: value
|
||||
});
|
||||
|
||||
// 保存设置
|
||||
this.saveFontSizeSetting(value);
|
||||
},
|
||||
|
||||
/* 阻止滑块之间的点击 */
|
||||
onSliderTap: function(e) {
|
||||
e.stopPropagation();
|
||||
},
|
||||
|
||||
/* 保存字体大小设置 */
|
||||
saveFontSizeSetting: function(value) {
|
||||
try {
|
||||
// 字体大小选项
|
||||
let fontSizeOption = 'medium';
|
||||
if (value <= 16) {
|
||||
fontSizeOption = 'small';
|
||||
} else if (value >= 20) {
|
||||
fontSizeOption = 'large';
|
||||
}
|
||||
|
||||
// 获取聊天设置
|
||||
const chatSettings = wx.getStorageSync('chatSettings') || {};
|
||||
// 更新字体大小设置
|
||||
const updatedSettings = { ...chatSettings, fontSize: fontSizeOption, fontSizeValue: value };
|
||||
// 保存到本地
|
||||
wx.setStorageSync('chatSettings', updatedSettings);
|
||||
|
||||
// 更新数据
|
||||
this.setData({
|
||||
currentFontSize: fontSizeOption,
|
||||
fontSizeValue: value
|
||||
});
|
||||
|
||||
// 更新通知
|
||||
getApp().globalData.fontSize = fontSizeOption;
|
||||
|
||||
} catch (error) {
|
||||
console.error('保存字体设置失败:', error);
|
||||
wx.showToast({
|
||||
title: '设置保存失败',
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/* 返回上一页 */
|
||||
navigateBack: function() {
|
||||
wx.navigateBack();
|
||||
},
|
||||
|
||||
/* 监听页面显示 */
|
||||
onShow: function () {
|
||||
// 重新加载字体设置
|
||||
this.loadCurrentFontSize();
|
||||
}
|
||||
});
|
||||
9
subpackages/settings/font-size/font-size.json
Normal file
9
subpackages/settings/font-size/font-size.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"navigationBarTitleText": "",
|
||||
"navigationBarBackgroundColor": "#000000",
|
||||
"navigationBarTextStyle": "white",
|
||||
"backgroundColor": "#f5f5f5",
|
||||
"enablePullDownRefresh": false,
|
||||
"disableScroll": false,
|
||||
"usingComponents": {}
|
||||
}
|
||||
73
subpackages/settings/font-size/font-size.wxml
Normal file
73
subpackages/settings/font-size/font-size.wxml
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
<view class="font-size-container">
|
||||
<view class="content" style="padding-top: {{statusBarHeight + menuButtonInfo.height}}px;">
|
||||
<!-- 预览区域 -->
|
||||
<view class="preview-section">
|
||||
<view class="chat-preview" style="font-size: {{previewFontSize}}px;">
|
||||
<view class="message-bubble right">
|
||||
<view class="bubble-content">
|
||||
<text class="message-text">Preview text size</text>
|
||||
</view>
|
||||
<view class="avatar right">
|
||||
<image src="/images/avatar.png" mode="aspectFill" style="width: 100%; height: 100%; border-radius: 50%;"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="message-bubble left">
|
||||
<view class="avatar left">
|
||||
<image src="/images/Findme avatar.png" mode="aspectFill" style="width: 100%; height: 100%; border-radius: 50%;"></image>
|
||||
</view>
|
||||
<view class="bubble-content">
|
||||
<text class="message-text">Adjust the slider below to change text size</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="message-bubble left">
|
||||
<view class="avatar left">
|
||||
<image src="/images/Findme avatar.png" mode="aspectFill" style="width: 100%; height: 100%; border-radius: 50%;"></image>
|
||||
</view>
|
||||
<view class="bubble-content">
|
||||
<text class="message-text">接下来,你可以试着用滑块调整字体大小。</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部空间 -->
|
||||
<view style="height: 150rpx;"></view>
|
||||
|
||||
<!-- 滑块组件 -->
|
||||
<view class="slider-section" style="position: fixed; bottom: 0; left: 0; right: 0; padding: 20rpx; box-sizing: border-box;">
|
||||
<view class="text-container">
|
||||
<text class="size-label">A</text>
|
||||
<text class="size-label large">A</text>
|
||||
</view>
|
||||
|
||||
<view class="slider-wrapper">
|
||||
<view class="custom-track"></view>
|
||||
<view class="dots-container-overlay">
|
||||
<view class="dot {{activeDotIndex === 0 ? 'active' : ''}}" bindtap="onDotClick" data-value="14"></view>
|
||||
<view class="dot-container">
|
||||
<text class="dot-label">Default</text>
|
||||
<view class="dot {{activeDotIndex === 1 ? 'active' : ''}}" bindtap="onDotClick" data-value="16"></view>
|
||||
</view>
|
||||
<view class="dot {{activeDotIndex === 2 ? 'active' : ''}}" bindtap="onDotClick" data-value="18"></view>
|
||||
<view class="dot {{activeDotIndex === 3 ? 'active' : ''}}" bindtap="onDotClick" data-value="20"></view>
|
||||
<view class="dot {{activeDotIndex === 4 ? 'active' : ''}}" bindtap="onDotClick" data-value="22"></view>
|
||||
<view class="dot {{activeDotIndex === 5 ? 'active' : ''}}" bindtap="onDotClick" data-value="24"></view>
|
||||
</view>
|
||||
<slider
|
||||
min="14"
|
||||
max="24"
|
||||
value="{{fontSizeValue}}"
|
||||
activeColor="transparent"
|
||||
backgroundColor="transparent"
|
||||
block-size="22"
|
||||
block-color="transparent"
|
||||
block-border-radius="50%"
|
||||
track-height="6"
|
||||
disabled="true"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
321
subpackages/settings/font-size/font-size.wxss
Normal file
321
subpackages/settings/font-size/font-size.wxss
Normal file
|
|
@ -0,0 +1,321 @@
|
|||
/* 页面样式 */
|
||||
.font-size-container {
|
||||
position: relative;
|
||||
min-height: 100vh;
|
||||
background-color: #202529;
|
||||
}
|
||||
|
||||
/* 顶部导航栏样式 */
|
||||
.navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color: #cc0000;
|
||||
z-index: 1000;
|
||||
border-bottom: 1px solid #a00000;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
width: 44px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.back-btn .icon {
|
||||
font-size: 18px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.title {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 17px;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* 内容样式 */
|
||||
.content {
|
||||
padding-bottom: 40rpx;
|
||||
padding-top: 50rpx !important;
|
||||
}
|
||||
|
||||
/* 预览区域样式 */
|
||||
.preview-section {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
background-color: #202529;
|
||||
}
|
||||
|
||||
.chat-preview {
|
||||
padding: 0rpx 0rpx 20rpx 0rpx;
|
||||
background-color: #202529;
|
||||
}
|
||||
|
||||
.message-bubble {
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.message-bubble:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.message-bubble.left {
|
||||
flex-direction: row;
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
|
||||
.message-bubble.right {
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.avatar.left {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #333333;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 50rpx 15rpx;
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.avatar.right {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #333333;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 45rpx 30rpx;
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.bubble-content {
|
||||
max-width: 600rpx;
|
||||
padding: 15rpx 15rpx;
|
||||
border-radius: 15rpx;
|
||||
position: relative;
|
||||
word-break: break-word;
|
||||
margin-bottom: 45rpx;
|
||||
}
|
||||
|
||||
.message-bubble.left .bubble-content {
|
||||
background-color: #f0f0f0;
|
||||
color: #333333;
|
||||
border: none;
|
||||
border-bottom-left-radius: 5rpx;
|
||||
}
|
||||
|
||||
.message-bubble.left .bubble-content::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: 100%;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
border-style: solid;
|
||||
border-width: 8rpx 12rpx 8rpx 0;
|
||||
border-color: transparent #f0f0f0 transparent transparent;
|
||||
}
|
||||
|
||||
.message-bubble.right .bubble-content {
|
||||
background-color: #4DD1A1;
|
||||
color: black;
|
||||
border: none;
|
||||
border-bottom-right-radius: 5rpx;
|
||||
width: 350rpx;
|
||||
}
|
||||
|
||||
.message-bubble.right .bubble-content::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 100%;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
border-style: solid;
|
||||
border-width: 8rpx 0 8rpx 12rpx;
|
||||
border-color: transparent transparent transparent #4DD1A1;
|
||||
}
|
||||
|
||||
.message-text {
|
||||
line-height: 1.4;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.no-wrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* 滑块样式 */
|
||||
.slider-section {
|
||||
padding: 0 40rpx;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.text-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
color: #ffffff;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.custom-track {
|
||||
position: absolute;
|
||||
width: 90%;
|
||||
height: 4rpx;
|
||||
background-color: #E5E5E5;
|
||||
top: 50%;
|
||||
left: 5%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
/* 指示器样式 */
|
||||
.dots-container-overlay {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding: 0 5%;
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
transform: translateY(-50%);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #E5E5E5;
|
||||
border: 2rpx solid #333333;
|
||||
transition: all 0.2s ease;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.dot.active {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
background-color: #ffffff;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
transform: scale(1);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.size-label {
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
.size-label.large {
|
||||
font-size: 60rpx;
|
||||
color: #ffffff;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.default-text {
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
font-weight: normal;
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
|
||||
/* 标签样式 */
|
||||
.dot-container {
|
||||
width: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dot-label {
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
font-weight: normal;
|
||||
margin-bottom: 10rpx;
|
||||
position: absolute;
|
||||
top: -70rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.slider-wrapper {
|
||||
position: relative;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.slider-wrapper slider {
|
||||
width: 100%;
|
||||
height: 40rpx;
|
||||
margin: 0;
|
||||
clip-path: inset(0 5% 0 5%);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
|
||||
.slider-wrapper slider text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 适配深色模式 */
|
||||
.theme-dark .font-size-container {
|
||||
background-color: #1a1a1a;
|
||||
}
|
||||
|
||||
.theme-dark .navbar {
|
||||
background-color: #2c2c2c;
|
||||
border-bottom-color: #3a3a3a;
|
||||
}
|
||||
|
||||
.theme-dark .back-btn .icon,
|
||||
.theme-dark .title {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.theme-dark .preview-section {
|
||||
background-color: #2c2c2c;
|
||||
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.theme-dark .message-bubble.left .bubble-content {
|
||||
background-color: #3a3a3a;
|
||||
border-color: #4a4a4a;
|
||||
}
|
||||
|
||||
.theme-dark .message-bubble.left .message-text {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.theme-dark .hint,
|
||||
.theme-dark .size-label,
|
||||
.theme-dark .size-label.large,
|
||||
.theme-dark .default-hint {
|
||||
color: #cccccc;
|
||||
}
|
||||
|
||||
.theme-dark .reset-button {
|
||||
color: #1aad19;
|
||||
border-color: #1aad19;
|
||||
background-color: #2c2c2c;
|
||||
}
|
||||
|
|
@ -0,0 +1,558 @@
|
|||
// 🔔 通知设置页面逻辑
|
||||
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) {
|
||||
|
||||
// 获取系统信息
|
||||
this.getSystemInfo();
|
||||
|
||||
// 加载通知设置
|
||||
this.loadNotificationSettings();
|
||||
|
||||
// 加载未读计数
|
||||
this.loadUnreadCount();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
|
||||
// 刷新未读计数
|
||||
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
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} 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;
|
||||
|
||||
this.setData({
|
||||
'notificationSettings.enabled': enabled
|
||||
});
|
||||
|
||||
this.saveNotificationSettings();
|
||||
},
|
||||
|
||||
// 消息通知变更
|
||||
onMessageNotificationChange(e) {
|
||||
const enabled = e.detail.value;
|
||||
|
||||
this.setData({
|
||||
'notificationSettings.message.enabled': enabled
|
||||
});
|
||||
|
||||
this.saveNotificationSettings();
|
||||
},
|
||||
|
||||
// 消息预览变更
|
||||
onMessagePreviewChange(e) {
|
||||
const enabled = e.detail.value;
|
||||
|
||||
this.setData({
|
||||
'notificationSettings.message.showPreview': enabled
|
||||
});
|
||||
|
||||
this.saveNotificationSettings();
|
||||
},
|
||||
|
||||
// 消息提示音变更
|
||||
onMessageSoundChange(e) {
|
||||
const enabled = e.detail.value;
|
||||
|
||||
this.setData({
|
||||
'notificationSettings.message.sound': enabled
|
||||
});
|
||||
|
||||
this.saveNotificationSettings();
|
||||
},
|
||||
|
||||
// 消息震动变更
|
||||
onMessageVibrateChange(e) {
|
||||
const enabled = e.detail.value;
|
||||
|
||||
this.setData({
|
||||
'notificationSettings.message.vibrate': enabled
|
||||
});
|
||||
|
||||
this.saveNotificationSettings();
|
||||
},
|
||||
|
||||
// 消息分组变更
|
||||
onMessageGroupChange(e) {
|
||||
const enabled = e.detail.value;
|
||||
|
||||
this.setData({
|
||||
'notificationSettings.message.groupByChat': enabled
|
||||
});
|
||||
|
||||
this.saveNotificationSettings();
|
||||
},
|
||||
|
||||
// 群聊通知变更
|
||||
onGroupNotificationChange(e) {
|
||||
const enabled = e.detail.value;
|
||||
|
||||
this.setData({
|
||||
'notificationSettings.group.enabled': enabled
|
||||
});
|
||||
|
||||
this.saveNotificationSettings();
|
||||
},
|
||||
|
||||
// 群聊仅@提醒变更
|
||||
onGroupMentionOnlyChange(e) {
|
||||
const enabled = e.detail.value;
|
||||
|
||||
this.setData({
|
||||
'notificationSettings.group.mentionOnly': enabled
|
||||
});
|
||||
|
||||
this.saveNotificationSettings();
|
||||
},
|
||||
|
||||
// 群聊提示音变更
|
||||
onGroupSoundChange(e) {
|
||||
const enabled = e.detail.value;
|
||||
|
||||
this.setData({
|
||||
'notificationSettings.group.sound': enabled
|
||||
});
|
||||
|
||||
this.saveNotificationSettings();
|
||||
},
|
||||
|
||||
// 群聊震动变更
|
||||
onGroupVibrateChange(e) {
|
||||
const enabled = e.detail.value;
|
||||
|
||||
this.setData({
|
||||
'notificationSettings.group.vibrate': enabled
|
||||
});
|
||||
|
||||
this.saveNotificationSettings();
|
||||
},
|
||||
|
||||
// 好友通知变更
|
||||
onFriendNotificationChange(e) {
|
||||
const enabled = e.detail.value;
|
||||
|
||||
this.setData({
|
||||
'notificationSettings.friend.enabled': enabled
|
||||
});
|
||||
|
||||
this.saveNotificationSettings();
|
||||
},
|
||||
|
||||
// 好友提示音变更
|
||||
onFriendSoundChange(e) {
|
||||
const enabled = e.detail.value;
|
||||
|
||||
this.setData({
|
||||
'notificationSettings.friend.sound': enabled
|
||||
});
|
||||
|
||||
this.saveNotificationSettings();
|
||||
},
|
||||
|
||||
// 系统通知变更
|
||||
onSystemNotificationChange(e) {
|
||||
const enabled = e.detail.value;
|
||||
|
||||
this.setData({
|
||||
'notificationSettings.system.enabled': enabled
|
||||
});
|
||||
|
||||
this.saveNotificationSettings();
|
||||
},
|
||||
|
||||
// 🔕 ===== 免打扰设置 =====
|
||||
|
||||
// 免打扰模式变更
|
||||
onDoNotDisturbChange(e) {
|
||||
const enabled = e.detail.value;
|
||||
|
||||
this.setData({
|
||||
'doNotDisturb.enabled': enabled
|
||||
});
|
||||
|
||||
this.saveDoNotDisturbSettings();
|
||||
},
|
||||
|
||||
// 选择开始时间
|
||||
selectStartTime() {
|
||||
|
||||
this.setData({
|
||||
showTimePicker: true,
|
||||
selectedTime: this.data.doNotDisturb.startTime,
|
||||
timePickerType: 'start'
|
||||
});
|
||||
},
|
||||
|
||||
// 选择结束时间
|
||||
selectEndTime() {
|
||||
|
||||
this.setData({
|
||||
showTimePicker: true,
|
||||
selectedTime: this.data.doNotDisturb.endTime,
|
||||
timePickerType: 'end'
|
||||
});
|
||||
},
|
||||
|
||||
// 时间选择变更
|
||||
onTimeChange(e) {
|
||||
const time = e.detail.value;
|
||||
|
||||
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;
|
||||
|
||||
this.setData({
|
||||
'doNotDisturb.allowUrgent': enabled
|
||||
});
|
||||
|
||||
this.saveDoNotDisturbSettings();
|
||||
},
|
||||
|
||||
// 允许@提醒变更
|
||||
onAllowMentionsChange(e) {
|
||||
const enabled = e.detail.value;
|
||||
|
||||
this.setData({
|
||||
'doNotDisturb.allowMentions': enabled
|
||||
});
|
||||
|
||||
this.saveDoNotDisturbSettings();
|
||||
},
|
||||
|
||||
// 📋 ===== 通知管理 =====
|
||||
|
||||
// 查看通知历史
|
||||
viewNotificationHistory() {
|
||||
|
||||
wx.navigateTo({
|
||||
url: '/subpackages/settings/notification-settings/notification-settings'
|
||||
});
|
||||
},
|
||||
|
||||
// 清空通知历史
|
||||
clearNotificationHistory() {
|
||||
|
||||
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'
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ 清空通知历史失败:', error);
|
||||
wx.showToast({
|
||||
title: '清空失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 📱 ===== 订阅消息 =====
|
||||
|
||||
// 请求订阅消息权限
|
||||
async requestSubscribeMessage() {
|
||||
|
||||
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() {
|
||||
|
||||
wx.showToast({
|
||||
title: '功能开发中',
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
|
||||
// ⚙️ ===== 设置管理 =====
|
||||
|
||||
// 保存通知设置
|
||||
saveNotificationSettings() {
|
||||
try {
|
||||
// 更新通知管理器设置
|
||||
notificationManager.updateNotificationSettings(this.data.notificationSettings);
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ 保存通知设置失败:', error);
|
||||
}
|
||||
},
|
||||
|
||||
// 保存免打扰设置
|
||||
saveDoNotDisturbSettings() {
|
||||
try {
|
||||
wx.setStorageSync('doNotDisturbSettings', this.data.doNotDisturb);
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ 保存免打扰设置失败:', error);
|
||||
}
|
||||
},
|
||||
|
||||
// 重置设置
|
||||
resetSettings() {
|
||||
|
||||
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'
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ 重置通知设置失败:', error);
|
||||
wx.showToast({
|
||||
title: '重置失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 🧭 ===== 页面导航 =====
|
||||
|
||||
// 返回上一页
|
||||
goBack() {
|
||||
wx.navigateBack();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#F2F2F7",
|
||||
"backgroundTextStyle": "dark",
|
||||
"enablePullDownRefresh": false,
|
||||
"onReachBottomDistance": 50
|
||||
}
|
||||
|
|
@ -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>
|
||||
|
|
@ -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);
|
||||
}
|
||||
466
subpackages/settings/phone-binding/phone-binding.js
Normal file
466
subpackages/settings/phone-binding/phone-binding.js
Normal file
|
|
@ -0,0 +1,466 @@
|
|||
// 手机号绑定页面
|
||||
const app = getApp();
|
||||
const apiClient = require('../../../utils/api-client.js');
|
||||
const accountSyncManager = require('../../../utils/account-sync.js');
|
||||
const authManager = require('../../../utils/auth.js');
|
||||
|
||||
Page({
|
||||
data: {
|
||||
// 表单数据
|
||||
phoneNumber: '',
|
||||
verifyCode: '',
|
||||
|
||||
// 状态控制
|
||||
canSendCode: false,
|
||||
canBind: false,
|
||||
isBinding: false,
|
||||
|
||||
// 验证码倒计时
|
||||
codeButtonText: '获取验证码',
|
||||
codeCountdown: 0,
|
||||
codeTimer: null,
|
||||
|
||||
// 合并相关
|
||||
showMergeDialog: false,
|
||||
mergeCandidates: [],
|
||||
|
||||
// 系统适配
|
||||
statusBarHeight: 44,
|
||||
navBarHeight: 88,
|
||||
windowHeight: 667,
|
||||
safeAreaBottom: 0,
|
||||
|
||||
// 用户信息
|
||||
userInfo: null
|
||||
},
|
||||
|
||||
onLoad: function (options) {
|
||||
|
||||
this.initSystemInfo();
|
||||
this.initUserInfo();
|
||||
},
|
||||
|
||||
onUnload: function () {
|
||||
// 清理定时器
|
||||
if (this.data.codeTimer) {
|
||||
clearInterval(this.data.codeTimer);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化系统信息
|
||||
initSystemInfo() {
|
||||
try {
|
||||
const systemInfo = wx.getSystemInfoSync();
|
||||
const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
|
||||
|
||||
const statusBarHeight = systemInfo.statusBarHeight;
|
||||
const navBarHeight = menuButtonInfo.bottom + menuButtonInfo.top - statusBarHeight;
|
||||
|
||||
this.setData({
|
||||
statusBarHeight,
|
||||
navBarHeight,
|
||||
windowHeight: systemInfo.windowHeight,
|
||||
safeAreaBottom: systemInfo.safeArea ? systemInfo.screenHeight - systemInfo.safeArea.bottom : 0
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('初始化系统信息失败:', error);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化用户信息
|
||||
initUserInfo() {
|
||||
const userInfo = authManager.getUserDisplayInfo();
|
||||
if (userInfo) {
|
||||
this.setData({ userInfo });
|
||||
} else {
|
||||
console.error('无法获取用户信息,返回上一页');
|
||||
wx.navigateBack();
|
||||
}
|
||||
},
|
||||
|
||||
// 手机号输入处理
|
||||
onPhoneInput: function (e) {
|
||||
const value = e.detail.value;
|
||||
this.setData({
|
||||
phoneNumber: value
|
||||
});
|
||||
this.validateForm();
|
||||
},
|
||||
|
||||
// 验证码输入处理
|
||||
onCodeInput: function (e) {
|
||||
const value = e.detail.value;
|
||||
this.setData({
|
||||
verifyCode: value
|
||||
});
|
||||
this.validateForm();
|
||||
},
|
||||
|
||||
// 表单验证
|
||||
validateForm: function () {
|
||||
const { phoneNumber, verifyCode, codeCountdown } = this.data;
|
||||
|
||||
// 手机号格式验证
|
||||
const phoneRegex = /^1[3-9]\d{9}$/;
|
||||
const isPhoneValid = phoneRegex.test(phoneNumber);
|
||||
|
||||
// 验证码验证
|
||||
const isCodeValid = verifyCode.length === 6;
|
||||
|
||||
this.setData({
|
||||
canSendCode: isPhoneValid && codeCountdown === 0,
|
||||
canBind: isPhoneValid && isCodeValid
|
||||
});
|
||||
},
|
||||
|
||||
// 发送验证码
|
||||
sendVerifyCode: function () {
|
||||
if (!this.data.canSendCode) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { phoneNumber } = this.data;
|
||||
|
||||
wx.showLoading({
|
||||
title: '发送中...',
|
||||
mask: true
|
||||
});
|
||||
|
||||
apiClient.sendVerifyCode(phoneNumber)
|
||||
.then(response => {
|
||||
wx.hideLoading();
|
||||
|
||||
this.startCodeCountdown();
|
||||
|
||||
wx.showToast({
|
||||
title: '验证码已发送',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
wx.hideLoading();
|
||||
console.error('验证码发送失败:', error);
|
||||
|
||||
let errorMessage = '发送失败,请重试';
|
||||
if (error.message) {
|
||||
errorMessage = error.message;
|
||||
}
|
||||
|
||||
wx.showToast({
|
||||
title: errorMessage,
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 开始验证码倒计时
|
||||
startCodeCountdown: function () {
|
||||
let countdown = 60;
|
||||
|
||||
this.setData({
|
||||
codeCountdown: countdown,
|
||||
codeButtonText: `${countdown}s后重发`
|
||||
});
|
||||
|
||||
const timer = setInterval(() => {
|
||||
countdown--;
|
||||
|
||||
if (countdown <= 0) {
|
||||
clearInterval(timer);
|
||||
this.setData({
|
||||
codeCountdown: 0,
|
||||
codeButtonText: '重新发送',
|
||||
codeTimer: null
|
||||
});
|
||||
this.validateForm();
|
||||
} else {
|
||||
this.setData({
|
||||
codeCountdown: countdown,
|
||||
codeButtonText: `${countdown}s后重发`
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
this.setData({
|
||||
codeTimer: timer
|
||||
});
|
||||
},
|
||||
|
||||
// 绑定手机号
|
||||
handleBind: function () {
|
||||
if (!this.data.canBind || this.data.isBinding) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { phoneNumber, verifyCode } = this.data;
|
||||
|
||||
this.setData({ isBinding: true });
|
||||
|
||||
wx.showLoading({
|
||||
title: '绑定中...',
|
||||
mask: true
|
||||
});
|
||||
|
||||
// 🔥 使用新的分步绑定逻辑
|
||||
this.attemptBinding(phoneNumber, verifyCode);
|
||||
},
|
||||
|
||||
// 🔥 分步绑定逻辑
|
||||
async attemptBinding(phoneNumber, verifyCode) {
|
||||
try {
|
||||
// 第一步:尝试不自动合并的绑定
|
||||
|
||||
const result = await accountSyncManager.bindPhone(phoneNumber, verifyCode, false);
|
||||
|
||||
// 绑定成功
|
||||
this.handleBindingSuccess(result);
|
||||
|
||||
} catch (error) {
|
||||
|
||||
if (error.message && error.message.includes('已关联其他账号')) {
|
||||
// 发现冲突,询问用户是否合并
|
||||
this.showMergeConfirmDialog(phoneNumber, verifyCode);
|
||||
} else {
|
||||
// 其他错误,直接显示
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: error.message || '绑定失败',
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
});
|
||||
this.setData({ isBinding: false });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 显示合并确认对话框
|
||||
showMergeConfirmDialog(phoneNumber, verifyCode) {
|
||||
wx.hideLoading();
|
||||
|
||||
wx.showModal({
|
||||
title: '发现账号冲突',
|
||||
content: `手机号 ${phoneNumber} 已被其他账号使用。\n\n是否同意自动合并账号?合并后将保留当前账号的数据。`,
|
||||
cancelText: '取消绑定',
|
||||
confirmText: '同意合并',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// 用户同意合并
|
||||
this.performAutoMergeBinding(phoneNumber, verifyCode);
|
||||
} else {
|
||||
// 用户取消
|
||||
this.setData({ isBinding: false });
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 执行自动合并绑定
|
||||
async performAutoMergeBinding(phoneNumber, verifyCode) {
|
||||
wx.showLoading({
|
||||
title: '合并账号中...',
|
||||
mask: true
|
||||
});
|
||||
|
||||
try {
|
||||
|
||||
const result = await accountSyncManager.bindPhone(phoneNumber, verifyCode, true);
|
||||
|
||||
// 合并成功
|
||||
this.handleBindingSuccess(result);
|
||||
|
||||
} catch (error) {
|
||||
console.error('🔄 自动合并绑定失败:', error);
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: error.message || '合并失败',
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
});
|
||||
this.setData({ isBinding: false });
|
||||
}
|
||||
},
|
||||
|
||||
// 处理绑定成功
|
||||
handleBindingSuccess(result) {
|
||||
wx.hideLoading();
|
||||
|
||||
// 重置绑定状态
|
||||
this.setData({ isBinding: false });
|
||||
|
||||
// 根据文档,处理不同的绑定结果
|
||||
if (result.hasMerged && result.mergeCount > 0) {
|
||||
wx.showToast({
|
||||
title: `绑定成功!已自动合并 ${result.mergeCount} 个账号`,
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '绑定成功!',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
|
||||
// 延迟返回上一页,让用户看到成功提示
|
||||
setTimeout(() => {
|
||||
wx.navigateBack();
|
||||
}, 2000);
|
||||
},
|
||||
|
||||
// 处理账号冲突
|
||||
async handleAccountConflict() {
|
||||
try {
|
||||
const userInfo = this.data.userInfo;
|
||||
if (!userInfo || !userInfo.customId) {
|
||||
throw new Error('无法获取用户ID');
|
||||
}
|
||||
|
||||
const mergeInfo = await accountSyncManager.detectMerge(userInfo.customId);
|
||||
|
||||
if (mergeInfo.hasMergeCandidates && mergeInfo.candidates.length > 0) {
|
||||
this.setData({
|
||||
mergeCandidates: mergeInfo.candidates,
|
||||
showMergeDialog: true
|
||||
});
|
||||
} else {
|
||||
// 🚨 异常情况:绑定失败但检测不到冲突账号
|
||||
console.error('🚨 系统异常:绑定失败但检测不到冲突账号');
|
||||
|
||||
wx.showModal({
|
||||
title: '系统检测异常',
|
||||
content: `手机号 ${this.data.phoneNumber} 绑定失败,提示已被其他账号使用,但系统检测不到冲突账号。\n\n可能原因:\n1. 数据库状态异常\n2. 已删除账号的残留数据\n3. 账号状态不一致\n\n建议联系技术支持处理。`,
|
||||
showCancel: true,
|
||||
cancelText: '使用其他手机号',
|
||||
confirmText: '联系客服',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
wx.showToast({
|
||||
title: '请联系客服处理此问题',
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('检测可合并账号失败:', error);
|
||||
wx.showToast({
|
||||
title: '检测账号失败,请重试',
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 关闭合并对话框
|
||||
closeMergeDialog: function () {
|
||||
this.setData({
|
||||
showMergeDialog: false,
|
||||
mergeCandidates: []
|
||||
});
|
||||
},
|
||||
|
||||
// 手动合并指定账号
|
||||
mergeSpecificAccount: function (e) {
|
||||
const candidateCustomId = e.currentTarget.dataset.customId;
|
||||
this.performMerge(candidateCustomId, '用户手动选择合并');
|
||||
},
|
||||
|
||||
// 自动合并所有账号
|
||||
autoMergeAll: function () {
|
||||
const { phoneNumber, verifyCode } = this.data;
|
||||
|
||||
wx.showLoading({
|
||||
title: '自动合并中...',
|
||||
mask: true
|
||||
});
|
||||
|
||||
// 根据文档,使用autoMerge=true参数进行自动合并
|
||||
accountSyncManager.bindPhone(phoneNumber, verifyCode, true)
|
||||
.then(result => {
|
||||
wx.hideLoading();
|
||||
|
||||
const mergeCount = result.mergeCount || 0;
|
||||
const message = result.hasMerged ?
|
||||
`绑定成功!已自动合并 ${mergeCount} 个账号` :
|
||||
'绑定成功!';
|
||||
|
||||
wx.showToast({
|
||||
title: message,
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
|
||||
this.setData({ showMergeDialog: false });
|
||||
|
||||
setTimeout(() => {
|
||||
wx.navigateBack();
|
||||
}, 2000);
|
||||
})
|
||||
.catch(error => {
|
||||
wx.hideLoading();
|
||||
console.error('自动合并失败:', error);
|
||||
|
||||
wx.showToast({
|
||||
title: error.message || '自动合并失败',
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 执行合并操作
|
||||
async performMerge(secondaryCustomId, mergeReason) {
|
||||
try {
|
||||
const userInfo = this.data.userInfo;
|
||||
if (!userInfo || !userInfo.customId) {
|
||||
throw new Error('无法获取用户ID');
|
||||
}
|
||||
|
||||
wx.showLoading({
|
||||
title: '合并中...',
|
||||
mask: true
|
||||
});
|
||||
|
||||
const result = await accountSyncManager.mergeAccount(
|
||||
userInfo.customId,
|
||||
secondaryCustomId,
|
||||
mergeReason
|
||||
);
|
||||
|
||||
wx.hideLoading();
|
||||
|
||||
wx.showToast({
|
||||
title: '账号合并成功!',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
|
||||
this.setData({ showMergeDialog: false });
|
||||
|
||||
setTimeout(() => {
|
||||
wx.navigateBack();
|
||||
}, 2000);
|
||||
|
||||
} catch (error) {
|
||||
wx.hideLoading();
|
||||
console.error('账号合并失败:', error);
|
||||
|
||||
wx.showToast({
|
||||
title: error.message || '合并失败,请重试',
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 返回上一页
|
||||
goBack: function () {
|
||||
wx.navigateBack();
|
||||
}
|
||||
});
|
||||
|
||||
5
subpackages/settings/phone-binding/phone-binding.json
Normal file
5
subpackages/settings/phone-binding/phone-binding.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#667eea",
|
||||
"backgroundTextStyle": "light"
|
||||
}
|
||||
141
subpackages/settings/phone-binding/phone-binding.wxml
Normal file
141
subpackages/settings/phone-binding/phone-binding.wxml
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
<!--手机号绑定页面-->
|
||||
<view class="container" style="height: {{windowHeight}}px;">
|
||||
|
||||
<!-- 自定义导航栏 -->
|
||||
<view class="custom-navbar" style="height: {{navBarHeight}}px; padding-top: {{statusBarHeight}}px;">
|
||||
<view class="navbar-content">
|
||||
<view class="navbar-left" bindtap="goBack">
|
||||
<text class="back-icon">←</text>
|
||||
</view>
|
||||
<view class="navbar-title">绑定手机号</view>
|
||||
<view class="navbar-right"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 主要内容 -->
|
||||
<view class="main-content">
|
||||
|
||||
<!-- 头部说明 -->
|
||||
<view class="header-section">
|
||||
<view class="header-icon">📱</view>
|
||||
<view class="header-title">绑定手机号</view>
|
||||
<view class="header-desc">为了更好的使用体验和账号安全,请绑定您的手机号</view>
|
||||
</view>
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<view class="form-section">
|
||||
|
||||
<!-- 手机号输入 -->
|
||||
<view class="input-group">
|
||||
<text class="input-label">手机号</text>
|
||||
<view class="input-container">
|
||||
<view class="input-icon">📱</view>
|
||||
<input
|
||||
class="phone-input"
|
||||
type="number"
|
||||
placeholder="请输入手机号"
|
||||
maxlength="11"
|
||||
value="{{phoneNumber}}"
|
||||
bindinput="onPhoneInput"
|
||||
placeholder-class="input-placeholder"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 验证码输入 -->
|
||||
<view class="input-group">
|
||||
<text class="input-label">验证码</text>
|
||||
<view class="input-container code-container">
|
||||
<view class="input-icon">🔐</view>
|
||||
<input
|
||||
class="code-input"
|
||||
type="number"
|
||||
placeholder="请输入验证码"
|
||||
maxlength="6"
|
||||
value="{{verifyCode}}"
|
||||
bindinput="onCodeInput"
|
||||
placeholder-class="input-placeholder"
|
||||
/>
|
||||
<view
|
||||
class="code-button {{canSendCode ? 'active' : 'disabled'}}"
|
||||
bindtap="sendVerifyCode"
|
||||
>
|
||||
<text class="code-button-text">{{codeButtonText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 绑定按钮 -->
|
||||
<view
|
||||
class="bind-button {{canBind ? 'active' : 'disabled'}}"
|
||||
bindtap="handleBind"
|
||||
>
|
||||
<view class="bind-content">
|
||||
<view class="bind-icon" wx:if="{{isBinding}}">⏳</view>
|
||||
<view class="bind-icon" wx:else>🔗</view>
|
||||
<text class="bind-text">{{isBinding ? '绑定中...' : '立即绑定'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 温馨提示 -->
|
||||
<view class="tips-section">
|
||||
<view class="tips-title">温馨提示</view>
|
||||
<view class="tips-item">• 绑定手机号后可以更安全地管理您的账号</view>
|
||||
<view class="tips-item">• 如果该手机号已关联其他账号,系统会提示您进行账号合并</view>
|
||||
<view class="tips-item">• 账号合并后,所有数据将统一到当前账号</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 账号合并对话框 -->
|
||||
<view class="merge-dialog-mask" wx:if="{{showMergeDialog}}" bindtap="closeMergeDialog">
|
||||
<view class="merge-dialog" catchtap="">
|
||||
|
||||
<view class="dialog-header">
|
||||
<view class="dialog-title">发现可合并的账号</view>
|
||||
<view class="dialog-close" bindtap="closeMergeDialog">×</view>
|
||||
</view>
|
||||
|
||||
<view class="dialog-content">
|
||||
<view class="dialog-desc">该手机号已关联以下账号,请选择处理方式:</view>
|
||||
|
||||
<!-- 候选账号列表 -->
|
||||
<view class="candidates-list">
|
||||
<view
|
||||
class="candidate-item"
|
||||
wx:for="{{mergeCandidates}}"
|
||||
wx:key="customId"
|
||||
>
|
||||
<view class="candidate-info">
|
||||
<view class="candidate-name">{{item.nickname || '未知用户'}}</view>
|
||||
<view class="candidate-detail">
|
||||
<text class="detail-item">注册时间:{{item.registerTime}}</text>
|
||||
<text class="detail-item">匹配原因:{{item.matchReason}}</text>
|
||||
<text class="detail-item">可信度:{{item.confidence}}%</text>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="merge-btn"
|
||||
data-custom-id="{{item.customId}}"
|
||||
bindtap="mergeSpecificAccount"
|
||||
>
|
||||
合并此账号
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="dialog-actions">
|
||||
<view class="action-btn cancel-btn" bindtap="closeMergeDialog">取消</view>
|
||||
<view class="action-btn auto-btn" bindtap="autoMergeAll">自动合并所有</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 安全区域占位 -->
|
||||
<view style="height: {{safeAreaBottom}}px;"></view>
|
||||
|
||||
</view>
|
||||
384
subpackages/settings/phone-binding/phone-binding.wxss
Normal file
384
subpackages/settings/phone-binding/phone-binding.wxss
Normal file
|
|
@ -0,0 +1,384 @@
|
|||
/* 手机号绑定页面样式 */
|
||||
@import "../../../styles/design-system.wxss";
|
||||
@import "../../../styles/components.wxss";
|
||||
|
||||
.container {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 自定义导航栏 */
|
||||
.custom-navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.navbar-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 44px;
|
||||
padding: 0 32rpx;
|
||||
}
|
||||
|
||||
.navbar-left {
|
||||
width: 80rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.back-icon {
|
||||
font-size: 36rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.navbar-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.navbar-right {
|
||||
width: 80rpx;
|
||||
}
|
||||
|
||||
/* 主要内容 */
|
||||
.main-content {
|
||||
flex: 1;
|
||||
padding: 120rpx 60rpx 40rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 头部区域 */
|
||||
.header-section {
|
||||
text-align: center;
|
||||
margin-bottom: 80rpx;
|
||||
}
|
||||
|
||||
.header-icon {
|
||||
font-size: 120rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.header-title {
|
||||
font-size: 48rpx;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.header-desc {
|
||||
font-size: 28rpx;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
line-height: 1.6;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
/* 表单区域 */
|
||||
.form-section {
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
border-radius: 24rpx;
|
||||
padding: 60rpx 40rpx;
|
||||
margin-bottom: 60rpx;
|
||||
box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.input-group {
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.input-label {
|
||||
display: block;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-bottom: 16rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.input-container {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #f8f9fa;
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid transparent;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.input-container:focus-within {
|
||||
border-color: #667eea;
|
||||
background: white;
|
||||
box-shadow: 0 0 0 6rpx rgba(102, 126, 234, 0.1);
|
||||
}
|
||||
|
||||
.input-icon {
|
||||
padding: 0 20rpx;
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.phone-input,
|
||||
.code-input {
|
||||
flex: 1;
|
||||
height: 88rpx;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
background: transparent;
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.input-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 验证码容器 */
|
||||
.code-container {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.code-button {
|
||||
height: 88rpx;
|
||||
padding: 0 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 0 16rpx 16rpx 0;
|
||||
transition: all 0.3s ease;
|
||||
border-left: 2rpx solid #eee;
|
||||
}
|
||||
|
||||
.code-button.active {
|
||||
background: #667eea;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.code-button.disabled {
|
||||
background: #f5f5f5;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.code-button-text {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 绑定按钮 */
|
||||
.bind-button {
|
||||
width: 100%;
|
||||
height: 96rpx;
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.bind-button.active {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
box-shadow: 0 8rpx 24rpx rgba(102, 126, 234, 0.3);
|
||||
}
|
||||
|
||||
.bind-button.disabled {
|
||||
background: #e9ecef;
|
||||
}
|
||||
|
||||
.bind-button.active:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.bind-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.bind-icon {
|
||||
font-size: 36rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.bind-text {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.bind-button.active .bind-text {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.bind-button.disabled .bind-text {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 温馨提示 */
|
||||
.tips-section {
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
border-radius: 16rpx;
|
||||
padding: 40rpx;
|
||||
}
|
||||
|
||||
.tips-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.tips-item {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
/* 合并对话框 */
|
||||
.merge-dialog-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 2000;
|
||||
padding: 40rpx;
|
||||
}
|
||||
|
||||
.merge-dialog {
|
||||
background: white;
|
||||
border-radius: 24rpx;
|
||||
width: 100%;
|
||||
max-width: 600rpx;
|
||||
max-height: 80vh;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.dialog-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 40rpx 40rpx 20rpx;
|
||||
border-bottom: 2rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.dialog-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.dialog-close {
|
||||
font-size: 48rpx;
|
||||
color: #999;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.dialog-content {
|
||||
flex: 1;
|
||||
padding: 20rpx 40rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.dialog-desc {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
margin-bottom: 30rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.candidates-list {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.candidate-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx 20rpx;
|
||||
background: #f8f9fa;
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.candidate-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.candidate-name {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.candidate-detail {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.detail-item {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
|
||||
.merge-btn {
|
||||
background: #667eea;
|
||||
color: white;
|
||||
padding: 16rpx 24rpx;
|
||||
border-radius: 12rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.dialog-actions {
|
||||
display: flex;
|
||||
padding: 20rpx 40rpx 40rpx;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
background: #f8f9fa;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.auto-btn {
|
||||
background: #667eea;
|
||||
color: white;
|
||||
}
|
||||
50
subpackages/settings/settingss/settingss.js
Normal file
50
subpackages/settings/settingss/settingss.js
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
// pages/settingss/settingss.js
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
menuButtonInfo: { height: 32, width: 32, top: 0 },
|
||||
statusBarHeight: 0
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.initSystemInfo();
|
||||
},
|
||||
|
||||
initSystemInfo() {
|
||||
try {
|
||||
const systemInfo = wx.getSystemInfoSync();
|
||||
const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
|
||||
this.setData({
|
||||
statusBarHeight: systemInfo.statusBarHeight || 0,
|
||||
menuButtonInfo: menuButtonInfo || this.data.menuButtonInfo
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('获取系统信息失败:', e);
|
||||
}
|
||||
},
|
||||
|
||||
navigateBack() {
|
||||
wx.navigateBack();
|
||||
},
|
||||
|
||||
openFeedback() {
|
||||
wx.navigateTo({ url: '/subpackages/settings/feedback/feedback' });
|
||||
},
|
||||
|
||||
async logout() {
|
||||
wx.showModal({
|
||||
title: '退出登录',
|
||||
content: '确定要退出当前账号吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
app.logout().then(() => {
|
||||
wx.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
9
subpackages/settings/settingss/settingss.json
Normal file
9
subpackages/settings/settingss/settingss.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"navigationBarTitleText": "设置",
|
||||
"navigationBarBackgroundColor": "#000000",
|
||||
"navigationBarTextStyle": "white",
|
||||
"backgroundColor": "#000000",
|
||||
"disableScroll": false,
|
||||
"navigationStyle": "custom",
|
||||
"pageOrientation": "portrait"
|
||||
}
|
||||
44
subpackages/settings/settingss/settingss.wxml
Normal file
44
subpackages/settings/settingss/settingss.wxml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<!-- pages/settingss/settingss.wxml -->
|
||||
<view class="settings-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>
|
||||
|
||||
<!-- 页面内容 -->
|
||||
<scroll-view class="settings-content"
|
||||
scroll-y
|
||||
style="padding-top: {{statusBarHeight + menuButtonInfo.height + 30}}px; height: calc(100vh - {{statusBarHeight + menuButtonInfo.height + 30}}px);">
|
||||
<!-- 帮助与反馈卡片 -->
|
||||
<view class="menu-group">
|
||||
<view class="group-header">
|
||||
<view class="group-icon"></view>
|
||||
<text class="group-title">帮助与反馈</text>
|
||||
</view>
|
||||
|
||||
<view class="menu-item" bindtap="openFeedback">
|
||||
<view class="menu-icon feedback">💬</view>
|
||||
<view class="menu-content">
|
||||
<text class="menu-title">意见反馈</text>
|
||||
<text class="menu-subtitle">提交故障、建议,及联系客服</text>
|
||||
</view>
|
||||
<view class="menu-arrow">›</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 退出登录按钮 -->
|
||||
<view class="logout-section">
|
||||
<button class="logout-btn" bindtap="logout">
|
||||
退出登录
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<!-- 底部安全区域 -->
|
||||
<view class="bottom-space"></view>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
162
subpackages/settings/settingss/settingss.wxss
Normal file
162
subpackages/settings/settingss/settingss.wxss
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
/* 页面容器 */
|
||||
.settings-container {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background: #000000;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 导航栏样式 */
|
||||
.navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
z-index: 10;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
/* 滚动内容区 */
|
||||
.settings-content {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding-left: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* 菜单组样式 */
|
||||
.menu-group {
|
||||
background-color: #1a1a1a;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 组标题 */
|
||||
.group-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx 30rpx 20rpx;
|
||||
}
|
||||
|
||||
.group-icon {
|
||||
font-size: 36rpx;
|
||||
margin-right: 20rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.group-title {
|
||||
color: #ffffff;
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 菜单项 */
|
||||
.menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 25rpx 30rpx;
|
||||
border-top: 1px solid #333333;
|
||||
}
|
||||
|
||||
.menu-item:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
/* 菜单图标 */
|
||||
.menu-icon {
|
||||
font-size: 36rpx;
|
||||
margin-right: 25rpx;
|
||||
width: 40rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.feedback {
|
||||
color: #00BCD4;
|
||||
}
|
||||
|
||||
/* 菜单内容 */
|
||||
.menu-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.menu-title {
|
||||
color: #ffffff;
|
||||
font-size: 30rpx;
|
||||
display: block;
|
||||
margin-bottom: 5rpx;
|
||||
}
|
||||
|
||||
.menu-subtitle {
|
||||
color: #aaaaaa;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
/* 菜单箭头 */
|
||||
.menu-arrow {
|
||||
color: #666666;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
/* 退出登录按钮 */
|
||||
.logout-section {
|
||||
padding: 40rpx 30rpx;
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
background: linear-gradient(135deg, #044db4 0%, #156301 100%);
|
||||
color: #ffffff;
|
||||
font-size: 32rpx;
|
||||
border-radius: 45rpx;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
border: none;
|
||||
outline: none;
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23ffffff' fill-opacity='0.05' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
|
||||
box-shadow: 0 4px 6px -1px rgb(48, 51, 238),
|
||||
inset 0 1px 0 rgb(255, 0, 0);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.logout-btn:active {
|
||||
transform: scale(0.98);
|
||||
background: linear-gradient(135deg, #1d69d3 0%, #273140 100%);
|
||||
box-shadow: 0 2px 4px -1px rgba(250, 0, 0, 0.3),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
|
||||
/* 底部安全区域 */
|
||||
.bottom-space {
|
||||
height: 60rpx;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue