如果没有经纬度则给到默认的经纬度

This commit is contained in:
wangxiaowei
2025-12-26 13:25:34 +08:00
parent 434fc0f041
commit dc635de2e9
10 changed files with 56 additions and 41 deletions

View File

@ -398,8 +398,8 @@
handleInitComboDetails: async () => { handleInitComboDetails: async () => {
const res = await getTeaRoomPackageOrderDetail({ const res = await getTeaRoomPackageOrderDetail({
id: orderId.value, id: orderId.value,
latitude: uni.getStorageSync('latitude'), latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
longitude: uni.getStorageSync('longitude') longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
}) })
comboOrder.value = res.details comboOrder.value = res.details
}, },

View File

@ -127,8 +127,8 @@
handleInit: async () => { handleInit: async () => {
const res = await getTeaRoomPackageOrderDetail({ const res = await getTeaRoomPackageOrderDetail({
id: orderId.value, id: orderId.value,
latitude: uni.getStorageSync('latitude'), latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
longitude: uni.getStorageSync('longitude') longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
}) })
order.value = res.details order.value = res.details
title.value = DouYinOrderStatusTextValue[order.value.user_group.status].title || '订单详情' title.value = DouYinOrderStatusTextValue[order.value.user_group.status].title || '订单详情'

View File

@ -149,8 +149,8 @@
<view class="mt-34rpx" v-if="order.store.operation_type == StoreType.Direct"> <view class="mt-34rpx" v-if="order.store.operation_type == StoreType.Direct">
<!-- 待使用 --> <!-- 待使用 -->
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus === GroupComboOrderStatus.ToUse"> <view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus === GroupComboOrderStatus.ToUse">
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="OrderDetail.handleToRefund">申请退款</view> <view class="w-630rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="OrderDetail.handleToRefund">申请退款</view>
<view class="w-330rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleUsePackage">立即预定</view> <!-- <view class="w-330rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleUsePackage">立即预定</view> -->
</view> </view>
<!-- 已使用 --> <!-- 已使用 -->
@ -256,8 +256,8 @@
handleInit: async () => { handleInit: async () => {
const res = await getTeaRoomPackageOrderDetail({ const res = await getTeaRoomPackageOrderDetail({
id: orderId.value, id: orderId.value,
latitude: uni.getStorageSync('latitude'), latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
longitude: uni.getStorageSync('longitude') longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
}) })
order.value = res.details order.value = res.details
title.value = GroupComboOrderStatusTextValue[order.value.user_group.status].title || '订单详情' title.value = GroupComboOrderStatusTextValue[order.value.user_group.status].title || '订单详情'
@ -310,10 +310,9 @@
} }
}).then((res) => { }).then((res) => {
if (res.action == 'confirm') { if (res.action == 'confirm') {
let res = handleRefundOrderHooks(order.value.id, PayOrderType.ComboRefund) let res = handleRefundOrderHooks(order.value.user_group.id, PayOrderType.ComboRefund)
if (res) { if (res) {
OrderDetail.handleInit() OrderDetail.handleInit()
uni.$emit('refreshComboOrderList')
} }
} }
}).catch(() => { }).catch(() => {

View File

@ -182,7 +182,7 @@
<view class="text-[#4C9F44] font-bold text-32rpx leading-44rpx absolute top-[50%] transform translate-y-[-50%] right-22rpx">点击开锁</view> <view class="text-[#4C9F44] font-bold text-32rpx leading-44rpx absolute top-[50%] transform translate-y-[-50%] right-22rpx">点击开锁</view>
</view> </view>
<view class="text-[#303133] text-30rpx leading-42rpx mt-16rpx text-center">大门锁</view> <view class="text-[#303133] text-30rpx leading-42rpx mt-16rpx text-center">大门锁</view>
<view class="text-[#606266] text-26rpx leading-48rpx mt-4rpx text-center font-500">手动输入 1052 32#</view> <view class="text-[#606266] text-26rpx leading-48rpx mt-4rpx text-center font-500">{{ order.is_lockpwd == 1 ? `手动输入 ${order.gate_key}` : '正在生成密码' }}</view>
</view> </view>
<view class="border-r-2rpx border-r-solid border-r-[#F6F7F9] h-224rpx"></view> <view class="border-r-2rpx border-r-solid border-r-[#F6F7F9] h-224rpx"></view>
<view class="w-224rpx" @click="OrderDetail.handleOpenDoorLock('room')"> <view class="w-224rpx" @click="OrderDetail.handleOpenDoorLock('room')">
@ -191,7 +191,7 @@
<view class="text-[#4C9F44] font-bold text-32rpx leading-44rpx absolute top-[50%] transform translate-y-[-50%] right-22rpx">点击开锁</view> <view class="text-[#4C9F44] font-bold text-32rpx leading-44rpx absolute top-[50%] transform translate-y-[-50%] right-22rpx">点击开锁</view>
</view> </view>
<view class="text-[#303133] text-30rpx leading-42rpx mt-16rpx text-center">房间锁</view> <view class="text-[#303133] text-30rpx leading-42rpx mt-16rpx text-center">房间锁</view>
<view class="text-[#606266] text-26rpx leading-48rpx mt-4rpx text-center font-500">手动输入 1052 32#</view> <view class="text-[#606266] text-26rpx leading-48rpx mt-4rpx text-center font-500">{{ order.is_lockpwd == 1 ? `手动输入 ${order.room_key}` : '正在生成密码' }}</view>
</view> </view>
</view> </view>
</view> </view>
@ -398,7 +398,11 @@
start_time: '', start_time: '',
end_time: '', end_time: '',
renew_price: 0 renew_price: 0
} },
is_lockpwd: 0,
gate_key: '',
room_key: ''
}) })
// 一键续订的时间 // 一键续订的时间
@ -660,12 +664,10 @@
console.log('开始转让订单4', res) console.log('开始转让订单4', res)
uni.removeStorageSync('transferOrder') uni.removeStorageSync('transferOrder')
toast.success('订单接收成功') toast.success('订单接收成功')
router.switchTab('/pages/my/my', 500) router.redirectTo('/bundle/order/tea-room/order-list', 500)
}) })
} }
}).catch(() => { }).catch(() => {})
// 点击取消按钮回调事件
})
}, },
/** /**

View File

@ -271,8 +271,8 @@
const res = await getTeaRoomDetail({ const res = await getTeaRoomDetail({
id: storeId.value, id: storeId.value,
latitude: uni.getStorageSync('latitude'), latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
longitude: uni.getStorageSync('longitude'), longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
room_id: id.value, room_id: id.value,
user_id: userInfo.value.id || 0 user_id: userInfo.value.id || 0
}) })

View File

@ -147,8 +147,8 @@
handleInit: async () => { handleInit: async () => {
const res = await getTeaRoomPackageOrderDetail({ const res = await getTeaRoomPackageOrderDetail({
id: groupCouponId.value, id: groupCouponId.value,
latitude: uni.getStorageSync('latitude'), latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
longitude: uni.getStorageSync('longitude') longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
}) })
order.value = res.details order.value = res.details
console.log("🚀 ~ order.value:", order.value) console.log("🚀 ~ order.value:", order.value)

View File

@ -285,7 +285,7 @@
import type { ITeaSpecialistFuture7DaysResult } from '@/api/types/tea' import type { ITeaSpecialistFuture7DaysResult } from '@/api/types/tea'
import { getNext7Days, getTeaRoomBalance, createTeaRoomOrder } from '@/api/tea-room' import { getNext7Days, getTeaRoomBalance, createTeaRoomOrder } from '@/api/tea-room'
import { CouponType } from '@/utils/coupon' import { CouponType } from '@/utils/coupon'
import { router, toTimes, toPlus, toMinus, randomLabelColor } from '@/utils/tools' import { router, randomLabelColor } from '@/utils/tools'
import type { IUserInfoVo } from '@/api/types/login' import type { IUserInfoVo } from '@/api/types/login'
import { useUserStore } from '@/store' import { useUserStore } from '@/store'
import { getTeaRoomDetail, createTeaRoomPackageOrder, getTeaRoomPackageDetail, calculateTeaRoomPrice } from '@/api/tea-room' import { getTeaRoomDetail, createTeaRoomPackageOrder, getTeaRoomPackageDetail, calculateTeaRoomPrice } from '@/api/tea-room'
@ -385,6 +385,7 @@
id.value = Number(args.id) // 在茶室下这个id是包间ID在团购下是套餐ID id.value = Number(args.id) // 在茶室下这个id是包间ID在团购下是套餐ID
teaRoomPrice.value = Number(args.price) || 0 teaRoomPrice.value = Number(args.price) || 0
pageType.value = args.type || '' pageType.value = args.type || ''
console.log("🚀 ~ pageType.value:", pageType.value)
if (args.type == ReserveServiceCategory.GroupBuying) { if (args.type == ReserveServiceCategory.GroupBuying) {
isGroupBuying.value = true isGroupBuying.value = true
@ -412,8 +413,8 @@
const res = await getTeaRoomDetail({ const res = await getTeaRoomDetail({
id: storeId.value, id: storeId.value,
latitude: uni.getStorageSync('latitude'), latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
longitude: uni.getStorageSync('longitude'), longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
user_id: userInfo.value.id || 0, user_id: userInfo.value.id || 0,
room_id: id.value room_id: id.value
}) })
@ -498,9 +499,7 @@
uni.$off('chooseCoupon'); uni.$off('chooseCoupon');
uni.$on('chooseCoupon', params => { uni.$on('chooseCoupon', params => {
console.log(12312312)
uni.$off('chooseCoupon') uni.$off('chooseCoupon')
console.log("🚀 ~ type:", type)
if (type === CouponType.Discount) { if (type === CouponType.Discount) {
selectedCoupon.value = {id: params.coupon.id, name: `${params.coupon.name}${params.coupon.coupon_price}` } selectedCoupon.value = {id: params.coupon.id, name: `${params.coupon.name}${params.coupon.coupon_price}` }
bill.value.coupon = params.coupon.coupon_price bill.value.coupon = params.coupon.coupon_price
@ -517,8 +516,6 @@
// 获取预定了几个小时 // 获取预定了几个小时
const count = bill.value.service.num const count = bill.value.service.num
console.log("🚀 ~ bill.value:", bill.value)
console.log("🚀 ~ selectCouponId:", selectCouponId.value)
router.navigateTo(`/bundle/coupon/coupon?id=${id.value}&numbers=${count}&type=${type}&storeId=${storeId.value}&couponId=${selectCouponId.value}&groupCouponId=${selectGroupCouponId.value}`) router.navigateTo(`/bundle/coupon/coupon?id=${id.value}&numbers=${count}&type=${type}&storeId=${storeId.value}&couponId=${selectCouponId.value}&groupCouponId=${selectGroupCouponId.value}`)
}, },
@ -570,13 +567,13 @@
uni.$off("payment") uni.$off("payment")
isSubmitting.value = false isSubmitting.value = false
if (params.result) { if (params.result) {
//支付成功提示
uni.redirectTo({ uni.redirectTo({
url: `/pages/notice/reserve?type=${OrderType.TeaRoomOrder}&orderId=${params.orderId}&isGroupBuying=${isGroupBuying.value ? 1 : 0}` url: `/pages/notice/reserve?type=${OrderType.TeaRoomOrder}&orderId=${params.orderId}&isGroupBuying=${isGroupBuying.value ? 1 : 0}&storeId=${storeId.value}&storeType=${teaRoom.value.operation_type}`
}) })
} else { } else {
if (isGroupBuying.value) { // 支付失败跳转订单列表
router.redirectTo(`/bundle/order/platform/order-list`) if (!isGroupBuying.value) {
} else {
router.redirectTo(`/bundle/order/tea-room/order-list?isGroupBuying=${isGroupBuying.value ? 1 : 0}`) router.redirectTo(`/bundle/order/tea-room/order-list?isGroupBuying=${isGroupBuying.value ? 1 : 0}`)
} }
} }

View File

@ -9,7 +9,15 @@
<template> <template>
<view> <view>
<view> <view>
<navbar title="预约茶室" fixed> <navbar fixed layoutLeft hideLeftIcon>
<template #left>
<view class="h-48rpx flex items-center" @click="Room.handleBack">
<view class="mt-4rpx">
<wd-icon name="thin-arrow-left" size="30rpx" color="#121212" ></wd-icon>
</view>
<view class="text-[#303133] text-36rpx ml-24rpx leading-48rpx">预约茶室</view>
</view>
</template>
<template #right> <template #right>
<view class="flex items-center ml-114rpx right-slot"> <view class="flex items-center ml-114rpx right-slot">
<!-- <view class="mr-16rpx flex items-center" @click="Room.handleCollect"> <!-- <view class="mr-16rpx flex items-center" @click="Room.handleCollect">
@ -248,8 +256,8 @@
const res = await getTeaRoomDetail({ const res = await getTeaRoomDetail({
id: teaRoomId.value, id: teaRoomId.value,
latitude: uni.getStorageSync('latitude'), latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
longitude: uni.getStorageSync('longitude'), longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
user_id: userInfo.value.id || 0 user_id: userInfo.value.id || 0
}) })
teaRoom.value = res.details teaRoom.value = res.details
@ -373,6 +381,15 @@
handleToRecharge: () => { handleToRecharge: () => {
// router.navigateTo(`/bundle/store-recharge/store-recharge?id=${teaRoom.value.id}&storeName=${teaRoom.value.name}`) // router.navigateTo(`/bundle/store-recharge/store-recharge?id=${teaRoom.value.id}&storeName=${teaRoom.value.name}`)
router.navigateTo('/bundle/wallet/recharge') router.navigateTo('/bundle/wallet/recharge')
},
/**
* 因为会从付款成功提示页跳转但是返回时页面没有栈所以需要switch方法跳转
*/
handleBack: () => {
router.navigateBack().catch(err => {
router.switchTab('/pages/index/index')
})
} }
} }
</script> </script>

