feat: 我的页整合扫一扫/设置与提现、all-chapters去重、内容上传API、文档与后台登录

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
卡若
2026-02-20 18:50:16 +08:00
parent 09fb67d2af
commit 0e4baa4b7f
27 changed files with 1526 additions and 347 deletions

View File

@@ -33,12 +33,13 @@ Page({
// 最近阅读
recentChapters: [],
// 菜单列表
// 菜单列表:扫一扫整合在「我的」内;提现记录与设置合并为「设置与提现」入口
menuList: [
{ id: 'scan', title: '扫一扫', icon: '📷', iconBg: 'brand' },
{ id: 'orders', title: '我的订单', icon: '📦', count: 0 },
{ id: 'referral', title: '推广中心', icon: '🎁', badge: '' },
{ id: 'about', title: '关于作者', icon: '👤', iconBg: 'brand' },
{ id: 'settings', title: '设置', icon: '⚙️', iconBg: 'gray' }
{ id: 'settings', title: '设置与提现', icon: '⚙️', iconBg: 'gray' }
],
// 登录弹窗
@@ -281,11 +282,27 @@ Page({
handleMenuTap(e) {
const id = e.currentTarget.dataset.id
if (!this.data.isLoggedIn && id !== 'about') {
if (!this.data.isLoggedIn && id !== 'about' && id !== 'scan') {
this.showLogin()
return
}
// 扫一扫:在「我的」内直接调起扫码
if (id === 'scan') {
wx.scanCode({
onlyFromCamera: false,
scanType: ['qrCode', 'barCode'],
success: (res) => {
wx.showToast({ title: '已识别', icon: 'success' })
if (res.result) {
wx.setClipboardData({ data: res.result })
}
},
fail: () => {}
})
return
}
const routes = {
orders: '/pages/purchases/purchases',
referral: '/pages/referral/referral',