Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
chen-xin-zhi 2025-06-04 01:20:19 +08:00
commit 1067eb8c72
11 changed files with 161 additions and 32 deletions

View File

@ -1,3 +1,5 @@
import { baseUrl } from "../../../request";
// pages/personCenter/commissionSetting/commissionSetting.js
Page({
@ -5,30 +7,73 @@ Page({
* 页面的初始数据
*/
data: {
projectList: [], // 项目列表
items_1: [null, null, null],
items: [null, null],
showPopup: false, // 控制弹窗显隐
showCommissionRatePop: false,
},
getProjectList() {
wx.request({
url: baseUrl + '/projectCommission/query/commission',
method: 'POST',
header: {
Authorization: wx.getStorageSync('token'),
},
success: res => {
if (res.data.code === 1) {
console.log('项目列表---->',res.data.data);
this.setData({
projectList: res.data.data
})
}
}
})
},
// 显示弹窗
showPopup() {
this.setData({
showPopup: true
});
},
// 关闭弹窗
closePopup() {
this.setData({
showPopup: false
});
},
// 处理抽佣比例提交
handleCommissionSubmit(e) {
const { commissionRate } = e.detail;
console.log(`设置的抽佣比例是:${commissionRate}%`);
// 你可以在这里保存提交的数据,或者执行其他操作
wx.request({
url: baseUrl + '/projectCommission/update/unite/rate',
method: 'POST',
header: {
Authorization: wx.getStorageSync('token'),
},
data: {
uniteCommissionRate: commissionRate
},
success: res => {
console.log('一键设置下级抽成比例结果---->',res.data);
if (res.data.code === 1) {
wx.showToast({
title: '设置成功',
icon: 'success',
duration: 1500
})
}
}
})
this.closePopup(); // 确认后关闭弹窗
},
// 点击“设价”按钮,显示弹窗
showCommissionRatePop() {
this.setData({ showCommissionRatePop: true });
@ -54,7 +99,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getProjectList()
},
/**

View File

@ -16,17 +16,17 @@
/>
</view>
<view class="flex-col mt-19">
<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="{{projectList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="flex-row group_2">
<view class="flex-row flex-1 self-center">
<image
class="shrink-0 image_3"
src="./images/xmtp.png"
src="{{ item.projectImage }}"
/>
<view class="flex-col items-start flex-1 group_3 ml-13">
<text class="font">美团神券包-春季活动</text>
<text class="font">{{ item.projectName }}</text>
<view class="flex-col justify-start items-center text-wrapper mt-14">
<text class="font_3 text_4">结算T+2</text>
<text class="font_3 text_4">结算T+{{ item.projectSettlementCycle }}</text>
</view>
</view>
</view>
@ -47,13 +47,13 @@
<view class="flex-col mt-16">
<view
class="flex-row justify-center items-center relative list-item_2 mt-14"
wx:for="{{items_1}}"
wx:for-item="item"
wx:for="{{item.projectDetailCommissionVOList}}"
wx:for-item="CommissionList"
wx:for-index="index"
wx:key="index"
>
<text class="font_6 text_6 pos">3.6元购买</text>
<text class="font_7 text_9">0.30/0.30/0.00%</text>
<text class="font_6 text_6 pos">{{ CommissionList.projectDetailName }}</text>
<text class="font_7 text_9">{{ CommissionList.myUnitPrice }}/{{ CommissionList.agentUnitPrice }}/{{ CommissionList.currentCommissionRate }}%</text>
<view class="flex-row group_5 pos_2" bindtap="showCommissionRatePop">
<image
class="image_4 image_6"

View File

@ -14,7 +14,7 @@ Component({
* 组件的初始数据
*/
data: {
commissionRate: "", // 用户输入的抽佣比例
commissionRate: 0, // 用户输入的抽佣比例
},
/**

View File

@ -40,8 +40,8 @@
</view>
</view>
<view class="flex-col items-center mt-22">
<view class="flex-col justify-start items-center text-wrapper_2"><text class="font_3 text_12">确定</text></view>
<view class="flex-col justify-start items-center text-wrapper_3 mt-12">
<view class="flex-col justify-start items-center text-wrapper_2" bind:tap="confirm"><text class="font_3 text_12">确定</text></view>
<view class="flex-col justify-start items-center text-wrapper_3 mt-12" bind:tap="cancel">
<text class="font_3 text_13">取消</text>
</view>
</view>

View File

@ -136,6 +136,27 @@ Page({
})
},
// 复制邀请码到剪贴板
copyInvitationCode() {
wx.setClipboardData({
data: this.data.invitationCode,
success() {
wx.showToast({
title: '复制成功',
icon: 'success',
duration: 1500
});
},
fail() {
wx.showToast({
title: '复制失败',
icon: 'error',
duration: 1500
});
}
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

View File

@ -11,7 +11,7 @@
/>
<text class="font_2 text_2 ml-7">{{ phoneNumber }}</text>
</view>
<view class="flex-row items-center self-stretch section_2 mt-9">
<view class="flex-row items-center self-stretch section_2 mt-9" bindtap="copyInvitationCode">
<text class="font_3 text_3">邀请码:{{ invitationCode }}</text>
<image
class="shrink-0 image_4"

View File

@ -1,3 +1,5 @@
import { baseUrl } from "../../../request"
// pages/personCenter/teamManage/teamManage.js
Page({
@ -5,14 +7,67 @@ Page({
* 页面的初始数据
*/
data: {
items: [null, null, null, null, null],
directAgentSize: 0, // 直接代理人数
teamSize: null, // 团队人数
teamEarnings: null, // 团队收益
invitationCode: "", // 邀请码
userMemberInfoVOList: [] // 成员列表
},
// 获取团队成员信息
getTeamMembersInfo() {
wx.request({
url: baseUrl + '/userMainInfo/query/team',
method: 'POST',
header: {
Authorization: wx.getStorageSync('token')
},
success: res => {
console.log('团队成员信息---->',res.data.data);
this.setData({
directAgentSize: res.data.data.directAgentSize,
teamSize: res.data.data.teamSize,
teamEarnings: res.data.data.teamEarnings,
invitationCode: res.data.data.invitationCode,
userMemberInfoVOList: res.data.data.userMemberInfoVOList
})
}
})
},
// 复制邀请码到剪贴板
copyInvitationCode() {
wx.setClipboardData({
data: this.data.invitationCode,
success() {
wx.showToast({
title: '复制成功',
icon: 'success',
duration: 1500
});
},
fail() {
wx.showToast({
title: '复制失败',
icon: 'error',
duration: 1500
});
}
});
},
// 跳转抽佣界面
gotoCommissionSetting() {
wx.navigateTo({
url: '/pages/personCenter/commissionSetting/commissionSetting',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getTeamMembersInfo()
},
/**

View File

@ -3,18 +3,18 @@
<view class="flex-row equal-division group">
<view class="flex-col items-center group_2 group_1">
<text class="font text">直接代理人数</text>
<text class="font_2 text_13 mt-14">4</text>
<text class="font_2 text_13 mt-14">{{directAgentSize}}</text>
</view>
<view class="flex-col items-center group_2 group_3">
<text class="font text_2">团队总人数</text>
<text class="font_2 text_4 mt-12">12</text>
<text class="font_2 text_4 mt-12">{{teamSize}}</text>
</view>
<view class="flex-col items-start group_2 group_4">
<text class="font text_3">团队总收益</text>
<text class="font_2 text_1 mt-13">¥12.00</text>
<text class="font_2 text_1 mt-13">{{teamEarnings ? '¥' + teamEarnings : '¥0'}}</text>
</view>
</view>
<view class="flex-row justify-between items-center self-stretch section_2">
<view class="flex-row justify-between items-center self-stretch section_2" bind:tap="gotoCommissionSetting">
<view class="flex-row items-center">
<image
class="shrink-0 image"
@ -29,12 +29,12 @@
mode="aspectFill"
/>
</view>
<view class="flex-row justify-end items-center self-center section_3">
<view class="flex-row justify-end items-center self-center section_3" bindtap="copyInvitationCode">
<image
class="shrink-0 image_3"
src="./images/fuzhi.png"
/>
<text class="font text_6">我的邀请码:418037</text>
<text class="font text_6">我的邀请码:{{invitationCode}}</text>
</view>
</view>
<view class="flex-row justify-between items-center mt-13">
@ -50,7 +50,7 @@
<view class="flex-col list mt-13">
<view
class="flex-row items-center relative group_6"
wx:for="{{items}}"
wx:for="{{userMemberInfoVOList}}"
wx:for-item="item"
wx:for-index="index"
wx:key="index"
@ -58,19 +58,19 @@
<view class="shrink-0 section_5"></view>
<view class="shrink-0 section_6 pos_2" style="{{index === 0 ? 'top:0rpx;' : ''}}"></view>
<view class="flex-col flex-1 relative section_1" style="{{index === 0 ? 'margin-top:0rpx;' : ''}}">
<text class="self-start font_3 text_9">张新然</text>
<text class="self-start font_3 text_9">{{item.nickName}}</text>
<view class="flex-col self-stretch section_7">
<text class="self-start font_4">手机号:15888610253</text>
<text class="self-start font_4">手机号:{{item.phoneNumber}}</text>
<view class="flex-row justify-between self-stretch mt-19">
<text class="font_5">团队人数:0</text>
<text class="font_6 text_15">给我创造的收益:¥0</text>
<text class="font_5">团队人数:{{item.teamSize}}</text>
<text class="font_6 text_15">给我创造的收益:¥{{item.parentEarnings}}</text>
</view>
</view>
<view class="flex-row items-center self-end group_5">
<text class="shrink-0 font_7">注册时间:</text>
<text class="flex-1 font_8 ml-3">2025-10-31 16:10:05</text>
<text class="flex-1 font_8 ml-3">{{item.registerTime}}</text>
</view>
</view>
</view>
</view>
</view>
</view>

View File

@ -14,8 +14,15 @@ Page({
},
onLoad(options) {
// console.log('---->',options);
const id = options.id;
this.setData({ id });
const promotionCode = options.promotionCode;
this.setData({ id,promotionCode });
if (promotionCode) { // 切换到‘我的推广码状态’
this.setData({
activeTab: 1
})
}
},
// 每次页面展示都刷新含navigateBack返回时

View File

@ -9,7 +9,7 @@ Page({
data: {
userProjectList: [],
promotionCode: true // 推广码开启
promotionCode: true,
},
/**
@ -52,9 +52,10 @@ Page({
gotoProjectDetail(e){
// 获取data-id中的值
const projectId = e.currentTarget.dataset.id;
const promotionCode = this.data.promotionCode;
wx.navigateTo({
url: `/pages/projectModule/projectDetail/projectDetail?id=${projectId}`,
url: `/pages/projectModule/projectDetail/projectDetail?id=${projectId}&promotionCode=${promotionCode}`,
})
},
/**

View File

@ -20,7 +20,7 @@
/>
</view>
<view class="mt-14 flex-row group_2 equal-division">
<view class="flex-row justify-center items-center section equal-division-item" bind:tap="gotoProjectDetail" data-id="{{ item.id }}" data-promotionCode="{{ promotionCode }}">
<view class="flex-row justify-center items-center section equal-division-item" bind:tap="gotoProjectDetail" data-id="{{ item.id }}">
<image
class="image_3"
src="./images/tgm.png"