From 3282e95db0207ee133d1e98d9771dec9d83b0fc4 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 02 四月 2026 16:24:38 +0800
Subject: [PATCH] 2026.4.2 新增专题管理功能
---
pages/usercenter/notice/publish/components/user-list/index.js | 37 +++++++++++++++++++++++++++++++++++--
1 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/pages/usercenter/notice/publish/components/user-list/index.js b/pages/usercenter/notice/publish/components/user-list/index.js
index 6376a50..c0243c2 100644
--- a/pages/usercenter/notice/publish/components/user-list/index.js
+++ b/pages/usercenter/notice/publish/components/user-list/index.js
@@ -3,6 +3,7 @@
import { useTownPicker } from '../../../../../../behaviors/picker/town/town';
import { useLoading } from '../../../../../../behaviors/loading';
import { fetchSearchUser } from '../../../../../../services/usercenter/fetchUser';
+import { choseTownList, toLabel } from '../../../../../../common/dataTowns';
Component({
behaviors: [useScenePicker, useDistrictPicker, useTownPicker, useLoading],
@@ -31,6 +32,7 @@
searchOption: {},
list: [],
selectedList: [],
+ checkAll: false,
},
lifetimes: {
@@ -71,6 +73,10 @@
// 涓嬫媺妗嗛�夋嫨浜嬩欢
_confirm(key) {
+ // 鐩戝惉鍖哄幙鐨勪笅鎷夋閫夋嫨鏃堕棿锛屽姩鎬佽缃闀囩殑鎵�灞炲尯鍘�
+ if (key == 'district') {
+ this.setSelectOptions('town', choseTownList(this.data.districtValue));
+ }
this._startLoad();
},
@@ -92,13 +98,40 @@
selectedList,
[`list[${index}]`]: user,
});
- console.log(selectedList);
+ // console.log(selectedList);
+ },
+
+ onCheckAll() {
+ const { selectedList, list } = this.data;
+ // 宸插叏閫夛紝鍒欏叏閮ㄥ彇娑�
+ if (selectedList.length >= list) {
+ list.forEach(u => {
+ u.checked = false;
+ });
+ this.setData({
+ selectedList: [],
+ list,
+ checkAll: false,
+ });
+ }
+ // 鏈叏閫夛紝鍒欏叏閮ㄩ�変腑
+ else {
+ list.forEach(u => {
+ u.checked = true;
+ });
+ this.setData({
+ selectedList: list,
+ list,
+ checkAll: true,
+ });
+ }
},
_fetchData(page) {
- const { sceneValue, districtValue, townValue, searchValue } = this.data;
+ const { sceneValue, districtValue, districtText, townValue, searchValue } = this.data;
const data = {
sceneTypes: sceneValue,
+ districtName: districtText,
districtCode: districtValue[0],
townCode: townValue[0],
searchText: searchValue,
--
Gitblit v1.9.3