From 23ee3cfd2ed4070c8f19793bf774f71b37b2dfaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com> Date: Sat, 8 Jun 2024 22:08:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8C=85=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bl/massage/massagePackage.vue | 148 ++++++++++++++++++++++++ src/views/bl/order/packageOrder.vue | 2 + 2 files changed, 150 insertions(+) diff --git a/src/views/bl/massage/massagePackage.vue b/src/views/bl/massage/massagePackage.vue index 23ee765..c04855f 100644 --- a/src/views/bl/massage/massagePackage.vue +++ b/src/views/bl/massage/massagePackage.vue @@ -201,6 +201,13 @@ @click="handleDelete(scope.row)" >删除 + 购买 + @@ -985,6 +992,83 @@ + + +
+ 订单号: + +
+
+ 用户: + +
+
+ 优惠价: + {{ packagePrice }} +
+
+ 购买数量: + +
+
+ 支付金额: + +
+
+ 支付方式: + + + + + + + + +
+
+ 代金卷ID: + +
+ + +
+ @@ -1080,6 +1164,15 @@ export default { massageLimit: 10, massageImgPercentage:0,//封面图片上传进度 //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<服务项目<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + packageId:"",//服务包ID + ordersNo:"",//订单号 + userId:"",//用户ID + quantity:0,//数量 + payMoney:0,//支付金额 + payWay:"",//支付方式 + couponId:"",//代金券ID + dialogFormVisibleBuy: false, }; }, methods: { @@ -2091,6 +2184,61 @@ export default { this.province= ""; //省 }, //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<服务项目<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + showBuyView(row){ + this.packageId = row.id; + this.userId = ""; + this.quantity = 0; + this.couponId = ""; + this.packagePrice = row.price;//单价 + this.payMoney = 0;//支付金额 + this.payWay = "1";//支付方式 + this.dialogFormVisibleBuy = true; + }, + + handleBuy(){ + if(this.quantity <= 0){ + this.$message({ + message: "购买失败,购买数量必须大于0!", + type: "warning", + duration: 1500 + }); + return; + } + this.$http({ + url: this.$http.adornUrl("app/user/package/order/buy"), + method: "post", + params: this.$http.adornParams({ + ordersNo: this.ordersNo, + packageId: this.packageId, + userId: this.userId, + quantity: this.quantity, + payMoney: this.payMoney, + couponId: this.couponId, + payWay: this.payWay, + }), + }).then(({data}) => { + if (data.code == 0) { + this.$message({ + message: "购买成功", + type: "success", + duration: 1500, + onClose: () => { + }, + }); + this.dialogFormVisibleBuy = false; + } else { + this.$message({ + message: data.msg, + type: "warning", + duration: 1500, + onClose: () => { + }, + }); + } + }); + }, + }, mounted() { this.handleSelect(); diff --git a/src/views/bl/order/packageOrder.vue b/src/views/bl/order/packageOrder.vue index 2f6718d..8bd6f9f 100644 --- a/src/views/bl/order/packageOrder.vue +++ b/src/views/bl/order/packageOrder.vue @@ -38,6 +38,7 @@ clearable v-model="status" style="width: 150px; margin-left: 10px"> +    @@ -93,6 +94,7 @@