commission--yt-commit

This commit is contained in:
2025-06-05 22:27:57 +08:00
parent e2182c8248
commit 8a3a6dde23
9 changed files with 93 additions and 67 deletions

View File

@ -18,6 +18,7 @@ Page({
nowAgentUnitPrice: 0, // 现在的‘代理单价’,用于传给弹窗
nowProjectDetailName: '', // 现在的‘项目详细名称’,用于传给弹窗
isSub: false, // 用于区分是项目抽佣页面还是单个用户抽佣页面
fixedRate: 0, // 固定抽佣——一键设置
},
// 获取项目列表
@ -55,30 +56,29 @@ Page({
// 处理抽佣比例提交
handleCommissionSubmit(e) {
const { commissionRate } = e.detail;
console.log(`设置的抽佣比例是:${commissionRate}%`);
// 你可以在这里保存提交的数据,或者执行其他操作
this.getProjectList()
this.getFixedRate()
this.closePopup(); // 确认后关闭弹窗
},
// 获取一键抽佣比例
getFixedRate() {
wx.request({
url: baseUrl + '/projectCommission/update/unite/rate',
method: 'POST',
url: baseUrl + '/userInfo/get/main/jwt',
method: 'GET',
header: {
Authorization: wx.getStorageSync('token'),
},
data: {
uniteCommissionRate: commissionRate
Authorization: wx.getStorageSync('token')
},
success: res => {
console.log('一键设置下级抽成比例结果---->',res.data);
if (res.data.code === 1) {
wx.showToast({
title: '设置成功',
icon: 'success',
duration: 1500
console.log('一键抽佣--->',res.data);
if ( res.data.code === 1 ) {
this.setData({
fixedRate: res.data.data.uniteRate,
})
}
}
})
this.closePopup(); // 确认后关闭弹窗
},
// 点击“设价”按钮,显示弹窗
@ -121,6 +121,7 @@ Page({
*/
onLoad(options) {
this.getProjectList()
this.getFixedRate()
},
/**