const _Http = getApp().globalData.http;
Component({
    options: {
        addGlobalClass: true
    },
    properties: {
        ownertable: String,
        ownerid: String,
    },
    data: {
        content: {
            nocache: true,
            pageNumber: 1,
            pageSize: 10,
            pageTotal: 1,
            total: null
        },
        list: []
    },
    methods: {
        getList(id, init = false) {
            let content = {
                ...this.data.content,
                "ownertable": this.data.ownertable,
                "ownerid": this.data.ownerid,
            };
            if (init) {
                content.pageNumber = 1
                content.pageTotal = 1
            }
            _Http.basic({
                "id": 20221114125401,
                content
            }).then(res => {
                console.log("操作记录", res)
                if (res.msg != '成功') return wx.showToast({
                    title: res.data,
                    icon: "none"
                });
                this.setData({
                    "content.pageNumber": res.pageNumber + 1,
                    "content.pageTotal": res.pageTotal,
                    "content.total": res.total,
                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
                })
            })
        },
    }
})