From 26834c36c0b187de7a3538a90fb7763b01f8a87b Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Fri, 30 Jan 2026 01:13:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user.ts | 68 ++ src/bundle/parten/pages/bank-card/add.vue | 8 +- src/bundle/settle-in/parten.vue | 8 +- src/bundle/settle-in/tea-room.vue | 408 +++++++----- src/bundle/settle-in/tea-specialist.vue | 621 ++++++++++-------- src/bundle/tea-room/detail.vue | 40 +- src/bundle_b/pages/tea-specialist/list.vue | 16 +- src/bundle_b/pages/tea-specialist/reserve.vue | 2 +- src/pages/index/index.vue | 1 - src/pages/login/mobile.vue | 9 +- src/pages/my/my.vue | 2 +- src/utils/tools.ts | 27 + 12 files changed, 756 insertions(+), 454 deletions(-) diff --git a/src/api/user.ts b/src/api/user.ts index dea9734..a294076 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -196,3 +196,71 @@ export function openLock(order_id: number, type: number) { export function getStoreBalanceLog() { return http.Post('/api/user/userStoreMoneyList', {}) } + +/** + * 获取验证码 + */ +export interface IGetStoreVerificationCodeParams { + mobile: string + scene: string +} + +export function getVerificationCode(data: IGetStoreVerificationCodeParams) { + return http.Post('/storeapi/sms/sendCode', data, { + meta: { ignoreAuth: true } + }) +} + +/** + * 添加申请茶艺师 + */ +export interface IAddTeaSpecialistParams { + license_img: string // 营业执照 + username: string // 茶艺师名字 + gender: number // 茶艺师性别(1男 2女) + both: number | string // 出生年月 + height: string // 身高 + weight: string // 体重 + hobby_introduce: string // 兴趣爱好介绍 + city_id: number // 城市ID + avatar: string // 头像 + certificate: string // 健康证、资格证书信息 + mobile: string // 联系电话 + code: string // 验证码 +} + +export function addTeaSpecialist(data: IAddTeaSpecialistParams) { + return http.Post('/api/submitForm/addTeamaster', data) +} + +/** + * 查看申请茶艺师表单状态 + */ +export function getTeaSpecialistStatus() { + return http.Post('/api/submitForm/teamasterRealStatus') +} + +/** + * 添加加盟合作 + */ +export interface IAddJoinCooperationParams { + operation_type: number // 加盟类型 + license_img: string // 营业执照 + username: string // 联系人姓名 + mobile: string // 联系电话 + code: string // 验证码 + city_id: number // 城市ID + address: string // 详细地址 + suggest: string // 意见建议 +} + +export function addJoinCooperation(data: IAddJoinCooperationParams) { + return http.Post('/api/submitForm/addStore', data) +} + +/** + * 查看加盟合作表单状态 + */ +export function getJoinCooperationStatus() { + return http.Post('/api/submitForm/StoreRealStatus') +} \ No newline at end of file diff --git a/src/bundle/parten/pages/bank-card/add.vue b/src/bundle/parten/pages/bank-card/add.vue index 3628709..af86861 100644 --- a/src/bundle/parten/pages/bank-card/add.vue +++ b/src/bundle/parten/pages/bank-card/add.vue @@ -135,11 +135,9 @@ // 发送验证码 handleCountDown: () => { startCountDown.value = true - nextTick(() => { - countDown.value?.start() - - // 发送验证码请求 - }) + setTimeout(() => { + countDown.value.start() + }, 100) }, // 验证码倒计时结束 diff --git a/src/bundle/settle-in/parten.vue b/src/bundle/settle-in/parten.vue index 1772e6b..d8dac36 100644 --- a/src/bundle/settle-in/parten.vue +++ b/src/bundle/settle-in/parten.vue @@ -186,11 +186,9 @@ // 发送验证码 handleCountDown: () => { startCountDown.value = true - nextTick(() => { - countDown.value?.start() - - // 发送验证码请求 - }) + setTimeout(() => { + countDown.value.start() + }, 100) }, // 验证码倒计时结束 diff --git a/src/bundle/settle-in/tea-room.vue b/src/bundle/settle-in/tea-room.vue index b0c2c5c..f75f84e 100644 --- a/src/bundle/settle-in/tea-room.vue +++ b/src/bundle/settle-in/tea-room.vue @@ -9,7 +9,22 @@ diff --git a/src/bundle/settle-in/tea-specialist.vue b/src/bundle/settle-in/tea-specialist.vue index 0c8ba6d..8271e11 100644 --- a/src/bundle/settle-in/tea-specialist.vue +++ b/src/bundle/settle-in/tea-specialist.vue @@ -10,282 +10,286 @@ diff --git a/src/bundle/tea-room/detail.vue b/src/bundle/tea-room/detail.vue index 77e80e2..6aae26b 100644 --- a/src/bundle/tea-room/detail.vue +++ b/src/bundle/tea-room/detail.vue @@ -116,13 +116,6 @@ - - - 其他说明 - - - - @@ -187,6 +180,13 @@ + + + 使用说明 + + + + @@ -285,7 +285,7 @@ import type { ITeaSpecialistFuture7DaysResult } from '@/api/types/tea' import { getNext7Days, getTeaRoomBalance, createTeaRoomOrder } from '@/api/tea-room' import { CouponType } from '@/utils/coupon' - import { router, randomLabelColor, previewImage } from '@/utils/tools' + import { router, randomLabelColor, previewImage, replaceNewLine } from '@/utils/tools' import type { IUserInfoVo } from '@/api/types/login' import { useUserStore } from '@/store' import { getTeaRoomDetail, createTeaRoomPackageOrder, getTeaRoomPackageDetail, calculateTeaRoomPrice } from '@/api/tea-room' @@ -422,6 +422,12 @@ room_id: id.value }) teaRoom.value = res.details + + // 处理使用说明的换行问题 + if (teaRoom.value.room.other_describe) { + teaRoom.value.room.other_describe = replaceNewLine(teaRoom.value.room.other_describe) + } + if (pageType.value == ReserveServiceCategory.ReserveRoom) { swiperList.value = teaRoom.value.room.room_arr @@ -447,6 +453,24 @@ handleInitGroupBuying: async () => { const res = await getTeaRoomPackageDetail({ id: id.value }) teaRoomPackage.value = res.details + + // 处理使用说明的换行问题 + if (teaRoomPackage.value.introduce) { + teaRoom.value.introduce = replaceNewLine(teaRoom.value.introduce) + } + + if (teaRoomPackage.value.rests_introduce) { + teaRoom.value.rests_introduce = replaceNewLine(teaRoom.value.rests_introduce) + } + + if (teaRoomPackage.value.room_name) { + teaRoom.value.room_name = replaceNewLine(teaRoom.value.room_name) + } + + if (teaRoomPackage.value.returd_details) { + teaRoom.value.returd_details = replaceNewLine(teaRoom.value.returd_details) + } + if (pageType.value == ReserveServiceCategory.GroupBuying) { swiperList.value = teaRoomPackage.value.img } diff --git a/src/bundle_b/pages/tea-specialist/list.vue b/src/bundle_b/pages/tea-specialist/list.vue index b6d16a9..4ac2917 100644 --- a/src/bundle_b/pages/tea-specialist/list.vue +++ b/src/bundle_b/pages/tea-specialist/list.vue @@ -85,15 +85,14 @@ + v-for="(item, index) in list" :key="index" > {{ item.state == 0 ? '可约' : '工作中' }} - + - + {{ item.name }} @@ -153,7 +152,7 @@ import { useToast } from 'wot-design-uni' import { onPageScroll, onReachBottom } from '@dcloudio/uni-app' import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js" - import { router } from '@/utils/tools' + import { router, previewImage } from '@/utils/tools' import { getTeaSpecialist } from '@/api/tea-specialist' import TeaSpecialistLevel from '@/components/TeaSpecialistLevel.vue' import type { ITeaSpecialistResult } from '@/api/types/tea-specialist' @@ -267,6 +266,13 @@ router.navigateBack().catch(err => { router.switchTab('/pages/index/index') }) + }, + + /** + * 预览图片 + */ + handlePreviewImage: (img: any) => { + previewImage(img, [img]) } } diff --git a/src/bundle_b/pages/tea-specialist/reserve.vue b/src/bundle_b/pages/tea-specialist/reserve.vue index a5d32f5..62f79c7 100644 --- a/src/bundle_b/pages/tea-specialist/reserve.vue +++ b/src/bundle_b/pages/tea-specialist/reserve.vue @@ -147,7 +147,7 @@ 茶艺服务 - + diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 8e56028..7fe4068 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -214,7 +214,6 @@ }) onLoad(async(args) => { - // 获取小程序码注册来源 // getWxacode().then( res => {}) diff --git a/src/pages/login/mobile.vue b/src/pages/login/mobile.vue index 301af16..89146e7 100644 --- a/src/pages/login/mobile.vue +++ b/src/pages/login/mobile.vue @@ -146,13 +146,10 @@ }) return } - startCountDown.value = true - nextTick(() => { - countDown.value?.start() - - // 发送验证码请求 - }) + setTimeout(() => { + countDown.value.start() + }, 100) }, // 验证码倒计时结束 diff --git a/src/pages/my/my.vue b/src/pages/my/my.vue index 53ade91..0b56d5b 100644 --- a/src/pages/my/my.vue +++ b/src/pages/my/my.vue @@ -324,7 +324,7 @@ const serviceMenuList = reactive([ { id: 1, title: '茶馆入驻', icon: `${OSS}icon/icon_service_teahouse.png`, badge: '', url: '/bundle/settle-in/tea-room' }, { id: 2, title: '申请茶艺师', icon: `${OSS}icon/icon_service_tea.png`, badge: '', url: '/bundle/settle-in/tea-specialist' }, - { id: 3, title: '合创合伙人', icon: `${OSS}icon/icon_service_partner.png`, badge: '赚佣金', url: '/bundle/settle-in/parten' }, + // { id: 3, title: '合创合伙人', icon: `${OSS}icon/icon_service_partner.png`, badge: '赚佣金', url: '/bundle/settle-in/parten' }, ]) // 推广码弹窗 diff --git a/src/utils/tools.ts b/src/utils/tools.ts index f9f22c4..e688959 100644 --- a/src/utils/tools.ts +++ b/src/utils/tools.ts @@ -189,3 +189,30 @@ export function strToParams(uri: string) :any { } return newparams } + +/** + * 格式化上传图片的URL,去除前缀 + * @param file 上传图片文件列表 + * @returns 去除前缀后的图片URL列表 + */ +export function removeImageUrlPrefix(file: any) { + const fileList = file.map(item => { + if (item.response) { + const response = JSON.parse(item.response) + if (response.code) { + return response.data.uri.replace(import.meta.env.VITE_UPLOAD_IMAGE_URL, '') + } + } + return item.url.replace(import.meta.env.VITE_UPLOAD_IMAGE_URL, '') + }) + return fileList +} + +/** + * 替换字符串中的回车换行符 + */ +export function replaceNewLine(str: string) :string { + if (!str) return '' + let content = str.replace(/\n/g, "
") + return content.replace(/\r\n/g, "
") +} \ No newline at end of file