From b0868703a590286452765841fff4626448ca9df7 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Wed, 27 Nov 2024 15:07:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=88=E5=B9=B6=EF=BC=8C?= =?UTF-8?q?=E4=BB=A3=E5=AE=A2=E4=B8=8B=E5=8D=95=E5=A2=9E=E5=8A=A0=E6=8C=82?= =?UTF-8?q?=E8=B4=A6=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/Instead.js | 24 ++ src/assets/images/scan.png | Bin 0 -> 1988 bytes .../Instead/components/choose-guazhang.vue | 181 +++++++++ .../tool/Instead/components/keyboard.vue | 17 +- .../components/popup-choose-guazhang.vue | 355 ++++++++++++++++++ .../Instead/components/popup-tuan-quan.vue | 165 ++++++++ .../Instead/components/tuan-quan-table.vue | 61 +++ src/views/tool/Instead/index.vue | 91 ++++- 8 files changed, 883 insertions(+), 11 deletions(-) create mode 100644 src/assets/images/scan.png create mode 100644 src/views/tool/Instead/components/choose-guazhang.vue create mode 100644 src/views/tool/Instead/components/popup-choose-guazhang.vue create mode 100644 src/views/tool/Instead/components/popup-tuan-quan.vue create mode 100644 src/views/tool/Instead/components/tuan-quan-table.vue diff --git a/src/api/Instead.js b/src/api/Instead.js index af26134..8be0623 100644 --- a/src/api/Instead.js +++ b/src/api/Instead.js @@ -29,4 +29,28 @@ export function $updatePrice(data) { ...data } }); +} + +// 团购券-获取可使用团购券列表 + +export function $thirdPartyCoupon(data) { + return request({ + url: '/api/thirdPartyCoupon/list', + method: "get", + params:{ + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} +//核销团购券商品 +export function $checkCoupon(data) { + return request({ + url: '/api/place/checkCoupon', + method: "post", + data:{ + shopId: localStorage.getItem("shopId"), + ...data + } + }); } \ No newline at end of file diff --git a/src/assets/images/scan.png b/src/assets/images/scan.png new file mode 100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dN}Lv9(te;SKSjGYcED`)09=XK zRz0@(Ixpf4)W}LDpu6#d{#&dYTyR%St#kD^Yi+PA1$YsGHV5|hVS1LVMAG0uyjte% z;XwEW4Ym$mcz=8d(On<9;NI$f{G0_`P~fBfcxlJk5R9`1BG!9Q?4!hGEzmW|9_4Q6 z@P~u1v~rAlUG;kPbJ=-|aXWlEStbpLV{6Q@3sjX>?vXhkf@?G2o`J z67;?AZIWS%t92HU{dwYPce5aHR9-4q3n0k}@XvL$3yTzGN^pANmM73!sJtMj1v(}y zl6f%Ob$u?@4*LITl|#V^K;f_2Y4r67B}=Cv;+p6s#@0yB{%0*{es%V<$%kge4OuuC z`6Jwpi6YJYi+dC*bu8bQzw)UyT2AKVaF=ycBSKh9&42nwUgqc)^n4KELT#C#s%UGe z!zO&?4FoWfML~;!kl_-<mip{|obXCQj&O;gr5OjFyy z+t+g|zfNnr5Q5{Sm(vZ|;;9=m*a4V9FwgUNyU!&5;r#k#@n|qUI{jk=RnRCpo^?K~ zO=ZsSozr844GBBzDY1+nYizQRownx{ zECMTz9H>!_)7gA3FBH??ixihSdOm5^S%8CI(>y5qv%D3r3FWjB1r1%wX=~`7s|Dj|B0Qb$u7l};E(OPv=oNXUIEJ9(8NJ%+8)>?Ea&p5#sNotEKb(ZS* zazslPR1{!vYw~Eoj=C421w{|E_POPP?CSV}TS&6jtgN9P6kX1AJ%#}V=iIt}N0O6* mbd+;|OQZf;0p>pp3E;nMOVs1K^XG+c8Mr!mI@a40GXDZFSde}I literal 0 HcmV?d00001 diff --git a/src/views/tool/Instead/components/choose-guazhang.vue b/src/views/tool/Instead/components/choose-guazhang.vue new file mode 100644 index 0000000..21e6110 --- /dev/null +++ b/src/views/tool/Instead/components/choose-guazhang.vue @@ -0,0 +1,181 @@ + + + + + diff --git a/src/views/tool/Instead/components/keyboard.vue b/src/views/tool/Instead/components/keyboard.vue index 8436f1f..c316f80 100644 --- a/src/views/tool/Instead/components/keyboard.vue +++ b/src/views/tool/Instead/components/keyboard.vue @@ -6,6 +6,7 @@ {{ number }} +
@@ -79,13 +80,18 @@ export default { default: false, }, max: { - type: Number, + type: [Number,String], default: Infinity, }, value: { type: [String, Number], default: 0, }, + // 是否启用小数 + isFloat: { + type: Boolean, + default: false, + } }, data() { return { @@ -102,14 +108,21 @@ export default { }, methods: { clearFunction() { + if(this.isFloat){ + return this.keyboradAdd('.') + } this.$emit("clear", this.number); }, keyboradAdd(n) { + if(n=='.'&& `${this.number}`.includes('.')){ + return + } if (Number(this.number) == 0) { return (this.number = n); } const newval = this.number + n; - if (newval > this.max) { + console.log(newval) + if (newval*1 > this.max*1) { return this.$message( this.maxTips); } this.number = newval; diff --git a/src/views/tool/Instead/components/popup-choose-guazhang.vue b/src/views/tool/Instead/components/popup-choose-guazhang.vue new file mode 100644 index 0000000..99e6720 --- /dev/null +++ b/src/views/tool/Instead/components/popup-choose-guazhang.vue @@ -0,0 +1,355 @@ + + + + + \ No newline at end of file diff --git a/src/views/tool/Instead/components/popup-tuan-quan.vue b/src/views/tool/Instead/components/popup-tuan-quan.vue new file mode 100644 index 0000000..ae67f2a --- /dev/null +++ b/src/views/tool/Instead/components/popup-tuan-quan.vue @@ -0,0 +1,165 @@ + + + + \ No newline at end of file diff --git a/src/views/tool/Instead/components/tuan-quan-table.vue b/src/views/tool/Instead/components/tuan-quan-table.vue new file mode 100644 index 0000000..29e5757 --- /dev/null +++ b/src/views/tool/Instead/components/tuan-quan-table.vue @@ -0,0 +1,61 @@ + + diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index ac3de58..cbd4f73 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -500,7 +500,7 @@ @@ -639,10 +639,13 @@ > 退菜
-
单品改价
+
+ 单品改价 +
等叫
取消全部等叫
@@ -924,8 +927,35 @@
-
+ 团购代金券 +
+ 代金券名称 + +
+ + +
+ +
优惠券
+ @@ -1010,6 +1041,7 @@ :disabledPayType="disabledPayType" > + 挂账
立即支付 @@ -1411,6 +1443,14 @@ :vipUser="vipUser" @updateCart="updateCartItem" > + + + +
@@ -1429,6 +1469,10 @@ import returnCart from "./components/return-cart.vue"; import moneyKeyboard from "./components/money-keyboard.vue"; import caiAdd from "./components/popup-linshiCai.vue"; import cartChangePrice from "./components/popup-cart-changePrice.vue"; +import popTuanQuan from "./components/popup-tuan-quan.vue"; +import tuanQuanTable from "./components/tuan-quan-table.vue"; +import popupChooseGuazhang from "./components/popup-choose-guazhang.vue"; + import dayjs from "dayjs"; import { tbShopInfo } from "@/api/user"; import { hasPermission } from "@/utils/limits.js"; @@ -1463,6 +1507,7 @@ import { } from "@/api/table"; import { tbShopCategoryGet } from "@/api/shop"; +import { $checkCoupon } from "@/api/Instead"; import { isCanBuy, arrayContainsAll, @@ -1479,11 +1524,15 @@ import { returnProductCoupAllPrice } from "./quan_util.js"; //商品数量从0到n每一个对应的价格 let $goodsPayPriceMap = {}; import { $status } from "@/utils/table.js"; +import PopupChooseGuazhang from './components/popup-choose-guazhang.vue'; let $originTableList = []; export default { components: { + popupChooseGuazhang, cartChangePrice, + popTuanQuan, + tuanQuanTable, caiAdd, quansPop, returnCart, @@ -1496,6 +1545,7 @@ export default { moneyDiscount, cartItem, chooseDinersNumber, + PopupChooseGuazhang, }, data() { return { @@ -1512,6 +1562,8 @@ export default { value: 0, toMoney: 0, }, + //团购券 + tuanQuan: "", //选中可用优惠券 quansSelArr: [], //台桌搜索文字 @@ -2194,10 +2246,22 @@ export default { this.open(this.$route.query); }, methods: { + //挂账 + guazhangShow(){ + this.$refs.refGuaZhang.open(); + }, + //团购券扫码弹窗 + shouwTuanQuan() { + this.$refs.refPopTuanQuan.open(); + }, + tuanQuanConfirm(e) { + console.log(e); + this.tuanQuan = e; + }, //更新单品改价数据 - updateCartItem(res){ - if(res){ - this.order.list[this.order.selIndex]=res + updateCartItem(res) { + if (res) { + this.order.list[this.order.selIndex] = res; } }, // 单品改价 @@ -2923,6 +2987,15 @@ export default { return prve; }, []); try { + // 核销团购券商品 + if (this.tuanQuan && this.tuanQuan.goods.length > 0) { + await $checkCoupon({ + code: this.tuanQuan.couponCode, + num: this.tuanQuan.number, + orderId: this.createOrder.data.id, + cartId: this.tuanQuan.goods.map((v) => v.cartId), + }); + } const res = await $payOrder({ tableId: this.table.tableId, masterId: this.masterId,