|
|
@@ -2,41 +2,62 @@ const _Http = getApp().globalData.http;
|
|
|
|
|
|
Page({
|
|
|
data: {
|
|
|
- sys_enterpriseid: "",
|
|
|
- parems: {
|
|
|
- id: '20221102110003',
|
|
|
- content: {
|
|
|
- nocache: true,
|
|
|
- pageNumber: 1,
|
|
|
- pageSize: 20,
|
|
|
- pageTotal: 1,
|
|
|
- total: 0,
|
|
|
- where: {
|
|
|
- "condition": "",
|
|
|
- }
|
|
|
+ active: 0,
|
|
|
+ content: {
|
|
|
+ sys_enterpriseid: "",
|
|
|
+ nocache: true,
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ pageTotal: 1,
|
|
|
+ total: 0,
|
|
|
+ where: {
|
|
|
+ "condition": "",
|
|
|
}
|
|
|
},
|
|
|
list: [],
|
|
|
- radio: "",
|
|
|
- acitonItem: {},
|
|
|
+ },
|
|
|
+ getList(init = false) {
|
|
|
+ const content = this.data.content;
|
|
|
+ if (init) content.pageNumber = 1;
|
|
|
+ if (content.pageNumber > content.pageTotal) return;
|
|
|
+
|
|
|
+ _Http.basic({
|
|
|
+ id: this.data.active == 0 ? 20221219161202 : 20221219193002,
|
|
|
+ content
|
|
|
+ }).then(res => {
|
|
|
+ console.log("通讯录列表", res)
|
|
|
+
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+
|
|
|
+ content.pageNumber = res.pageNumber + 1;
|
|
|
+ content.pageTotal = res.pageTotal;
|
|
|
+ content.total = res.total;
|
|
|
+
|
|
|
+ this.setData({
|
|
|
+ list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
|
|
|
+ content
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onChange(e) {
|
|
|
+ this.setData({
|
|
|
+ active: e.detail.index
|
|
|
+ });
|
|
|
+ this.getList(true);
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
if (options.sys_enterpriseid) this.setData({
|
|
|
- sys_enterpriseid: options.sys_enterpriseid
|
|
|
+ 'content.sys_enterpriseid': options.sys_enterpriseid
|
|
|
});
|
|
|
this.getList();
|
|
|
},
|
|
|
/* 默认添加 */
|
|
|
created() {
|
|
|
wx.redirectTo({
|
|
|
- url: '/packageA/setclient/modules/contacts/add/index?sys_enterpriseid=' + this.data.sys_enterpriseid,
|
|
|
- })
|
|
|
- },
|
|
|
- /* 快速添加 */
|
|
|
- quickly() {
|
|
|
- console.log(this.data.acitonItem)
|
|
|
- wx.redirectTo({
|
|
|
- url: `/packageA/setclient/modules/contacts/add/index?sys_enterpriseid=${this.data.sys_enterpriseid}&data=${JSON.stringify(this.data.acitonItem)}`,
|
|
|
+ url: '/packageA/setclient/modules/contacts/add/index?sys_enterpriseid=' + this.data.content.sys_enterpriseid,
|
|
|
})
|
|
|
},
|
|
|
onClick(e) {
|
|
|
@@ -44,9 +65,8 @@ Page({
|
|
|
item
|
|
|
} = e.currentTarget.dataset;
|
|
|
delete(item.tag1)
|
|
|
- this.setData({
|
|
|
- radio: item.sys_phonebookid,
|
|
|
- acitonItem: item
|
|
|
+ wx.redirectTo({
|
|
|
+ url: `/packageA/setclient/modules/contacts/add/index?sys_enterpriseid=${this.data.content.sys_enterpriseid}&data=${JSON.stringify(item)}`,
|
|
|
})
|
|
|
},
|
|
|
onSearch({
|
|
|
@@ -63,25 +83,6 @@ Page({
|
|
|
});
|
|
|
this.getList(true);
|
|
|
},
|
|
|
- getList(init = false) {
|
|
|
- const parems = this.data.parems;
|
|
|
- if (init) parems.content.pageNumber = 1;
|
|
|
- if (parems.content.pageNumber > parems.content.pageTotal) return;
|
|
|
- _Http.basic(parems).then(res => {
|
|
|
- console.log("通讯录列表", res)
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- parems.content.pageNumber = res.pageNumber + 1;
|
|
|
- parems.content.pageTotal = res.pageTotal;
|
|
|
- parems.content.total = res.total;
|
|
|
- this.setData({
|
|
|
- list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
|
|
|
- parems
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
onReachBottom() {
|
|
|
this.getList();
|
|
|
},
|