添加的功能:查看推广码对应的结算记录

This commit is contained in:
2025-06-09 19:08:32 +08:00
parent 38ba528f76
commit c0c6b5b61a
23 changed files with 131 additions and 86 deletions

View File

@ -1,3 +1,6 @@
import { baseUrl } from "../../../request";
import { globalImgUrl } from "../../../request";
// pages/projectModule/settlement/settlement.js
Page({
@ -5,14 +8,59 @@ Page({
* 页面的初始数据
*/
data: {
items: [null, null],
settlementData: [], // 用来存储从后端获取的结算数据
globalImgUrl,
projectImage: '',
saleName: '',
id: '',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 调用后端接口
this.setData({id: options.id})
this.setData({projectImage: options.image})
this.setData({saleName: options.name})
this.fetchSettlementData();
},
/**
* 请求结算数据
*/
fetchSettlementData() {
const token = wx.getStorageSync('token'); // 从本地存储获取 token
const data = {
id: 5
};
wx.request({
url: baseUrl + '/projectSettlement/query/settle',
method: 'POST',
data: data,
header: {
'Authorization': token, // 设置请求头,包含 token
},
success: (res) => {
if (res.data.code === 1) {
// 请求成功,更新页面数据
this.setData({
settlementData: res.data.data // 将返回的数据赋值给 settlementData
});
} else {
wx.showToast({
title: '加载数据失败',
icon: 'none'
});
}
},
fail: () => {
wx.showToast({
title: '请求失败',
icon: 'none'
});
}
});
},
/**
@ -63,4 +111,4 @@ Page({
onShareAppMessage() {
}
})
});

View File

@ -1,16 +1,18 @@
<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">业务员:{{ saleName }}</text>
</view>
<view class="flex-col mt-11">
<view class="flex-col list-item mt-20" wx:for="{{items}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="flex-col list-item mt-20" wx:for="{{settlementData}}" 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="{{ globalImgUrl + projectImage }}"
/>
<text class="font text_2 ml-14">美团神券包-春季活动</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,22 +22,22 @@
</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">3.6元购买券</text>
<text class="font_4">10</text>
<text class="font_5 pos_2">¥3.00</text>
<text class="font_3 text_6 pos">{{item.settlementRevenue}}元购买券</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">2025-05-20</text>
<text class="font_5">{{item.workTime}}</text>
</view>
<view class="group_4 ml-47">
<text class="font_6">结算时间:</text>
<text class="font_5">2025-05-22</text>
<text class="font_5">{{item.settlementTime}}</text>
</view>
</view>
</view>
</view>
</view>
</view>

View File

@ -8,7 +8,7 @@
margin-left: 88.13rpx;
}
.page {
padding: 50.63rpx 24.38rpx 608.44rpx;
padding: 50.63rpx 24.38rpx 100.44rpx;
background-image: linear-gradient(180deg, #ff8d1a -7.3%, #f5f5f5 39.3%);
width: 100%;
overflow-y: auto;
@ -91,12 +91,6 @@
.text_6 {
width: 103.13rpx;
}
.pos {
/* position: absolute;
left: 0.99rpx;
top: 50%;
transform: translateY(-50%); */
}
.font_4 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
@ -109,12 +103,6 @@
line-height: 19.93rpx;
color: #ff8d1a;
}
.pos_2 {
/* position: absolute;
right: -14.23rpx;
top: 50%;
transform: translateY(-50%); */
}
.group_1 {
display: flex;
justify-content: space-between;