Initial Commit

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

View file

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