fix: 代客下单问题修复,本地测试服链接修改,为解决部分接口自动添加了部分路由前缀导致404,部分接口前缀增加/

This commit is contained in:
YeMingfei666 2025-10-10 18:13:38 +08:00
parent 6be93661f4
commit 7ceca3b917
6 changed files with 118 additions and 103 deletions

View File

@ -8,13 +8,13 @@ VITE_APP_PORT=3000
# VITE_APP_API_URL=https://tapi.cashier.sxczgkj.cn/ # 测试 # VITE_APP_API_URL=https://tapi.cashier.sxczgkj.cn/ # 测试
# VITE_APP_API_URL=https://cashier.sxczgkj.com/ # 正式 # VITE_APP_API_URL=https://cashier.sxczgkj.com/ # 正式
VITE_APP_API_URL=http://192.168.1.31/ # 本地 VITE_APP_API_URL=http://192.168.1.42/ # 本地
# WebSocket 端点(不配置则关闭),线上 ws://api.youlai.tech/ws ,本地 ws://localhost:8989/ws # WebSocket 端点(不配置则关闭),线上 ws://api.youlai.tech/ws ,本地 ws://localhost:8989/ws
# VITE_APP_WS_ENDPOINT=wss://sockets.sxczgkj.com/wss # VITE_APP_WS_ENDPOINT=wss://sockets.sxczgkj.com/wss
# VITE_APP_WS_ENDPOINT=wss://czgeatws.sxczgkj.com/wss # 正式 # VITE_APP_WS_ENDPOINT=wss://czgeatws.sxczgkj.com/wss # 正式
VITE_APP_WS_ENDPOINT=ws://192.168.1.31:2348 # 本地 VITE_APP_WS_ENDPOINT=ws://192.168.1.42:2348 # 本地
# 启用 Mock 服务 # 启用 Mock 服务

View File

@ -34,8 +34,8 @@ vscode如果无代码提示
映射地址 映射地址
<https://fv901fw8033.vicp.fun/> <https://fv901fw8033.vicp.fun/>
1. 上传.zip文件解压到服务器的 /home/web下 1. ***cd /usr/share/nginx/html***
2. cd到/home/web 2. 上传.zip文件服务器的 /usr/share/nginx/html
3. 执行命令 3. 执行命令
```unzip -o dist.zip``` ```unzip -o dist.zip```

View File

