- 后端: users表新增VIP字段, 4个VIP API (purchase/status/profile/members) - 后端: hot接口改按user_tracks阅读量排序 - 后端: orders表支持vip产品类型, migrate新增vip_fields迁移 - 小程序「我的」: 推广中心改为我的收益, 头像VIP标识, VIP入口卡片 - 小程序「我的」: 最近阅读显示真实章节名称 - 小程序首页: 去掉内容概览, 新增创业老板排行(4列网格) - 小程序首页: 精选推荐从hot接口获取, goToRead增加track记录 - 新增页面: VIP详情页, 会员详情页 - 开发文档精简为10个标准目录, 创建SKILL.md, 需求日志规范化 Co-authored-by: Cursor <cursoragent@cursor.com>
201 lines
8.4 KiB
Plaintext
201 lines
8.4 KiB
Plaintext
<!--Soul创业实验 - 我的页面-->
|
|
<view class="page page-transition">
|
|
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
|
|
<view class="nav-content">
|
|
<text class="nav-title brand-color">我的</text>
|
|
</view>
|
|
</view>
|
|
<view class="nav-placeholder" style="height: {{statusBarHeight + 44}}px;"></view>
|
|
|
|
<!-- 未登录 -->
|
|
<view class="user-card card-gradient login-card" wx:if="{{!isLoggedIn}}">
|
|
<view class="login-prompt">
|
|
<view class="login-icon-large">🔐</view>
|
|
<text class="login-title">登录 Soul创业实验</text>
|
|
<text class="login-desc">登录后可购买章节、解锁更多内容</text>
|
|
<button class="btn-wechat-large" bindtap="handleWechatLogin">
|
|
<text class="btn-icon">微</text>
|
|
<text>微信快捷登录</text>
|
|
</button>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 已登录 - 用户卡片 -->
|
|
<view class="user-card card-gradient" wx:else>
|
|
<view class="user-header-row">
|
|
<button class="avatar-btn-simple" open-type="chooseAvatar" bindchooseavatar="onChooseAvatar">
|
|
<view class="avatar {{isVip ? 'avatar-vip' : 'avatar-normal'}}">
|
|
<image class="avatar-img" wx:if="{{userInfo.avatar}}" src="{{userInfo.avatar}}" mode="aspectFill"/>
|
|
<text class="avatar-text" wx:else>{{userInfo.nickname[0] || '微'}}</text>
|
|
<view class="vip-badge" wx:if="{{isVip}}">VIP</view>
|
|
</view>
|
|
</button>
|
|
<view class="user-info-block">
|
|
<view class="user-name-row">
|
|
<text class="user-name" bindtap="editNickname">{{userInfo.nickname || '点击设置昵称'}}</text>
|
|
<text class="edit-icon-small">✎</text>
|
|
<view class="vip-tag" wx:if="{{isVip}}">创业伙伴</view>
|
|
</view>
|
|
<view class="user-id-row" bindtap="copyUserId">
|
|
<text class="user-id">{{userWechat ? '微信: ' + userWechat : 'ID: ' + userIdShort}}</text>
|
|
<text class="copy-icon">📋</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="stats-grid">
|
|
<view class="stat-item">
|
|
<text class="stat-value brand-color">{{purchasedCount}}</text>
|
|
<text class="stat-label">已购章节</text>
|
|
</view>
|
|
<view class="stat-item">
|
|
<text class="stat-value brand-color">{{referralCount}}</text>
|
|
<text class="stat-label">推荐好友</text>
|
|
</view>
|
|
<view class="stat-item">
|
|
<text class="stat-value gold-color">{{pendingEarnings > 0 ? '¥' + pendingEarnings : '--'}}</text>
|
|
<text class="stat-label">我的收益</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- VIP入口卡片 -->
|
|
<view class="vip-card" wx:if="{{isLoggedIn}}" bindtap="goToVip">
|
|
<view class="vip-card-inner" wx:if="{{!isVip}}">
|
|
<view class="vip-card-left">
|
|
<text class="vip-card-icon">👑</text>
|
|
<view class="vip-card-info">
|
|
<text class="vip-card-title">开通VIP会员</text>
|
|
<text class="vip-card-desc">解锁全部章节 · 匹配创业伙伴</text>
|
|
</view>
|
|
</view>
|
|
<view class="vip-card-price">
|
|
<text class="vip-price-num">¥{{vipPrice}}</text>
|
|
<text class="vip-price-unit">/年</text>
|
|
</view>
|
|
</view>
|
|
<view class="vip-card-inner vip-active" wx:else>
|
|
<view class="vip-card-left">
|
|
<text class="vip-card-icon">👑</text>
|
|
<view class="vip-card-info">
|
|
<text class="vip-card-title gold-color">VIP会员</text>
|
|
<text class="vip-card-desc">剩余 {{vipDaysRemaining}} 天</text>
|
|
</view>
|
|
</view>
|
|
<text class="vip-manage-btn">管理 →</text>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- Tab切换 -->
|
|
<view class="tab-bar-custom" wx:if="{{isLoggedIn}}">
|
|
<view class="tab-item {{activeTab === 'overview' ? 'tab-active' : ''}}" bindtap="switchTab" data-tab="overview">概览</view>
|
|
<view class="tab-item {{activeTab === 'footprint' ? 'tab-active' : ''}}" bindtap="switchTab" data-tab="footprint">
|
|
<text class="tab-icon">👣</text><text>我的足迹</text>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 概览内容 -->
|
|
<view class="tab-content" wx:if="{{activeTab === 'overview' && isLoggedIn}}">
|
|
<view class="menu-card card">
|
|
<view class="menu-item" wx:for="{{menuList}}" wx:key="id" bindtap="handleMenuTap" data-id="{{item.id}}">
|
|
<view class="menu-left">
|
|
<view class="menu-icon {{item.iconBg === 'brand' ? 'icon-brand' : ''}}">{{item.icon}}</view>
|
|
<text class="menu-title">{{item.title}}</text>
|
|
</view>
|
|
<view class="menu-right">
|
|
<text class="menu-count" wx:if="{{item.count !== undefined}}">{{item.count}}笔</text>
|
|
<text class="menu-arrow">→</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="settings-card card">
|
|
<view class="card-title"><text class="title-icon">⚙️</text><text>账号设置</text></view>
|
|
<view class="settings-list">
|
|
<view class="settings-item" bindtap="bindWechat">
|
|
<text class="settings-label">绑定微信号</text>
|
|
<view class="settings-right">
|
|
<text class="settings-value">{{userWechat || '未绑定'}}</text>
|
|
<text class="menu-arrow">→</text>
|
|
</view>
|
|
</view>
|
|
<view class="settings-item" bindtap="clearCache">
|
|
<text class="settings-label">清除缓存</text>
|
|
<text class="menu-arrow">→</text>
|
|
</view>
|
|
<view class="settings-item logout-item" bindtap="handleLogout">
|
|
<text class="settings-label logout-text">退出登录</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 足迹内容 -->
|
|
<view class="tab-content" wx:if="{{activeTab === 'footprint' && isLoggedIn}}">
|
|
<view class="stats-card card">
|
|
<view class="card-title"><text class="title-icon">👁️</text><text>阅读统计</text></view>
|
|
<view class="stats-row">
|
|
<view class="stat-box">
|
|
<text class="stat-icon brand-color">📖</text>
|
|
<text class="stat-num">{{purchasedCount}}</text>
|
|
<text class="stat-text">已读章节</text>
|
|
</view>
|
|
<view class="stat-box">
|
|
<text class="stat-icon gold-color">⏱️</text>
|
|
<text class="stat-num">{{totalReadTime}}</text>
|
|
<text class="stat-text">阅读分钟</text>
|
|
</view>
|
|
<view class="stat-box">
|
|
<text class="stat-icon pink-color">👥</text>
|
|
<text class="stat-num">{{matchHistory}}</text>
|
|
<text class="stat-text">匹配伙伴</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="recent-card card">
|
|
<view class="card-title"><text class="title-icon">📖</text><text>最近阅读</text></view>
|
|
<view class="recent-list" wx:if="{{recentChapters.length > 0}}">
|
|
<view class="recent-item" wx:for="{{recentChapters}}" wx:key="id" bindtap="goToRead" data-id="{{item.id}}">
|
|
<view class="recent-left">
|
|
<text class="recent-index">{{index + 1}}</text>
|
|
<text class="recent-title">{{item.title}}</text>
|
|
</view>
|
|
<text class="recent-btn">继续阅读</text>
|
|
</view>
|
|
</view>
|
|
<view class="empty-state" wx:else>
|
|
<text class="empty-icon">📖</text>
|
|
<text class="empty-text">暂无阅读记录</text>
|
|
<view class="empty-btn" bindtap="goToChapters">去阅读 →</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="match-card card">
|
|
<view class="card-title"><text class="title-icon">👥</text><text>匹配记录</text></view>
|
|
<view class="empty-state">
|
|
<text class="empty-icon">👥</text>
|
|
<text class="empty-text">暂无匹配记录</text>
|
|
<view class="empty-btn" bindtap="goToMatch">去匹配 →</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 登录弹窗 -->
|
|
<view class="modal-overlay" wx:if="{{showLoginModal}}" bindtap="closeLoginModal">
|
|
<view class="modal-content" catchtap="stopPropagation">
|
|
<view class="modal-close" bindtap="closeLoginModal">✕</view>
|
|
<view class="login-icon">🔐</view>
|
|
<text class="login-title">登录 Soul创业实验</text>
|
|
<text class="login-desc">登录后可购买章节、解锁更多内容</text>
|
|
<button class="btn-wechat" bindtap="handleWechatLogin" disabled="{{isLoggingIn}}">
|
|
<text class="btn-wechat-icon">微</text>
|
|
<text>{{isLoggingIn ? '登录中...' : '微信快捷登录'}}</text>
|
|
</button>
|
|
<text class="login-notice">登录即表示同意《用户协议》和《隐私政策》</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="bottom-space"></view>
|
|
</view>
|