From e26049593f25301f5eca0bf1594f77be941dcab9 Mon Sep 17 00:00:00 2001
From: gyq <875626088@qq.com>
Date: Thu, 18 Apr 2024 13:42:17 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BF=AB=E6=8D=B7=E6=94=B6?=
=?UTF-8?q?=E9=93=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/pay.js | 13 +
src/components/fastPayCard.vue | 355 ++++++++++++++
src/components/payCard/scanModal.vue | 482 +++++++++++---------
src/views/home/components/fastCashier.vue | 55 +++
src/views/home/components/settleAccount.vue | 62 +--
src/views/home/index.vue | 17 +-
6 files changed, 731 insertions(+), 253 deletions(-)
create mode 100644 src/components/fastPayCard.vue
create mode 100644 src/views/home/components/fastCashier.vue
diff --git a/src/api/pay.js b/src/api/pay.js
index a6a750f..10c09a5 100644
--- a/src/api/pay.js
+++ b/src/api/pay.js
@@ -89,4 +89,17 @@ export function print(params) {
url: "cloudPrinter/print",
params
});
+}
+
+/**
+ * 快捷收款
+ * @param {*} params
+ * @returns
+ */
+export function quickPay(params) {
+ return request({
+ method: "get",
+ url: "pay/quickPay",
+ params
+ });
}
\ No newline at end of file
diff --git a/src/components/fastPayCard.vue b/src/components/fastPayCard.vue
new file mode 100644
index 0000000..57e1114
--- /dev/null
+++ b/src/components/fastPayCard.vue
@@ -0,0 +1,355 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item }}
+
+
.
+
0
+
+
+
+
+
+
+
+ 支
+ 付
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/payCard/scanModal.vue b/src/components/payCard/scanModal.vue
index 4f0ba93..c57b215 100644
--- a/src/components/payCard/scanModal.vue
+++ b/src/components/payCard/scanModal.vue
@@ -1,24 +1,34 @@
-
-
-
-
-
-
-
-
- 扫码支付
- {{ props.amount }}
-
-
-
-
- 立即支付
-
-
-
-
-
-
- 查询用户支付状态
- 查询中...
-
-
-
- 重新扫码
-
-
-
-
-
+
+ 立即支付
+
+
+
+
+
+
+ 查询用户支付状态
+ 查询中...
+
+
+
+ 重新扫码
+
+
+
+
+
\ No newline at end of file
+
diff --git a/src/views/home/components/fastCashier.vue b/src/views/home/components/fastCashier.vue
new file mode 100644
index 0000000..b465f46
--- /dev/null
+++ b/src/views/home/components/fastCashier.vue
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/views/home/components/settleAccount.vue b/src/views/home/components/settleAccount.vue
index d1b65cf..714e02d 100644
--- a/src/views/home/components/settleAccount.vue
+++ b/src/views/home/components/settleAccount.vue
@@ -151,41 +151,41 @@ async function bySubTypeAjax() {
}
async function printHandle() {
- try {
- if (!isPrint.value) return;
- if (printList.value.length) {
- const data = {
- shop_name: store.userInfo.merchantName,
- carts: props.cart,
- amount: props.amount,
- remark: props.remark,
- orderInfo: props.orderInfo,
- deviceName: printList.value[0].config.deviceName,
- createdAt: dayjs(props.orderInfo.createdAt).format(
- "YYYY-MM-DD HH:mm:ss"
- ),
- printTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
- };
- ipcRenderer.send("printerInfoSync", JSON.stringify(data));
- } else {
- ElMessage.error("您还没有添加打印设备");
- }
- } catch (error) {
- console.log(error);
- }
// try {
- // printLoading.value = true;
- // await print({
- // type: "normal",
- // ispre: true,
- // orderId: props.orderInfo.id,
- // });
- // printLoading.value = false;
- // ElMessage.success("打印成功");
+ // if (!isPrint.value) return;
+ // if (printList.value.length) {
+ // const data = {
+ // shop_name: store.userInfo.merchantName,
+ // carts: props.cart,
+ // amount: props.amount,
+ // remark: props.remark,
+ // orderInfo: props.orderInfo,
+ // deviceName: printList.value[0].config.deviceName,
+ // createdAt: dayjs(props.orderInfo.createdAt).format(
+ // "YYYY-MM-DD HH:mm:ss"
+ // ),
+ // printTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
+ // };
+ // ipcRenderer.send("printerInfoSync", JSON.stringify(data));
+ // } else {
+ // ElMessage.error("您还没有添加打印设备");
+ // }
// } catch (error) {
- // printLoading.value = false;
// console.log(error);
// }
+ try {
+ printLoading.value = true;
+ await print({
+ type: "normal",
+ ispre: true,
+ orderId: props.orderInfo.id,
+ });
+ printLoading.value = false;
+ ElMessage.success("打印成功");
+ } catch (error) {
+ printLoading.value = false;
+ console.log(error);
+ }
}
// 订单已支付
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 8caa883..192c83a 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -11,6 +11,15 @@
{{ masterId }}
+
+
@@ -164,6 +175,7 @@ import remarkModal from "@/components/remarkModal.vue";
import takeFoodCode from "@/components/takeFoodCode.vue";
import cartOperation from "@/views/home/components/cartOperation.vue";
import settleAccount from "@/views/home/components/settleAccount.vue";
+import fastCashier from "@/views/home/components/fastCashier.vue";
import pendingCartModal from "@/views/home/components/pendingCartModal.vue";
import {
@@ -188,6 +200,7 @@ const takeFoodCodeRef = ref(null);
const goodsRef = ref(null);
const pendingCartModalRef = ref(null);
const settleAccountRef = ref(null);
+const fastCashierRef = ref(null);
const allSelected = ref(false);
@@ -332,7 +345,7 @@ async function addCart(params, type = "add") {
skuId: type == "add" ? params.id : params.skuId,
number: params.number || 1,
isPack: params.isPack || "false",
- isGift: params.isGift || 'false',
+ isGift: params.isGift || "false",
cartId: type == "add" ? "" : params.id,
uuid: params.uuid || store.userInfo.uuid,
type: type,
@@ -455,7 +468,7 @@ onMounted(() => {
.icon {
color: var(--el-color-primary);
- font-size: 24px;
+ font-size: 18px;
}
.t {