12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- const _Http = getApp().globalData.http;
- Page({
- data: {
- content: {
- pageNumber: 1,
- pageTotal: 1,
- pageSize: 20,
- where: {
- condition: "",
- begindate: "",
- enddate: ""
- }
- }
- },
- onLoad(options) {
- this.getList()
- },
- tabsChange({
- detail
- }) {
- let where = this.data.content.where;
- if (detail.index == 0) {
- delete(where.isuncheckout);
- where.datetype = ""
- } else if (detail.index == 1) {
- where.isuncheckout = 1;
- where.datetype = ""
- } else {
- where.isuncheckout = 1;
- where.datetype = detail.name;
- }
- this.data.content.where = where;
- 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;
- this.setListHeight();
- _Http.basic({
- "id": 20230508111703,
- content
- }).then(res => {
- console.log("订单列表", res)
- if (res.msg != '成功') return wx.showToast({
- title: res.msg,
- icon: "none"
- })
- this.selectComponent('#ListBox').RefreshToComplete();
- content.pageNumber = res.pageNumber + 1
- content.pageTotal = res.pageTotal
- this.setData({
- list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
- content
- })
- })
- },
- /* 修改查看日期 */
- changeDate(e) {
- this.data.content.where[e.currentTarget.dataset.name] = e.detail.value;
- this.getList(true)
- },
- initialize() {
- this.data.content.where.enddate = "";
- this.data.content.where.begindate = "";
- this.getList(true)
- },
- /* 搜索 */
- onSearch({
- detail
- }) {
- this.data.content.where.condition = detail;
- this.getList(true)
- },
- /* 设置页面高度 */
- setListHeight() {
- this.selectComponent("#ListBox").setHeight(".top", this);
- }
- })
|