后端 API:AI 对话/报告/余额告警 等服务与路由;小程序 tabBar 配置与分润相关能力;出站推送 Webhook 与管理端调试;飞书留资、小程序数据分析 等支撑;多份 数据库迁移(AI 聊天、灵魂文章、tabBar、分润等)。 管理端 / 超管:看板、用户/订单/分销/财务、设置与 小程序 tabBar 管理、分润规则、灵魂文章、AI 配置与监控 等大量页面与能力扩展;主题与布局更新。 抖音小程序:与微信侧在 结果页/购买/个人中心 等方向做了同步或优化。 另含 部署/脚本、开发文档 等配套更新。 邀请码与解锁:后端 分销/邀请码 接口与 add_invite_codes 等 SQL;小程序侧 邀请码弹窗组件、个人中心/推广/多类结果页 的填写入口与 解锁门控(inviteCodeGate、unlockGate);并补充 《小程序解锁引导与邀请码方案》 文档。 超管后台:路由与 企业中心(EnterpriseHub) 等交互与结构优化。 小程序体验:在 首页结果、推广、各测评结果页 上继续打磨;与 邀请码门控、审核门控 小步联动。
260 lines
10 KiB
Plaintext
260 lines
10 KiB
Plaintext
<!--pages/promo/index.wxml-->
|
||
<view class="container">
|
||
<!-- 顶部统计卡片 -->
|
||
<view class="hero-card">
|
||
<view class="hero-header-row">
|
||
<view class="hero-left">
|
||
<view class="wallet-icon">
|
||
<text class="emoji">🧧</text>
|
||
</view>
|
||
<view class="title-text">
|
||
<text class="label">可提现金额</text>
|
||
<view class="badge">
|
||
<view class="dot"></view>
|
||
<text class="badge-text">{{commissionRate}}% 高额返利</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="hero-right">
|
||
<text class="amount">¥{{balance}}</text>
|
||
<text class="amount-sub">累计: ¥{{totalEarned}} | 待审核: ¥{{pendingAmount}}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<button class="withdraw-btn {{balance > 0 ? '' : 'disabled'}}" bindtap="handleWithdraw">
|
||
<text>{{balance > 0 ? '立即提现' : '暂无提现'}}</text>
|
||
</button>
|
||
|
||
<view class="record-link" bindtap="goToWithdrawHistory">
|
||
<text>查看提现记录</text>
|
||
<text class="arrow">›</text>
|
||
</view>
|
||
</view>
|
||
|
||
<block wx:if="{{!hideInviteCodeEntry}}">
|
||
<view class="my-invite-card">
|
||
<view class="my-invite-card__head">
|
||
<text class="my-invite-card__title">我的邀请码</text>
|
||
<view wx:if="{{myInviteCodeLoadState === 'ready' && myInviteCode}}" class="my-invite-card__copy" bindtap="copyMyInviteCode">复制</view>
|
||
<view wx:elif="{{myInviteCodeLoadState === 'error'}}" class="my-invite-card__retry" bindtap="retryMyInviteCode">重试</view>
|
||
</view>
|
||
<block wx:if="{{myInviteCodeLoadState === 'loading'}}">
|
||
<text class="my-invite-card__code my-invite-card__code--muted">加载中…</text>
|
||
</block>
|
||
<block wx:elif="{{myInviteCodeLoadState === 'error'}}">
|
||
<text class="my-invite-card__err">{{myInviteCodeErrMsg}}</text>
|
||
<text class="my-invite-card__tip">若提示功能未就绪,请在数据库执行 api/database/add_invite_codes.sql 建表后再试。</text>
|
||
</block>
|
||
<block wx:elif="{{myInviteCodeLoadState === 'ready' && myInviteCode}}">
|
||
<text class="my-invite-card__code" user-select="true">{{myInviteCode}}</text>
|
||
<text class="my-invite-card__tip">好友在付费解锁前填写此码,即可与你建立推广绑定</text>
|
||
</block>
|
||
<block wx:else>
|
||
<text class="my-invite-card__err">{{myInviteCodeHint}}</text>
|
||
<text wx:if="{{myInviteCodeLoadState === 'nodata'}}" class="my-invite-card__tip">你可稍后下拉刷新或联系管理员。</text>
|
||
</block>
|
||
</view>
|
||
|
||
<view class="invite-fill-entry" bindtap="openInviteCodeFill">
|
||
<text class="invite-fill-entry__icon">🔗</text>
|
||
<view class="invite-fill-entry__main">
|
||
<text class="invite-fill-entry__title">填写好友邀请码</text>
|
||
<text class="invite-fill-entry__sub">绑定推广关系 · 付费前也可在此填写</text>
|
||
</view>
|
||
<text class="invite-fill-entry__arrow">›</text>
|
||
</view>
|
||
</block>
|
||
|
||
<!-- 自定义提现金额弹框 -->
|
||
<view class="withdraw-mask" wx:if="{{showWithdrawDialog}}">
|
||
<view class="withdraw-dialog">
|
||
<view class="dialog-title">申请提现</view>
|
||
<view class="dialog-sub">可提现 ¥{{balance}},请输入本次提现金额</view>
|
||
|
||
<view class="amount-input-row">
|
||
<text class="currency">¥</text>
|
||
<input
|
||
class="amount-input"
|
||
type="digit"
|
||
focus="true"
|
||
value="{{withdrawAmountInput}}"
|
||
placeholder="输入提现金额"
|
||
bindinput="onWithdrawInput"
|
||
/>
|
||
</view>
|
||
<view class="amount-hint">
|
||
<text>本次最高可提 ¥{{balance}}</text>
|
||
</view>
|
||
<view class="fee-actual-row" wx:if="{{withdrawFeePct > 0}}">
|
||
<text>手续费 ¥{{withdrawFeeYuan}}</text>
|
||
<text class="actual">实际到账 ¥{{withdrawActualYuan}}</text>
|
||
</view>
|
||
<view class="error-text" wx:if="{{withdrawError}}">
|
||
<text>{{withdrawError}}</text>
|
||
</view>
|
||
|
||
<view class="dialog-actions">
|
||
<view class="btn cancel" bindtap="closeWithdrawDialog">取消</view>
|
||
<view class="btn confirm" bindtap="confirmWithdraw">确定</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 四格统计 -->
|
||
<view class="stats-grid">
|
||
<view class="stat-item">
|
||
<text class="stat-val">{{bindingCount}}</text>
|
||
<text class="stat-label">绑定中</text>
|
||
</view>
|
||
<view class="stat-item">
|
||
<text class="stat-val">{{paidCount}}</text>
|
||
<text class="stat-label">已付款</text>
|
||
</view>
|
||
<view class="stat-item">
|
||
<text class="stat-val highlight">{{expiringCount}}</text>
|
||
<text class="stat-label">即将过期</text>
|
||
</view>
|
||
<view class="stat-item">
|
||
<text class="stat-val">{{totalInvite}}</text>
|
||
<text class="stat-label">总邀请</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 收益规则 -->
|
||
<view class="section rule-section">
|
||
<view class="section-header">
|
||
<view class="header-icon red">
|
||
<text class="emoji-sm">🛡️</text>
|
||
</view>
|
||
<text class="section-title">推广收益规则</text>
|
||
</view>
|
||
<view class="rule-list">
|
||
<view class="rule-item">
|
||
<text class="rule-bullet">✨</text>
|
||
<text class="rule-text">用户绑定有效期为 <text class="highlight">{{bindingDays}}天</text>,期满自动解除</text>
|
||
</view>
|
||
<view class="rule-item">
|
||
<text class="rule-bullet">💰</text>
|
||
<text class="rule-text">单笔提现:最低 <text class="highlight">¥{{withdrawMinYuan}}</text></text>
|
||
<text class="rule-text" wx:if="{{withdrawMaxYuan}}">,最高 <text class="highlight">¥{{withdrawMaxYuan}}</text></text>
|
||
<text class="rule-text" wx:else>,不设上限</text>
|
||
</view>
|
||
<view class="rule-item" wx:if="{{withdrawFeePct > 0}}">
|
||
<text class="rule-bullet">📋</text>
|
||
<text class="rule-text">提现手续费:<text class="highlight">{{withdrawFeePct}}%</text></text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 绑定用户列表 -->
|
||
<view class="section user-section">
|
||
<view class="section-header border-b">
|
||
<view class="header-left">
|
||
<text class="emoji-sm">👥</text>
|
||
<text class="section-title">绑定用户</text>
|
||
<text class="count-label">({{totalInvite}})</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- Tab 切换 -->
|
||
<view class="tab-bar">
|
||
<view class="tab-item {{activeTab === 0 ? 'active' : ''}}" bindtap="switchTab" data-index="0">
|
||
绑定中 ({{bindingCount}})
|
||
</view>
|
||
<view class="tab-item {{activeTab === 1 ? 'active' : ''}}" bindtap="switchTab" data-index="1">
|
||
已付款 ({{paidCount}})
|
||
</view>
|
||
<view class="tab-item {{activeTab === 2 ? 'active' : ''}}" bindtap="switchTab" data-index="2">
|
||
已过期 ({{expiringCount}})
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 空状态 -->
|
||
<view class="empty-state" wx:if="{{userList.length === 0}}">
|
||
<view class="empty-icon">
|
||
<text class="emoji-lg">🔍</text>
|
||
</view>
|
||
<text class="empty-text">目前还没有绑定的用户哦</text>
|
||
<text class="empty-sub">快去分享链接邀请好友吧</text>
|
||
</view>
|
||
|
||
<!-- 用户列表 -->
|
||
<view class="user-list" wx:else>
|
||
<view class="user-item" wx:for="{{userList}}" wx:key="id">
|
||
<!-- 头像 -->
|
||
<image wx:if="{{item.avatar}}" class="user-avatar" src="{{item.avatar}}" mode="aspectFill"/>
|
||
<view wx:else class="user-avatar user-avatar-placeholder">
|
||
<text class="user-avatar-letter">{{item.nickname ? item.nickname[0] : '?'}}</text>
|
||
</view>
|
||
<!-- 昵称 + 绑定时间 -->
|
||
<view class="user-info">
|
||
<text class="user-name">{{item.nickname || '微信用户'}}</text>
|
||
<text class="user-time">绑定于 {{item.createdAtStr}}</text>
|
||
</view>
|
||
<!-- 状态 / 剩余天数 -->
|
||
<view class="user-badge {{item.status === 'active' ? 'badge-active' : (item.status === 'expired' ? 'badge-expired' : 'badge-paid')}}">
|
||
<text wx:if="{{item.status === 'active'}}">{{item.remainDays}}天到期</text>
|
||
<text wx:elif="{{item.status === 'expired'}}">已过期</text>
|
||
<text wx:else>已付款</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 加载更多 / 没有更多 -->
|
||
<view class="list-footer" wx:if="{{listLoading}}">
|
||
<text class="list-footer-text">加载中...</text>
|
||
</view>
|
||
<view class="list-footer" wx:elif="{{listFinished && userList.length > 0}}">
|
||
<text class="list-footer-text">— 已加载全部 —</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 操作菜单 -->
|
||
<view class="menu-card">
|
||
<view class="menu-item" bindtap="generatePoster">
|
||
<view class="menu-icon-wrap rose">
|
||
<text class="emoji-sm">🎨</text>
|
||
</view>
|
||
<view class="menu-info">
|
||
<text class="menu-name">生成推广海报</text>
|
||
<text class="menu-desc">一键生成您的专属精美海报</text>
|
||
</view>
|
||
<text class="menu-arrow">›</text>
|
||
</view>
|
||
<view class="menu-item" bindtap="shareToTimeline">
|
||
<view class="menu-icon-wrap emerald">
|
||
<text class="emoji-sm">💬</text>
|
||
</view>
|
||
<view class="menu-info">
|
||
<text class="menu-name">分享到朋友圈</text>
|
||
<text class="menu-desc">通过右上角菜单分享到朋友圈</text>
|
||
</view>
|
||
<text class="menu-arrow">›</text>
|
||
</view>
|
||
<button class="menu-item share-btn" open-type="share">
|
||
<view class="menu-icon-wrap violet">
|
||
<text class="emoji-sm">📤</text>
|
||
</view>
|
||
<view class="menu-info">
|
||
<text class="menu-name">分享给好友</text>
|
||
<text class="menu-desc">通过系统面板发送给微信好友</text>
|
||
</view>
|
||
<text class="menu-arrow">›</text>
|
||
</button>
|
||
</view>
|
||
|
||
<!-- 底部提示 -->
|
||
<view class="footer-tip">
|
||
<text>分享专属链接,好友通过链接点击后自动绑定</text>
|
||
<text>购买任意测评即可获得 <text class="highlight">90%</text> 的现金返利</text>
|
||
</view>
|
||
|
||
<view class="safe-bottom"></view>
|
||
|
||
<invite-code-dialog
|
||
visible="{{showInviteCodeDialog}}"
|
||
bind:skip="onInviteCodeSkip"
|
||
bind:success="onInviteCodeSuccess"
|
||
/>
|
||
</view>
|