| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- const _Http = getApp().globalData.http;
- Page({
- data: {
- condition: "",
- defaultGroup: [],
- myGroup: []
- },
- onLoad(options) {
- this.getList()
- getApp().globalData.Language.getLanguagePackage(this, options.title || '选择群组');
- },
- getList(init = false) {
- _Http.basic({
- "id": "20240102153304",
- "content": {
- nocache: true,
- pageSize: 9999,
- where: {
- condition: this.data.condition
- }
- }
- }).then(res => {
- console.log("群组", res)
- if (res.code != '1') 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;
- }
- })
|