@ -1,9 +1,9 @@
import request from "@/utils/request"; import request from "@/utils/request";
const baseURL = "account/admin/shopInfo"; const baseURL = "/account/admin/shopInfo";
const ShopApi = { const ShopApi = {
/** 获取店铺列表*/ /** 获取店铺列表*/
getList(params : PageQuery) { getList(params: PageQuery) {
return request<any, ShopInfoEditDTO[]>({ return request<any, ShopInfoEditDTO[]>({
url: `${baseURL}`, url: `${baseURL}`,
method: "get", method: "get",
@ -11,48 +11,48 @@ const ShopApi = {
}); });
}, },
/** 获取店铺分店列表*/ /** 获取店铺分店列表*/
getOtherShopList(params : PageQuery) { getOtherShopList(params: PageQuery) {
return request<any, ShopInfoEditDTO[]>({ return request<any, ShopInfoEditDTO[]>({
url: `${baseURL}/otherShop`, url: `${baseURL}/otherShop`,
method: "get", method: "get",
params: params, params: params,
}); });
}, },
getBranchList(params : PageQuery) { getBranchList(params: PageQuery) {
return request<any, ShopInfoEditDTO[]>({ return request<any, ShopInfoEditDTO[]>({
url: `${baseURL}/branchList`, url: `${baseURL}/branchList`,
method: "get", method: "get",
params: params, params: params,
}); });
}, },
getBranchChange(id : PageQuery) { getBranchChange(id: PageQuery) {
return request<any, ShopInfoEditDTO[]>({ return request<any, ShopInfoEditDTO[]>({
url: `${baseURL}/change/${id}`, url: `${baseURL}/change/${id}`,
method: "post", method: "post",
}); });
}, },
add(data : ShopInfoEditDTO) { add(data: ShopInfoEditDTO) {
return request<any, ShopInfoEditDTO>({ return request<any, ShopInfoEditDTO>({
url: `${baseURL}`, url: `${baseURL}`,
method: "post", method: "post",
data, data,
}); });
}, },
edit(data : ShopInfoEditDTO) { edit(data: ShopInfoEditDTO) {
return request<any, ShopInfoEditDTO>({ return request<any, ShopInfoEditDTO>({
url: `${baseURL}`, url: `${baseURL}`,
method: "put", method: "put",
data, data,
}); });
}, },
get(params : getRequest) { get(params: getRequest) {
return request<any, ShopInfo>({ return request<any, ShopInfo>({
url: `${baseURL}/detail`, url: `${baseURL}/detail`,
method: "get", method: "get",
params params
}); });
}, },
delete(params : any) { delete(params: any) {
return request({ return request({
url: `${baseURL}`, url: `${baseURL}`,
method: "delete", method: "delete",
@ -66,39 +66,39 @@ export interface getRequest {
/** /**
* id * id
*/ */
id ?: string | number; id?: string | number;
[property : string] : any; [property: string]: any;
} }
/** /**
* ShopInfoEditDTO * ShopInfoEditDTO
*/ */
export interface ShopInfoEditDTO { export interface ShopInfoEditDTO {
accountName ?: null | string; accountName?: null | string;
accountPwd ?: null | string; accountPwd?: null | string;
activateCode ?: null | string; activateCode?: null | string;
address ?: null | string; address?: null | string;
chainName ?: null | string; chainName?: null | string;
detail ?: null | string; detail?: null | string;
frontImg ?: null | string; frontImg?: null | string;
id : number | null; id: number | null;
lat ?: null | string; lat?: null | string;
lng ?: null | string; lng?: null | string;
logo ?: null | string; logo?: null | string;
phone ?: null | string; phone?: null | string;
profiles ?: null | string; profiles?: null | string;
roleId ?: number | null; roleId?: number | null;
shopName ?: null | string; shopName?: null | string;
shopType ?: null | string; shopType?: null | string;
[property : string] : any; [property: string]: any;
} }
export interface PageQuery { export interface PageQuery {
page : number; page: number;
shopName ?: string; shopName?: string;
size : number; size: number;
status ?: number; status?: number;
[property : string] : any; [property: string]: any;
} }
@ -109,193 +109,193 @@ export interface ShopInfo {
/** /**
* *
*/ */
address ?: null | string; address?: null | string;
/** /**
* *
*/ */
article ?: null | string; article?: null | string;
/** /**
* *
*/ */
backImg ?: null | string; backImg?: null | string;
/** /**
* *
*/ */
bindAccount ?: null | string; bindAccount?: null | string;
/** /**
* *
*/ */
bookingSms ?: null | string; bookingSms?: null | string;
/** /**
* () * ()
*/ */
businessEndDay ?: null | string; businessEndDay?: null | string;
/** /**
* () * ()
*/ */
businessStartDay ?: null | string; businessStartDay?: null | string;
/** /**
* *
*/ */
businessTime ?: null | string; businessTime?: null | string;
/** /**
* *
*/ */
chainName ?: null | string; chainName?: null | string;
/** /**
* *
*/ */
cities ?: null | string; cities?: null | string;
/** /**
* all- vip- * all- vip-
*/ */
consumeColony ?: null | string; consumeColony?: null | string;
/** /**
* *
*/ */
contactName ?: null | string; contactName?: null | string;
/** /**
* *
*/ */
coverImg ?: null | string; coverImg?: null | string;
createTime ?: null | string; createTime?: null | string;
/** /**
* *
*/ */
detail ?: null | string; detail?: null | string;
/** /**
* / * /
*/ */
districts ?: null | string; districts?: null | string;
/** /**
* dine-in take-out * dine-in take-out
*/ */
eatModel ?: null | string; eatModel?: null | string;
/** /**
* *
*/ */
expireTime ?: null | string; expireTime?: null | string;
/** /**
* *
*/ */
frontImg ?: null | string; frontImg?: null | string;
/** /**
* 使 sys_user id * 使 sys_user id
*/ */
id ?: number | null; id?: number | null;
/** /**
* *
*/ */
isAccountPay ?: number | null; isAccountPay?: number | null;
/** /**
* 1 0 * 1 0
*/ */
isCustomAmount ?: number | null; isCustomAmount?: number | null;
/** /**
* 1 0 * 1 0
*/ */
isMemberInPwd ?: number | null; isMemberInPwd?: number | null;
/** /**
* 01 * 01
*/ */
isMemberPrice ?: number | null; isMemberPrice?: number | null;
/** /**
* 退 1 0 * 退 1 0
*/ */
isMemberReturnPwd ?: number | null; isMemberReturnPwd?: number | null;
/** /**
* 退 1 0 * 退 1 0
*/ */
isReturnPwd ?: number | null; isReturnPwd?: number | null;
/** /**
* 01 * 01
*/ */
isTableFee ?: number | null; isTableFee?: number | null;
/** /**
* *
*/ */
lat ?: null | string; lat?: null | string;
/** /**
* *
*/ */
lng ?: null | string; lng?: null | string;
/** /**
* logo * logo
*/ */
logo ?: null | string; logo?: null | string;
/** /**
* id * id
*/ */
mainId ?: number | null; mainId?: number | null;
/** /**
* 0 1 2 * 0 1 2
*/ */
onSale ?: number | null; onSale?: number | null;
/** /**
* *
*/ */
operationPwd ?: null | string; operationPwd?: null | string;
/** /**
* *
*/ */
paymentQrcode ?: null | string; paymentQrcode?: null | string;
/** /**
* *
*/ */
phone ?: null | string; phone?: null | string;
/** /**
* trial试用版release正式 * trial试用版release正式
*/ */
profiles ?: null | string; profiles?: null | string;
/** /**
* *
*/ */
provinces ?: null | string; provinces?: null | string;
registerType ?: null | string; registerType?: null | string;
/** /**
* *
*/ */
sdType ?: null | string; sdType?: null | string;
/** /**
* *
*/ */
shopName ?: null | string; shopName?: null | string;
/** /**
* *
*/ */
shopQrcode ?: null | string; shopQrcode?: null | string;
/** /**
* --only --chain--join type * --only --chain--join type
*/ */
shopType ?: null | string; shopType?: null | string;
/** /**
* () * ()
*/ */
smallQrcode ?: null | string; smallQrcode?: null | string;
/** /**
* -1 0-1 * -1 0-1
*/ */
status ?: number | null; status?: number | null;
/** /**
* *
*/ */
subTitle ?: null | string; subTitle?: null | string;
/** /**
* *
*/ */
tableFee ?: number | null; tableFee?: number | null;
/** /**
* *
*/ */
tag ?: null | string; tag?: null | string;
/** /**
* *
*/ */
taxAmount ?: null | string; taxAmount?: null | string;
/** /**
* 0 1, 1 0 * 0 1, 1 0
*/ */
tubeType ?: number | null; tubeType?: number | null;
updateTime ?: null | string; updateTime?: null | string;
[property : string] : any; [property: string]: any;
} }

View File

@ -4,8 +4,8 @@
// 商品,耗材相关:<https://tapi.cashier.sxczgkj.cn/product/> // 商品,耗材相关:<https://tapi.cashier.sxczgkj.cn/product/>
// 系统相关:<https://tapi.cashier.sxczgkj.cn/system/> // 系统相关:<https://tapi.cashier.sxczgkj.cn/system/>
export const Account_BaseUrl = "account"; export const Account_BaseUrl = "/account";
export const Order_BaseUrl = "order"; export const Order_BaseUrl = "/order";
export const Product_BaseUrl = "product"; export const Product_BaseUrl = "/product";
export const System_BaseUrl = "system"; export const System_BaseUrl = "/system";
export const Market_BaseUrl = "market"; export const Market_BaseUrl = "/market";

View File

@ -94,7 +94,7 @@ export const useCartsStore = defineStore("carts", () => {
const vipUser = ref<{ id?: string | number, isVip?: boolean }>({}); const vipUser = ref<{ id?: string | number, isVip?: boolean }>({});
function changeUser(user: any) { function changeUser(user: any) {
vipUser.value = user; vipUser.value = user;
userPoints.value = 0; payParamsInit()
} }
// 就餐类型 // 就餐类型
@ -382,10 +382,10 @@ export const useCartsStore = defineStore("carts", () => {
} }
function changeSelCart(cart: CartsState) { function changeSelCart(cart: CartsState) {
console.log(cart)
if (!cart.id) { if (!cart.id) {
return return
} }
if (cart.placeNum) { if (cart.placeNum) {
selPlaceNum.value = cart.placeNum selPlaceNum.value = cart.placeNum
isOldOrder.value = true isOldOrder.value = true
@ -395,11 +395,7 @@ export const useCartsStore = defineStore("carts", () => {
}) })
return return
} }
if (cart.is_gift) {
isSelGift.value = true
} else {
isSelGift.value = false
}
if (cart.is_gift) { if (cart.is_gift) {
isSelGift.value = true isSelGift.value = true
@ -408,7 +404,9 @@ export const useCartsStore = defineStore("carts", () => {
} else { } else {
isSelGift.value = false isSelGift.value = false
isOldOrder.value = false
selListIndex.value = list.value.findIndex((item: CartsState) => item.id === cart.id); selListIndex.value = list.value.findIndex((item: CartsState) => item.id === cart.id);
console.log('selListIndex.value', selListIndex.value)
} }
} }

View File

@ -125,9 +125,7 @@
<el-button <el-button
type="primary" type="primary"
size="large" size="large"
:disabled=" :disabled="disabledMorePay"
!carts.isLinkFinshed || showOrder || (carts.oldOrder.detailMap.length && !showOrder)
"
@click="createOrder('more-pay')" @click="createOrder('more-pay')"
> >
更多支付 更多支付
@ -257,6 +255,25 @@ function itemClick(item) {
function changeNumber(step, item) { function changeNumber(step, item) {
carts.changeNumber(step * 1, item); carts.changeNumber(step * 1, item);
} }
const disabledMorePay = computed(() => {
if (!carts.isLinkFinshed) {
return true;
}
if (props.showOrder) {
return true;
}
if (Array.isArray(carts.oldOrder.detailMap)) {
if (carts.oldOrder.detailMap.length && !props.showOrder) {
return true;
}
} else {
if (carts.isEmpty && JSON.stringify(carts.oldOrder.detailMap) === "{}") {
return true;
}
}
return false;
});
defineExpose({ defineExpose({
carts, carts,