From 4d21314fc688f9686cce3d8ad52dcdee9a25b93a Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Wed, 8 Jan 2025 09:44:25 +0800 Subject: [PATCH] 250108 --- .env.development | 6 +- .env.production | 7 +- .idea/inspectionProfiles/Project_Default.xml | 125 ++ src/api/booking/userInvoice/index.ts | 25 +- src/api/shop/cart/index.ts | 24 +- src/api/think/thinkCard/index.ts | 5 +- src/api/think/thinkCardsBills/index.ts | 106 ++ src/api/think/thinkCardsBills/model/index.ts | 35 + src/api/think/thinkDeposit/index.ts | 2 +- src/api/think/thinkDepositItem/index.ts | 106 ++ src/api/think/thinkDepositItem/model/index.ts | 27 + src/api/think/thinkGoodsOrder/index.ts | 2 +- src/api/think/thinkInvoice/index.ts | 2 +- src/api/think/thinkMachineOpenLog/index.ts | 106 ++ .../think/thinkMachineOpenLog/model/index.ts | 31 + src/api/think/thinkOrder/index.ts | 10 + src/api/think/thinkUsersVip/index.ts | 11 + src/api/think/thinkVipCardsBills/index.ts | 106 ++ .../think/thinkVipCardsBills/model/index.ts | 35 + src/package.json | 4 +- src/package/article/index.vue | 2 +- src/package/booking/checkout.vue | 191 ++- src/package/booking/confirm.vue | 457 +++--- src/package/booking/index.vue | 111 +- src/package/cart/index.vue | 143 +- src/package/goods/checkout.vue | 457 +++--- src/package/goods/detail.vue | 248 ++-- src/package/goods/order-detail.vue | 642 +++++---- src/package/goods/order.vue | 156 +- src/package/order/check.vue | 88 ++ src/package/order/detail.vue | 52 +- src/package/user/card-detail-merchant.vue | 399 ++---- src/package/user/card-detail-record.vue | 120 +- src/package/user/card-detail.vue | 854 +++++------ src/package/user/card.vue | 2 +- src/package/user/depositList.vue | 159 +++ src/package/user/guide.vue | 70 + src/package/user/ic-card.vue | 110 +- src/package/user/invoice-edit.vue | 492 +++---- src/package/user/invoice-show.vue | 212 ++- src/package/user/invoice-type.vue | 28 +- src/package/user/invoice.vue | 551 ++++---- src/package/user/invoiceRent.vue | 404 ++++++ src/package/user/map.vue | 37 + src/package/user/phoneService.vue | 45 + src/package/user/signUp.vue | 52 + src/package/user/siteGuide.vue | 76 + src/pages.json | 58 +- src/pages/index.vue | 144 +- src/pages/order.vue | 364 +++-- src/pages/shop.vue | 216 +-- src/pages/user.vue | 285 ++-- src/pnpm-lock.yaml | 1256 +---------------- src/static/style/common.scss | 8 +- .../ws-login/components/ws-login/ws-login.vue | 3 +- src/uni_modules/zeng-calen/changelog.md | 8 + .../components/zeng-calen/zeng-calen.vue | 455 ++++++ src/uni_modules/zeng-calen/package.json | 85 ++ src/uni_modules/zeng-calen/readme.md | 69 + src/utils/request.ts | 88 +- 60 files changed, 5477 insertions(+), 4495 deletions(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 src/api/think/thinkCardsBills/index.ts create mode 100644 src/api/think/thinkCardsBills/model/index.ts create mode 100644 src/api/think/thinkDepositItem/index.ts create mode 100644 src/api/think/thinkDepositItem/model/index.ts create mode 100644 src/api/think/thinkMachineOpenLog/index.ts create mode 100644 src/api/think/thinkMachineOpenLog/model/index.ts create mode 100644 src/api/think/thinkVipCardsBills/index.ts create mode 100644 src/api/think/thinkVipCardsBills/model/index.ts create mode 100644 src/package/order/check.vue create mode 100644 src/package/user/depositList.vue create mode 100644 src/package/user/guide.vue create mode 100644 src/package/user/invoiceRent.vue create mode 100644 src/package/user/map.vue create mode 100644 src/package/user/phoneService.vue create mode 100644 src/package/user/signUp.vue create mode 100644 src/package/user/siteGuide.vue create mode 100644 src/uni_modules/zeng-calen/changelog.md create mode 100644 src/uni_modules/zeng-calen/components/zeng-calen/zeng-calen.vue create mode 100644 src/uni_modules/zeng-calen/package.json create mode 100644 src/uni_modules/zeng-calen/readme.md diff --git a/.env.development b/.env.development index 8d10c2e..aca3657 100644 --- a/.env.development +++ b/.env.development @@ -1,9 +1,7 @@ VITE_APP_NAME=后台管理系统 VITE_SOCKET_URL=wss://server.gxwebsoft.com -VITE_SERVER_URL=https://server.gxwebsoft.com/api -VITE_API_URL=https://modules.gxwebsoft.com/api +VITE_SERVER_URL=https://gxtyzx-server.websoft.top/api +VITE_API_URL=https://gxtyzx-modules.websoft.top/api VITE_THINK_URL=https://gxtyzx-api.websoft.top/api -#VITE_SERVER_URL=http://127.0.0.1:9090/api -#VITE_API_URL=http://127.0.0.1:9099/api #VITE_THINK_URL=http://127.0.0.1:9099/api diff --git a/.env.production b/.env.production index ee66a2b..134dda6 100644 --- a/.env.production +++ b/.env.production @@ -1,8 +1,5 @@ VITE_APP_NAME=后台管理系统 VITE_SOCKET_URL=wss://server.gxwebsoft.com -VITE_SERVER_URL=https://server.gxwebsoft.com/api +VITE_SERVER_URL=https://gxtyzx-server.websoft.top/api +VITE_API_URL=https://gxtyzx-modules.websoft.top/api VITE_THINK_URL=https://gxtyzx-api.websoft.top/api -VITE_API_URL=https://modules.gxwebsoft.com/api -#VITE_SERVER_URL=http://127.0.0.1:9090/api -#VITE_API_URL=http://127.0.0.1:9001/api -#VITE_THINK_URL=http://127.0.0.1:9099/api diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..9ae2fa3 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/api/booking/userInvoice/index.ts b/src/api/booking/userInvoice/index.ts index 26bac16..e64adfd 100644 --- a/src/api/booking/userInvoice/index.ts +++ b/src/api/booking/userInvoice/index.ts @@ -1,14 +1,15 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { UserInvoice, UserInvoiceParam } from './model'; -import { MODULES_API_URL } from '@/config/setting'; +import { THINK_API_URL } from '@/config/setting'; +import type {ThinkInvoice} from "@/api/think/thinkInvoice/model"; /** * 分页查询发票 */ export async function pageUserInvoice(params: UserInvoiceParam) { const res = await request.get>>( - MODULES_API_URL + '/booking/user-invoice/page', + THINK_API_URL + '/booking/booking-user-invoice/page', { params } @@ -24,7 +25,7 @@ export async function pageUserInvoice(params: UserInvoiceParam) { */ export async function listUserInvoice(params?: UserInvoiceParam) { const res = await request.get>( - MODULES_API_URL + '/booking/user-invoice', + THINK_API_URL + '/booking/booking-user-invoice', { params } @@ -40,7 +41,7 @@ export async function listUserInvoice(params?: UserInvoiceParam) { */ export async function addUserInvoice(data: UserInvoice) { const res = await request.post>( - MODULES_API_URL + '/booking/user-invoice', + THINK_API_URL + '/booking/booking-user-invoice', data ); if (res.data.code === 0) { @@ -54,7 +55,7 @@ export async function addUserInvoice(data: UserInvoice) { */ export async function updateUserInvoice(data: UserInvoice) { const res = await request.put>( - MODULES_API_URL + '/booking/user-invoice', + THINK_API_URL + '/booking/booking-user-invoice', data ); if (res.data.code === 0) { @@ -68,7 +69,7 @@ export async function updateUserInvoice(data: UserInvoice) { */ export async function removeUserInvoice(id?: number) { const res = await request.delete>( - MODULES_API_URL + '/booking/user-invoice/' + id + THINK_API_URL + '/booking/booking-user-invoice/' + id ); if (res.data.code === 0) { return res.data.message; @@ -81,7 +82,7 @@ export async function removeUserInvoice(id?: number) { */ export async function removeBatchUserInvoice(data: (number | undefined)[]) { const res = await request.delete>( - MODULES_API_URL + '/booking/user-invoice/batch', + THINK_API_URL + '/booking/booking-user-invoice/batch', { data } @@ -97,7 +98,7 @@ export async function removeBatchUserInvoice(data: (number | undefined)[]) { */ export async function getUserInvoice(id: number) { const res = await request.get>( - MODULES_API_URL + '/booking/user-invoice/' + id + THINK_API_URL + '/booking/booking-user-invoice/' + id ); if (res.data.code === 0 && res.data.data) { return res.data.data; @@ -108,9 +109,9 @@ export async function getUserInvoice(id: number) { /** * 开具发票 */ -export async function doInvoice(data: UserInvoice) { +export async function doInvoice(data: ThinkInvoice) { const res = await request.post>( - MODULES_API_URL + '/booking/user-invoice/doInvoice', + THINK_API_URL + '/think/think-invoice/doInvoice', data ); if (res.data.code === 0) { @@ -123,9 +124,9 @@ export async function doInvoice(data: UserInvoice) { /** * 根据orderNo查询发票 */ -export async function showInvoice(orderNo: string) { +export async function showInvoice(id: number) { const res = await request.get>( - MODULES_API_URL + '/booking/user-invoice/showInvoice/' + orderNo + THINK_API_URL + `/think/think-invoice/showInvoice/${id}` ); if (res.data.code === 0 && res.data.data) { return res.data.data; diff --git a/src/api/shop/cart/index.ts b/src/api/shop/cart/index.ts index 3c7dc94..0bc90ae 100644 --- a/src/api/shop/cart/index.ts +++ b/src/api/shop/cart/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import type {ApiResult, PageResult} from '@/api'; -import {MODULES_API_URL} from '@/config/setting'; +import {THINK_API_URL} from '@/config/setting'; import type {Cart, CartParam, CartVo} from "@/api/shop/cart/model"; import type {Merchant} from "@/api/shop/merchant/model"; @@ -9,7 +9,7 @@ import type {Merchant} from "@/api/shop/merchant/model"; */ export async function pageCart(params: CartParam) { const res = await request.get>>( - MODULES_API_URL + '/shop/cart/page', + THINK_API_URL + '/shop/cart/page', { params } @@ -25,7 +25,7 @@ export async function pageCart(params: CartParam) { */ export async function listCart(params?: CartParam) { const res = await request.get>( - MODULES_API_URL + '/shop/cart', + THINK_API_URL + '/shop/cart', { params } @@ -41,7 +41,7 @@ export async function listCart(params?: CartParam) { */ export async function addCart(data: Cart) { const res = await request.post>( - MODULES_API_URL + '/shop/cart', + THINK_API_URL + '/shop/cart', data ); console.log(res) @@ -56,7 +56,7 @@ export async function addCart(data: Cart) { */ export async function updateCart(data: Cart) { const res = await request.put>( - MODULES_API_URL + '/shop/cart', + THINK_API_URL + '/shop/cart', data ); if (res.data.code === 0) { @@ -70,7 +70,7 @@ export async function updateCart(data: Cart) { */ export async function removeCart(id?: number) { const res = await request.delete>( - MODULES_API_URL + '/shop/cart/' + id + THINK_API_URL + '/shop/cart/' + id ); if (res.data.code === 0) { return res.data.message; @@ -81,7 +81,7 @@ export async function removeCart(id?: number) { // 按店铺ID更新选中 export async function updateCartByMerchantId(id?: number) { const res = await request.put>( - MODULES_API_URL + '/shop/cart/updateCartByMerchantId/' + id + THINK_API_URL + '/shop/cart/updateCartByMerchantId/' + id ); if (res.data.code === 0) { return res.data.message; @@ -93,7 +93,7 @@ export async function updateCartByMerchantId(id?: number) { // 全选操作 export async function onSelectAll(yes: Boolean) { const res = await request.put>( - MODULES_API_URL + '/shop/cart/onSelectAll/' + yes + THINK_API_URL + '/shop/cart/onSelectAll/' + yes ); if (res.data.code === 0) { return res.data; @@ -105,7 +105,7 @@ export async function onSelectAll(yes: Boolean) { * 批量修改 */ export async function updateBatchCart(data: Cart[]) { - const res = await request.put>(MODULES_API_URL + '/shop/cart/batch', data); + const res = await request.put>(THINK_API_URL + '/shop/cart/batch', data); if (res.data.code === 0) { return res.data.message; } @@ -117,7 +117,7 @@ export async function updateBatchCart(data: Cart[]) { */ export async function removeBatchCart(data: (number | undefined)[]) { const res = await request.delete>( - MODULES_API_URL + '/shop/cart/batch', + THINK_API_URL + '/shop/cart/batch', data ); if (res.data.code === 0) { @@ -131,7 +131,7 @@ export async function removeBatchCart(data: (number | undefined)[]) { */ export async function getCart(id: number) { const res = await request.get>( - MODULES_API_URL + '/shop/cart/' + id + THINK_API_URL + '/shop/cart/' + id ); if (res.data.code === 0 && res.data.data) { return res.data.data; @@ -144,7 +144,7 @@ export async function getCart(id: number) { */ export async function myCart(params: CartParam) { const res = await request.get>( - MODULES_API_URL + '/shop/cart/myCart', + THINK_API_URL + '/shop/cart/myCart', { params } diff --git a/src/api/think/thinkCard/index.ts b/src/api/think/thinkCard/index.ts index b384b09..ca62937 100644 --- a/src/api/think/thinkCard/index.ts +++ b/src/api/think/thinkCard/index.ts @@ -123,8 +123,9 @@ export async function bindCard(data: ThinkCard) { THINK_API_URL + '/think/think-card/bindCard', data ); - if (res.data.code === 0 && res.data.data) { - return res.data.data; + console.log('res.data.code', res.data.code) + if (res.data.code === 0) { + return res.data; } return Promise.reject(new Error(res.data.message)); } diff --git a/src/api/think/thinkCardsBills/index.ts b/src/api/think/thinkCardsBills/index.ts new file mode 100644 index 0000000..73cc1f0 --- /dev/null +++ b/src/api/think/thinkCardsBills/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ThinkCardsBills, ThinkCardsBillsParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询Vip卡每日账单 + */ +export async function pageThinkCardsBills(params: ThinkCardsBillsParam) { + const res = await request.get>>( + MODULES_API_URL + '/think/think-cards-bills/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询Vip卡每日账单列表 + */ +export async function listThinkCardsBills(params?: ThinkCardsBillsParam) { + const res = await request.get>( + MODULES_API_URL + '/think/think-cards-bills', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加Vip卡每日账单 + */ +export async function addThinkCardsBills(data: ThinkCardsBills) { + const res = await request.post>( + MODULES_API_URL + '/think/think-cards-bills', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改Vip卡每日账单 + */ +export async function updateThinkCardsBills(data: ThinkCardsBills) { + const res = await request.put>( + MODULES_API_URL + '/think/think-cards-bills', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除Vip卡每日账单 + */ +export async function removeThinkCardsBills(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/think/think-cards-bills/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除Vip卡每日账单 + */ +export async function removeBatchThinkCardsBills(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/think/think-cards-bills/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询Vip卡每日账单 + */ +export async function getThinkCardsBills(id: number) { + const res = await request.get>( + MODULES_API_URL + '/think/think-cards-bills/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/think/thinkCardsBills/model/index.ts b/src/api/think/thinkCardsBills/model/index.ts new file mode 100644 index 0000000..1e6d650 --- /dev/null +++ b/src/api/think/thinkCardsBills/model/index.ts @@ -0,0 +1,35 @@ +import type { PageParam } from '@/api'; + +/** + * Vip卡每日账单 + */ +export interface ThinkCardsBills { + // + id?: number; + // + uid?: number; + // + cid?: number; + // + date?: string; + // + amount?: string; + // 租户id + tenantId?: number; + // 状态, 0已发布, 1待审核 2已驳回 3违规内容 + status?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 创建时间 + createTime?: string; + // 修改时间 + updateTime?: string; +} + +/** + * Vip卡每日账单搜索条件 + */ +export interface ThinkCardsBillsParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/api/think/thinkDeposit/index.ts b/src/api/think/thinkDeposit/index.ts index 72f9a97..c3036c9 100644 --- a/src/api/think/thinkDeposit/index.ts +++ b/src/api/think/thinkDeposit/index.ts @@ -44,7 +44,7 @@ export async function addThinkDeposit(data: ThinkDeposit) { data ); if (res.data.code === 0) { - return res.data.message; + return res.data.data; } return Promise.reject(new Error(res.data.message)); } diff --git a/src/api/think/thinkDepositItem/index.ts b/src/api/think/thinkDepositItem/index.ts new file mode 100644 index 0000000..06b3527 --- /dev/null +++ b/src/api/think/thinkDepositItem/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ThinkDepositItem, ThinkDepositItemParam } from './model'; +import { THINK_API_URL } from '@/config/setting'; + +/** + * 分页查询押金物品 + */ +export async function pageThinkDepositItem(params: ThinkDepositItemParam) { + const res = await request.get>>( + THINK_API_URL + '/think/think-deposit-item/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询押金物品列表 + */ +export async function listThinkDepositItem(params?: ThinkDepositItemParam) { + const res = await request.get>( + THINK_API_URL + '/think/think-deposit-item', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加押金物品 + */ +export async function addThinkDepositItem(data: ThinkDepositItem) { + const res = await request.post>( + THINK_API_URL + '/think/think-deposit-item', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改押金物品 + */ +export async function updateThinkDepositItem(data: ThinkDepositItem) { + const res = await request.put>( + THINK_API_URL + '/think/think-deposit-item', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除押金物品 + */ +export async function removeThinkDepositItem(id?: number) { + const res = await request.delete>( + THINK_API_URL + '/think/think-deposit-item/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除押金物品 + */ +export async function removeBatchThinkDepositItem(data: (number | undefined)[]) { + const res = await request.delete>( + THINK_API_URL + '/think/think-deposit-item/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询押金物品 + */ +export async function getThinkDepositItem(id: number) { + const res = await request.get>( + THINK_API_URL + '/think/think-deposit-item/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/think/thinkDepositItem/model/index.ts b/src/api/think/thinkDepositItem/model/index.ts new file mode 100644 index 0000000..ce7210d --- /dev/null +++ b/src/api/think/thinkDepositItem/model/index.ts @@ -0,0 +1,27 @@ +import type { PageParam } from '@/api'; + +/** + * 押金物品 + */ +export interface ThinkDepositItem { + // + id?: number; + // + title?: string; + // + amount?: string; + // + siteName?: string; + // 创建时间 + createTime?: number; + // 租户id + tenantId?: number; +} + +/** + * 押金物品搜索条件 + */ +export interface ThinkDepositItemParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/api/think/thinkGoodsOrder/index.ts b/src/api/think/thinkGoodsOrder/index.ts index 5ad4d42..fdc9de8 100644 --- a/src/api/think/thinkGoodsOrder/index.ts +++ b/src/api/think/thinkGoodsOrder/index.ts @@ -44,7 +44,7 @@ export async function addThinkGoodsOrder(data: ThinkGoodsOrder) { data ); if (res.data.code === 0) { - return res.data.message; + return res.data.data; } return Promise.reject(new Error(res.data.message)); } diff --git a/src/api/think/thinkInvoice/index.ts b/src/api/think/thinkInvoice/index.ts index 0e63e45..028bdb2 100644 --- a/src/api/think/thinkInvoice/index.ts +++ b/src/api/think/thinkInvoice/index.ts @@ -44,7 +44,7 @@ export async function addThinkInvoice(data: ThinkInvoice) { data ); if (res.data.code === 0) { - return res.data.message; + return res.data; } return Promise.reject(new Error(res.data.message)); } diff --git a/src/api/think/thinkMachineOpenLog/index.ts b/src/api/think/thinkMachineOpenLog/index.ts new file mode 100644 index 0000000..73d51ae --- /dev/null +++ b/src/api/think/thinkMachineOpenLog/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ThinkMachineOpenLog, ThinkMachineOpenLogParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询闸机开门记录 + */ +export async function pageThinkMachineOpenLog(params: ThinkMachineOpenLogParam) { + const res = await request.get>>( + MODULES_API_URL + '/think/think-machine-open-log/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询闸机开门记录列表 + */ +export async function listThinkMachineOpenLog(params?: ThinkMachineOpenLogParam) { + const res = await request.get>( + MODULES_API_URL + '/think/think-machine-open-log', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加闸机开门记录 + */ +export async function addThinkMachineOpenLog(data: ThinkMachineOpenLog) { + const res = await request.post>( + MODULES_API_URL + '/think/think-machine-open-log', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改闸机开门记录 + */ +export async function updateThinkMachineOpenLog(data: ThinkMachineOpenLog) { + const res = await request.put>( + MODULES_API_URL + '/think/think-machine-open-log', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除闸机开门记录 + */ +export async function removeThinkMachineOpenLog(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/think/think-machine-open-log/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除闸机开门记录 + */ +export async function removeBatchThinkMachineOpenLog(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/think/think-machine-open-log/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询闸机开门记录 + */ +export async function getThinkMachineOpenLog(id: number) { + const res = await request.get>( + MODULES_API_URL + '/think/think-machine-open-log/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/think/thinkMachineOpenLog/model/index.ts b/src/api/think/thinkMachineOpenLog/model/index.ts new file mode 100644 index 0000000..c488981 --- /dev/null +++ b/src/api/think/thinkMachineOpenLog/model/index.ts @@ -0,0 +1,31 @@ +import type { PageParam } from '@/api'; + +/** + * 闸机开门记录 + */ +export interface ThinkMachineOpenLog { + // + id?: number; + // + orderId?: number; + // 租户id + tenantId?: number; + // 备注 + comments?: string; + // 状态, 0在线, 1离线 + status?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 注册时间 + createTime?: string; + // 修改时间 + updateTime?: string; +} + +/** + * 闸机开门记录搜索条件 + */ +export interface ThinkMachineOpenLogParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/api/think/thinkOrder/index.ts b/src/api/think/thinkOrder/index.ts index cedb117..d87bcca 100644 --- a/src/api/think/thinkOrder/index.ts +++ b/src/api/think/thinkOrder/index.ts @@ -105,6 +105,16 @@ export async function getThinkOrder(id: number) { return Promise.reject(new Error(res.data.message)); } +export async function getThinkOrderByCode(code: string) { + const res = await request.get>( + THINK_API_URL + `/think/think-order/by-code/${code}` + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + export async function thinkOrderRepay(data: ThinkOrder) { const res = await request.post>( THINK_API_URL + '/think/think-order/repay', data diff --git a/src/api/think/thinkUsersVip/index.ts b/src/api/think/thinkUsersVip/index.ts index 5f60760..4448525 100644 --- a/src/api/think/thinkUsersVip/index.ts +++ b/src/api/think/thinkUsersVip/index.ts @@ -104,6 +104,7 @@ export async function getThinkUsersVip(id: number) { } return Promise.reject(new Error(res.data.message)); } + export async function thinkUsersVipRepay(data: any) { const res = await request.post>( THINK_API_URL + '/think/think-users-vip/repay', data @@ -113,3 +114,13 @@ export async function thinkUsersVipRepay(data: any) { } return Promise.reject(new Error(res.data.message)); } + +export async function thinkUsersVipLog(id: number) { + const res = await request.get>( + THINK_API_URL + `/think/think-users-vip/log/${id}` + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/think/thinkVipCardsBills/index.ts b/src/api/think/thinkVipCardsBills/index.ts new file mode 100644 index 0000000..56b50cd --- /dev/null +++ b/src/api/think/thinkVipCardsBills/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ThinkVipCardsBills, ThinkVipCardsBillsParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询Vip卡每日账单 + */ +export async function pageThinkVipCardsBills(params: ThinkVipCardsBillsParam) { + const res = await request.get>>( + MODULES_API_URL + '/think/think-vip-cards-bills/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询Vip卡每日账单列表 + */ +export async function listThinkVipCardsBills(params?: ThinkVipCardsBillsParam) { + const res = await request.get>( + MODULES_API_URL + '/think/think-vip-cards-bills', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加Vip卡每日账单 + */ +export async function addThinkVipCardsBills(data: ThinkVipCardsBills) { + const res = await request.post>( + MODULES_API_URL + '/think/think-vip-cards-bills', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改Vip卡每日账单 + */ +export async function updateThinkVipCardsBills(data: ThinkVipCardsBills) { + const res = await request.put>( + MODULES_API_URL + '/think/think-vip-cards-bills', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除Vip卡每日账单 + */ +export async function removeThinkVipCardsBills(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/think/think-vip-cards-bills/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除Vip卡每日账单 + */ +export async function removeBatchThinkVipCardsBills(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/think/think-vip-cards-bills/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询Vip卡每日账单 + */ +export async function getThinkVipCardsBills(id: number) { + const res = await request.get>( + MODULES_API_URL + '/think/think-vip-cards-bills/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/think/thinkVipCardsBills/model/index.ts b/src/api/think/thinkVipCardsBills/model/index.ts new file mode 100644 index 0000000..b07ee1d --- /dev/null +++ b/src/api/think/thinkVipCardsBills/model/index.ts @@ -0,0 +1,35 @@ +import type { PageParam } from '@/api'; + +/** + * Vip卡每日账单 + */ +export interface ThinkVipCardsBills { + // + id?: number; + // + uid?: number; + // + vid?: number; + // + date?: string; + // + amount?: string; + // 租户id + tenantId?: number; + // 状态, 0已发布, 1待审核 2已驳回 3违规内容 + status?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 创建时间 + createTime?: string; + // 修改时间 + updateTime?: string; +} + +/** + * Vip卡每日账单搜索条件 + */ +export interface ThinkVipCardsBillsParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/package.json b/src/package.json index 4d7186c..3850b0a 100644 --- a/src/package.json +++ b/src/package.json @@ -12,6 +12,7 @@ "@types/socket.io-client": "^3.0.0", "@vitejs/plugin-vue": "^5.0.5", "autoprefixer": "^9.8.8", + "coordtransform": "^2.1.2", "crypto-js": "^4.2.0", "dayjs": "^1.11.11", "decimal.js": "^10.4.3", @@ -28,6 +29,5 @@ "repository": {}, "author": "", "license": "ISC", - "displayName": "websoft-app", - "devDependencies": {} + "displayName": "websoft-app" } diff --git a/src/package/article/index.vue b/src/package/article/index.vue index 68ab5b2..10c9173 100644 --- a/src/package/article/index.vue +++ b/src/package/article/index.vue @@ -7,7 +7,7 @@ - + diff --git a/src/package/booking/checkout.vue b/src/package/booking/checkout.vue index a1873b9..a3a0edc 100644 --- a/src/package/booking/checkout.vue +++ b/src/package/booking/checkout.vue @@ -5,62 +5,64 @@ - - + + + + + + + + + + + 可预约 - - - - - 可预约 - - - - 已出售 - - - - 我的选择 - - - - 已预定半场 - + + + 已出售 - - - - - {{ item.timePeriod }} - - - - {{ field.name }} - {{ item.price }}元 - - - - - - - - 18:00 - 20:00 + + + 我的选择 + + + + 已预定半场 + + + + + + + {{ item.timePeriod }} - - 1号场地 - 580元 - - - 2号场地 - 580元 - - - 3号场地 - 580元 - + + + {{ field.name }} + {{ isHalf !== 1 ? item.price : item.halfPrice }}元 + + + + + + + + 18:00 - 20:00 + + + 1号场地 + 580元 + + + 2号场地 + 580元 + + + 3号场地 + 580元 @@ -180,7 +182,7 @@ export default { } }, onLoad(option) { - this.merchantId = option.id + this.merchantId = parseInt(option.id) this.reload(); }, onShow() { @@ -194,7 +196,8 @@ export default { const app = this let totalPrice = 0; app.selection.map(d => { - totalPrice = totalPrice + d.price + if (app.isHalf === 1) totalPrice += d.halfPrice + else totalPrice += d.price }) carStore.totalPrice = totalPrice console.log('totalPrice: ', totalPrice); @@ -256,7 +259,9 @@ export default { }, setDateList() { this.next7day = [] - for (let i = 0; i < 7; i++) { + let day = 7 + if (this.merchantId === 37) day = 7 + for (let i = 0; i < day; i++) { const day = dayjs().add(i, 'day') this.next7day.push({ week: day.format('d') === '0' ? '7' : day.format('d'), @@ -276,8 +281,14 @@ export default { this.periodList = [] this.timeList.forEach(item => { const weekList = JSON.parse(item.week) - if (weekList.includes(this.week) && dayjs().isBefore(dayjs(this.dateTime + ' ' + item.timePeriod.split(' - ')[0]))) this.periodList.push(item) + if (parseInt(this.merchantId) === 37) { + const today = dayjs().format('YYYY-MM-DD') + if (dayjs().isBefore(dayjs(today + ' 21:00:00')) || dayjs(this.dateTime).isAfter(dayjs())) this.periodList.push(item) + } else { + if (weekList.includes(this.week) && dayjs().isBefore(dayjs(this.dateTime + ' ' + item.timePeriod.split(' - ')[0]))) this.periodList.push(item) + } }) + // console.log(this.periodList) }, onDisabled() { this.disabled = !this.disabled; @@ -305,7 +316,7 @@ export default { }, async getFieldList() { if (!this.periodList.length) { - return uni.showToast({ + return uni.showToast({ title: '暂无可预订场地', icon: 'none' }) @@ -324,53 +335,6 @@ export default { periodVoList }) }, - getBookingPeriod() { - const { - serverTime, - merchantId - } = this - const now = new Date(); - const hours = now.getHours(); - const minutes = now.getMinutes() - const week = this.week == 0 ? 7 : this.week - let startTime; - startTime = serverTime.today == this.dateTime ? String(hours) + String(minutes) : undefined - // 游泳馆当前21:30前都可以预定 - if (merchantId === '3028' && Number(startTime) < 2130) { - startTime = undefined - } - - PeriodApi.listPeriod({ - merchantId: this.merchantId, - isStatus: 0, - week, - dateTime: `${this.dateTime}`, - startTime, - half: this.isHalf - }).then(list => { - this.periodList = list; - uni.hideLoading() - }).catch(err => { - this.periodList = []; - uni.showToast({ - title: err.message, - icon: 'none' - }) - uni.hideLoading() - if (err.message === '您还有未支付订单,请先支付') { - setTimeout(() => { - return uni.switchTab({ - url: '/pages/order/order' - }); - }, 1000) - } - }) - }, - callPhone(phone) { - uni.makePhoneCall({ - phoneNumber: phone - }); - }, openCarInfo() { // this.showCarInfo = !this.showCarInfo; // 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center'] @@ -380,8 +344,11 @@ export default { this.$refs.popup.close() }, onField(field, item) { + const timePeriod = item.timePeriod + const checkTimePeriod = field.periodVoList.find(d => (d.period === timePeriod && d.id === item.id)) + // console.log('here', field, item) // 已被预定 - if (field.sold) { + if (checkTimePeriod.sold) { return } const app = this @@ -402,6 +369,7 @@ export default { }) return false } + // console.log(field) const split = item.timePeriod.split(' - ') const siteTime = field.periodVoList.find(d => d.period === item.timePeriod) // 添加到购物车 @@ -412,11 +380,12 @@ export default { fieldId: field.id, fieldName: field.name, price: item.price, + halfPrice: item.halfPrice, childrenPrice: item.childrenPrice, adultNum: 1, childrenNum: 0, siteName: merchant.name, - isChildren: item.isChildren, + isChildren: 2, isHalf: this.isHalf, type: this.type, timePeriod: item.timePeriod, @@ -428,7 +397,7 @@ export default { dateTime: `${this.dateTime}`, comments: `${this.dateTime}(${getWeek(week)})${item.timePeriod}`, }) - console.log(app.selection); + // console.log(app.selection); // console.log('period: ', period); // 是否支持儿童票 // console.log('item.isChildren: ', item.isChildren); @@ -448,7 +417,10 @@ export default { }, isActive(field, item) { const index = this.selection.find(d => d.key === getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${field.id}`)) - if (item.sold) { + const timePeriod = item.timePeriod + const checkTimePeriod = field.periodVoList.find(d => (d.period === timePeriod && d.id === item.id)) + // console.log('checkTimePeriod', checkTimePeriod, timePeriod) + if (checkTimePeriod && checkTimePeriod.sold) { if (item.isHalf === 1) { return 'web-bg-warning' } @@ -467,6 +439,7 @@ export default { uni.navigateTo({ url: '/package/booking/confirm', success: (res) => { + console.log(this.selection) res.eventChannel.emit('data', this.selection) } }) diff --git a/src/package/booking/confirm.vue b/src/package/booking/confirm.vue index bd61fe3..6102ce0 100644 --- a/src/package/booking/confirm.vue +++ b/src/package/booking/confirm.vue @@ -25,15 +25,8 @@ - - - - - - {{ item.name }} - - ¥{{ item.price }} - - - - ¥{{ item.price }} - - - - - - - - - - - + + + + - + + + + + + + + + + + @@ -103,7 +88,38 @@ - + + + + + + + + + + + + + + + + + + + + @@ -161,23 +177,26 @@ diff --git a/src/package/goods/detail.vue b/src/package/goods/detail.vue index 6b50e8c..996bd3e 100644 --- a/src/package/goods/detail.vue +++ b/src/package/goods/detail.vue @@ -1,7 +1,7 @@ - + @@ -9,17 +9,17 @@ ¥ - {{ form.price }} + {{ form.minPrice }} - - 划线价¥{{ form.price * 2 }} - + + + - {{ form.goodsName }} + {{ form.title }} @@ -32,49 +32,49 @@ - - - - - 可选 - - - - - - - 已选 - - - - - - - - - - - 配送 - 啦啦 - - - - - - - - - - 保障 - 坏了包赔 假一赔十 七天无理由 - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -202,6 +202,7 @@ import UvAvatar from "@/uni_modules/uv-avatar/components/uv-avatar/uv-avatar.vue import UvGap from "@/uni_modules/uv-gap/components/uv-gap/uv-gap.vue"; import UvButton from "@/uni_modules/uv-button/components/uv-button/uv-button.vue"; import UvText from "@/uni_modules/uv-text/components/uv-text/uv-text.vue"; +import {getThinkGoods} from "@/api/think/thinkGoods"; const cartStore = useCartStore(); const { @@ -243,14 +244,17 @@ export default { type, isNew, dateTime, - options: [{ - icon: 'server-fill', - text: '客服' - }, { - icon: 'bag', - text: '购物车', - info: 0 - }], + options: [ + { + icon: 'server-fill', + text: '客服' + }, + { + icon: 'bag', + text: '购物车', + info: 0 + } + ], buttonGroup: [ { text: '加入购物车', @@ -291,37 +295,17 @@ export default { } } }); + this.form = await this.getGoods() + // this.form.content = this.formatRichText(this.form.content) + if (this.isLogin) { + this.cart = await this.listCart() + this.options[1].info = this.cart.reduce((sum, item) => sum + item.cartNum, 0) + } - // 请求数据 - Promise.all([app.getGoods(), app.listCart()]).then(data => { - const form = data[0] - form.content = this.formatRichText(form.content) - app.form = form; - cartStore.merchantId = form.merchantId - cartStore.merchantName = form.merchantName - cartStore.merchantCode = form.merchantCode - - // 修改标题 - uni.setNavigationBarTitle({ - title: form.goodsName - }) - // 加载场馆相册 - if (form.files) { - app.photo = JSON.parse(form.files) - } - - // 购物车信息 - app.cart = data[1] - console.log(app.cart.totalNums) - // 更新购物车角标 - if (app.cart?.totalNums) { - app.options[1].info = app.cart.totalNums - } - }) }, getGoods() { return new Promise((resolve, reject) => { - GoodsApi.getGoods(this.id).then(result => { + getThinkGoods(this.id).then(result => { resolve(result) }).catch(reject) }) @@ -353,55 +337,6 @@ export default { app.skuText = app.sku.join('、') } }, - // openBookingTel() { - // // 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center'] - // this.$refs.popup.open('center') - // }, - // closeBookingTel() { - // this.$refs.popup.close() - // }, - callPhone(phone) { - uni.makePhoneCall({ - phoneNumber: phone - }); - }, - onMap() { - uni.getLocation({ - type: 'gcj02', //返回可以用于uni.openLocation的经纬度 - success: function (res) { - console.log('返回可以用于uni.openLocation的经纬度: ', res); - const latitude = this.merchant.latitude; - const longitude = this.merchant.longitude; - uni.openLocation({ - latitude: latitude, - longitude: longitude, - success: function () { - console.log('success'); - } - }); - } - }); - }, - formatRichText(html) { - let newContent = html.replace(/]*>/gi, function (match, capture) { - match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, ''); - match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, ''); - match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, ''); - return match; - }); - newContent = newContent.replace(/style="[^"]+"/gi, function (match, capture) { - match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi, - 'max-width:100%;'); - return match; - }); - newContent = newContent.replace(/]*\/>/gi, ''); - newContent = newContent.replace(/\ { - app.reload() - uni.showToast({ - title: '添加成功', - icon: 'success' - }); - }).catch(res => { - uni.showToast({ - title: res.message, - icon: 'none' - }); - }) - return false - } + // if (form.specs === 0) { + CartApi.addCart(form).then(data => { + app.reload() + uni.showToast({ + title: '添加成功', + icon: 'success' + }); + }).catch(res => { + uni.showToast({ + title: res.message, + icon: 'none' + }); + }) + return false + // } // 多规格 - if (form.specs === 1) { - this.$refs.specForm.open('center'); - return false; - } + // if (form.specs === 1) { + // this.$refs.specForm.open('center'); + // return false; + // } return false; } // 立即购买 @@ -474,6 +415,7 @@ export default { this.$refs.specForm.open('center'); return false; } + form.price = form.minPrice; CartApi.addCart(form).then(cartId => { // 跳转页面 uni.navigateTo({ diff --git a/src/package/goods/order-detail.vue b/src/package/goods/order-detail.vue index a637a39..5b4b4f3 100644 --- a/src/package/goods/order-detail.vue +++ b/src/package/goods/order-detail.vue @@ -1,413 +1,399 @@ - - - - - - - - + + + + + + + + - + - - ¥{{ item.price }} - - - {{ item.comments }} - - - - x {{ item.totalNum }} + + ¥{{ item.goodsPrice }} - - - - - - - - - 合计:¥{{ form.totalPrice }} - 实付:¥{{ form.payPrice }} - - - - - - - - - - - - - - - - + + + + + + 合计:¥{{ form.totalPrice }} + 实付:¥{{ form.payPrice }} + + + + + + + + + 已取消 - - - 未支付 - - {{ orderStatus[form.orderStatus] }} - - - - - - - - - - - - - ¥ - - - - - - - + + + 未支付 + + {{ orderStatus[form.orderStatus] }} + + + + + + + + + + + + + ¥ + + + + + + + diff --git a/src/package/goods/order.vue b/src/package/goods/order.vue index 91cf521..00b90f8 100644 --- a/src/package/goods/order.vue +++ b/src/package/goods/order.vue @@ -1,7 +1,8 @@ - + @@ -9,45 +10,39 @@ - - - - - {{ item.merchantName }} - - - 已取消 - - - 已完成 + + 未支付 - 已支付 - - - 未支付 + + 已支付 + 待发货 + 待收货 + 已完成 + 退款中 + 退款拒绝 + 退款成功 + 已取消 - + - ¥{{sub.price}} - 共{{ item.totalNum }}件 + ¥{{ sub.goodsPrice }} @@ -61,12 +56,15 @@ - 取消订单 - 去支付 + 取消订单 + + 去支付 + - - - + + + @@ -91,15 +89,16 @@ - + \ No newline at end of file diff --git a/src/package/order/detail.vue b/src/package/order/detail.vue index a994476..011cb02 100644 --- a/src/package/order/detail.vue +++ b/src/package/order/detail.vue @@ -1,8 +1,10 @@ - - 核销码 + + {{ countDown }}秒后自动刷新 + + 核销码(每120秒刷新,点击二维码手动刷新) @@ -140,7 +142,9 @@ export default { current: 0, colorIndex: 0, activeColor: '#108001', - styleType: 'text' + styleType: 'text', + countDown: 120, + interval: null }; }, onLoad(option) { @@ -176,19 +180,7 @@ export default { uni.showLoading({ title: '数据读取中.' }); - OrderApi.getThinkOrder(orderId).then((data) => { - app.form = data; - - // 页面标题 - if (data.orderStatus === 1) { - uni.setNavigationBarTitle({ - title: '订单详情(已完成)' - }); - } - - uni.hideLoading(); - }); - + this.getOrder() // H5版网址 const h5_url = uni.getStorageSync('h5_url'); const tid = uni.getStorageSync('TenantId'); @@ -211,6 +203,34 @@ export default { return false; } }, + async getOrder() { + const app = this + if (this.interval) clearInterval(this.interval); + this.countDown = 120 + OrderApi.getThinkOrder(this.orderId).then((data) => { + app.form = data; + // 页面标题 + if (data.orderStatus === 1) { + uni.setNavigationBarTitle({ + title: '订单详情(已完成)' + }); + } + this.setCountDown() + uni.hideLoading(); + }); + }, + setCountDown() { + this.interval = setInterval(() => { + if (this.form.payStatus === 1 && this.form.orderStatus === 2) { + if (this.countDown > 0) { + this.countDown-- + } else { + clearInterval(this.interval) + this.getOrder() + } + }else clearInterval(this.interval) + }, 1000) + }, async openPay() { const orderInfo = await thinkOrderRepay({id: this.orderId}) const _this = this diff --git a/src/package/user/card-detail-merchant.vue b/src/package/user/card-detail-merchant.vue index 10990c5..28d9cf2 100644 --- a/src/package/user/card-detail-merchant.vue +++ b/src/package/user/card-detail-merchant.vue @@ -1,284 +1,149 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/src/package/user/card-detail-record.vue b/src/package/user/card-detail-record.vue index 90c0b2a..46023ac 100644 --- a/src/package/user/card-detail-record.vue +++ b/src/package/user/card-detail-record.vue @@ -1,76 +1,76 @@ - - - - - - - - - - + + + + + + + 已使用 + 未使用 + + + + + + + diff --git a/src/package/user/card.vue b/src/package/user/card.vue index 3315f1b..ef55a48 100644 --- a/src/package/user/card.vue +++ b/src/package/user/card.vue @@ -29,7 +29,7 @@ {{ item.month }}个月 --> 剩余{{ - item.number + item.num }}次 余额¥{{ diff --git a/src/package/user/depositList.vue b/src/package/user/depositList.vue new file mode 100644 index 0000000..a011cfe --- /dev/null +++ b/src/package/user/depositList.vue @@ -0,0 +1,159 @@ + + + + + + + {{ item.name }} + + + + + + 请选择押金项目 + + {{ item.title }} + ¥{{ item.amount }} + + + + 关闭 + + + + + + + + + + \ No newline at end of file diff --git a/src/package/user/guide.vue b/src/package/user/guide.vue new file mode 100644 index 0000000..8658633 --- /dev/null +++ b/src/package/user/guide.vue @@ -0,0 +1,70 @@ + + + + + + 场馆线路导航 + 查看广西体育中心内各个场馆的导航线路 + + + + + + + 公交交通线路导航 + 查看前往广西体育中心的公共交通线路 + + + + + + + + + + 驾车线路导航 + 一键导航至广西体育中心 + + + + + + \ No newline at end of file diff --git a/src/package/user/ic-card.vue b/src/package/user/ic-card.vue index f204141..d980ba9 100644 --- a/src/package/user/ic-card.vue +++ b/src/package/user/ic-card.vue @@ -8,13 +8,19 @@ - + + + + + + - + - + @@ -27,31 +33,31 @@ - + - + @@ -68,7 +74,9 @@ import {openUrl} from '@/utils/common'; import {useTenantStore} from '@/store/modules/tenant'; import {pad} from 'crypto-js'; -import {bindCard} from "@/api/think/thinkCard"; +import {bindCard, updateThinkCard} from "@/api/think/thinkCard"; +import {thinkUserInfo} from "@/api/think/thinkUsers"; +import {getThinkOrderByCode} from "@/api/think/thinkOrder"; const tenantStore = useTenantStore(); @@ -81,14 +89,14 @@ export default { statusBarHeight: 104, isLogin: false, form: { - name: '', - phone: '' + cardNum: '', + username: '', + phone: '', }, // 表单数据 formData: {}, fields: {}, logo: '', - bookingUser: {}, server: [], order: [] }; @@ -97,26 +105,22 @@ export default { this.reload(); }, methods: { + async getThinkUser() { + const res = await thinkUserInfo(); + this.formData.username = res.username; + this.formData.phone = res.phone; + }, async reload(e) { const app = this; - Api.pageThinkCard({}).then(res => { - console.log(res) - }) - // 当前登录用户信息 const userInfo = await userStore.fetchUserInfo(); if (Object.keys(userInfo).length > 0) { app.isLogin = true; app.userInfo = userInfo; + await this.getThinkUser() } else { app.isLogin = false; } - // 获取联系人列表 - // Api.pageEmergency({ - // userId: userInfo.userId - // }).then((res) => { - // app.list = res.list; - // }); }, navTo(item) { if (!this.isLogin) { @@ -135,41 +139,43 @@ export default { add() { this.$refs.addForm.open('center'); }, - onDel(item) { - const app = this; - uni.showModal({ - title: '确定要删除吗?', - success(o) { - if (o.confirm) { - uni.showLoading({ - title: '请求中.' - }); - // Api.removeEmergency(item.emergencyId).then((res) => { - // uni.showToast({ - // title: '操作成功', - // icon: 'none' - // }); - // }); - app.reload(); - } - } - }); - }, // 触发提交表单 submit() { - this.$refs.form.validate().then(res => { - Api.bindCard(this.formData).then(res => { - console.log(res) - }).catch(err => { + this.$refs.form.validate().then(async () => { + const res = await bindCard(this.formData).catch(err => { uni.showToast({ title: err.message, icon: 'none' }) - }); + }) + if (res) { + uni.showToast({ + title: '绑定成功', + icon: 'none' + }) + setTimeout(() => { + uni.navigateBack() + }, 1500) + } }).catch(err => { console.log('表单错误信息:', err); }) }, + scan() { + uni.scanCode({ + onlyFromCamera: true, + success: async ({result}) => { + this.formData.cardNum = result + }, + fail: (err) => { + uni.showToast({ + title: '扫码失败', + icon: 'none' + }) + } + }); + } + } }; diff --git a/src/package/user/invoice-edit.vue b/src/package/user/invoice-edit.vue index 1f97a23..c84aae6 100644 --- a/src/package/user/invoice-edit.vue +++ b/src/package/user/invoice-edit.vue @@ -1,268 +1,288 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/package/user/invoice-show.vue b/src/package/user/invoice-show.vue index b039e23..646ba14 100644 --- a/src/package/user/invoice-show.vue +++ b/src/package/user/invoice-show.vue @@ -1,14 +1,18 @@ - - - 复制发票链接 - + + + + 复制发票链接 + + diff --git a/src/package/user/invoice-type.vue b/src/package/user/invoice-type.vue index 9dfa8d3..6b1e30b 100644 --- a/src/package/user/invoice-type.vue +++ b/src/package/user/invoice-type.vue @@ -6,6 +6,7 @@ :cellStyle="{ padding: '5px 0' }" :border="false" @click="switchTabTo(`/pages/order`)" + icon="https://oss.wsdns.cn/20241206/eb94f79b4d9049999554e11bc355480e.png" > @@ -17,25 +18,26 @@ :title="`租赁发票`" :cellStyle="{ padding: '5px 0' }" :border="false" - @click="navTo(`/package/user/card`)" - > - - - - - - - + + + + + + + + + + + + diff --git a/src/package/user/invoice.vue b/src/package/user/invoice.vue index 023f4ac..a5f5b72 100644 --- a/src/package/user/invoice.vue +++ b/src/package/user/invoice.vue @@ -1,293 +1,320 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/package/user/invoiceRent.vue b/src/package/user/invoiceRent.vue new file mode 100644 index 0000000..597bbb0 --- /dev/null +++ b/src/package/user/invoiceRent.vue @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + ㎡ + + + + + 元 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/package/user/map.vue b/src/package/user/map.vue new file mode 100644 index 0000000..4116bd2 --- /dev/null +++ b/src/package/user/map.vue @@ -0,0 +1,37 @@ + + + + + + \ No newline at end of file diff --git a/src/package/user/phoneService.vue b/src/package/user/phoneService.vue new file mode 100644 index 0000000..3035bcf --- /dev/null +++ b/src/package/user/phoneService.vue @@ -0,0 +1,45 @@ + + + + + {{ item.dictDataName }} + {{ item.dictDataCode }} + + + + + + + + + + + \ No newline at end of file diff --git a/src/package/user/signUp.vue b/src/package/user/signUp.vue new file mode 100644 index 0000000..3384ad0 --- /dev/null +++ b/src/package/user/signUp.vue @@ -0,0 +1,52 @@ + + + + + + {{ hasSign ? '今日已签到' : '签到' }} + + + + + + \ No newline at end of file diff --git a/src/package/user/siteGuide.vue b/src/package/user/siteGuide.vue new file mode 100644 index 0000000..ade796a --- /dev/null +++ b/src/package/user/siteGuide.vue @@ -0,0 +1,76 @@ + + + + + + + {{ item.name }} + + + + + + + + + + \ No newline at end of file diff --git a/src/pages.json b/src/pages.json index d8be5db..28e539b 100644 --- a/src/pages.json +++ b/src/pages.json @@ -19,7 +19,8 @@ "path": "pages/order", "style": { "navigationBarTitleText": "我的订单", - "enablePullDownRefresh": false + "enablePullDownRefresh": false, + "navigationStyle": "custom" } }, { @@ -77,6 +78,13 @@ "enablePullDownRefresh": false } }, + { + "path": "user/invoiceRent", + "style": { + "navigationBarTitleText": "租赁发票开具", + "enablePullDownRefresh": false + } + }, { "path": "user/invoice-edit", "style": { @@ -182,6 +190,48 @@ "enablePullDownRefresh": false } }, + { + "path": "user/signUp", + "style": { + "navigationBarTitleText": "签到", + "enablePullDownRefresh": false + } + }, + { + "path": "user/depositList", + "style": { + "navigationBarTitleText": "场馆列表", + "enablePullDownRefresh": false + } + }, + { + "path": "user/siteGuide", + "style": { + "navigationBarTitleText": "场馆导航", + "enablePullDownRefresh": false + } + }, + { + "path": "user/guide", + "style": { + "navigationBarTitleText": "地图导航", + "enablePullDownRefresh": false + } + }, + { + "path": "user/map", + "style": { + "navigationBarTitleText": "地图导航", + "enablePullDownRefresh": false + } + }, + { + "path": "user/phoneService", + "style": { + "navigationBarTitleText": "电话客服", + "enablePullDownRefresh": false + } + }, { "path": "goods/index", "style": { @@ -290,6 +340,12 @@ "navigationBarTitleText": "订单详情" } }, + { + "path": "order/check", + "style": { + "navigationBarTitleText": "订单核销" + } + }, { "path": "course/index", "style": { diff --git a/src/pages/index.vue b/src/pages/index.vue index 64d5330..d19cd8b 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -34,36 +34,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 场地预定 @@ -73,7 +73,7 @@ - {{ item.name }} + {{ item.name }} @@ -95,7 +95,22 @@ - + + + + + 热门活动 + {{ activity.title }} + + + 立即查看 + + + + + + @@ -111,6 +126,7 @@ import Layout from "@/components/layout.vue"; import * as MenuIcons from '@/api/menu-icons.ts'; import {openUrl} from '@/utils/common'; import {listThinkSite} from "@/api/think/thinkSite"; +import {listArticle, pageArticle} from "@/api/cms/article"; const mpStore = useMpStore(); @@ -143,17 +159,40 @@ export default { hideTools: true, mp_menu_display_method: 0, openid: null, - siteList: [] + siteList: [], + activity: null, }; }, onLoad() { this.reload(); this.openid = uni.getStorageSync('openid'); }, + onShow() { + if (uni.getStorageSync('user_id') && uni.getStorageSync('access_token')) { + this.isLogin = true; + // console.log(this.isLogin) + } + }, methods: { + doLogin() { + this.isLogin = true; + this.reload() + }, + async getActivity() { + const res = await pageArticle({ + categoryId: 2454, + page: 1, + limit: 1, + status: 0, + }) + if (res.count > 0) { + this.activity = res.list[0] + this.$refs.popup.open() + } + }, async reload() { const app = this; - + this.getActivity() // 获取小程序信息包 const info = await mpStore.fetchMpInfo(); // 配置信息 @@ -162,29 +201,6 @@ export default { app.mpName = info.config.mpName // 登录状态 - if (uni.getStorageSync('user_id') && uni.getStorageSync('access_token')) { - app.isLogin = true; - if (!uni.getStorageSync('openid')) { - // 更新openid - // #ifdef MP-WEIXIN - uni.login({ - success: (res) => { - getWxOpenId({ - code: res.code - }).then((response) => { - uni.setStorageSync('openid', response.openid); - updateUsers({ - uid: app.userInfo.ouid, - openid: response.openid, - sessionKey: response.session_key, - unionid: response.unionid - }); - }); - } - }); - // #endif - } - } // 解析网站参数 if (info.fields) { @@ -337,6 +353,20 @@ export default { const json = JSON.parse(item.images); return json[0].url; }, + toArticle(articleId) { + this.openUrl(`/package/article/detail?articleId=${articleId}`); + this.$refs.popup.close() + }, + closeActivity(){ + this.$refs.popup.close() + } + + }, + onShareAppMessage() { + return { + title: '广西体育中心', + path: '/pages/index' + } } }; diff --git a/src/pages/order.vue b/src/pages/order.vue index 23a3ee9..75df003 100644 --- a/src/pages/order.vue +++ b/src/pages/order.vue @@ -4,12 +4,18 @@ - - + + + + + + - + @@ -19,92 +25,131 @@ - - - - - - {{ item.siteName }} - - - {{ item.siteNames }} - 待支付 - 已支付 - 已退款 - 已取消 - - - 已取消 - - - 已完成 - - - 已支付 - - - 未支付 + + + + {{ item.orderNum }} + 未支付 + 已支付,未退款 + 已退款 + + + {{ item.siteName }}-{{ item.info }} + ¥{{ item.money }} + + + {{ dayjs(item.createTime * 1000).format('YYYY-MM-DD HH:mm:ss') }} + + + + + + + + + + 订单号: {{ item.orderNum }} - - - - - - - - + + {{ item.siteNames }} + 待支付 + 已支付 + 已退款 + 已取消 + + + 已取消 - - - - - - - 合计:¥{{ item.totalPrice }} - - - 合计:¥{{ item.price }} + + 已完成 + + + 已支付 + + + 未支付 + + + + + + + + + + + + + + + + + 合计:¥{{ item.totalPrice }} + + + 合计:¥{{ item.price }} + - - - - - 取消订单 - - 立即支付 - - - - - 申请开票 - - 查看发票 - - - - - 取消订单 - - 立即支付 - - - - - 申请开票 - - 查看发票 - - - - - + + + + 取消订单 + + 立即支付 + + + + + 退款中 + + + {{ item.payType === 1 ? '退款成功' : '已取消' }} + + + {{ item.payType === 1 ? '申请退款' : '取消订单' }} + + + 核销码 + + + 申请开票 + + + 查看发票 + + + + + + 取消订单 + + 立即支付 + + + + + 申请开票 + + + 查看发票 + + + + + + + @@ -141,24 +186,34 @@ + \ No newline at end of file diff --git a/src/uni_modules/zeng-calen/package.json b/src/uni_modules/zeng-calen/package.json new file mode 100644 index 0000000..e03ca90 --- /dev/null +++ b/src/uni_modules/zeng-calen/package.json @@ -0,0 +1,85 @@ +{ + "id": "zeng-calen", + "displayName": "日历组件可选择周与月标记打卡支持左右切换", + "version": "1.0.5", + "description": "zeng-calen日历组件可选择周与月支持左右切换", + "keywords": [ + "日历", + "多选", + "单选", + "日期选择", + "标记打卡" +], + "repository": "", + "engines": { + "HBuilderX": "^3.4.2" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y", + "钉钉": "y", + "快手": "y", + "飞书": "y", + "京东": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/src/uni_modules/zeng-calen/readme.md b/src/uni_modules/zeng-calen/readme.md new file mode 100644 index 0000000..bfa6a5a --- /dev/null +++ b/src/uni_modules/zeng-calen/readme.md @@ -0,0 +1,69 @@ + + +### 代码块 + +直接引入就可以使用,代码如下: +```xml + + + + + + + + + + +``` +### +Calendar Props: + +| 属性名 | 类型 | 默认值 | 说明 | +| :----- | :--: | :-------: | :-------: | +| weekstart | Number | 0 | 星期几为第一天(0为星期日) | +| markDays | Array | null | 已标记的日期 | +| headerBar | Boolean | true | 是否展示月份切换按钮 | +| disabledAfter | Boolean | false | 过去日期是否不可点击 | +| actDay | Array | null | 接收用户选择的参数 | +| chooseDay | Array | null | 接受已经被选择的参数 | + +### +Calendar Events: + +| 事件 | 说明 | +| :----- | :--: | +| onDayClick | 选中的日期 | \ No newline at end of file diff --git a/src/utils/request.ts b/src/utils/request.ts index b872088..a6a4cae 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -1,7 +1,7 @@ import Request from 'luch-request' import { - SERVER_API_URL, - TENANT_ID + SERVER_API_URL, + TENANT_ID } from '@/config/setting'; const http = new Request(); @@ -10,56 +10,64 @@ const http = new Request(); * @param {Function} */ http.setConfig((config) => { - /* config 为默认全局配置*/ - config.baseURL = SERVER_API_URL; /* 根域名 */ + /* config 为默认全局配置*/ + config.baseURL = SERVER_API_URL; /* 根域名 */ - return config + return config }) // 拦截器(请求之前拦截) http.interceptors.request.use((config) => { // 可使用async await 做异步操作 - const token = uni.getStorageSync('access_token') - config.header = { - ...config.header, - TenantId: TENANT_ID - } - if (token) { - config.header.Authorization = token - } - if (config.data) { - config.data.tenantId = TENANT_ID - } - if (!token) { - // 如果token不存在,需要加签 - // config.params.tenantId = TENANT_ID - // config.params.sign = getSign(config.params, appSecret); - } - return config + const token = uni.getStorageSync('access_token') + config.header = { + ...config.header, + TenantId: TENANT_ID + } + if (token) { + config.header.Authorization = token + } + if (config.data) { + config.data.tenantId = TENANT_ID + } + if (!token) { + // 如果token不存在,需要加签 + // config.params.tenantId = TENANT_ID + // config.params.sign = getSign(config.params, appSecret); + } + return config }, config => { // 可使用async await 做异步操作 - return Promise.reject(config) + return Promise.reject(config) }) // 拦截器(请求之后拦截) http.interceptors.response.use((response) => { - /* 对响应成功做点什么 可使用async await 做异步操作*/ - // if (response.data.code !== 200) { // 服务端返回的状态码不等于200,则reject() - // return Promise.reject(response) // return Promise.reject 可使promise状态进入catch - // if (response.config.custom.verification) { // 演示自定义参数的作用 - // return response.data - // } + /* 对响应成功做点什么 可使用async await 做异步操作*/ + // if (response.data.code !== 200) { // 服务端返回的状态码不等于200,则reject() + // return Promise.reject(response) // return Promise.reject 可使promise状态进入catch + // if (response.config.custom.verification) { // 演示自定义参数的作用 + // return response.data + // } - // token过期 - if (response.data.code == 401) { - - } - if (response.data.code == 1) { - return Promise.reject(response.data) - } - return response + // token过期 + if (response.data.code == 401) { + uni.removeStorageSync('access_token') + uni.removeStorageSync('user_id') + uni.removeStorageSync('phone') + } + if (response.data.code == 1) { + return Promise.reject(response.data) + } + if (response.data.message === '请先登录') { + uni.removeStorageSync('access_token') + uni.removeStorageSync('user_id') + uni.removeStorageSync('phone') + return Promise.reject(response.data) + } + return response }, (response) => { - /* 对响应错误做点什么 (statusCode !== 200)*/ - console.log(response) - return Promise.reject(response) + /* 对响应错误做点什么 (statusCode !== 200)*/ + console.log(response) + return Promise.reject(response) }) export default http