添加的功能:查看推广码对应的结算记录
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
const { baseUrl } = require('../../../request');
|
||||
import { globalImgUrl } from '../../../request';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
@ -10,7 +11,8 @@ Page({
|
||||
id: null,
|
||||
showPromoPop: false,
|
||||
currentQrcode: '',
|
||||
currentPromoLink: ''
|
||||
currentPromoLink: '',
|
||||
globalImgUrl,
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
@ -87,17 +89,24 @@ Page({
|
||||
},
|
||||
|
||||
// 跳转结算明细
|
||||
gotoSubSettlement(e) {
|
||||
|
||||
gotoSettlement(e) {
|
||||
const projectId = e.currentTarget.dataset.id;
|
||||
const url = e.currentTarget.dataset.url;
|
||||
const name = e.currentTarget.dataset.name;
|
||||
|
||||
wx.navigateTo({
|
||||
url: `/pages/projectModule/settlement/settlement?id=${projectId}&picurl=${url}&name=${name}`,
|
||||
})
|
||||
},
|
||||
|
||||
gotoSubSettlement(e) {
|
||||
const promoId = e.currentTarget.dataset.id;
|
||||
const image = e.currentTarget.dataset.image
|
||||
const name = e.currentTarget.dataset.name
|
||||
wx.navigateTo({
|
||||
url: `/pages/projectModule/subSettlement/subSettlement?id=${promoId}&image=${image}&name=${name}`,
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 推广码-查看资料
|
||||
goToPromoMaterial(e) {
|
||||
|
@ -3,13 +3,13 @@
|
||||
<view class="flex-row items-center">
|
||||
<image
|
||||
class="shrink-0 image"
|
||||
src="{{projectDetail.projectImage}}"
|
||||
src="{{ globalImgUrl + projectDetail.projectImage }}"
|
||||
/>
|
||||
<view class="flex-col flex-1 group_1 ml-20">
|
||||
<text class="self-start font text">{{projectDetail.projectName}}</text>
|
||||
<view class="flex-row items-center self-stretch mt-7">
|
||||
<text class="flex-1 font_2 text_2">{{projectDetail.projectDescription}}</text>
|
||||
<view class="flex-row items-center shrink-0 section ml-13" bindtap="gotoSubSettlement" data-id="{{ projectDetail.id }}" data-url="{{ projectDetail.projectImage }}" data-name="{{ projectDetail.projectName }}">
|
||||
<view class="flex-row items-center shrink-0 section ml-13" bindtap="gotoSettlement" data-id="{{ projectDetail.id }}" data-url="{{ projectDetail.projectImage }}" data-name="{{ projectDetail.projectName }}">
|
||||
<image
|
||||
class="shrink-0 image_2"
|
||||
src="./images/jsmx.png"
|
||||
@ -149,7 +149,7 @@
|
||||
data-link="{{item.promoCodeLink}}"
|
||||
>查看推广码</text>
|
||||
<view class="flex-row self-stretch group_12">
|
||||
<view class="flex-col justify-start items-center text-wrapper_3" >
|
||||
<view data-promoId="{{item.id}}" class="flex-col justify-start items-center text-wrapper_3" bindtap="gotoSubSettlement" data-id="{{ item.id }}" data-image="{{ projectDetail.projectImage }}" data-name="{{ item.salespersonName }}">
|
||||
<text class="font_14 text_21">结算明细</text>
|
||||
</view>
|
||||
<view class="flex-col justify-start items-center text-wrapper_4 ml-12" bindtap="goToPromoMaterial" data-id="{{item.projectId}}"
|
||||
@ -172,7 +172,7 @@
|
||||
|
||||
<promo-pop
|
||||
show="{{showPromoPop}}"
|
||||
qrcode="{{currentQrcode}}"
|
||||
qrcode="{{ globalImgUrl + currentQrcode }}"
|
||||
link="{{currentPromoLink}}"
|
||||
close-icon="../promoPop/images/cha.png"
|
||||
bind:close="onClosePromoPop"
|
||||
|
@ -1,4 +1,5 @@
|
||||
const { baseUrl } = require('../../../request');
|
||||
import { globalImgUrl } from '../../../request';
|
||||
|
||||
Page({
|
||||
/**
|
||||
@ -13,7 +14,8 @@ Page({
|
||||
'./images/banner.png'
|
||||
],
|
||||
// 后端返回的项目列表
|
||||
items: []
|
||||
items: [],
|
||||
globalImgUrl,
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -28,7 +28,7 @@
|
||||
<!-- 项目图片 -->
|
||||
<image
|
||||
class="image_2"
|
||||
src="{{item.projectImage}}"
|
||||
src="{{ globalImgUrl + item.projectImage }}"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<view class="ml-14 flex-row items-end">
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { baseUrl } from "../../../request";
|
||||
import { globalImgUrl } from "../../../request";
|
||||
|
||||
// pages/projectModule/settlement/settlement.js
|
||||
Page({
|
||||
@ -17,6 +18,7 @@ Page({
|
||||
workTime: '', // 作业收益
|
||||
settlementTime: '', // 结算时间
|
||||
revenueSource: false, // 收益来源(true抽成,false为推广码)
|
||||
globalImgUrl,
|
||||
},
|
||||
|
||||
// 获取项目结算明细列表
|
||||
|
@ -6,7 +6,7 @@
|
||||
<view class="flex-row items-center flex-1">
|
||||
<image
|
||||
class="shrink-0 image"
|
||||
src="{{ picurl }}"
|
||||
src="{{ globalImgUrl + picurl }}"
|
||||
/>
|
||||
<text class="font text_2 ml-14">{{ item.projectDetailName}}</text>
|
||||
</view>
|
||||
|
@ -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;
|
||||
|
@ -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() {
|
||||
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { baseUrl } from "../../../request"
|
||||
import { globalImgUrl } from "../../../request"
|
||||
|
||||
// pages/projectModule/userProject/userProject.js
|
||||
Page({
|
||||
@ -8,6 +9,7 @@ Page({
|
||||
*/
|
||||
|
||||
data: {
|
||||
globalImgUrl,
|
||||
userProjectList: [],
|
||||
},
|
||||
|
||||
@ -20,11 +22,9 @@ Page({
|
||||
|
||||
// 结算记录
|
||||
gotoSubSettlement(e) {
|
||||
|
||||
const projectId = e.currentTarget.dataset.id;
|
||||
const url = e.currentTarget.dataset.url;
|
||||
const name = e.currentTarget.dataset.name;
|
||||
|
||||
wx.navigateTo({
|
||||
url: `/pages/projectModule/settlement/settlement?id=${projectId}&picurl=${url}&name=${name}`,
|
||||
})
|
||||
@ -53,6 +53,7 @@ Page({
|
||||
gotoProjectDetail(e){
|
||||
// 获取data-id中的值
|
||||
const projectId = e.currentTarget.dataset.id;
|
||||
console.log('项目id =============>', projectId)
|
||||
wx.navigateTo({
|
||||
url: `/pages/projectModule/projectDetail/projectDetail?id=${projectId}&isPromo=0`,
|
||||
})
|
||||
|
@ -1,11 +1,11 @@
|
||||
<view class="flex-col justify-start page">
|
||||
<view class="flex-col list">
|
||||
<view class="flex-col list-item mt-15" wx:for="{{ userProjectList }}" wx:for-item="item" wx:for-index="index" wx:key="index" bind:tap="gotoProjectDetail" data-id="{{ item.projectId }}">
|
||||
<view class="flex-col list-item mt-15" wx:for="{{ userProjectList }}" wx:for-item="item" wx:for-index="index" wx:key="index" bind:tap="gotoProjectDetail" data-id="{{ item.projectId }}">
|
||||
<view class="flex-row justify-between items-center self-stretch">
|
||||
<view class="flex-row items-center">
|
||||
<image
|
||||
class="shrink-0 image"
|
||||
src="{{ item.projectImage }}"
|
||||
src="{{ globalImgUrl + item.projectImage }}"
|
||||
/>
|
||||
<view class="ml-18 flex-col shrink-0 group">
|
||||
<text class="font">{{ item.projectName }}</text>
|
||||
@ -18,14 +18,14 @@
|
||||
/>
|
||||
</view>
|
||||
<view class="mt-14 flex-row group_2 equal-division">
|
||||
<view class="flex-row justify-center items-center section equal-division-item" data-id="{{ item.projectId }}"catch:tap="stopEventPropagation">
|
||||
<view class="flex-row justify-center items-center section equal-division-item" data-id="{{ item.projectId }}" catch:tap="stopEventPropagation">
|
||||
<image
|
||||
class="image_3"
|
||||
src="./images/tgm.png"
|
||||
/>
|
||||
<text class="ml-4 font_3">推广码</text>
|
||||
</view>
|
||||
<view class="ml-14 flex-row items-center section equal-division-item_2" bind:tap="gotoSubSettlement" data-id="{{ item.projectId }}" data-url="{{ item.projectImage }}" data-name="{{ item.projectName }}">
|
||||
<view class="ml-14 flex-row items-center section equal-division-item_2" catch:tap="gotoSubSettlement" data-id="{{ item.projectId }}" data-url="{{ item.projectImage }}" data-name="{{ item.projectName }}">
|
||||
<image
|
||||
class="shrink-0 image_4"
|
||||
src="./images/jsmx.png"
|
||||
|
Reference in New Issue
Block a user