|
|
@@ -0,0 +1,67 @@
|
|
|
+const _Http = getApp().globalData.http;
|
|
|
+
|
|
|
+Page({
|
|
|
+ data: {
|
|
|
+ condition: "",
|
|
|
+ defaultGroup: [],
|
|
|
+ myGroup: []
|
|
|
+ },
|
|
|
+ onLoad(options) {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ getList(init = false) {
|
|
|
+ _Http.basic({
|
|
|
+ "id": "20220831164303",
|
|
|
+ "content": {
|
|
|
+ nocache: true,
|
|
|
+ type: 99,
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+})
|