From b4c3225054fabff960d6ae82c5c65b27c84317e8 Mon Sep 17 00:00:00 2001 From: zheng_hb <19584434@qq.com> Date: Mon, 30 Dec 2024 23:36:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/model/order.js | 2 +- components/cart/CardList.vue | 7 +- pages/index/cart.vue | 96 +++++---------- pages_order/invoiceIssuance.vue | 70 ++++++----- pages_order/orderEvaluation.vue | 253 +++++++++++++++++++++++++--------------- 5 files changed, 242 insertions(+), 186 deletions(-) diff --git a/api/model/order.js b/api/model/order.js index 9f896ab..c07fd82 100644 --- a/api/model/order.js +++ b/api/model/order.js @@ -23,7 +23,7 @@ const api = { method: 'GET', }, // 订单开具发票 - evaluate: { + invoice: { url: '/order_common/invoice', method: 'POST', }, diff --git a/components/cart/CardList.vue b/components/cart/CardList.vue index 69549af..4769395 100644 --- a/components/cart/CardList.vue +++ b/components/cart/CardList.vue @@ -21,10 +21,13 @@ + + + @@ -57,8 +60,8 @@ }, mounted() {}, methods: { - skip(val) { - this.$emit('btnClick', val) + skip(val, type) { + this.$emit('btnClick', val, type) }, toOrderDetails(val) { this.$emit('toOrderDetails', val) diff --git a/pages/index/cart.vue b/pages/index/cart.vue index 2579283..e7a51a9 100644 --- a/pages/index/cart.vue +++ b/pages/index/cart.vue @@ -13,6 +13,7 @@ + @@ -33,6 +34,7 @@ Navbar }, data() { + this.orderId = ''; return { status:"loading", params: { @@ -45,9 +47,9 @@ name: '全部' }, { - id: 0, - name: '未付款' - }, + id: 0, + name: '未付款' + }, { id: 1, name: '待参加' @@ -62,64 +64,6 @@ }, ], lineBg: require('@/static/image/cart/tabIcon.png'), - // cardListData: [{ - // imgUrl: 'https://up.zhuoku.org/22/a4/60/50/fc3bd0b4e656911fccdde4383637c1cd.jpg', - // orderTime: '2024.08.23 12:00', - // state: 'U', - // stateText: '待参加', - // title: '夏日去撒野旅游计划~', - // time: '2024.10.28 10:00', - // address: '成都市东丽湖露营地32号', - // totalPrice: '298.00', - // btnObj: [{ - // id: '0', - // btnTitle: '取消活动', - // color: '#AFAFAF', - // bgColor: '#34312E' - // }, - // { - // id: '1', - // btnTitle: '活动签到', - // color: '#FF4546', - // bgColor: '#492623' - // } - // ] - // }, - // { - // imgUrl: 'https://up.zhuoku.org/22/a4/60/50/fc3bd0b4e656911fccdde4383637c1cd.jpg', - // orderTime: '2024.08.23 12:00', - // state: 'S', - // stateText: '已完成', - // title: '夏日去撒野旅游计划~', - // time: '2024.10.28 10:00', - // address: '成都市东丽湖露营地32号', - // totalPrice: '298.00', - // btnObj: [{ - // id: '2', - // btnTitle: '活动评价', - // color: '#FF4546', - // bgColor: '#492623' - // }, - // { - // id: '3', - // btnTitle: '开具发票', - // color: '#FFB245', - // bgColor: '#49361D' - // } - // ] - // }, - // { - // imgUrl: 'https://up.zhuoku.org/22/a4/60/50/fc3bd0b4e656911fccdde4383637c1cd.jpg', - // orderTime: '2024.08.23 12:00', - // state: 'F', - // stateText: '已完成', - // title: '夏日去撒野旅游计划~', - // time: '2024.10.28 10:00', - // address: '成都市东丽湖露营地32号', - // totalPrice: '298.00', - // btnObj: [] - // } - // ] totalPage: 0, cardListData: [] } @@ -164,17 +108,41 @@ }) }, btnClick(item,type) {//0取消活动 1活动签到 2评价活动 3开具发票 + this.orderId = item.id; + if (type == 0) { + this.$refs.modal.open(); + } + if (type == 1) { + this.$api('signIn', {orderId: item.id}, res=> { + if (res.code == 200) { + this.cardListData = [] + this.getOrderPageList() + this.$refs.toast.show({ + type: 'success', + message: res.result + }) + } + }) + } if (type == 2) { uni.navigateTo({ - url: '/pages_order/orderEvaluation' + url: `/pages_order/orderEvaluation?activityId=${this.orderId}` }) } if (type == 3) { uni.navigateTo({ - url: '/pages_order/invoiceIssuance' + url: `/pages_order/invoiceIssuance?orderId=${this.orderId}` }) } - } + }, + confirm() { + this.$api('cancelOrder', {orderId: this.orderId}, res => { + if (res.code == 200) { + this.cardListData = []; + this.getOrderPageList(); + } + }) + } } } diff --git a/pages_order/invoiceIssuance.vue b/pages_order/invoiceIssuance.vue index a00b77b..460d1dc 100644 --- a/pages_order/invoiceIssuance.vue +++ b/pages_order/invoiceIssuance.vue @@ -1,7 +1,7 @@ @@ -61,25 +60,42 @@ }, data() { return { - radioValue: '香蕉', - enterpriseName: '', - aa: { - color: '#f40' + orderId: '', + radioValue: '0', + invoicingInfo: { + name: '', + no: '', + emil: '' } } }, + onLoad({orderId}) { + this.orderId = orderId + }, methods: { toInvoiceRecords() { - uni.navigateTo({ - url: '/pages_order/invoiceRecords' + let params = {} + params = this.invoicingInfo; + params.orderId = this.orderId + console.log(params); + this.$api('invoice', params, res=> { + if (res.code == 200) { + this.$refs.toast.show({ + type: 'success', + message: res.result + }) + uni.navigateTo({ + url: '/pages_order/invoiceRecords' + }) + } }) + } } } \ No newline at end of file