Files
wangxiaowei 2e61a619d3 调试接口
2025-12-25 00:06:10 +08:00

114 lines
3.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 使用 type="home" 属性设置首页其他页面不需要设置默认为page -->
<route lang="jsonc" type="page">{
"needLogin": true,
"layout": "tabbar",
"style": {
"navigationStyle": "custom"
}
}</route>
<template>
<view class="pb-180rpx">
<view>
<navbar title="包间详情" custom-class='!bg-[#F6F7F8]'></navbar>
</view>
<view>
<view class="mt-20rpx mx-30rpx swiper">
<wd-swiper height="320rpx"
:indicator="{ type: 'dots-bar' }" :list="swiperList" v-model:current="current" mode="aspectFit">
</wd-swiper>
</view>
<view class="bg-white rounded-16rpx py-26rpx px-30rpx mt-24rpx mx-30rpx">
<view class="flex items-center justify-between">
<price-format color="#FF5951" :first-size="36" :second-size="36" :subscript-size="24" :price="teaRoom.room.price"></price-format>
<view class="font-400 text-22rpx text-[#6A6363] leading-32rpx">已售 {{ teaRoom.room.sold > 10 ? '10+': teaRoom.room.sold }} </view>
</view>
<view class="font-bold text-36rpx text-[#303133] leading-50rpx mt-20rpx">{{ teaRoom.room.title }}</view>
<view class="mt-14rpx flex">
<template v-for="(label, labelIndex) in teaRoom.label" :key="labelIndex">
<view class="mr-20rpx flex items-start">
<wd-tag
:color="randomLabelColor(Number(labelIndex))"
:bg-color="randomLabelColor(Number(labelIndex))"
plain
custom-class="!rounded-4rpx"
>{{ label.label_name }}</wd-tag>
</view>
</template>
</view>
</view>
<view >
<!-- 使用说明 -->
<view class="bg-white rounded-16rpx py-26rpx px-30rpx mt-24rpx mx-30rpx">
<view class="text-[#303133] text-32rpx leading-44rpx font-bold mb-24rpx">使用说明</view>
<view class="">
<rich-text :nodes="teaRoom.textarea1"></rich-text>
</view>
</view>
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import { getStoreOrderDetails } from '@/api/store'
import PriceFormat from '@/components/PriceFormat.vue'
import { randomLabelColor } from '@/utils/tools'
const swiperList = ref<string[]>([])
const current = ref<number>(0)
const html: string = '<p>这里是富文本内容,需要后台传递</p>'
// 包间内容
const roomId = ref<number>(0) // 门店ID
const teaRoom = ref<any>({})
onLoad((args) => {
roomId.value = Number(args.id)
Detail.handleInitReserveRoom()
})
const Detail = {
/**
* 初始包间详情
*/
handleInitReserveRoom: async () => {
const res = await getStoreOrderDetails(roomId.value)
console.log("🚀 ~ res:", res)
teaRoom.value = res.details
console.log("🚀 ~ teaRoom.value:", teaRoom.value)
swiperList.value = teaRoom.value.img_arr
}
}
</script>
<style lang="scss">
page {
background-color: $cz-page-background;
}
.swiper {
:deep() {
.wd-swiper-nav__item--dots-bar {
width: 56rpx !important;
height: 6rpx !important;
border-radius: 3rpx !important;
}
.is-active {
background-color: #2B9F93 !important;
}
}
}
.pay {
:deep() {
.wd-radio {
margin-top: 0 !important;
}
}
}
</style>