From 74139f2bc6bdc8147dd570ac1d774245f67e4f9f Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期一, 01 四月 2024 14:05:45 +0800 Subject: [PATCH] 样式修改 --- packagePersonal/pages/myOrder/index.js | 68 ++++++++++++++++++++++++--------- 1 files changed, 49 insertions(+), 19 deletions(-) diff --git a/packagePersonal/pages/myOrder/index.js b/packagePersonal/pages/myOrder/index.js index 8b502b1..f89f220 100644 --- a/packagePersonal/pages/myOrder/index.js +++ b/packagePersonal/pages/myOrder/index.js @@ -1,7 +1,9 @@ const app = getApp(); import moment from 'moment' import tool2 from "../../../assets/js/toolClass.js" -import { getPublicImage } from "../../../assets/js/middleGround/tool.js"; +import { + getPublicImage +} from "../../../assets/js/middleGround/tool.js"; Page({ /** @@ -9,8 +11,7 @@ */ data: { active: 0, - tabList: [ - { + tabList: [{ label: '鍏ㄩ儴', value: 'all', }, @@ -27,6 +28,7 @@ value: 'Cancel', } ], + searchText: "", list: [], //鍒嗛〉 page: 1, @@ -38,7 +40,9 @@ isBackTop: false, setScrollValue: 0, skeletonLoding: true, - queryFilter: [] + queryFilter: [], + isPaySuccess: false, + isPayComplete: false, }, /** @@ -56,26 +60,39 @@ }, tabBookClick(item) { - console.log(item, 1) let that = this; let info = this.data.tabList[item.detail.value] that.setData({ skeletonLoding: true, active: item.detail.value, - queryFilter: info.value == 'all' ? [] : [{ field: 'State', value: info.value }], + queryFilter: info.value == 'all' ? [] : [{ + field: 'State', + value: info.value + }], list: [], page: 1, bottomLoading: false, isMoreData: false, + searchText: "" }) that.getDataList(false); }, getDataList(isReachBottom) { + var searchArr = []; + console.log(this.data.searchText, "earch") + if (this.data.searchText != undefined && this.data.searchText != "") { + searchArr.push({ + compareType: "Contains", + field: "orderNumber", + keywords: this.data.searchText, + }) + } const data = { start: this.data.page * this.data.limit - this.data.limit, size: this.data.limit, filterList: this.data.queryFilter, + searchList: searchArr, sort: { type: 'Desc', field: 'CreateDate' @@ -140,6 +157,7 @@ }) } else { this.setData({ + list: [], skeletonLoding: false, loading: false }) @@ -148,6 +166,12 @@ console.log(error) } }) + }, + onSearchOrder(e) { + this.setData({ + searchText: e.detail.value, + }) + this.getDataList(false); }, @@ -162,7 +186,8 @@ limit: 12, pageTotalCount: 0, bottomLoading: false, - isMoreData: false + isMoreData: false, + searchText: '' }) this._freshing = true; this.setData({ @@ -199,20 +224,27 @@ }, onCancel(e) { - let { orderNum } = e.currentTarget.dataset - console.log(orderNum, 12) + let that = this; + let { + orderNum + } = e.currentTarget.dataset wx.showModal({ title: '鎻愮ず', //鎻愮ず鐨勬爣棰� content: '纭畾瑕佸彇娑堣鍗曪紵', //鎻愮ず鐨勫唴瀹� success: function (res) { if (res.confirm) { - app.MG.store.cancelOrder({ orderNum: orderNum }).then(() => { - wx.showToast({ - title: "璁㈠崟宸插彇娑�", - icon: 'success', - duration: 1000 - }) - this.getDataList(false) + app.MG.store.cancelOrder({ + orderNum: orderNum + }).then((res) => { + if (res) { + wx.showToast({ + title: "璁㈠崟宸插彇娑�", + icon: 'success', + duration: 1000 + }) + that.getDataList(false) + } + }) } else if (res.cancel) { console.log('鐢ㄦ埛鐐瑰嚮浜嗗彇娑�') @@ -260,9 +292,7 @@ }, "complete": function (res) { if (res.errMsg == 'requestPayment:ok') { - that.setData({ - isPayComplete: true - }) + that.getDataList(false) } if (that.data.isPaySuccess && that.data.isPayComplete) { that.navToBack() -- Gitblit v1.9.1