1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- const _Http = getApp().globalData.http;
- Component({
- options: {
- addGlobalClass: true
- },
- properties: {
- ownertable: {
- type: String
- },
- ownerid: {
- type: 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.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,
- list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
- })
- })
- },
- }
- })
|