团队管理和下级用户抽佣明细的输入框搜索功能
This commit is contained in:
@ -42,14 +42,13 @@ Page({
|
||||
success(res) {
|
||||
// console.log('后端返回---->',res.data);
|
||||
// 成功的回调
|
||||
wx.showToast({
|
||||
title: '更新成功',
|
||||
icon: 'success',
|
||||
});
|
||||
// 这里可以跳转到其他页面
|
||||
wx.navigateTo({
|
||||
url: '/pages/personCenter/withdrawalAccount/withdrawalAccount',
|
||||
});
|
||||
if (res.data.code === 1) {
|
||||
wx.showToast({
|
||||
title: '更新成功',
|
||||
icon: 'success',
|
||||
});
|
||||
wx.navigateBack({});
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
// 失败的回调
|
||||
|
@ -37,6 +37,7 @@
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.text_3 {
|
||||
width: 90%;
|
||||
margin-left: 27.52rpx;
|
||||
}
|
||||
.font {
|
||||
@ -60,13 +61,14 @@
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.text_12 {
|
||||
width: 90%;
|
||||
margin-left: 25.8rpx;
|
||||
}
|
||||
.group_4 {
|
||||
line-height: 28.09rpx;
|
||||
}
|
||||
.text_1 {
|
||||
width: 400rpx;
|
||||
width: 90%;
|
||||
margin-left: 27.82rpx;
|
||||
}
|
||||
.group_5 {
|
||||
@ -76,6 +78,7 @@
|
||||
line-height: 28.21rpx;
|
||||
}
|
||||
.text_5 {
|
||||
width: 90%;
|
||||
margin-left: 26.74rpx;
|
||||
}
|
||||
.font_4 {
|
||||
@ -98,5 +101,6 @@
|
||||
width: 248.09rpx;
|
||||
}
|
||||
.text_8 {
|
||||
line-height: 100%;
|
||||
color: #ffffff;
|
||||
}
|
@ -18,8 +18,29 @@ Page({
|
||||
nowAgentUnitPrice: 0, // 现在的‘代理单价’,用于传给弹窗
|
||||
nowProjectDetailName: '', // 现在的‘项目详细名称’,用于传给弹窗
|
||||
isSub: true, // 用于区分是项目抽佣页面还是单个用户抽佣页面
|
||||
searchText: '',
|
||||
tempSubCommissionList: []
|
||||
},
|
||||
|
||||
// 输入框内容变化时更新数据
|
||||
onInput(e) {
|
||||
this.setData({
|
||||
searchText: e.detail.value, // 获取用户输入的关键字
|
||||
});
|
||||
},
|
||||
|
||||
onSearch() {
|
||||
let searchValue = this.data.searchText; // 获取输入框的值
|
||||
let subCommissionList = this.data.subCommissionList
|
||||
// 筛选出 salespersonName 包含 searchText 的项
|
||||
let filtered = subCommissionList.filter(item =>
|
||||
item.subUserNickName.includes(searchValue)
|
||||
);
|
||||
this.setData({
|
||||
tempSubCommissionList: filtered
|
||||
})
|
||||
},
|
||||
|
||||
// 点击“设价”按钮,显示弹窗
|
||||
showCommissionRatePop(e) {
|
||||
console.log('弹窗传值----->',e);
|
||||
@ -59,7 +80,8 @@ Page({
|
||||
console.log('下级抽佣列表----->',res.data.data);
|
||||
if (res.data.code === 1) {
|
||||
this.setData({
|
||||
subCommissionList: res.data.data
|
||||
subCommissionList: res.data.data,
|
||||
tempSubCommissionList: res.data.data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -7,11 +7,11 @@
|
||||
class="image"
|
||||
src="./images/ss.png"
|
||||
/>
|
||||
<input class="font text_2 ml-7" placeholder="请输入关键字" />
|
||||
<input class="font text_2 ml-7" placeholder="请输入关键字" bindinput="onInput" confirm-type="search" bindconfirm="onSearch" value="{{searchText}}"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-col mt-16">
|
||||
<view class="flex-col list-item_1 mt-23" wx:for="{{ subCommissionList }}" wx:for-item="item" wx:for-index="index" wx:key="index">
|
||||
<view class="flex-col list-item_1 mt-23" wx:for="{{ tempSubCommissionList }}" wx:for-item="item" wx:for-index="index" wx:key="index">
|
||||
<text class="self-start font_2 text_3">结算标准:{{ item.subUserNickName }}</text>
|
||||
<view class="flex-col self-stretch section_3 mt-17">
|
||||
<view class="flex-row justify-between items-center">
|
||||
|
@ -41,7 +41,7 @@
|
||||
height: 35.63rpx;
|
||||
}
|
||||
.text_2 {
|
||||
color: #999999;
|
||||
color: #323232;
|
||||
line-height: 27.96rpx;
|
||||
}
|
||||
.list-item_1 {
|
||||
|
@ -8,10 +8,12 @@ Page({
|
||||
*/
|
||||
data: {
|
||||
directAgentSize: 0, // 直接代理人数
|
||||
teamSize: null, // 团队人数
|
||||
teamEarnings: null, // 团队收益
|
||||
teamSize: '', // 团队人数
|
||||
teamEarnings: '', // 团队收益
|
||||
invitationCode: "", // 邀请码
|
||||
userMemberInfoVOList: [] // 成员列表
|
||||
userMemberInfoVOList: [], // 成员列表
|
||||
searchText: '',
|
||||
tempUserMemberInfoVOList: [],
|
||||
},
|
||||
|
||||
// 获取团队成员信息
|
||||
@ -23,19 +25,39 @@ Page({
|
||||
Authorization: wx.getStorageSync('token')
|
||||
},
|
||||
success: res => {
|
||||
console.log('团队成员信息---->',res.data.data);
|
||||
// console.log('团队成员信息---->',res.data.data);
|
||||
let result = res.data.data
|
||||
this.setData({
|
||||
directAgentSize: result.directAgentSize,
|
||||
teamSize: result.teamSize,
|
||||
teamEarnings: result.teamEarnings,
|
||||
invitationCode: result.invitationCode,
|
||||
userMemberInfoVOList: result.userMemberInfoVOList
|
||||
userMemberInfoVOList: result.userMemberInfoVOList,
|
||||
tempUserMemberInfoVOList: result.userMemberInfoVOList
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 输入框内容变化时更新数据
|
||||
onInput(e) {
|
||||
this.setData({
|
||||
searchText: e.detail.value, // 获取用户输入的关键字
|
||||
});
|
||||
},
|
||||
|
||||
onSearch() {
|
||||
let searchValue = this.data.searchText; // 获取输入框的值
|
||||
let userMemberList = this.data.userMemberInfoVOList
|
||||
// 筛选出 salespersonName 包含 searchText 的项
|
||||
let filtered = userMemberList.filter(item =>
|
||||
item.nickName.includes(searchValue)
|
||||
);
|
||||
this.setData({
|
||||
tempUserMemberInfoVOList: filtered
|
||||
})
|
||||
},
|
||||
|
||||
// 复制邀请码到剪贴板
|
||||
copyInvitationCode() {
|
||||
wx.setClipboardData({
|
||||
|
@ -44,13 +44,13 @@
|
||||
class="image_4"
|
||||
src="./images/ss.png"
|
||||
/>
|
||||
<input class="font text_8 ml-4" placeholder="请输入关键字"/>
|
||||
<input class="font text_8 ml-4" placeholder="请输入关键字" bindinput="onInput" confirm-type="search" bindconfirm="onSearch" value="{{searchText}}"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-col list mt-13">
|
||||
<view
|
||||
class="flex-row items-center relative group_6"
|
||||
wx:for="{{userMemberInfoVOList}}"
|
||||
wx:for="{{tempUserMemberInfoVOList}}"
|
||||
wx:for-item="item"
|
||||
wx:for-index="index"
|
||||
wx:key="index"
|
||||
|
Reference in New Issue
Block a user