qingcheng-xiaochengxu/pages/projectModule/settlement/settlement.js

109 lines
2.0 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { baseUrl } from "../../../request";
// pages/projectModule/settlement/settlement.js
Page({
/**
* 页面的初始数据
*/
data: {
pid: 0, // 项目id
pname: '', // 项目名称
picurl: '', // 项目图片
projectSettlementList: [], // 项目结算列表
projectDetailName: '', // 项目明细名称
settlementQuantity: 0, // 结算数量
settlementRevenue: 0, // 结算收益
workTime: '', // 作业收益
settlementTime: '', // 结算时间
revenueSource: false, // 收益来源(true抽成false为推广码)
},
// 获取项目结算明细列表
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) {
this.setData({
projectSettlementList: res.data.data
})
} else {
wx.showToast({
title: '服务错误',
})
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({ pid: options.id });
this.setData({ pname: options.name })
this.setData({ picurl: options.picurl })
console.log('项目id--->',options.id);
this.getProjectSettlementList();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
});