Files
Mycontent/miniprogram/pages/settings/settings.wxml
2026-04-13 14:32:32 +08:00

154 lines
6.7 KiB
Plaintext

<!--设置页 - 账号绑定功能-->
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack">
<icon name="chevron-left" size="44" color="rgba(255,255,255,0.6)" customClass="back-icon"></icon>
</view>
<text class="nav-title">设置</text>
<view class="nav-placeholder"></view>
</view>
<view style="height: {{statusBarHeight + 44}}px;"></view>
<view class="content">
<!-- 账号绑定 -->
<view class="bind-card" wx:if="{{isLoggedIn}}">
<view class="card-header">
<icon name="shield" size="48" color="#00CED1" customClass="card-icon"></icon>
<view class="card-title-wrap">
<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"><icon name="smartphone" size="40" color="#00CED1"></icon></view>
<view class="bind-info">
<text class="bind-label">手机号</text>
<text class="bind-value">{{phoneNumber || '未绑定'}}</text>
</view>
</view>
<view class="bind-right">
<icon wx:if="{{phoneNumber}}" name="check" size="36" color="#34C759" customClass="bind-check"></icon>
<button wx:else id="agree-settings-phone-btn" class="get-phone-btn" open-type="getPhoneNumber|agreePrivacyAuthorization" bindgetphonenumber="onGetPhoneNumber" bindagreeprivacyauthorization="onAgreePrivacyForPhone">
快捷获取
</button>
</view>
</view>
<view class="privacy-wechat-row" wx:if="{{showPrivacyModal}}">
<text class="privacy-wechat-desc">为获取手机号,请先同意《用户隐私保护指引》</text>
<button id="agree-privacy-btn" class="privacy-agree-btn" open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="onAgreePrivacyForPhone">同意</button>
</view>
<!-- 联系方式 - 审核模式隐藏 -->
<view class="bind-item" wx:if="{{!auditMode}}">
<view class="bind-left">
<view class="bind-icon wechat-icon"><icon name="message-circle" size="40" color="#00CED1"></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">
<icon wx:if="{{wechatId}}" name="check" size="36" color="#34C759" customClass="bind-check"></icon>
</view>
</view>
<!-- 收货地址 - 跳转到地址管理页 -->
<view class="bind-item" bindtap="goToAddresses">
<view class="bind-left">
<view class="bind-icon address-icon"><icon name="map-pin" size="40" color="#00CED1"></icon></view>
<view class="bind-info">
<text class="bind-label">收货地址</text>
<text class="bind-value address-text">管理收货地址,用于发货与邮寄</text>
</view>
</view>
<view class="bind-right">
<text class="bind-manage brand-color">管理</text>
</view>
</view>
</view>
</view>
<!-- 自动提现设置 - 审核模式隐藏 -->
<view class="bind-card auto-withdraw-card" wx:if="{{isLoggedIn && wechatId && !auditMode}}">
<view class="card-header">
<icon name="wallet" size="48" color="#00CED1" customClass="card-icon"></icon>
<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 && !auditMode}}">
<text class="tip-text">提示:绑定联系方式才能使用提现功能</text>
</view>
<!-- 开发专用入口已移除 -->
<view class="logout-btn" wx:if="{{isLoggedIn}}" bindtap="handleLogout">退出登录</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"><icon name="x" size="36" color="#8e8e93"></icon></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">
确认绑定
</view>
</view>
</view>
</view>
</view>