|
|
@@ -0,0 +1,65 @@
|
|
|
+const _Http = getApp().globalData.http;
|
|
|
+
|
|
|
+Page({
|
|
|
+ data: {
|
|
|
+ content: {
|
|
|
+ "ownertable": "sa_itemgroup",
|
|
|
+ "ownerid": 11,
|
|
|
+ pageSize: 20,
|
|
|
+ pageNumber: 1,
|
|
|
+ pageTotal: 1,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ list: [],
|
|
|
+ result: [],
|
|
|
+ },
|
|
|
+ onLoad(options) {
|
|
|
+ console.log(options)
|
|
|
+ if (options.ownertable) {
|
|
|
+ this.setData({
|
|
|
+ content: {
|
|
|
+ ...options
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ console.log(this.data.content)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onChange(e) {
|
|
|
+ const userid = e.currentTarget.dataset.item.userid + "";
|
|
|
+ if (!userid) return;
|
|
|
+ let result = this.data.result;
|
|
|
+ if (result.some(v => v == userid)) {
|
|
|
+ result = result.filter(v => v != userid)
|
|
|
+ } else {
|
|
|
+ result.push(userid)
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ result
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getList(init = false) {
|
|
|
+ let content = this.data.content;
|
|
|
+ if (init) {
|
|
|
+ content.pageTotal = 1
|
|
|
+ content.pageNumber = 1
|
|
|
+ }
|
|
|
+ if (content.pageNumber > content.pageTotal) return;
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221018122201,
|
|
|
+ content
|
|
|
+ }).then(res => {
|
|
|
+ console.log("数据团队列表", res)
|
|
|
+ this.setData({
|
|
|
+ list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
|
|
|
+ "content.pageTotal": res.pageTotal,
|
|
|
+ "content.pageNumber": res.pageNumber + 1,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+})
|