From 59859a23632ea3a2cab9cb1a53344b5d6fff0ab9 Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Sat, 10 Jan 2026 19:09:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=85=E5=80=BC=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E3=80=81=E4=BC=98=E5=8C=96=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/.env | 10 +- env/.env.development | 11 ++ env/.env.production | 13 +- src/api/store.ts | 51 +++++ src/bundle/recharge/recharge.vue | 281 ++++++++++++++++++++++++++++ src/bundle/store/edit-store.vue | 55 +++--- src/bundle/tea-room/detail.vue | 21 ++- src/bundle/user/recharge-detail.vue | 177 ++++++++++++++++++ src/bundle/user/recharge-list.vue | 155 +++++++++++++++ src/bundle/user/user-list.vue | 146 +++++++++++++-- src/pages/index/index.vue | 15 +- src/pages/login/login.vue | 17 +- src/pages/my/my.vue | 3 +- src/pages/order/order.vue | 1 + src/pages/store/room-detail.vue | 89 +++++---- src/pages/store/store.vue | 1 + src/utils/tools.ts | 18 ++ 17 files changed, 959 insertions(+), 105 deletions(-) create mode 100644 src/bundle/recharge/recharge.vue create mode 100644 src/bundle/user/recharge-detail.vue create mode 100644 src/bundle/user/recharge-list.vue diff --git a/env/.env b/env/.env index 1794870..4ebc677 100644 --- a/env/.env +++ b/env/.env @@ -9,18 +9,10 @@ VITE_APP_PUBLIC_BASE=/ # 登录页面 VITE_LOGIN_URL = '/pages/login/login' -# 第一个请求地址 -VITE_SERVER_BASEURL = 'https://76458.com' - -VITE_UPLOAD_BASEURL = 'https://76458.com/upload' # h5是否需要配置代理 VITE_APP_PROXY=true VITE_APP_PROXY_PREFIX = '/storeapi' # 第二个请求地址 (目前alova中可以使用) -VITE_SERVER_BASEURL = 'https://76458.com' - -# 上传图片请求地址 -VITE_UPLOAD_BASEURL = 'https://76458.com/storeapi/upload/image' -VITE_UPLOAD_IMAGE_URL = 'https://76458.com/' \ No newline at end of file +# VITE_SERVER_BASEURL = 'https://76458.com' \ No newline at end of file diff --git a/env/.env.development b/env/.env.development index 04fa273..8d5446a 100644 --- a/env/.env.development +++ b/env/.env.development @@ -1,6 +1,17 @@ # 变量必须以 VITE_ 为前缀才能暴露给外部读取 NODE_ENV = 'development' +VITE_NODE_ENV = 'development' + # 是否去除console 和 debugger VITE_DELETE_CONSOLE = false # 是否开启sourcemap VITE_SHOW_SOURCEMAP = true + +# 请求地址 +VITE_SERVER_BASEURL = 'https://76458.com' +# 图片上传路径 +VITE_UPLOAD_BASEURL = 'https://76458.com/upload' + +# 上传图片请求地址 +VITE_UPLOAD_BASEURL = 'https://76458.com/storeapi/upload/image' +VITE_UPLOAD_IMAGE_URL = 'https://76458.com/' \ No newline at end of file diff --git a/env/.env.production b/env/.env.production index 8a1b50c..d2f21d4 100644 --- a/env/.env.production +++ b/env/.env.production @@ -1,6 +1,17 @@ # 变量必须以 VITE_ 为前缀才能暴露给外部读取 -NODE_ENV = 'development' +NODE_ENV = 'production' +VITE_NODE_ENV = 'production' + # 是否去除console 和 debugger VITE_DELETE_CONSOLE = true # 是否开启sourcemap VITE_SHOW_SOURCEMAP = false + +# 请求地址 +VITE_SERVER_BASEURL = 'https://76458.com' +# 图片上传路径 +VITE_UPLOAD_BASEURL = 'https://76458.com/upload' + +# 上传图片请求地址 +VITE_UPLOAD_BASEURL = 'https://76458.com/storeapi/upload/image' +VITE_UPLOAD_IMAGE_URL = 'https://76458.com/' \ No newline at end of file diff --git a/src/api/store.ts b/src/api/store.ts index d3d8e8d..fe1bb85 100644 --- a/src/api/store.ts +++ b/src/api/store.ts @@ -109,6 +109,7 @@ export interface IEditRoomParams { price?: number hours?: number other_describe?: string + weight?: number } export function editRoom(data: IEditRoomParams) { return http.Post('/storeapi/store/editRoom', data) @@ -225,3 +226,53 @@ export function getStoreIncomeList(data: IGetStoreIncomeListParams) { export function scanVerifyCoupon(qr_sn: string, store_id: number) { return http.Post('/storeapi/group/cancelCode', { qr_sn, store_id }) } + +/** + * 充值活动列表 + */ +export function getRechargeActivityList(data: {store_id}) { + return http.Post('/storeapi/Store/rechargeLists', data) +} + +/** + * 添加充值活动 + */ +export interface IAddRechargeActivityParams { + store_id: number + title: string + price: number + gift_price: number +} + +export function addRechargeActivity(data: IAddRechargeActivityParams) { + return http.Post('/storeapi/Store/addRecharge', data) +} + +/** + * 编辑充值活动 + */ +export interface IEditRechargeActivityParams { + id: number + store_id: number + title: string + price: number + gift_price: number +} + +export function editRechargeActivity(data: IEditRechargeActivityParams) { + return http.Post('/storeapi/Store/editRecharge', data) +} + +/** + * 删除充值活动 + */ +export function deleteRechargeActivity(id: number) { + return http.Post('/storeapi/Store/delRecharge', { id }) +} + +/** + * 充值活动状态 + */ +export function toggleRechargeActivityStatus(data: {store_id: number, state: number}) { + return http.Post('/storeapi/Store/operateRecharge', data) +} \ No newline at end of file diff --git a/src/bundle/recharge/recharge.vue b/src/bundle/recharge/recharge.vue new file mode 100644 index 0000000..c556438 --- /dev/null +++ b/src/bundle/recharge/recharge.vue @@ -0,0 +1,281 @@ +{ + "needLogin": true, + "layout": "default", + "style": { + "navigationStyle": "custom", + "navigationBarBackgroundColor": "#fff" + } +} + + + + + + + diff --git a/src/bundle/store/edit-store.vue b/src/bundle/store/edit-store.vue index f921de7..9139ce8 100644 --- a/src/bundle/store/edit-store.vue +++ b/src/bundle/store/edit-store.vue @@ -91,7 +91,7 @@ 门店图片 - @@ -101,6 +101,16 @@ 添加图片 + --> + + + + + + 添加图片 + @@ -117,7 +127,7 @@ import { toast } from '@/utils/toast' import { getStoreDetails, editStoreInfo } from '@/api/store' import { useStoreStore } from '@/store' - import { router } from '@/utils/tools' + import { router, removeImageUrlPrefix } from '@/utils/tools' const OSS = inject('OSS') const useStore = useStoreStore() @@ -236,25 +246,25 @@ /** * 图片选择/删除 */ - handleUploadFile: ({ fileList: files }) => { - let url = '' - let name = '' - let response = null + // handleUploadFile: ({ fileList: files }) => { + // let url = '' + // let name = '' + // let response = null - const res = files.map(item => { - if (item.response) { - response = JSON.parse(item.response) - url = response.data.url - name = response.data.name - } - return { - name: name || item.name, - url: url || item.url - } - }) + // const res = files.map(item => { + // if (item.response) { + // response = JSON.parse(item.response) + // url = response.data.url + // name = response.data.name + // } + // return { + // name: name || item.name, + // url: url || item.url + // } + // }) - EditStore.fileList = res - }, + // EditStore.fileList = res + // }, /** * 保存门店信息 @@ -290,12 +300,7 @@ return } - 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_arr = removeImageUrlPrefix(fileList.value) form.value.image = form.value.image_arr[0] form.value.id = useStore.defaultStore.id diff --git a/src/bundle/tea-room/detail.vue b/src/bundle/tea-room/detail.vue index 1c09e99..86da5d7 100644 --- a/src/bundle/tea-room/detail.vue +++ b/src/bundle/tea-room/detail.vue @@ -40,13 +40,19 @@ - + - 使用说明 + 其他说明 + + + + 起订时间 + {{ teaRoom?.room?.hours }}小时起订 + @@ -63,7 +69,14 @@ // 包间内容 const roomId = ref(0) // 门店ID - const teaRoom = ref({}) + const teaRoom = ref({ + room: { + price: 0, + sold: 0, + title: '', + hours: 0 + } + }) onLoad((args) => { roomId.value = Number(args.id) @@ -79,7 +92,7 @@ console.log("🚀 ~ res:", res) teaRoom.value = res.details console.log("🚀 ~ teaRoom.value:", teaRoom.value) - swiperList.value = teaRoom.value.img_arr + swiperList.value = teaRoom.value.room.room_arr } } diff --git a/src/bundle/user/recharge-detail.vue b/src/bundle/user/recharge-detail.vue new file mode 100644 index 0000000..2502ab4 --- /dev/null +++ b/src/bundle/user/recharge-detail.vue @@ -0,0 +1,177 @@ +{ + "layout": "default", + "style": { + "navigationStyle": "custom", + "navigationBarBackgroundColor": "#fff" + } +} + + + + + + + diff --git a/src/bundle/user/recharge-list.vue b/src/bundle/user/recharge-list.vue new file mode 100644 index 0000000..f9ce2bc --- /dev/null +++ b/src/bundle/user/recharge-list.vue @@ -0,0 +1,155 @@ +{ + "layout": "default", + "style": { + "navigationStyle": "custom", + "navigationBarBackgroundColor": "#fff" + } +} + + + + + + + diff --git a/src/bundle/user/user-list.vue b/src/bundle/user/user-list.vue index 9bc9320..666bb42 100644 --- a/src/bundle/user/user-list.vue +++ b/src/bundle/user/user-list.vue @@ -7,9 +7,77 @@ }