| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- const _Http = getApp().globalData.http;
- Component({
- properties: {},
- data: {
- content: {
- nocache: true,
- pageNumber: 1,
- pageSize: 20,
- pageTotal: 1,
- total: null,
- },
- total: 0,
- list: []
- },
- lifetimes: {
- attached: function () {
- getApp().globalData.Language.getLanguagePackage(this)
- }
- },
- methods: {
- getList(id, init = false) {
- if (id == 0) return;
- let content = this.data.content;
- content.sys_phonebookid = id;
- if (init) content.pageNumber = 1
- _Http.basic({
- id: "20231215134204",
- content
- }).then(res => {
- console.log("关联客户", res)
- if (res.code != '1') return wx.showToast({
- title: res.data,
- icon: "none"
- });
- this.setData({
- "content.pageNumber": res.pageNumber + 1,
- "content.pageTotal": res.pageTotal,
- "content.total": res.total,
- total: res.total,
- list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
- })
- })
- }
- }
- })
|