123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- const _Http = getApp().globalData.http;
- Page({
- data: {
- "content": {
- nocache: true,
- sys_enterpriseid: "",
- pageNumber: 1,
- pageTotal: 1,
- "where": {
- "condition": "",
- "workaddress": 1
- }
- }
- },
- onLoad(options) {
- this.setData({
- "content.sys_enterpriseid": options.id
- })
- this.getList(true);
- },
- /* 获取产品 */
- getList(init = false) {
- if (init.detail != undefined) init = init.detail;
- let content = this.data.content;
- if (init) content.pageNumber = 1;
- if (content.pageNumber > content.pageTotal) return;
- _Http.basic({
- "id": "20221009155803",
- content
- }).then(res => {
- console.log("我的地址列表", res)
- this.selectComponent('#ListBox').RefreshToComplete();
- if (res.msg != '成功') return wx.showToast({
- title: res.msg,
- icon: "none",
- mask: true
- });
- content.pageNumber = res.pageNumber + 1;
- content.pageTotal = res.pageTotal;
- this.setData({
- list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
- })
- })
- },
- /* 开始搜索 */
- onSearch({
- detail
- }) {
- if (detail == this.data.content.where.condition) return;
- this.data.content.where.condition = detail;
- this.getList(true);
- },
- onClear(e) {
- this.data.content.where.condition = "";
- this.getList(true);
- },
- onReady() {
- this.selectComponent("#ListBox").setHeight(".top", this);
- }
- })
|