| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- const _Http = getApp().globalData.http;
- Page({
- data: {
- condition: "",
- defaultGroup: [],
- myGroup: []
- },
- onLoad(options) {
- this.getList()
- },
- getList(init = false) {
- _Http.basic({
- "id": "20240102153304",
- "content": {
- nocache: true,
- pageSize: 9999,
- where: {
- condition: this.data.condition
- }
- }
- }).then(res => {
- console.log("群组", res)
- if (res.msg != '成功') return wx.showToast({
- title: res.msg,
- icon: "none"
- });
- this.setData({
- defaultGroup: [res.data.find(v => v.groupname == '默认群组')],
- myGroup: res.data.filter(v => v.sys_phonebookgroupid)
- })
- })
- },
- onSelected(e) {
- let {
- item
- } = e.currentTarget.dataset;
- console.log(item)
- getApp().globalData.handleSelect && getApp().globalData.handleSelect({
- id: [item.sys_phonebookgroupid],
- item,
- value: [item.groupname, [item.sys_phonebookgroupid]]
- })
- },
- /* 开始搜索 */
- startSearch({
- detail
- }) {
- let condition = this.data.condition;
- if (detail == condition) return;
- this.setData({
- condition: detail,
- });
- this.getList(true);
- },
- /* 取消搜索 */
- onClear() {
- this.setData({
- condition: "",
- });
- this.getList(true);
- },
- onUnload() {
- getApp().globalData.handleSelect = null;
- }
- })
|