From 5cf2355d2899e5ced99f270f705f53e1b550a71f Mon Sep 17 00:00:00 2001
From: gyq <875626088@qq.com>
Date: Thu, 6 Mar 2025 19:28:01 +0800
Subject: [PATCH] =?UTF-8?q?=201.=E5=AF=B9=E6=8E=A5=E4=BC=9A=E5=91=98?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=202.=E5=AF=B9=E6=8E=A5=E6=8E=92=E9=98=9F?=
=?UTF-8?q?=E5=8F=AB=E5=8F=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/App.vue | 4 +
src/api/account.js | 132 +++
src/api/order.js | 51 +
src/components/fastPayCard.vue | 47 +-
src/components/payCard/payCard.vue | 481 +++++----
src/components/payCard/scanModal.vue | 29 +-
src/components/uploadImg.vue | 13 +-
src/store/global.js | 38 +
src/store/goods.js | 9 +-
src/store/socket.js | 4 +-
src/store/user.js | 12 +-
src/utils/index.js | 10 +
src/views/group_buy/index.vue | 8 +-
src/views/home/components/goods.vue | 13 +-
src/views/home/components/settleAccount.vue | 6 +-
src/views/home/index.vue | 22 +-
src/views/login.vue | 4 +-
src/views/member/components/addUserDrawer.vue | 163 +++
.../components/{add.vue => recordDialog.vue} | 130 ++-
src/views/member/components/userCharge.vue | 4 +-
src/views/member/index copy.vue | 807 +++++++++++++++
src/views/member/index.vue | 932 ++++--------------
src/views/order/index.vue | 66 +-
src/views/queue/components/addTab.vue | 6 +-
src/views/queue/components/getNumber.vue | 13 +-
src/views/queue/components/record.vue | 10 +-
src/views/queue/components/resultModal.vue | 9 +-
src/views/queue/components/setting.vue | 15 +-
src/views/queue/index.vue | 18 +-
29 files changed, 1920 insertions(+), 1136 deletions(-)
create mode 100644 src/views/member/components/addUserDrawer.vue
rename src/views/member/components/{add.vue => recordDialog.vue} (58%)
create mode 100644 src/views/member/index copy.vue
diff --git a/src/App.vue b/src/App.vue
index 2720cbe..c7b11da 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -454,4 +454,8 @@ html {
}
}
}
+
+.height_auto {
+ overflow-y: auto;
+}
diff --git a/src/api/account.js b/src/api/account.js
index ea94540..fc1ea75 100644
--- a/src/api/account.js
+++ b/src/api/account.js
@@ -100,3 +100,135 @@ export function shopStaffInfo() {
url: "/account/admin/shopStaff/info",
});
}
+
+/**
+ * 获取店铺用户充值记录
+ */
+export function shopUserChargeFlow(params) {
+ return request({
+ method: "get",
+ url: "/account/admin/shopUser/flow",
+ params,
+ });
+}
+
+/**
+ * 获取店铺用户充值记录
+ */
+export function addShopUser(data) {
+ return request({
+ method: "post",
+ url: "/account/admin/shopUser",
+ data,
+ });
+}
+
+/**
+ * 获取叫号队列
+ */
+export function callTableQueue(params) {
+ return request({
+ method: "get",
+ url: "/account/admin/callTable/queue",
+ params,
+ });
+}
+
+/**
+ * 获取叫号配置
+ */
+export function callTableConfig(params) {
+ return request({
+ method: "get",
+ url: "/account/admin/callTable/config",
+ params,
+ });
+}
+
+/**
+ * 修改叫号配置
+ */
+export function callTableConfigPut(data) {
+ return request({
+ method: "put",
+ url: "/account/admin/callTable/config",
+ data,
+ });
+}
+
+/**
+ * 叫号桌型新增
+ */
+export function addCallTable(data) {
+ return request({
+ method: "post",
+ url: "/account/admin/callTable",
+ data,
+ });
+}
+
+/**
+ * 叫号桌型删除
+ */
+export function delCallTable(data) {
+ return request({
+ method: "delete",
+ url: "/account/admin/callTable",
+ data,
+ });
+}
+
+/**
+ * 获取桌型列表
+ */
+export function getCallTable(params) {
+ return request({
+ method: "get",
+ url: "/account/admin/callTable",
+ params,
+ });
+}
+
+/**
+ * 新增叫号号码
+ */
+export function takeNumber(data) {
+ return request({
+ method: "post",
+ url: "/account/admin/callTable/takeNumber",
+ data,
+ });
+}
+
+/**
+ * 获取桌型列表
+ */
+export function callRecord(params) {
+ return request({
+ method: "get",
+ url: "/account/admin/callTable/callRecord",
+ params,
+ });
+}
+
+/**
+ * 执行叫号
+ */
+export function callTableCall(data) {
+ return request({
+ method: "post",
+ url: "/account/admin/callTable/call",
+ data,
+ });
+}
+
+/**
+ * 修改叫号队列状态
+ */
+export function callTableCallState(data) {
+ return request({
+ method: "put",
+ url: "/account/admin/callTable/updateState",
+ data,
+ });
+}
diff --git a/src/api/order.js b/src/api/order.js
index 2476caa..8e895e1 100644
--- a/src/api/order.js
+++ b/src/api/order.js
@@ -104,3 +104,54 @@ export function getOrderById(params) {
});
}
+/**
+ * 会员充值 - 现金充值
+ * @param {*} data
+ * @returns
+ */
+export function cashPayVip(data) {
+ return request({
+ method: "post",
+ url: "/order/pay/cashPayVip",
+ data,
+ });
+}
+
+/**
+ * 会员充值 - 反扫
+ * @param {*} data
+ * @returns
+ */
+export function microPayVip(data) {
+ return request({
+ method: "post",
+ url: "/order/pay/microPayVip",
+ data,
+ });
+}
+
+/**
+ * 会员充值 - 会员退款前置接口
+ * @param {*} data
+ * @returns
+ */
+export function refundVipBefore(data) {
+ return request({
+ method: "post",
+ url: "/order/pay/refundVipBefore",
+ data,
+ });
+}
+
+/**
+ * 会员充值 - 会员退款
+ * @param {*} data
+ * @returns
+ */
+export function refundVip(data) {
+ return request({
+ method: "post",
+ url: "/order/pay/refundVip",
+ data,
+ });
+}
diff --git a/src/components/fastPayCard.vue b/src/components/fastPayCard.vue
index 5afa216..6f9f89b 100644
--- a/src/components/fastPayCard.vue
+++ b/src/components/fastPayCard.vue
@@ -13,9 +13,9 @@
会员:
- {{
- props.userInfo.id && props.userInfo.telephone
- }}
+
+ {{ props.userInfo.id && props.userInfo.phone }}
+
已付:¥0.00
@@ -59,29 +59,24 @@
-
+
\ No newline at end of file
+
diff --git a/src/components/payCard/scanModal.vue b/src/components/payCard/scanModal.vue
index 34c0252..a69fc95 100644
--- a/src/components/payCard/scanModal.vue
+++ b/src/components/payCard/scanModal.vue
@@ -58,7 +58,7 @@ import { scanpay, queryOrder, quickPay, queryQuickPayStatus, accountPay, querySc
import { useUser } from "@/store/user.js";
import { useGlobal } from '@/store/global.js'
import { formatDecimal } from '@/utils'
-import { microPay, queryOrderStatus } from '@/api/order.js'
+import { microPay, queryOrderStatus, microPayVip } from '@/api/order.js'
const store = useUser();
const global = useGlobal()
@@ -76,6 +76,7 @@ const props = defineProps({
type: [Number, String],
default: 0,
},
+ // 0 订单支付 1 会员充值 2 快捷收款
selecttype: {
type: [Number, String],
default: 0,
@@ -117,8 +118,20 @@ async function submitHandle() {
try {
if (!scanCode.value) return;
loading.value = true;
- if (props.selecttype == 1) {
- await microPay(props.payData);
+ if (props.selecttype == 0) {
+ // 正常下单扫码支付
+ await microPay({
+ ...props.payData,
+ authCode: scanCode.value
+ });
+ } else if (props.selecttype == 1) {
+ // 会员扫码充值
+ await microPayVip({
+ shopId: store.shopInfo.id,
+ shopUserId: props.orderId,
+ amount: props.amount,
+ authCode: scanCode.value
+ })
} else {
if (props.fast) {
await quickPay({
@@ -128,11 +141,11 @@ async function submitHandle() {
});
} else {
if (props.payType == 'scanCode') {
- // 正常下单扫码支付
- await microPay({
- ...props.payData,
- authCode: scanCode.value
- });
+ if (props.selecttype == 1) {
+
+ } else if (props.selecttype == 2) {
+
+ }
emits('success')
}
if (props.payType == 'deposit') {
diff --git a/src/components/uploadImg.vue b/src/components/uploadImg.vue
index 717a2b2..1fae192 100644
--- a/src/components/uploadImg.vue
+++ b/src/components/uploadImg.vue
@@ -14,22 +14,23 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/store/global.js b/src/store/global.js
index 53f57f8..a8c4af5 100644
--- a/src/store/global.js
+++ b/src/store/global.js
@@ -110,6 +110,44 @@ export const useGlobal = defineStore("global", {
label: "现金支付",
},
],
+ bizCodes: [
+ {
+ type: "cashIn",
+ label: "现金充值",
+ },
+ {
+ type: "wechatIn",
+ label: "微信小程序充值",
+ },
+ {
+ type: "alipayIn",
+ label: "支付宝小程序充值",
+ },
+ {
+ type: "awardIn",
+ label: "充值奖励",
+ },
+ {
+ type: "rechargeRefund",
+ label: "充值退款",
+ },
+ {
+ type: "orderPay",
+ label: "订单消费",
+ },
+ {
+ type: "orderRefund",
+ label: "订单退款",
+ },
+ {
+ type: "adminIn",
+ label: "管理员充值",
+ },
+ {
+ type: "adminOut",
+ label: "管理员消费",
+ },
+ ],
}),
actions: {
// 更新状态
diff --git a/src/store/goods.js b/src/store/goods.js
index 667897a..e03773a 100644
--- a/src/store/goods.js
+++ b/src/store/goods.js
@@ -385,12 +385,13 @@ export const useGoods = defineStore("goods", {
this.operateCart({ table_code: tableCode }, "cleanup");
},
// 清空购物车回执操作
- successClearCart() {
+ successClearCart(clearOrder = false) {
this.cartList = [];
this.cartInfo = {};
-
- this.orderList = [];
- this.orderListInfo = "";
+ if (clearOrder) {
+ this.orderList = [];
+ this.orderListInfo = "";
+ }
this.calcCartInfo();
},
// 下单成功清除购物车,重新加载订单
diff --git a/src/store/socket.js b/src/store/socket.js
index 94f3b9e..b60c4e4 100644
--- a/src/store/socket.js
+++ b/src/store/socket.js
@@ -86,7 +86,7 @@ export const useSocket = defineStore("socket", {
// console.log("接收消息", data);
goodsStore.getCartList(data.data);
}
-
+
this.ws.send(
JSON.stringify({
type: "receipt",
@@ -171,7 +171,7 @@ export const useSocket = defineStore("socket", {
startheartbeat() {
this.heartbeatTimer = setInterval(() => {
if (this.log) console.log("发送心跳");
- this.ws.send(JSON.stringify({ type: "heartbeat" }));
+ this.ws.send(JSON.stringify({ type: "ping_interval" }));
}, 10000);
},
// 清除心跳
diff --git a/src/store/user.js b/src/store/user.js
index b7532fa..a3e699b 100644
--- a/src/store/user.js
+++ b/src/store/user.js
@@ -1,5 +1,5 @@
import { defineStore } from "pinia";
-import { login, shopStaffInfo } from "@/api/account.js";
+import { login, shopStaffInfo, shopInfo_detail } from "@/api/account.js";
import useStorage from "@/utils/useStorage";
export const useUser = defineStore("user", {
@@ -29,5 +29,15 @@ export const useUser = defineStore("user", {
console.log(error);
}
},
+ // 更新店铺信息
+ async getShopInfo() {
+ try {
+ const res = await shopInfo_detail();
+ useStorage.set("shopInfo", res);
+ this.shopInfo = useStorage.get("shopInfo");
+ } catch (error) {
+ console.log(error);
+ }
+ },
},
});
diff --git a/src/utils/index.js b/src/utils/index.js
index 36b61fe..b50c31e 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -178,3 +178,13 @@ export function commOrderPrintData(orderInfo) {
return data;
}
+
+/**
+ * 校验手机号
+ * @param {*} phone
+ * @returns
+ */
+export function regPhone(phone) {
+ let reg = /^(?:(?:\+|00)86)?1\d{10}$/;
+ return reg.test(phone);
+}
diff --git a/src/views/group_buy/index.vue b/src/views/group_buy/index.vue
index 5b5d7ab..6d59928 100644
--- a/src/views/group_buy/index.vue
+++ b/src/views/group_buy/index.vue
@@ -194,10 +194,10 @@ function payTypeFilter(t) {
// 订单类型
const typeList = reactive([
- {
- value: 1,
- label: '自营'
- },
+ // {
+ // value: 1,
+ // label: '自营'
+ // },
{
value: 2,
label: '抖音'
diff --git a/src/views/home/components/goods.vue b/src/views/home/components/goods.vue
index 9fc6fee..7870da3 100644
--- a/src/views/home/components/goods.vue
+++ b/src/views/home/components/goods.vue
@@ -82,7 +82,8 @@
¥{{ item.skuList[0].salePrice }}
- ¥{{ item.skuList[0].salePrice }}
+ ¥{{ item.skuList[0].salePrice
+ }}
¥{{ item.skuList[0].memberPrice }}
@@ -412,7 +413,7 @@ function searchHandle() {
// 确认选择规格回调
function skuConfirm(params) {
- console.log(params);
+ // console.log(params);
let goodsItem = goodsStore.cartList.find(goods => goods.product_id == params.productId && goods.sku_id == params.id)
if (goodsItem && goodsItem.id) {
// 编辑新增
@@ -427,7 +428,11 @@ function skuConfirm(params) {
}
} else {
// 添加
- goodsStore.addCart({ ...params, number: params.suitNum })
+ if (params.type == 'weight') {
+ goodsStore.addCart({ ...params, number: params.number })
+ } else {
+ goodsStore.addCart({ ...params, number: params.suitNum })
+ }
}
}
@@ -1028,9 +1033,11 @@ defineExpose({
padding: 6px 10px;
background-color: var(--primary-color);
position: relative;
+
.price_warp {
display: flex;
align-items: center;
+
.del {
color: #fff;
position: relative;
diff --git a/src/views/home/components/settleAccount.vue b/src/views/home/components/settleAccount.vue
index 753f3e9..e7560c3 100644
--- a/src/views/home/components/settleAccount.vue
+++ b/src/views/home/components/settleAccount.vue
@@ -34,9 +34,9 @@
-
+
打印预结单
@@ -297,7 +297,7 @@ function paySuccess() {
dialogVisible.value = false;
ElMessage.success('支付成功')
- goodsStore.successClearCart()
+ goodsStore.successClearCart(!cartList.length)
// printOrderLable()
// emit("paySuccess");
}
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 8b669ef..1bd4eae 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -11,10 +11,10 @@
-
+
- 选择会员
+ 选择会员
@@ -69,7 +69,7 @@
台桌:{{ goodsStore.tableInfo.name }}
- {{ goodsStore.tableInfo.num }}人
+ {{ goodsStore.tableInfo.num || 1 }}人
@@ -390,7 +390,7 @@ function clearVipUserHandle() {
.menu {
background-color: var(--el-color-warning);
color: #fff;
- width: 60px;
+ width: 80px;
display: flex;
align-items: center;
justify-content: center;
@@ -415,11 +415,11 @@ function clearVipUserHandle() {
align-items: center;
justify-content: space-between;
background-color: var(--el-color-info-light-7);
- padding: 0 10px;
.left {
display: flex;
align-items: center;
+ margin-left: 14px;
}
.icon_wrap {
@@ -430,8 +430,8 @@ function clearVipUserHandle() {
justify-content: center;
.u_icon {
- font-size: 20px;
- color: #999;
+ font-size: 16px;
+ color: var(--el-color-primary);
.i {
display: flex;
@@ -446,7 +446,10 @@ function clearVipUserHandle() {
.t {
font-size: var(--el-font-size-base);
- margin-left: 4px;
+ color: var(--el-color-primary);
+ margin-left: 6px;
+ position: relative;
+ top: -1px;
}
.user_info {
@@ -465,8 +468,9 @@ function clearVipUserHandle() {
.p {
width: 83px;
flex: 1;
- color: #999;
+ color: var(--el-color-primary);
font-size: 14px;
+ margin-left: 6px;
}
}
}
diff --git a/src/views/login.vue b/src/views/login.vue
index 9e6952d..b884cb1 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -146,6 +146,8 @@ const submitHandle = () => {
store
.userlogin(form)
.then(async (res) => {
+ console.log(res);
+
// 登录成功后保存商户号
// useStorage.set('merchantLoginAccount', form.username)
ElMessage.success("登录成功");
@@ -156,7 +158,7 @@ const submitHandle = () => {
});
}, 1000);
// const douyin = await douyincheckIn({
- // token: res.token,
+ // token: store.token,
// loginName: res.loginName,
// clientType: 'pc'
// })
diff --git a/src/views/member/components/addUserDrawer.vue b/src/views/member/components/addUserDrawer.vue
new file mode 100644
index 0000000..688af8c
--- /dev/null
+++ b/src/views/member/components/addUserDrawer.vue
@@ -0,0 +1,163 @@
+
+
+
+
+
+ form.headImg = e" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/member/components/add.vue b/src/views/member/components/recordDialog.vue
similarity index 58%
rename from src/views/member/components/add.vue
rename to src/views/member/components/recordDialog.vue
index 5c55278..7b19631 100644
--- a/src/views/member/components/add.vue
+++ b/src/views/member/components/recordDialog.vue
@@ -1,26 +1,25 @@
-
+
@@ -30,11 +29,29 @@
-
+
+
+ {{ refundItem.amount }}
+
+
+ {{ refundItem.inAmount }}
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+ 注意:一旦退款,赠送金额{{ refundItem.giftAmount }}也将全额退还
@@ -55,17 +72,21 @@
+
+
\ No newline at end of file
diff --git a/src/views/member/index.vue b/src/views/member/index.vue
index b34f592..9f6501c 100644
--- a/src/views/member/index.vue
+++ b/src/views/member/index.vue
@@ -1,805 +1,279 @@
-
-
-
-
-
- 会员昵称:
- {{ tableData.list.length != 0 ? tableData.list[datarow].name : '无' }}
-
-
- 手机号码:
- {{ tableData.list.length != 0 ? tableData.list[datarow].telephone : '无' }}
-
-
- 会员编号:
- {{ tableData.list.length != 0 ? tableData.list[datarow].code : '无' }}
-
-
- 会员等级:
- {{ tableData.list.length != 0 ? tableData.list[datarow].level : '无' }}
-
-
-
-
-
-
- 会员积分
-
-
{{ tableData.list.length != 0 ?
- tableData.list[datarow].levelConsume : '无' }}
-
-
-
-
-
-
- 储值余额
-
-
-
{{ tableData.list.length != 0 ? tableData.list[datarow].amount : '无' }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 账户充值
-
-
-
- 添加会员
-
- 确认
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 男
- 女
-
-
-
-
-
-
-
-
-
-
+