From 7e3b9c83d2170c18d3493edb0fe81224905c30df Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Sat, 20 Dec 2025 09:20:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E8=B7=AF=E5=BE=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/.env | 3 ++- src/bundle/profile/profile.vue | 2 +- src/bundle/setmeal/add.vue | 15 +++++++++++---- src/bundle/setmeal/detail.vue | 31 ++----------------------------- src/bundle/setmeal/setmeal.vue | 6 +++++- src/bundle/store/edit-store.vue | 12 +++++++++--- src/bundle/tea-room/detail.vue | 18 +++--------------- src/http/alova.ts | 2 +- src/pages/index/index.vue | 2 +- src/pages/login/login.vue | 2 +- src/pages/store/room-detail.vue | 2 +- src/static/images/home_bg.png | Bin 23580 -> 0 bytes src/utils/tools.ts | 13 ++++++++++++- 13 files changed, 49 insertions(+), 59 deletions(-) delete mode 100644 src/static/images/home_bg.png diff --git a/env/.env b/env/.env index b496484..a3f1db8 100644 --- a/env/.env +++ b/env/.env @@ -22,4 +22,5 @@ VITE_APP_PROXY_PREFIX = '/storeapi' VITE_SERVER_BASEURL = 'https://cz.stnav.com' # 上传图片请求地址 -VITE_UPLOAD_BASEURL = 'https://cz.stnav.com/storeapi/upload/image' \ No newline at end of file +VITE_UPLOAD_BASEURL = 'https://cz.stnav.com/storeapi/upload/image' +VITE_UPLOAD_IMAGE_URL = 'https://cz.stnav.com/' \ No newline at end of file diff --git a/src/bundle/profile/profile.vue b/src/bundle/profile/profile.vue index 7c4d03b..15c2c94 100644 --- a/src/bundle/profile/profile.vue +++ b/src/bundle/profile/profile.vue @@ -206,7 +206,7 @@ try { const response = JSON.parse(e.file.response) if (response.code) { - const avatarUrl = response.data.uri + const avatarUrl = response.data.url await updateUserInfo({ avatar: avatarUrl }) user.value.avatar = avatarUrl toast.info('头像上传成功') diff --git a/src/bundle/setmeal/add.vue b/src/bundle/setmeal/add.vue index 7810fc8..a9c5e8a 100644 --- a/src/bundle/setmeal/add.vue +++ b/src/bundle/setmeal/add.vue @@ -473,7 +473,7 @@ status: res.status, // 状态 0下架1上架 } - fileList.value = res.img.split(',').map((item: string) => ({ + fileList.value = res.img_list.map((item: string) => ({ name: item, url: item })) @@ -510,7 +510,7 @@ const res = files.map(item => { if (item.response) { response = JSON.parse(item.response) - url = response.data.uri + url = response.data.url name = response.data.name } return { @@ -651,8 +651,14 @@ toast.info('请输入退改说明') return } - - formData.img = Add.fileList.map(item => item.url).join(',') + + // 将图片URL中的 https://cz.stnav.com/ 替换为空 + formData.img = Add.fileList.map(item => { + if (typeof item.url === 'string') { + return item.url.replace(import.meta.env.VITE_UPLOAD_IMAGE_URL, '') + } + return item.url + }).join(',') if (roomId.value.includes(0)) { formData.room_id = '0' @@ -678,6 +684,7 @@ await editTeaSpecialistOrderPackage(formData) } + uni.$emit('refreshOrderList') uni.hideLoading() toast.info(type.value == 'add' ? '发布成功' : '编辑成功') router.navigateBack(1, 500) diff --git a/src/bundle/setmeal/detail.vue b/src/bundle/setmeal/detail.vue index f2aeb68..4ae9e57 100644 --- a/src/bundle/setmeal/detail.vue +++ b/src/bundle/setmeal/detail.vue @@ -25,7 +25,7 @@ {{ detail.discount }}折 - 已售 10+ + 已售 {{ detail.sold > 10 ? '10+' : detail.sold }} {{ detail.title }} {{ detail.description }} @@ -170,38 +170,11 @@ id.value = Number(args.id) teaRoomPrice.value = Number(args.price) || 0 - // if (args.type == ReserveServiceCategory.GroupBuying) { - // isGroupBuying.value = true - // pay.value = 3 - Detail.handleInitGroupBuying() - // } - // Detail.handleInitReserveRoom() + Detail.handleInitGroupBuying() - // 获取用户需求详 - // getUserInfo().then(res => { - // user.value = res - // }) }) const Detail = { - /** - * 初始包间详情 - */ - handleInitReserveRoom: async () => { - // 包间详情 - const userStore = useUserStore() - userInfo.value = userStore.userInfo - - const res = await getTeaRoomDetail({ - id: storeId.value, - latitude: uni.getStorageSync('latitude'), - longitude: uni.getStorageSync('longitude'), - user_id: userInfo.value.id || 0 - }) - teaRoom.value = res.details - swiperList.value = teaRoom.value.img_arr - }, - /* * 初始化套餐详情 */ diff --git a/src/bundle/setmeal/setmeal.vue b/src/bundle/setmeal/setmeal.vue index f734749..dbf099e 100644 --- a/src/bundle/setmeal/setmeal.vue +++ b/src/bundle/setmeal/setmeal.vue @@ -51,6 +51,9 @@ import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js" import { getTeaSpecialistOrderPackageList } from '@/api/order' import { router } from '@/utils/tools' + import { useStoreStore } from '@/store' + + const useStore = useStoreStore() // mescroll const { mescrollInit, downCallback, getMescroll } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook @@ -63,7 +66,7 @@ } const list = ref>([]) // 茶室列表 const keywords = ref('') // 搜索关键词 - + // tab const tab = ref(1) const tabList = ref>([ @@ -95,6 +98,7 @@ size: mescroll.size, status: tab.value, search: keywords.value, + store_id: useStore.defaultStore.id, } getTeaSpecialistOrderPackageList(filter).then((res) => { diff --git a/src/bundle/store/edit-store.vue b/src/bundle/store/edit-store.vue index add0e74..70fed0c 100644 --- a/src/bundle/store/edit-store.vue +++ b/src/bundle/store/edit-store.vue @@ -244,7 +244,7 @@ const res = files.map(item => { if (item.response) { response = JSON.parse(item.response) - url = response.data.uri + url = response.data.url name = response.data.name } return { @@ -290,8 +290,14 @@ return } - form.value.image_arr = EditStore.fileList.map(item => item.url) - form.value.image = EditStore.fileList[0].url + form.value.image_arr = EditStore.fileList.map(item => { + if (typeof item.url === 'string') { + return item.url.replace(import.meta.env.VITE_UPLOAD_IMAGE_URL, '') + } + return item.url + }) + + form.value.image = form.value.image_arr[0] form.value.id = useStore.defaultStore.id uni.showLoading({ diff --git a/src/bundle/tea-room/detail.vue b/src/bundle/tea-room/detail.vue index 860f819..fc5035e 100644 --- a/src/bundle/tea-room/detail.vue +++ b/src/bundle/tea-room/detail.vue @@ -29,8 +29,8 @@