| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- const _Http = getApp().globalData.http;
- Page({
- data: {
- "content": {
- nocache: true,
- "pageNumber": 1,
- "pageTotal": 1,
- "pageSize": 20,
- "where": {
- "condition": "",
- },
- },
- },
- onLoad() {
- 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": 20230105110003,
- content
- }).then(res => {
- console.log("选择序列号", res)
- this.selectComponent('#ListBox').RefreshToComplete();
- this.selectComponent("#ListBox").setHeight(".tab", this);
- this.setData({
- list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
- "content.pageNumber": res.pageNumber + 1,
- "content.pageTotal": res.pageTotal,
- "content.sort": res.sort,
- "content.total": res.total,
- })
- })
- },
- onClick(e) {
- const {
- item
- } = e.currentTarget.dataset;
- let page = getCurrentPages()[getCurrentPages().length - 2]
- if (page.__route__ = "packageA/repair/insert") {
- page.changeForm(item)
- } else {
- _Http.skuItem = item;
- wx.redirectTo({
- url: '/packageA/repair/insert',
- })
- }
- },
- onSearch({
- detail
- }) {
- if (this.data.content.where.condition == detail) return;
- this.setData({
- "content.where.condition": detail
- })
- this.getList(true)
- },
- onClear() {
- if (this.data.content.where.condition == "") return;
- this.setData({
- "content.where.condition": ""
- })
- this.getList(true)
- },
- })
|