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

@ -8,10 +8,18 @@ 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({
@ -26,7 +34,13 @@ Page({
success: res =>{
console.log('---->',res.data);
if (res.data.code === 1) {
this.setData({
projectSettlementList: res.data.data
})
} else {
wx.showToast({
title: '服务错误',
})
}
}
})
@ -36,32 +50,11 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({ pid: options.id })
this.setData({ pid: options.id });
this.setData({ pname: options.name })
this.setData({ picurl: options.picurl })
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
});
}
this.getProjectSettlementList();
},
/**

View File

@ -1,16 +1,16 @@
<view class="flex-col page">
<view class="flex-col justify-start items-start text-wrapper"><text class="text">项目:饿了么-超吃卡</text></view>
<view class="flex-col justify-start items-start text-wrapper"><text class="text">项目:{{ pname }}</text></view>
<view class="flex-col mt-11">
<view class="flex-col list-item mt-20" wx:for="{{ projectSettlementList }}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="flex-row items-center group">
<view class="flex-row items-center flex-1">
<image
class="shrink-0 image"
src="https://ide.code.fun/api/image?token=68368d354ae84d001230f4d1&name=1ca23eeec01596125d5539fcda13702d.png"
src="{{ picurl }}"
/>
<text class="font text_2 ml-14">{{ projectSettlementList.projectDetailName}}</text>
<text class="font text_2 ml-14">{{ item.projectDetailName}}</text>
</view>
<text class="font text_3 ml-21">业务员:陈新知</text>
<text class="font text_3 ml-21">业务员:{{ item.salespersonName }}</text>
</view>
<view class="flex-col section">
<view class="flex-row justify-between">
@ -20,20 +20,20 @@
</view>
<view class="flex-col justify-start group_2 mt-10">
<view class="flex-row justify-center items-center relative section_2">
<text class="font_3 text_6 pos">{{ projectSettlementList.settlementQuantity }}元购买券</text>
<text class="font_4">{{ projectSettlementList.settlementQuantity }}</text>
<text class="font_5 pos_2">¥{{ projectSettlementList.settlementRevenue.toFixed(2) }}</text>
<text class="font_3 text_6 pos">{{ item.projectDetailName }}</text>
<text class="font_4">{{ item.settlementQuantity }}</text>
<text class="font_5 pos_2">¥{{ item.settlementRevenue }}</text>
</view>
</view>
</view>
<view class="flex-row group_1">
<view class="group_3">
<text class="font_6 text_7">作业时间:</text>
<text class="font_5">{{ projectSettlementList.workTime || '暂无' }}</text>
<text class="font_5">{{ item.workTime || '暂无' }}</text>
</view>
<view class="group_4 ml-47">
<text class="font_6">结算时间:</text>
<text class="font_5">{{ projectSettlementList.settlementTime || '暂无' }}</text>
<text class="font_5">{{ item.settlementTime || '暂无' }}</text>
</view>
</view>
</view>