commission--yt-commit
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import { baseUrl } from "../../../request";
|
||||
|
||||
// pages/projectModule/settlement/settlement.js
|
||||
Page({
|
||||
|
||||
@ -5,14 +7,61 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
items: [null, null],
|
||||
pid: 0, // 项目id
|
||||
projectSettlementList: [], // 项目结算列表
|
||||
},
|
||||
|
||||
// 获取项目明细列表
|
||||
getProjectSettlementList() {
|
||||
const pid = this.data.pid
|
||||
wx.request({
|
||||
url: baseUrl + '/projectSettlement/query/all/settle',
|
||||
method: 'POST',
|
||||
header: {
|
||||
Authorization: wx.getStorageSync('token')
|
||||
},
|
||||
data: {
|
||||
id: pid
|
||||
},
|
||||
success: res =>{
|
||||
console.log('---->',res.data);
|
||||
if (res.data.code === 1) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.setData({ pid: options.id })
|
||||
console.log('项目id--->',options.id);
|
||||
this.getProjectSettlementList()
|
||||
// 模拟后端响应数据
|
||||
const response = {
|
||||
code: 0,
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
projectDetailName: "新用户完成首单",
|
||||
settlementQuantity: 2,
|
||||
settlementRevenue: 2.34,
|
||||
workTime: "2025-05-20", // 示例作业时间
|
||||
settlementTime: "2025-05-22", // 示例结算时间
|
||||
revenueSource: false
|
||||
}
|
||||
],
|
||||
message: ""
|
||||
};
|
||||
|
||||
if (response.code === 0) {
|
||||
// 将后端返回的数据赋值给 projectSettlementList
|
||||
this.setData({
|
||||
projectSettlementList: response.data
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -63,4 +112,4 @@ Page({
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
});
|
||||
|
Reference in New Issue
Block a user