View File

@ -185,8 +185,8 @@
handleGetTeaSpecialistDetails: async (id: number, user_id: number) => { handleGetTeaSpecialistDetails: async (id: number, user_id: number) => {
const res = await getTeaSpecialistDetails({ const res = await getTeaSpecialistDetails({
id, id,
latitude: uni.getStorageSync('latitude'), latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
longitude: uni.getStorageSync('longitude'), longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
user_id user_id
}) })
// 将返回的数据合并到 reactive 对象中 // 将返回的数据合并到 reactive 对象中
@ -200,8 +200,8 @@
// 获取订单详情接口 // 获取订单详情接口
const res = await getTeaRoomOrderDetail({ const res = await getTeaRoomOrderDetail({
id: orderId.value, id: orderId.value,
latitude: uni.getStorageSync('latitude'), latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
longitude: uni.getStorageSync('longitude') longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
}) })
order.value = res order.value = res
money.value = Number(res.details.order_amount) money.value = Number(res.details.order_amount)

View File

@ -241,8 +241,8 @@
handleInit: async () => { handleInit: async () => {
const res = await getTeaRoomOrderDetail({ const res = await getTeaRoomOrderDetail({
id: orderId.value, id: orderId.value,
latitude: uni.getStorageSync('latitude'), latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
longitude: uni.getStorageSync('longitude') longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
}) })
order.value = res.details order.value = res.details
console.log("🚀 ~ order.value :", order.value ) console.log("🚀 ~ order.value :", order.value )