From 3e84edbb6c93d790385046cb2ae81efaa7a28779 Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Tue, 25 Mar 2025 00:31:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B7=BB=E5=8A=A0=E4=BC=98?= =?UTF-8?q?=E6=83=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 16 +- .env.production | 4 +- .env.test | 10 +- src/api/system.js | 12 + src/components/lodop/receiptPrint.js | 2 +- src/components/payCard/couponModal.vue | 32 +- src/components/payCard/payCard.vue | 425 ++++++++++++-------- src/components/payCard/scanModal.vue | 1 - src/components/selectVipUser.vue | 4 +- src/components/skuModal.vue | 39 +- src/components/updateDialog.vue | 24 +- src/store/goods.js | 8 +- src/store/socket.js | 6 +- src/store/user.js | 9 +- src/utils/index.js | 1 + src/views/home/components/settleAccount.vue | 3 +- src/views/home/components/settleItem.vue | 21 +- src/views/home/index.vue | 6 +- src/views/login.vue | 17 +- 19 files changed, 402 insertions(+), 238 deletions(-) create mode 100644 src/api/system.js diff --git a/.env.development b/.env.development index e0bc07c..c1e20e4 100644 --- a/.env.development +++ b/.env.development @@ -1,14 +1,11 @@ # 本地环境 ENV = development +# 测试ws +# VITE_API_WSS = 'wss://sockets.sxczgkj.com/wss' + # 正式ws -# VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client' - -#测试ws -VITE_API_WSS = 'wss://sockets.sxczgkj.com/wss' - -# 阿伟本地ws -# VITE_API_WSS = 'ws://192.168.2.17:9998/client' +VITE_API_WSS = 'wss://czgeatws.sxczgkj.com/wss' # 正式 php VITE_API_PHP_URL = 'https://newblockwlx.sxczgkj.cn/index.php/api' @@ -38,5 +35,8 @@ VITE_API_KP_URL = 'https://invoice.sxczgkj.cn/api' # VITE_API_URL = 'http://192.168.1.35/' # 测试 -VITE_API_URL = 'https://tapi.cashier.sxczgkj.cn' +# VITE_API_URL = 'https://tapi.cashier.sxczgkj.cn' + +# 正式 +VITE_API_URL = 'https://cashier.sxczgkj.com' diff --git a/.env.production b/.env.production index ec77084..68d0f27 100644 --- a/.env.production +++ b/.env.production @@ -2,7 +2,7 @@ ENV = production # 正式ws -VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client' +VITE_API_WSS = 'wss://czgeatws.sxczgkj.com/wss' # 正式 php VITE_API_PHP_URL = 'https://newblockwlx.sxczgkj.cn/index.php/api' @@ -11,7 +11,7 @@ VITE_API_PHP_URL = 'https://newblockwlx.sxczgkj.cn/index.php/api' VITE_API_KP_URL = 'https://invoice.sxczgkj.cn/api' # 线上环境接口地址 -VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client/' +VITE_API_URL = 'https://cashier.sxczgkj.com/' # 预发布接口 # VITE_API_URL = 'https://pre-cashierclient.sxczgkj.cn/cashier-client/' \ No newline at end of file diff --git a/.env.test b/.env.test index 083cc8a..0540895 100644 --- a/.env.test +++ b/.env.test @@ -1,11 +1,11 @@ # 线上环境 ENV = test -#测试ws -VITE_API_WSS = 'wss://sockets.sxczgkj.com/wss' +# 测试ws +# VITE_API_WSS = 'wss://sockets.sxczgkj.com/wss' # 正式ws -# VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client' +VITE_API_WSS = 'wss://czgeatws.sxczgkj.com/wss' # 正式 php VITE_API_PHP_URL = 'https://newblockwlx.sxczgkj.cn/index.php/api' @@ -17,10 +17,10 @@ VITE_API_PHP_URL = 'https://newblockwlx.sxczgkj.cn/index.php/api' VITE_API_KP_URL = 'https://invoice.sxczgkj.cn/api' # 测试 -VITE_API_URL = 'https://tapi.cashier.sxczgkj.cn' +# VITE_API_URL = 'https://tapi.cashier.sxczgkj.cn' # 预发布 # VITE_API_URL = 'https://pre-cashierclient.sxczgkj.cn/cashier-client' # 正式 -# VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client' \ No newline at end of file +VITE_API_URL = 'https://cashier.sxczgkj.com/' \ No newline at end of file diff --git a/src/api/system.js b/src/api/system.js new file mode 100644 index 0000000..16a9657 --- /dev/null +++ b/src/api/system.js @@ -0,0 +1,12 @@ +import request from "@/utils/request.js"; + +/** + * 获取版本 pc:pc端 type 0 windows,1 安卓,2 iOS + * @returns + */ +export function findVersion(source = "pc", type = 0) { + return request({ + method: "get", + url: `/system/admin/version/${source}/${type}`, + }); +} diff --git a/src/components/lodop/receiptPrint.js b/src/components/lodop/receiptPrint.js index 013f066..f71ad40 100644 --- a/src/components/lodop/receiptPrint.js +++ b/src/components/lodop/receiptPrint.js @@ -101,7 +101,7 @@ export default (data) => {
原价 - ${data.amount} + ${data.originAmount}
折扣 diff --git a/src/components/payCard/couponModal.vue b/src/components/payCard/couponModal.vue index cc6597d..49fcfcb 100644 --- a/src/components/payCard/couponModal.vue +++ b/src/components/payCard/couponModal.vue @@ -157,7 +157,7 @@ function selectCoupon(row) { showDialog.value = false } -// 获取用户可用de优惠券 +// 获取用户可用的优惠券 async function findCouponAjax() { try { tableData.loading = true @@ -170,18 +170,38 @@ async function findCouponAjax() { tableData.list = res } else { let arr = [] - let ids = props.orderList.map(item => item.productId) - res && res.map(item => { - if (ids.includes(item.proId)) { - let pro = props.orderList.find(val => val.productId == item.proId) + let ids = props.orderList.map(item => item.product_id) + res && res.map((item, index) => { + + let found = ids.find(val => val == item.proId) + let result = found !== undefined + + if (result) { + let pro = props.orderList.find(val => val.product_id == item.proId) + + console.log('pro===', pro); + + let discount = pro.lowPrice + + if (goodsStore.showVipPrice) { + discount = pro.memberPrice + } + + if (+pro.discount_sale_amount) { + discount = pro.discount_sale_amount + } + arr.push({ ...item, productName: pro.productName, - lowPrice: pro.lowPrice + lowPrice: pro.lowPrice, + discount: discount }) } }) tableData.list = arr + + console.log('tableData.list===', tableData.list); } } catch (error) { console.log(error); diff --git a/src/components/payCard/payCard.vue b/src/components/payCard/payCard.vue index 99cf09e..e07fd2a 100644 --- a/src/components/payCard/payCard.vue +++ b/src/components/payCard/payCard.vue @@ -5,16 +5,20 @@
应收:¥ {{ money }} -
-
- 原价:¥{{ formatDecimal(props.amount - (goodsStore.tableInfo.tableFee || 0)) }} - 餐位费:¥{{ formatDecimal(+goodsStore.tableInfo.tableFee || 0) }} - 优惠:¥{{ formatDecimal(props.amount - money) }} - - 折扣:{{ discountRateVlaue }}折 +
+ 清除优惠 +
+
+
+ 原价:¥{{ originOrderAmount }} + 餐位费:¥{{ formatDecimal(+goodsStore.tableInfo.tableFee || 0) }} + 打包费:¥{{ formatDecimal(+goodsStore.cartInfo.packFee || 0) }} + 优惠:¥{{ formatDecimal(props.amount - money) }} + + 折扣:{{ discountRateVlaue }}折
@@ -56,7 +60,7 @@
0
- +
@@ -115,16 +119,10 @@ - +
- - - - -
@@ -137,9 +135,16 @@ 清除
+ + + + +
- 选择优惠券
优惠券
@@ -156,11 +161,11 @@
- +
@@ -169,7 +174,12 @@ + + + @@ -177,38 +187,42 @@
- +
- - - - +
+ + + + + 清除 +
注意:订单金额不足¥{{ formatDecimal(+pointOptions.minPaymentAmount) }},无法使用积分抵扣
- -
- {{ formatDecimal(+couponForm.amount) }} -
-
-