| | |
| | | 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({ |
| | | |
| | | /** |
| | |
| | | */ |
| | | data: { |
| | | active: 0, |
| | | tabList: [ |
| | | { |
| | | tabList: [{ |
| | | label: '全部', |
| | | value: 'all', |
| | | }, |
| | |
| | | value: 'Cancel', |
| | | } |
| | | ], |
| | | searchText: "", |
| | | list: [], |
| | | //分页 |
| | | page: 1, |
| | |
| | | isBackTop: false, |
| | | setScrollValue: 0, |
| | | skeletonLoding: true, |
| | | queryFilter: [] |
| | | queryFilter: [], |
| | | isPaySuccess: false, |
| | | isPayComplete: false, |
| | | }, |
| | | |
| | | /** |
| | |
| | | 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' |
| | |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | list: [], |
| | | skeletonLoding: false, |
| | | loading: false |
| | | }) |
| | |
| | | console.log(error) |
| | | } |
| | | }) |
| | | }, |
| | | onSearchOrder(e) { |
| | | this.setData({ |
| | | searchText: e.detail.value, |
| | | }) |
| | | this.getDataList(false); |
| | | }, |
| | | |
| | | |
| | |
| | | limit: 12, |
| | | pageTotalCount: 0, |
| | | bottomLoading: false, |
| | | isMoreData: false |
| | | isMoreData: false, |
| | | searchText: '' |
| | | }) |
| | | this._freshing = true; |
| | | this.setData({ |
| | |
| | | }, |
| | | |
| | | onCancel(e) { |
| | | let { orderNum } = e.currentTarget.dataset |
| | | 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('用户点击了取消') |
| | |
| | | }, |
| | | "complete": function (res) { |
| | | if (res.errMsg == 'requestPayment:ok') { |
| | | that.setData({ |
| | | isPayComplete: true |
| | | }) |
| | | that.getDataList(false) |
| | | } |
| | | if (that.data.isPaySuccess && that.data.isPayComplete) { |
| | | that.navToBack() |