删除不再使用的文件和配置,优化项目结构以提升可维护性;新增环境变量配置示例,更新 Docker 和部署相关文件以支持灵活的端口设置;重构数据库连接逻辑,增强错误处理和配置管理,确保更好的兼容性和稳定性。

This commit is contained in:
乘风
2026-02-02 18:16:15 +08:00
parent 6dcc6a4709
commit 8eec1ab78c
126 changed files with 12536 additions and 20384 deletions

View File

@@ -1,147 +1,91 @@
<!--设置页 - 账号绑定功能-->
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack">
<text class="back-icon"></text>
</view>
<text class="nav-title">设置</text>
<view class="nav-placeholder"></view>
<view class="nav-placeholder" style="height: {{navBarHeight || (statusBarHeight + 44)}}px;"></view>
<view class="header safe-header-right">
<view class="nav-back" bindtap="goBack">← 返回</view>
<text class="header-title">设置</text>
</view>
<view style="height: {{statusBarHeight + 44}}px;"></view>
<view class="content">
<!-- 账号绑定 -->
<view class="bind-card" wx:if="{{isLoggedIn}}">
<view class="card-header">
<text class="card-icon">🛡️</text>
<view class="card-title-wrap">
<view class="main">
<view class="card">
<view class="card-head">
<text class="card-icon">🛡</text>
<view>
<text class="card-title">账号绑定</text>
<text class="card-desc">绑定后可用于提现和找伙伴功能</text>
</view>
</view>
<view class="bind-list">
<!-- 手机号 - 使用微信一键获取 -->
<view class="bind-item">
<view class="bind-left">
<view class="bind-icon phone-icon">📱</view>
<view class="bind-info">
<text class="bind-label">手机号</text>
<text class="bind-value">{{phoneNumber || '未绑定'}}</text>
</view>
</view>
<view class="bind-right">
<text class="bind-check" wx:if="{{phoneNumber}}">✓</text>
<button wx:else class="get-phone-btn" open-type="getPhoneNumber" bindgetphonenumber="onGetPhoneNumber">
一键获取
</button>
</view>
</view>
<!-- 微信号 - 简化输入 -->
<view class="bind-item">
<view class="bind-left">
<view class="bind-icon wechat-icon">💬</view>
<view class="bind-info">
<text class="bind-label">微信号</text>
<input
class="bind-input"
placeholder="输入微信号"
value="{{wechatId}}"
bindinput="onWechatInput"
bindblur="saveWechat"
/>
</view>
</view>
<view class="bind-right">
<text class="bind-check" wx:if="{{wechatId}}">✓</text>
</view>
</view>
</view>
</view>
<!-- 收货地址管理(始终显示,未登录点击提示先登录) -->
<view class="bind-card address-card">
<view class="bind-item" bindtap="goToAddressList">
<view class="bind-item" data-type="phone" bindtap="openBindModal">
<view class="bind-left">
<view class="bind-icon address-icon">📍</view>
<view class="bind-info">
<view class="bind-icon {{user.phone ? 'bound' : ''}}">📱</view>
<view>
<text class="bind-label">手机号</text>
<text class="bind-value">{{user.phone || '未绑定'}}</text>
</view>
</view>
<text class="bind-action" wx:if="{{user.phone}}">✓</text>
<text class="bind-action brand" wx:else>去绑定</text>
</view>
<view class="bind-item" data-type="wechat" bindtap="openBindModal">
<view class="bind-left">
<view class="bind-icon wechat {{user.wechat ? 'bound' : ''}}">💬</view>
<view>
<text class="bind-label">微信号</text>
<text class="bind-value">{{user.wechat || '未绑定'}}</text>
</view>
</view>
<text class="bind-action" wx:if="{{user.wechat}}">✓</text>
<text class="bind-action green" wx:else>去绑定</text>
</view>
<view class="bind-item" data-type="alipay" bindtap="openBindModal">
<view class="bind-left">
<view class="bind-icon alipay {{user.alipay ? 'bound' : ''}}">💳</view>
<view>
<text class="bind-label">支付宝</text>
<text class="bind-value">{{user.alipay || '未绑定'}}</text>
</view>
</view>
<text class="bind-action" wx:if="{{user.alipay}}">✓</text>
<text class="bind-action blue" wx:else>去绑定</text>
</view>
<view class="bind-item" bindtap="goAddresses">
<view class="bind-left">
<view class="bind-icon addr">📍</view>
<view>
<text class="bind-label">收货地址</text>
<text class="bind-value address-text">{{isLoggedIn ? (addressSummary || '管理收货地址') : '点击登录后管理'}}</text>
<text class="bind-value">管理收货地址,用于发货与邮寄</text>
</view>
</view>
<view class="bind-right">
<text class="bind-arrow"></text>
</view>
<text class="bind-action brand">管理</text>
</view>
</view>
<!-- 自动提现设置 -->
<view class="bind-card auto-withdraw-card" wx:if="{{isLoggedIn && wechatId}}">
<view class="card-header">
<text class="card-icon">💰</text>
<view class="card-title-wrap">
<text class="card-title">自动提现</text>
<text class="card-desc">收益自动打款到微信零钱</text>
</view>
</view>
<view class="auto-withdraw-content">
<view class="withdraw-switch-row">
<text class="switch-label">开启自动提现</text>
<switch checked="{{autoWithdrawEnabled}}" bindchange="toggleAutoWithdraw" color="#00CED1"/>
</view>
<view class="withdraw-info" wx:if="{{autoWithdrawEnabled}}">
<view class="info-item">
<text class="info-label">提现方式</text>
<text class="info-value">微信零钱</text>
</view>
<view class="info-item">
<text class="info-label">提现账户</text>
<text class="info-value">{{wechatId}}</text>
</view>
<text class="withdraw-tip">收益将在每笔订单完成后自动打款</text>
</view>
</view>
</view>
<!-- 提现提示 -->
<view class="tip-banner" wx:if="{{isLoggedIn && !wechatId}}">
<text class="tip-text">提示:绑定微信号才能使用提现功能</text>
</view>
<view class="logout-btn" wx:if="{{isLoggedIn}}" bindtap="handleLogout">退出登录</view>
<view class="hint" wx:if="{{!user.wechat && !user.alipay}}">
<text>提示:绑定至少一个支付方式(微信或支付宝)才能使用提现功能</text>
</view>
<view class="btn-logout" bindtap="logout">退出登录</view>
</view>
<!-- 绑定弹窗 -->
<view class="modal-overlay" wx:if="{{showBindModal}}" bindtap="closeBindModal">
<view class="modal-content" catchtap="stopPropagation">
<view class="modal-header">
<text class="modal-title">绑定{{bindType === 'phone' ? '手机号' : bindType === 'wechat' ? '微信号' : '支付宝'}}</text>
<view class="modal-close" bindtap="closeBindModal">✕</view>
<view class="mask" wx:if="{{showBindModal}}" catchtap="closeBindModal">
<view class="modal" catchtap="">
<view class="modal-head">
<text class="modal-title">绑定{{bindType === 'phone' ? '手机号' : (bindType === 'wechat' ? '微信号' : '支付宝')}}</text>
<view class="modal-close" bindtap="closeBindModal">×</view>
</view>
<view class="modal-body">
<view class="input-wrapper">
<input
type="{{bindType === 'phone' ? 'number' : 'text'}}"
class="form-input"
placeholder="{{bindType === 'phone' ? '请输入11位手机号' : bindType === 'wechat' ? '请输入微信号' : '请输入支付宝账号'}}"
placeholder-class="input-placeholder"
value="{{bindValue}}"
bindinput="onBindInput"
maxlength="{{bindType === 'phone' ? 11 : 50}}"
/>
</view>
<text class="bind-tip">
{{bindType === 'phone' ? '绑定手机号后可用于找伙伴匹配' : bindType === 'wechat' ? '绑定微信号后可用于找伙伴匹配和好友添加' : '绑定支付宝后可用于提现收益'}}
</text>
<view class="btn-primary {{!bindValue ? 'btn-disabled' : ''}}" bindtap="confirmBind">
确认绑定
<input
class="bind-input"
placeholder="{{bindType === 'phone' ? '请输入11位手机号' : (bindType === 'wechat' ? '请输入微信号' : '请输入支付宝账号')}}"
value="{{bindValue}}"
bindinput="onBindInput"
/>
<text class="bind-err" wx:if="{{bindError}}">{{bindError}}</text>
<view class="btn-primary {{!bindValue || isBinding ? 'disabled' : ''}}" bindtap="submitBind">
{{isBinding ? '绑定中...' : '确认绑定'}}
</view>
</view>
</view>