const _Http = getApp().globalData.http;
Component({
    properties: {
        disabled: {
            type: Boolean
        },
        path: {
            type: String
        },
        enterprisename: {
            type: String
        },
        sa_customersid: {
            type: String
        }
    },
    data: {
        list: [],
        sat_orderclueid: "",
        content: {
            "nacache": true,
            "pageNumber": 1,
            "pageSize": 20,
            "pageTotal": 1,
            "total": null,
            "where": {
                "condition": "",
            }
        },
    },
    lifetimes: {
        attached: function () {
            getApp().globalData.Language.getLanguagePackage(this)
        }
    },
    methods: {
        getList(id, init) {
            let content = this.data.content;
            content.sat_orderclueid = id;
            if (init) content.pageNumber = 1;
            _Http.basic({
                "id": "2025042110014402",
                content
            }).then(res => {
                console.log("联系人", res)
                if (res.code != '1') return wx.showToast({
                    title: res.data,
                    icon: "none"
                })
                this.setData({
                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
                    "content.pageNumber": res.pageNumber + 1,
                    "content.pageSize": res.pageSize,
                    "content.pageTotal": res.pageTotal,
                    "content.total": res.total,
                    sat_orderclueid: id
                })
            })
        },
        /* 修改总数 */
        changeTotal() {
            this.setData({
                "content.total": this.data.content.total - 1
            })
        }
    }
})