diff --git a/config/order.js b/config/order.js index 8452598..7797dfc 100644 --- a/config/order.js +++ b/config/order.js @@ -5,9 +5,6 @@ export const payConfig = params => http.get('/pay/config', { params }) //查询订单明细 export const orderInfo = params => http.post('/sale/api/retail-order/query-order', params) -//订单状态 -export const orderStatus = params => - http.get('/system/pub/enums/order-status-api', { params }) //计算邮费 export const pickPostAge = params => diff --git a/pages/index/index.vue b/pages/index/index.vue index d1ddac9..7988c4f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -178,6 +178,11 @@ export default { ...mapGetters(['priceSymbol', 'priceSymbolVisible', 'isZeroLevel']), }, onLoad() { + // this.getLanguage(); + // this.getService() + }, + onShow() { + this.$store.dispatch('getCarLength') if ( uni.getStorageSync('showInfo') == undefined || uni.getStorageSync('showInfo') == 0 @@ -188,11 +193,6 @@ export default { ? REPURCHASE_AREA.id : REGIEST_AREA.id ) - // this.getLanguage(); - // this.getService() - }, - onShow() { - this.$store.dispatch('getCarLength') }, // onPullDownRefresh() { // let that = this diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 9e970ff..f769427 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -55,19 +55,6 @@ - - @@ -160,22 +147,29 @@ - - - - {{ '待付款' }} - {{ waitPayNum }} - - + + {{ '待发货' }} {{ payNum }} - + {{ '待收货' }} - + {{ '已收货' }} diff --git a/pages/mine/order/index.vue b/pages/mine/order/index.vue index 3e59d51..71eb381 100644 --- a/pages/mine/order/index.vue +++ b/pages/mine/order/index.vue @@ -322,6 +322,7 @@ import * as reg from '@/config/regiest' import * as api from '@/config/order.js' import { formatMsToDate } from '@/util/index' +import { ORDER_STATUS } from '@/util/common' export default { components: { backIcon, @@ -336,7 +337,7 @@ export default { isRemark: false, cancelCode: '', details: '', - orderStatusList: [], + orderStatusList: ORDER_STATUS, dataShow: false, dataShow1: false, detailsShow: false, @@ -370,7 +371,6 @@ export default { this.isTab = '' this.select.orderStatus = this.isTab } - this.getOrderStatus() // this.getDataList() this.getOrderType() }, @@ -391,13 +391,21 @@ export default { this.select.orderType = item.value }, getOrderType() { - api.orderType().then(res => { - res.data.unshift({ - label: '全部', - value: '', - }) - this.orderTypes = res.data + uni.showLoading({ + title: '加载中', }) + api + .orderType() + .then(res => { + res.data.unshift({ + label: '全部', + value: '', + }) + this.orderTypes = res.data + }) + .finally(() => { + uni.hideLoading() + }) }, rightOpen() { this.rightShow = true @@ -424,22 +432,30 @@ export default { specialArea: item.orderType, orderItemsParams: orderItemsParams, } - api.payCheck(item.orderCode).then(res => { - if (res.code == 200) { - uni.navigateTo({ - url: - '/pages/pay/index?paramsPost=' + - JSON.stringify(item) + - '&businessType=1', - }) - } else { - uni.showToast({ - title: res.msg, - icon: 'success', - mask: true, - }) - } + uni.showLoading({ + title: '加载中', }) + api + .payCheck(item.orderCode) + .then(res => { + if (res.code == 200) { + uni.navigateTo({ + url: + '/pages/pay/index?paramsPost=' + + JSON.stringify(item) + + '&businessType=1', + }) + } else { + uni.showToast({ + title: res.msg, + icon: 'success', + mask: true, + }) + } + }) + .finally(() => { + uni.hideLoading() + }) // uni.navigateTo({ // url: // '/pages/pay/index?paramsPost=' + @@ -448,30 +464,49 @@ export default { // }) }, toCancel() { - api.cancelOrder(this.cancelCode).then(res => { - if (res.code == 200) { - uni.showToast({ - title: '订单已取消', - icon: 'none', - duration: 1500, - }) - this.queryParams.pageNum = 1 - this.orderLists = [] - this.getDataList() - } - this.cancleOrder = false + uni.showLoading({ + title: '操作中', }) + api + .cancelOrder(this.cancelCode) + .then(res => { + if (res.code == 200) { + uni.showToast({ + title: '订单已取消', + icon: 'none', + duration: 1500, + }) + this.queryParams.pageNum = 1 + this.orderLists = [] + this.getDataList() + } + this.cancleOrder = false + }) + .catch(() => { + this.cancleOrder = false + }) + .finally(() => { + uni.hideLoading() + }) }, cancelPay(val) { this.cancelCode = val.orderCode this.cancleOrder = true }, getDetails(item) { - api.orderDetails(item.orderCode).then(res => { - this.details = res.data - this.detailsShow = true - console.log(this.details, '....this.details') + uni.showLoading({ + title: '加载中', }) + api + .orderDetails(item.orderCode) + .then(res => { + this.details = res.data + this.detailsShow = true + console.log(this.details, '....this.details') + }) + .finally(() => { + uni.hideLoading() + }) }, getDate(e) { this.select.creationTimeStart = formatMsToDate(e.value) @@ -487,27 +522,25 @@ export default { openDate1() { this.dataShow1 = true }, - getOrderStatus() { - api.orderStatus().then(res => { - res.data.unshift({ - label: '全部', - value: '', - }) - this.orderStatusList = res.data - }) - }, + getDataList(index) { if (index) { this.queryParams.pageNum = 1 this.orderLists = [] } this.rightShow = false + uni.showLoading({ + title: '加载中', + }) api .orderList(Object.assign({}, this.queryParams, this.select)) .then(res => { this.orderLists = this.orderLists.concat(res.rows) this.total = res.total }) + .finally(() => { + uni.hideLoading() + }) }, }, } diff --git a/pages/selfService/cancleOrder/index.vue b/pages/selfService/cancleOrder/index.vue index 0c62341..b2a41f2 100644 --- a/pages/selfService/cancleOrder/index.vue +++ b/pages/selfService/cancleOrder/index.vue @@ -146,7 +146,7 @@