commission--yt-commit

This commit is contained in:
2025-06-03 21:29:15 +08:00
parent eaf4b6c5e5
commit 361f6a89d3
16 changed files with 538 additions and 104 deletions

View File

@ -1,66 +1,92 @@
import { baseUrl } from "../../../request";
// pages/personCenter/withdrawal/withdrawal.js
Page({
/**
* 页面的初始数据
*/
data: {
withdrawalAccount: '', // 这里保存提现账户信息
},
// 获取当前账户信息
getAccountInfo() {
wx.request({
url: baseUrl + '/userAccount/queryById', // 替换为你的后端接口
method: 'POST',
header: {
Authorization: wx.getStorageSync('token'),
},
success: (res) => {
console.log('当前账户是---->',res.data.data);
if (res.data.code === 1) {
this.setData({
withdrawalAccount: res.data.data.bankCardNumber,
});
} else {
wx.showToast({
title: '获取数据失败',
icon: 'none'
});
}
},
fail: () => {
wx.showToast({
title: '请求失败',
icon: 'none'
});
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getAccountInfo()
},
/**
* 跳转到添加提现账户页面
*/
goToAddAccount() {
wx.navigateTo({
url: '/pages/personCenter/bindBankCard/bindBankCard', // 自定义的添加提现账户页面
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
onShareAppMessage() {},
});

View File

@ -2,11 +2,15 @@
<view class="flex-col self-stretch section">
<text class="self-start font">提现账户</text>
<view class="flex-row items-center self-stretch section_2 mt-11">
<image
class="image"
src="./images/zh.png"
/>
<text class="font_2 text ml-10">622031207006363442</text>
<!-- 判断是否有提现账户信息 -->
<block wx:if="{{withdrawalAccount}}">
<image class="image" src="./images/zh.png" />
<text class="font_2 text ml-10">{{withdrawalAccount}}</text>
</block>
<block wx:else>
<!-- 没有提现账户时显示“去添加”按钮 -->
<button class="add-btn" bindtap="goToAddAccount">去添加</button>
</block>
</view>
</view>
<view class="flex-col self-stretch section_3">

View File

@ -88,4 +88,12 @@
.text_6 {
color: #ffffff;
line-height: 28.36rpx;
}
}
.add-btn {
background-color: #ff8d1a;
color: #ffffff;
font-size: 26.72rpx;
padding: 10rpx 20rpx;
border-radius: 10rpx;
border: none;
}