From 9b573e376af495519f8cfef1c216b927ba583419 Mon Sep 17 00:00:00 2001 From: ISFP_T <68358856@qq.com> Date: Fri, 27 Mar 2026 17:16:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E6=9B=B4=E6=9B=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/.env.development | 4 +- env/.env.production | 2 +- src/interceptor/request.ts | 5 +- src/locale/en.json | 1 + src/locale/zh-Hans.json | 1 + src/manifest.json | 4 +- src/pages-store/pages/store/dishes.vue | 42 +++++--- src/pages-user/pages/search-address/utils.ts | 0 src/pages-user/pages/user-info/index.vue | 19 +++- .../components/tabbar-home/tabbar-home.vue | 11 +++ .../invite-poster/invite-poster.vue | 4 +- .../components/invite-user/invite-user.vue | 4 +- src/utils/upload/alioss.ts | 71 ++++++-------- src/utils/upload/ymx.ts | 96 +++++++++---------- 14 files changed, 144 insertions(+), 120 deletions(-) create mode 100644 src/pages-user/pages/search-address/utils.ts diff --git a/env/.env.development b/env/.env.development index e21bbc3..b5a93a5 100644 --- a/env/.env.development +++ b/env/.env.development @@ -4,7 +4,7 @@ NODE_ENV=development VITE_DELETE_CONSOLE=false #本地环境 -#VITE_SERVER_BASEURL=https://howhowfresh.com/prod-api -VITE_SERVER_BASEURL=http://192.168.5.58:8080 +VITE_SERVER_BASEURL=https://howhowfresh.com/prod-api +#VITE_SERVER_BASEURL=http://192.168.5.200:8080 #VITE_SERVER_BASEURL=http://192.168.0.148:8888 #VITE_SERVER_BASEURL=http://liuyao.nat100.top/meiguowaimai \ No newline at end of file diff --git a/env/.env.production b/env/.env.production index b6fa52b..80136d3 100644 --- a/env/.env.production +++ b/env/.env.production @@ -7,4 +7,4 @@ VITE_DELETE_CONSOLE=true #正式环境 #VITE_SERVER_BASEURL=http://liuyao.nat100.top/meiguowaimai #VITE_SERVER_BASEURL=https://gosplit.co.nz/apimgwm -VITE_SERVER_BASEURL=https://howhowfresh.com/prod-api +VITE_SERVER_BASEURL=https://www.howhowfresh.com/prod-api diff --git a/src/interceptor/request.ts b/src/interceptor/request.ts index 03239ca..9fa0ba4 100644 --- a/src/interceptor/request.ts +++ b/src/interceptor/request.ts @@ -43,8 +43,9 @@ const httpInterceptor = { // #endif // TIPS: 如果需要对接多个后端服务,也可以在这里处理,拼接成所需要的地址 } - // 1. 请求超时 - options.timeout = 10000 // 10s + // 1. 请求超时:上传接口放宽到 60s,其他接口保持 10s + const isUploadRequest = !!(options as any).filePath + options.timeout = isUploadRequest ? 60000 : 10000 // 谷歌地图的请求不额外增加请求头 if (!options.url.startsWith('https://maps.googleapis.com')) { diff --git a/src/locale/en.json b/src/locale/en.json index 76f079e..7b6a83d 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -69,6 +69,7 @@ "request-incorrect": "Request failed", "save-failed": "Save failed", "save-successfully": "Save successfully", + "soldOut": "This item is sold out", "system-prompt": "System prompts", "system-prompt-delete": "Are you sure to delete it?", "up-cross": "Loading...", diff --git a/src/locale/zh-Hans.json b/src/locale/zh-Hans.json index 67b5eb8..c457a8b 100644 --- a/src/locale/zh-Hans.json +++ b/src/locale/zh-Hans.json @@ -69,6 +69,7 @@ "request-incorrect": "请求失败", "save-failed": "保存失败", "save-successfully": "保存成功", + "soldOut": "该商品已售完", "system-prompt": "系统提示", "system-prompt-delete": "是否确认删除?", "up-cross": "上传中...", diff --git a/src/manifest.json b/src/manifest.json index aabdacc..13de78c 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,8 +2,8 @@ "name" : "CHEFLINK delivery", "appid" : "__UNI__06509BE", "description" : "", - "versionName" : "1.0.28", - "versionCode" : 128, + "versionName" : "1.0.29", + "versionCode" : 129, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/src/pages-store/pages/store/dishes.vue b/src/pages-store/pages/store/dishes.vue index 33e82c4..e78321c 100644 --- a/src/pages-store/pages/store/dishes.vue +++ b/src/pages-store/pages/store/dishes.vue @@ -24,6 +24,18 @@ const userStore = useUserStore(); const loading = ref(true); // 加载状态 const selectedSauce = ref([]); // 默认选择第一个 +function isSoldOutStock(stockLike: unknown) { + const n = Number(stockLike) + return !Number.isNaN(n) && n <= 0 +} + +function showSoldOutToast() { + uni.showToast({ + title: t('common.prompt.soldOut'), + icon: 'none' + }) +} + const selectSauce = (item, id: string) => { if(!item.selectedIds) { item.selectedIds = []; @@ -40,13 +52,8 @@ const selectSauce = (item, id: string) => { function handleSubmit() { console.log('加入购物车', dishDetailData.value) console.log('加入购物车', dishDetailData.value.merchantSideDishVoList) - const stock = Number(dishDetailData.value?.stock) - - if (!Number.isNaN(stock) && stock === 0) { - uni.showToast({ - title: t('common.prompt.stockInsufficient'), - icon: 'none' - }) + if (isSoldOutStock(dishDetailData.value?.stock)) { + showSoldOutToast() return } // 查看所有必选的配菜是否已经选择了 @@ -192,6 +199,8 @@ const totalPrice = computed(() => { return (basePrice + sidePrice).toFixed(2); }); +const isSoldOut = computed(() => isSoldOutStock(dishDetailData.value?.stock)) + const cartDataList = ref([]) function getCartInfo() { if(!userStore.isLogin) return @@ -313,8 +322,8 @@ function getStoreDetail() { -