From b2e450fd52fba446a7d732a558ad3f0841b1855a Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Mon, 29 Jul 2024 18:10:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9C=AC=E5=9C=B0USB?= =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 8 +- src/components/lodop/LodopFuncs.js | 4 +- src/components/lodop/index.vue | 8 +- src/components/lodop/receiptPrint.js | 83 +++++++++++++++++++++ src/store/print.js | 43 ++++++++++- src/store/socket.js | 2 + src/views/home/components/settleAccount.vue | 55 ++++++++------ src/views/order/index.vue | 65 ++++++++++++---- 8 files changed, 222 insertions(+), 46 deletions(-) create mode 100644 src/components/lodop/receiptPrint.js diff --git a/.env.development b/.env.development index 18a046a..5e62c37 100644 --- a/.env.development +++ b/.env.development @@ -3,10 +3,10 @@ ENV = development # 正式ws -VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client' +# VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client' #测试ws -# VITE_API_WSS = 'wss://wxcashiertest.sxczgkj.cn/client' +VITE_API_WSS = 'wss://wxcashiertest.sxczgkj.cn/client' # 阿伟本地ws # VITE_API_WSS = 'ws://192.168.2.17:9998/client' @@ -27,7 +27,7 @@ VITE_API_KP_URL = 'https://invoice.sxczgkj.cn/api' # VITE_API_URL = 'http://192.168.1.106:10589/cashier-client' # 测试 -# VITE_API_URL = 'https://cashier-client.sxczgkj.cn/cashier-client' +VITE_API_URL = 'https://cashier-client.sxczgkj.cn/cashier-client' # 正式 -VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client' \ No newline at end of file +# VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client' \ No newline at end of file diff --git a/src/components/lodop/LodopFuncs.js b/src/components/lodop/LodopFuncs.js index 4f30774..27c1c27 100644 --- a/src/components/lodop/LodopFuncs.js +++ b/src/components/lodop/LodopFuncs.js @@ -82,7 +82,7 @@ function checkOrTryHttp() { try { var WSK1 = new WebSocket(URL_WS1); WSK1.onopen = function (e) { - setTimeout("checkOrTryHttp()", 200); + setTimeout(checkOrTryHttp(), 200); } WSK1.onmessage = function (e) { if (!window.getCLodop) eval(e.data); @@ -90,7 +90,7 @@ function checkOrTryHttp() { WSK1.onerror = function (e) { var WSK2 = new WebSocket(URL_WS2); WSK2.onopen = function (e) { - setTimeout("checkOrTryHttp()", 200); + setTimeout(checkOrTryHttp(), 200); } WSK2.onmessage = function (e) { if (!window.getCLodop) eval(e.data); diff --git a/src/components/lodop/index.vue b/src/components/lodop/index.vue index ba30ea4..d2288d5 100644 --- a/src/components/lodop/index.vue +++ b/src/components/lodop/index.vue @@ -20,7 +20,7 @@