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 @@
{{ label.label_name }}
@@ -55,6 +55,7 @@
diff --git a/src/http/alova.ts b/src/http/alova.ts
index 91f9534..7de8f81 100644
--- a/src/http/alova.ts
+++ b/src/http/alova.ts
@@ -100,7 +100,7 @@ const alovaInstance = createAlova({
if (config.meta?.toast !== false) {
toast.info(msg)
- router.switchTab(import.meta.env.VITE_LOGIN_URL, 1000)
+ router.navigateTo(import.meta.env.VITE_LOGIN_URL, 1000)
}
throw new Error(`登录超时[${code}]:${msg}`)
}
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 9b8eca8..a98ae65 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -1,5 +1,5 @@
-{
+{
"needLogin": true,
"layout": "tabbar",
"style": {
diff --git a/src/pages/login/login.vue b/src/pages/login/login.vue
index cc43c1e..a602ec0 100644
--- a/src/pages/login/login.vue
+++ b/src/pages/login/login.vue
@@ -1,4 +1,4 @@
-{
+{
"layout": "default",
"style": {
"navigationStyle": "custom"
diff --git a/src/pages/store/room-detail.vue b/src/pages/store/room-detail.vue
index dabffc3..5ebb113 100644
--- a/src/pages/store/room-detail.vue
+++ b/src/pages/store/room-detail.vue
@@ -521,7 +521,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 })
form.image = avatarUrl
toast.info('头像上传成功')
diff --git a/src/static/images/home_bg.png b/src/static/images/home_bg.png
deleted file mode 100644
index 561998a..0000000
Binary files a/src/static/images/home_bg.png and /dev/null differ
diff --git a/src/utils/tools.ts b/src/utils/tools.ts
index f9a6bdd..bc35d92 100644
--- a/src/utils/tools.ts
+++ b/src/utils/tools.ts
@@ -135,4 +135,15 @@ export function copy(data: any) {
toast.info('已复制到剪贴板')
}
})
-}
\ No newline at end of file
+}
+
+/**
+ * 随机标签颜色
+ * @param index 索引
+ * @returns
+ */
+export function randomLabelColor (index: number) {
+ const tagColors = ['#40AE36', '#F55726']
+ return tagColors[index % tagColors.length]
+}
+