PDF需求全面修复 - v1.15
## 后端 1. 数据概览改为从API获取真实用户/订单数 2. 提现API增加容错和withdrawals表自动创建 ## 小程序 1. 设置页:去掉支付宝,微信号直接输入 2. 我的页面:优先显示微信号 3. 找伙伴-资源对接:新增三项填写(能帮到什么/需要什么/擅长什么) ## 部署配置 - 更新为小型宝塔 42.194.232.22
This commit is contained in:
@@ -156,22 +156,37 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
// 绑定微信号
|
||||
bindWechat() {
|
||||
this.setData({
|
||||
showBindModal: true,
|
||||
bindType: 'wechat',
|
||||
bindValue: ''
|
||||
})
|
||||
// 微信号输入
|
||||
onWechatInput(e) {
|
||||
this.setData({ wechatId: e.detail.value })
|
||||
},
|
||||
|
||||
// 绑定支付宝
|
||||
bindAlipay() {
|
||||
this.setData({
|
||||
showBindModal: true,
|
||||
bindType: 'alipay',
|
||||
bindValue: ''
|
||||
})
|
||||
|
||||
// 保存微信号
|
||||
async saveWechat() {
|
||||
const { wechatId } = this.data
|
||||
if (!wechatId || wechatId.length < 6) return
|
||||
|
||||
wx.setStorageSync('user_wechat', wechatId)
|
||||
|
||||
// 更新用户信息
|
||||
if (app.globalData.userInfo) {
|
||||
app.globalData.userInfo.wechat = wechatId
|
||||
wx.setStorageSync('userInfo', app.globalData.userInfo)
|
||||
}
|
||||
|
||||
// 同步到服务器
|
||||
try {
|
||||
await app.request('/api/user/update', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
userId: app.globalData.userInfo?.id,
|
||||
wechat: wechatId
|
||||
}
|
||||
})
|
||||
wx.showToast({ title: '微信号已保存', icon: 'success' })
|
||||
} catch (e) {
|
||||
console.log('保存微信号失败', e)
|
||||
}
|
||||
},
|
||||
|
||||
// 输入绑定值
|
||||
|
||||
@@ -38,33 +38,23 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 微信号 -->
|
||||
<view class="bind-item" bindtap="bindWechat">
|
||||
<!-- 微信号 - 简化输入 -->
|
||||
<view class="bind-item">
|
||||
<view class="bind-left">
|
||||
<view class="bind-icon wechat-icon">💬</view>
|
||||
<view class="bind-info">
|
||||
<text class="bind-label">微信号</text>
|
||||
<text class="bind-value">{{wechatId || '未绑定'}}</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>
|
||||
<text class="bind-btn" wx:else>去绑定</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付宝 -->
|
||||
<view class="bind-item" bindtap="bindAlipay">
|
||||
<view class="bind-left">
|
||||
<view class="bind-icon alipay-icon">💳</view>
|
||||
<view class="bind-info">
|
||||
<text class="bind-label">支付宝</text>
|
||||
<text class="bind-value">{{alipayAccount || '未绑定'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bind-right">
|
||||
<text class="bind-check" wx:if="{{alipayAccount}}">✓</text>
|
||||
<text class="bind-btn" wx:else>去绑定</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -86,12 +76,12 @@
|
||||
</view>
|
||||
|
||||
<!-- 自动提现设置 -->
|
||||
<view class="bind-card auto-withdraw-card" wx:if="{{isLoggedIn && (wechatId || alipayAccount)}}">
|
||||
<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>
|
||||
<text class="card-desc">收益自动打款到微信零钱</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -104,11 +94,11 @@
|
||||
<view class="withdraw-info" wx:if="{{autoWithdrawEnabled}}">
|
||||
<view class="info-item">
|
||||
<text class="info-label">提现方式</text>
|
||||
<text class="info-value">{{alipayAccount ? '支付宝' : '微信零钱'}}</text>
|
||||
<text class="info-value">微信零钱</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">提现账户</text>
|
||||
<text class="info-value">{{alipayAccount || wechatId}}</text>
|
||||
<text class="info-value">{{wechatId}}</text>
|
||||
</view>
|
||||
<text class="withdraw-tip">收益将在每笔订单完成后自动打款</text>
|
||||
</view>
|
||||
@@ -116,8 +106,8 @@
|
||||
</view>
|
||||
|
||||
<!-- 提现提示 -->
|
||||
<view class="tip-banner" wx:if="{{isLoggedIn && !wechatId && !alipayAccount}}">
|
||||
<text class="tip-text">提示:绑定至少一个支付方式(微信或支付宝)才能使用提现功能</text>
|
||||
<view class="tip-banner" wx:if="{{isLoggedIn && !wechatId}}">
|
||||
<text class="tip-text">提示:绑定微信号才能使用提现功能</text>
|
||||
</view>
|
||||
|
||||
<view class="logout-btn" wx:if="{{isLoggedIn}}" bindtap="handleLogout">退出登录</view>
|
||||
|
||||
@@ -25,9 +25,10 @@
|
||||
.bind-icon.phone-icon { background: rgba(0,206,209,0.2); }
|
||||
.bind-icon.wechat-icon { background: rgba(158,158,158,0.2); }
|
||||
.bind-icon.alipay-icon { background: rgba(158,158,158,0.2); }
|
||||
.bind-info { display: flex; flex-direction: column; gap: 4rpx; }
|
||||
.bind-info { display: flex; flex-direction: column; gap: 4rpx; flex: 1; }
|
||||
.bind-label { font-size: 28rpx; color: #fff; font-weight: 500; }
|
||||
.bind-value { font-size: 24rpx; color: rgba(255,255,255,0.5); }
|
||||
.bind-input { font-size: 24rpx; color: #00CED1; background: transparent; padding: 8rpx 0; }
|
||||
.bind-right { display: flex; align-items: center; }
|
||||
.bind-check { color: #00CED1; font-size: 32rpx; }
|
||||
.bind-btn { color: #00CED1; font-size: 26rpx; }
|
||||
|
||||
Reference in New Issue
Block a user