From f936328a66f0fcd1032f8ee8d18fb111ceffba02 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Mon, 10 Mar 2025 13:30:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=EF=BC=8C=E9=94=80=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=EF=BC=8C=E6=A1=8C=E5=8F=B0=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/coup/index.js | 10 +- src/api/order/data-summary.ts | 41 + src/api/order/sale-summary.ts | 33 + src/api/order/table-summary.ts | 25 + src/router/index.ts | 10 + src/store/modules/user.ts | 7 +- src/utils/auth.ts | 12 +- src/utils/request-php.js | 4 +- src/views/application/marketing/index.vue | 2 +- src/views/application/marketing/invite.vue | 3 + src/views/data/index.vue | 1480 ++++++++++++++++- src/views/data/sales.vue | 450 ++++- src/views/data/table.vue | 372 ++++- src/views/inventory/operation_in/index.vue | 4 +- src/views/login/index.vue | 18 +- src/views/system-setting/pay-types/index.vue | 7 +- .../Instead/components/popup-quan-hexiao.vue | 16 +- 17 files changed, 2466 insertions(+), 28 deletions(-) create mode 100644 src/api/order/data-summary.ts create mode 100644 src/api/order/sale-summary.ts create mode 100644 src/api/order/table-summary.ts create mode 100644 src/views/application/marketing/invite.vue diff --git a/src/api/coup/index.js b/src/api/coup/index.js index a2e900b..66cd018 100644 --- a/src/api/coup/index.js +++ b/src/api/coup/index.js @@ -1,13 +1,7 @@ // 代客下单 import request from "@/utils/request-php"; -import { getToken } from "@/utils/auth"; -import { useUserStore } from "@/store"; +import { getDouyinToken, getToken } from "@/utils/auth"; -const userStore = useUserStore(); - -function getLoginName() { - return userStore.userInfo.phone; -} // 抖音团购核销准备 export function $douyin_fulfilmentcertificateprepare(data) { return request({ @@ -90,7 +84,7 @@ export function $douyin_checkIn(data) { data: { clientType: "ADMIN", token: getToken(), - loginName: getLoginName(), + loginName: localStorage.getItem("userInfo").phone, ...data, }, }); diff --git a/src/api/order/data-summary.ts b/src/api/order/data-summary.ts new file mode 100644 index 0000000..07db384 --- /dev/null +++ b/src/api/order/data-summary.ts @@ -0,0 +1,41 @@ +import request from "@/utils/request"; +import { Order_BaseUrl } from "@/api/config"; +const baseURL = Order_BaseUrl + "/admin/data/summary"; +// 数据统计 +const Api = { + // 营业板块-上半部分 + trade(params: any) { + return request({ + url: `${baseURL}/trade`, + method: "get", + params + }); + }, + // 商品销售 右下 + productSaleDate(params: any) { + return request({ + url: `${baseURL}/productSaleDate`, + method: "get", + params + }); + }, + // 销售趋势柱状图 左下 + dateAmount(params: any) { + return request({ + url: `${baseURL}/dateAmount`, + method: "get", + params + }); + }, + // 支付占比饼图 左下 + datePayType(params: any) { + return request({ + url: `${baseURL}/datePayType`, + method: "get", + params + }); + }, +}; + +export default Api; + diff --git a/src/api/order/sale-summary.ts b/src/api/order/sale-summary.ts new file mode 100644 index 0000000..f8a8600 --- /dev/null +++ b/src/api/order/sale-summary.ts @@ -0,0 +1,33 @@ +import request from "@/utils/request"; +import { Order_BaseUrl } from "@/api/config"; +const baseURL = Order_BaseUrl + "/admin/sale/summary"; +// 销量统计 +const Api = { + // 统计 + count(params: any) { + return request({ + url: `${baseURL}/count`, + method: "get", + params + }); + }, + // 分页 + page(params: any) { + return request({ + url: `${baseURL}/page`, + method: "get", + params + }); + }, + // 导出 + export(params: any) { + return request({ + url: `${baseURL}/export`, + method: "get", + params + }); + }, +}; + +export default Api; + diff --git a/src/api/order/table-summary.ts b/src/api/order/table-summary.ts new file mode 100644 index 0000000..35bbee7 --- /dev/null +++ b/src/api/order/table-summary.ts @@ -0,0 +1,25 @@ +import request from "@/utils/request"; +import { Order_BaseUrl } from "@/api/config"; +const baseURL = Order_BaseUrl + "/admin/table/summary"; +// 台桌统计 +const Api = { + // 统计 + list(params: any) { + return request({ + url: `${baseURL}/list`, + method: "get", + params + }); + }, + // 导出 + export(params: any) { + return request({ + url: `${baseURL}/export`, + method: "get", + params + }); + }, +}; + +export default Api; + diff --git a/src/router/index.ts b/src/router/index.ts index f662e19..c5d9867 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -384,6 +384,16 @@ export const constantRoutes: RouteRecordRaw[] = [ hidden: true }, }, + { + path: "invite", + component: () => import("@/views/application/marketing/invite.vue"), + name: "invite", + meta: { + title: "邀请裂变", + affix: false, + hidden: true + }, + }, { path: "points", component: () => import("@/views/application/marketing/points/index.vue"), diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 7f3d75a..ea766a4 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -13,6 +13,9 @@ export const useUserStore = defineStore("user", () => { const isShopAdmin = useStorage("isShopAdmin", false) // 0商户 1员工 const userInfo = useStorage("userInfo", {} as UserInfo); const promissionList = useStorage("promissionList", [] as string[]); + //美团抖音核销店铺信息 + const meituan_douyin_info = useStorage("meituan_douyin_info", {}); + localStorage.setItem("shopId", "" + userInfo.value.shopId); if (userInfo.value.shopId) { @@ -28,11 +31,12 @@ export const useUserStore = defineStore("user", () => { return new Promise((resolve, reject) => { AuthAPI.login(loginRequest) .then((data) => { + isShopAdmin.value = data.loginType == 0 ? true : false; Object.assign(userInfo.value, { ...data.shopInfo, shopId: data.shopInfo.id }); promissionList.value = data.promissionList; const token = data.tokenInfo.tokenValue; - setToken(token); // Bearer eyJhbGciOiJIUzI1NiJ9.xxx.xxx + setToken(token); setRefreshToken(token); resolve(); }) @@ -119,6 +123,7 @@ export const useUserStore = defineStore("user", () => { return { isShopAdmin, + meituan_douyin_info, userInfo, promissionList, getUserInfo, diff --git a/src/utils/auth.ts b/src/utils/auth.ts index bd3e9b3..c971914 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -1,12 +1,22 @@ // 访问 token 缓存的 key const ACCESS_TOKEN_KEY = "access_token"; +// 访问 抖音token 缓存的 key +const DOUYIN_ACCESS_TOKEN_KEY = "douyin_access_token"; // 刷新 token 缓存的 key const REFRESH_TOKEN_KEY = "refresh_token"; +//抖音 token +function getDouyinToken() { + return localStorage.getItem(DOUYIN_ACCESS_TOKEN_KEY) || ""; +} +function setDouyinToken(token: string) { + return localStorage.setItem(DOUYIN_ACCESS_TOKEN_KEY, token); +} function getToken(): string { return localStorage.getItem(ACCESS_TOKEN_KEY) || ""; } + function setToken(token: string) { localStorage.setItem(ACCESS_TOKEN_KEY, token); } @@ -24,4 +34,4 @@ function clearToken() { localStorage.removeItem(REFRESH_TOKEN_KEY); } -export { getToken, setToken, clearToken, getRefreshToken, setRefreshToken }; +export { getToken, setToken, clearToken, getRefreshToken, setRefreshToken, getDouyinToken, setDouyinToken }; diff --git a/src/utils/request-php.js b/src/utils/request-php.js index 8e70537..999020a 100644 --- a/src/utils/request-php.js +++ b/src/utils/request-php.js @@ -1,6 +1,6 @@ import axios from "axios"; import router from "@/router"; -import { getToken } from "@/utils/auth"; +import { getDouyinToken, getToken } from "@/utils/auth"; // 创建axios实例 const service = axios.create({ @@ -12,7 +12,7 @@ const service = axios.create({ service.interceptors.request.use( (config) => { if (getToken()) { - config.headers["bausertoken"] = getToken(); + config.headers["bausertoken"] = getDouyinToken(); } config.headers["Content-Type"] = "application/json"; // 添加可取消请求配置 diff --git a/src/views/application/marketing/index.vue b/src/views/application/marketing/index.vue index 7ece955..db77641 100644 --- a/src/views/application/marketing/index.vue +++ b/src/views/application/marketing/index.vue @@ -27,7 +27,7 @@ const to = (item) => { const list = ref([ { name: "优惠券", icon: card, path: "coupon" }, { name: "霸王餐", icon: charge, path: "bwc" }, - { name: "邀请裂变", icon: invite, path: "" }, + { name: "邀请裂变", icon: invite, path: "invite" }, { name: "积分锁客", icon: score, path: "points" }, ]); diff --git a/src/views/application/marketing/invite.vue b/src/views/application/marketing/invite.vue new file mode 100644 index 0000000..663dc90 --- /dev/null +++ b/src/views/application/marketing/invite.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/views/data/index.vue b/src/views/data/index.vue index 41a40c8..762f4e8 100644 --- a/src/views/data/index.vue +++ b/src/views/data/index.vue @@ -1 +1,1479 @@ - \ No newline at end of file + + + + + + diff --git a/src/views/data/sales.vue b/src/views/data/sales.vue index e5e6a79..a90584d 100644 --- a/src/views/data/sales.vue +++ b/src/views/data/sales.vue @@ -1,3 +1,449 @@ \ No newline at end of file +
+ +
+ + + + + 全部 + 今天 + 昨天 + 最近7天 + 最近30天 + 本周 + 本月 + 自定义 + + + + + 查询 + 重置 + + 导出Excel + 下载中... + + + +
+
+
+
+
+ +
+
+
+ + {{ item.payAmount }} +
+
{{ item.payType }}
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + + + diff --git a/src/views/data/table.vue b/src/views/data/table.vue index e5e6a79..9332f44 100644 --- a/src/views/data/table.vue +++ b/src/views/data/table.vue @@ -1,3 +1,371 @@ \ No newline at end of file +
+ +
+ + + 全部 + 今天 + 昨天 + 最近7天 + 最近30天 + 本周 + 本月 + 自定义 + + + + 查询 + 重置 + + 导出Excel + 下载中... + + + +
+ +
+ + + + + + + + + + + + + + +
+ +
+ + + + + diff --git a/src/views/inventory/operation_in/index.vue b/src/views/inventory/operation_in/index.vue index a50b74c..49a1937 100644 --- a/src/views/inventory/operation_in/index.vue +++ b/src/views/inventory/operation_in/index.vue @@ -67,8 +67,8 @@ diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 94a1203..2f15e6c 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -79,12 +79,13 @@