115 lines
2.1 KiB
JavaScript
115 lines
2.1 KiB
JavaScript
import { baseUrl } from "../../../request";
|
|
|
|
// pages/personCenter/subCommissionSetting/subCommissionSetting.js
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
items_1: [null, null, null],
|
|
items: [null, null],
|
|
showCommissionRatePop: false,
|
|
id: 0, // 项目id
|
|
subCommissionList: [], // 下级抽佣列表
|
|
|
|
},
|
|
|
|
// 点击“设价”按钮,显示弹窗
|
|
showCommissionRatePop() {
|
|
this.setData({ showCommissionRatePop: true });
|
|
},
|
|
|
|
// 关闭弹窗(包括遮罩点击和取消按钮)
|
|
closeCommissionRatePop() {
|
|
this.setData({ showCommissionRatePop: false });
|
|
},
|
|
|
|
// 确认按钮回调
|
|
handleCommissionRateConfirm(e) {
|
|
const { agentPrice, commissionRate, pricingMethod } = e.detail;
|
|
console.log('设置数据:', agentPrice, commissionRate, pricingMethod);
|
|
this.closeCommissionRatePop();
|
|
},
|
|
|
|
// 查询下级抽佣情况
|
|
getSubCommissionList() {
|
|
const id = this.data.id
|
|
wx.request({
|
|
url: baseUrl + '/projectCommission/query/sub/commission',
|
|
method: 'POST',
|
|
header: {
|
|
Authorization: wx.getStorageSync('token'),
|
|
},
|
|
data: { id: id },
|
|
success: res => {
|
|
console.log('下级抽佣列表----->',res.data.data);
|
|
if (res.data.code === 1) {
|
|
this.setData({
|
|
subCommissionList: res.data.data
|
|
})
|
|
}
|
|
}
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad(options) {
|
|
console.log('----->',options);
|
|
this.setData({
|
|
id: options.id
|
|
})
|
|
this.getSubCommissionList()
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage() {
|
|
|
|
}
|
|
}) |