完善页面

This commit is contained in:
wangxiaowei
2025-09-09 22:33:38 +08:00
parent ff964fbc87
commit 0064e83e20
23 changed files with 1344 additions and 162 deletions

View File

@ -101,7 +101,7 @@
</view>
</view>
<view class="fixed left-0 right-0 bottom-0 z-2 bg-[#fff] flex justify-between items-center" :style="{ height: '140rpx', bottom: 'env(safe-area-inset-bottom)' }">
<view class="fixed left-0 right-0 bottom-0 z-2 bg-[#fff] flex justify-between items-center" :style="{ height: '140rpx'}">
<view class="ml-60rpx text-[#121212] text-24rpx leading-34rpx">已选择1张</view>
<view class="mr-30rpx">
<wd-button custom-class='!bg-[#4C9F44] !rounded-8rpx !h-70rpx'>确定</wd-button>

View File

@ -0,0 +1,248 @@
<route lang="jsonc" type="page">
{
"layout": "default",
"style": {
"navigationStyle": "custom"
}
}
</route>
<template>
<view class="pb-254rpx">
<!-- 平台团购直营店 -->
<view>
<navbar :title="title" custom-class='!bg-[#F6F7F8]'></navbar>
</view>
<view class="text-[#909399] text-26rpx leading-36rpx mx-102rpx mb-40rpx">
<view v-if="orderType === GroupBuyingCategoryOrderStatus.AfterSaleApply || orderType === GroupBuyingCategoryOrderStatus.AfterSaleProcessing">请耐心等待,我们会尽快处理您的请求</view>
<view v-if="orderType === GroupBuyingCategoryOrderStatus.Refunded" class="text-center mt-14rpx">
<view class="text-40rpx text-[#303133] leading-56rpx">退款成功¥128.00</view>
<view class="text-28rpx text-[#606266] leading-54rpx mt-20rpx">谢谢您的信任,我们一定会做的更好</view>
<view class="text-24rpx text-[#606266] leading-34rpx mt-12rpx">2025年4月13日 18:22</view>
</view>
</view>
<!-- 订单 -->
<view class="mx-30rpx">
<view class="bg-white rounded-16rpx p-30rpx">
<view class="flex items-center">
<view class="mr-30rpx">
<wd-img width="190rpx" height="190rpx" :src="`${OSS}images/home/home_image5.png`" mode="scaleToFill"></wd-img>
</view>
<view class="flex-1">
<view class="flex justify-between items-center" @click="afterSales.handleToCombo">
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx w-362rpx line-1">这是团购套餐的可以点击进 </view>
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
</view>
<view class="flex justify-between items-center text-26rpx leading-36rpx text-[#909399] mt-18rpx">
<view>3小时</view>
<view>x1</view>
</view>
<view class="text-[#606266] text-right mt-26rpx">
<text class="text-24rpx leading-34rpx mr-12rpx">实付</text>
<text class="tetx-32rpx leading-36rpx">¥29.32</text>
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
</view>
</view>
</view>
</view>
</view>
<!-- 售后原因 -->
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx" @click="showResonPopup = true" v-if="orderType === GroupBuyingCategoryOrderStatus.AfterSaleApply">
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between">
<view class="text-32rpx leading-44rpx text-[#303133]">售后原因</view>
<view>
<text class='text-[#909399] mr-10rpx'>{{ formData.reason ? reasonText : '请至少选择一项' }}</text>
<wd-icon name="arrow-right" size="24rpx" color="#666666" custom-class="!bg-[#F8F9FA]"></wd-icon>
</view>
</view>
</view>
<!-- 订单信息(选填) -->
<view class="bg-white rounded-16rpx px-30rpx pb-32rpx mx-30rpx mt-20rpx" v-if="orderType === GroupBuyingCategoryOrderStatus.AfterSaleApply">
<view class="pt-32rpx text-[#303133] text-32rpx leading-44rpx">
<text>订单信息</text>
<text class="text-26rpx text-[#909399] leading-36rpx ml-20rpx">(选填)</text>
</view>
<view class="mt-28rpx">
<wd-textarea placeholder="有想说的可以在这里写哦!" v-model="formData.info" custom-class='!rounded-18rpx !border-2rpx !border-[#EFF0EF] !bg-[#F8F9FA]' custom-textarea-class='!bg-[#F8F9FA]' />
</view>
</view>
<!-- 售后已完成 -->
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx" v-if="orderType === GroupBuyingCategoryOrderStatus.Refunded">
<view class="text-[#303133] text-32rpx leading-44rpx">售后订单</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>售后原因</view>
<view>买多了/买错了</view>
</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>退款金额</view>
<view>¥159.22</view>
</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>申请时间</view>
<view>2019-05-16 13:20:26</view>
</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>退款编号</view>
<view>
<text>7327328627526903</text>
<wd-divider vertical />
<text class="text-[#4C9F44]">复制</text>
</view>
</view>
</view>
<!-- 售后订单 -->
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx" v-if="orderType !== GroupBuyingCategoryOrderStatus.AfterSaleApply">
<view class="text-[#303133] text-32rpx leading-44rpx">售后订单</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>售后原因</view>
<view>买多了/买错了</view>
</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>退款金额</view>
<view>¥159.22</view>
</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>申请时间</view>
<view>2019-05-16 13:20:26</view>
</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>退款编号</view>
<view>
<text>7327328627526903</text>
<wd-divider vertical />
<text class="text-[#4C9F44]">复制</text>
</view>
</view>
</view>
<!-- 操作按钮 -->
<view class="w-full fixed bottom-0 left-0 right-0 h-152rpx" :class="orderType === GroupBuyingCategoryOrderStatus.AfterSaleApply ? '' : 'bg-white'">
<view class="mt-34rpx">
<!-- 待使用 -->
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center text-[#303133]" v-if="orderType !== GroupBuyingCategoryOrderStatus.AfterSaleApply">
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx mr-30rpx">联系商家</view>
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx">联系平台</view>
</view>
<!-- 申请售后 -->
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderType === GroupBuyingCategoryOrderStatus.AfterSaleApply" @click="afterSales.handleSubmitRefund">
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]">提交</view>
</view>
</view>
</view>
<!-- 售后原因弹出框 -->
<wd-popup v-model="showResonPopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
<view class="relative pb-78rpx">
<view class="absolute top-18rpx right-30rpx" @click="showResonPopup = false">
<wd-img width="60rpx" height='60rpx' :src="`${OSS}icon/icon_close.png`"></wd-img>
</view>
<view class="text-36rpx text-[#121212] leading-50rpx text-center pt-50rpx pb-40rpx">售后原因</view>
<view>
<wd-radio-group v-model="reasonModelValue">
<view v-for="(item, index) in reasonGroups" :key="index">
<view class="text-32rpx text-[#303133] leading-44rpx ml-60rpx mb-28rpx">{{ item.title }}</view>
<view v-for="option in item.options" :key="option.value" class="flex items-center justify-between mb-20rpx">
<view class="text-28rpx text-[#303133] ml-60rpx">{{ option.label }}</view>
<view class="mr-28rpx">
<wd-radio :value="option.value" checked-color="#4C9F44" size='large' shape="dot"></wd-radio>
</view>
</view>
<!-- 分隔线 -->
<view class="ml-30rpx" v-if="index === 0" >
<wd-divider color="#F6F7F9"/>
</view>
</view>
</wd-radio-group>
</view>
<view class="w-630rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff] mx-auto mt-160rpx" @click="afterSales.handleSelectReason">确定</view>
</view>
</wd-popup>
</view>
</template>
<script lang="ts" setup>
import { GroupBuyingCategory, GroupBuyingCategoryOrderStatus, GroupBuyingStatusTitle } from '@/utils/groupBuying'
import { PersonalReasonMap, MerchantReasonMap, ReasonMap } from '@/utils/platformService'
import {toast} from '@/utils/toast'
/** 表单相关 **/
const reasonText = ref<string>('') // 显示售后原因文本
const reasonModelValue = ref<number>(0) // 售后原因
const showResonPopup = ref<boolean>(false) // 是否显示售后原因弹出框
const reasonGroups = [
{ title: '个人原因', options: PersonalReasonMap },
{ title: '商家原因', options: MerchantReasonMap }
]
interface FormData {
info: string,
reason: number
}
const formData = reactive<FormData>({
info: '', // 订单信息(字符串)
reason: 0 // 售后原因整数类型建议和选项value对应
})
/** 结束 **/
const OSS = inject('OSS')
const title = ref<string>('')
const type = ref<string>('') // 订单类型:团购、抖音等
const orderType = ref<string>('') // 订单状态:待使用、退款等
onLoad((args) => {
// 这里暂时使用 GroupBuyingCategory.Direct 这个,因为平台团购类型下面都是有共同的售后
title.value = GroupBuyingStatusTitle[GroupBuyingCategory.Direct][args.orderType] || '订单详情'
type.value = args.type
orderType.value = args.orderType
})
const afterSales = {
handleToCombo: () => {
toast.info('跳转到套餐详情')
},
// 提交申请退款
handleSubmitRefund: () => {
if (formData.reason === 0) {
toast.info('请选择售后原因')
return
}
},
// 选择原因
handleSelectReason: () => {
if (reasonModelValue.value === 0) {
toast.info('请选择售后原因')
return
}
reasonText.value = ReasonMap[reasonModelValue.value]
formData.reason = reasonModelValue.value
showResonPopup.value = false
}
}
</script>
<style lang="scss">
page {
background-color: $cz-page-background;
}
.coupon-bg {
background-image: url(#{$OSS}images/order/order_image2.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
</style>

View File

@ -100,7 +100,7 @@
</template>
<script lang="ts" setup>
import { GroupBuyingCategory, GroupBuyingCategoryOrderStatus, GroupBuyingStatusTitle } from '@/utils/order'
import { GroupBuyingCategory, GroupBuyingCategoryOrderStatus, GroupBuyingStatusTitle } from '@/utils/groupBuying'
console.log("🚀 ~ GroupBuyingStatusTitle:", GroupBuyingStatusTitle)
import {toast} from '@/utils/toast'

View File

@ -20,7 +20,7 @@
<view class="content mx-30rpx mt-34rpx">
<mescroll-body @init="mescrollInit" @down="downCallback" @up="orderList.upCallback">
<view class="mb-20rpx" v-for="(item, index) in 10" :key="index">
<combo-card type="DouYin"></combo-card>
<combo-card :type="GroupBuyingCategory.DouYin"></combo-card>
</view>
</mescroll-body>
</view>
@ -38,7 +38,7 @@
</view>
</wd-tab>
</wd-tabs>
<view class="absolute right-0 top-10rpx excharge w-178rpx h-80rpx leading-80rpx text-[#fff] text-center font-bold text-24rpx leading-34rpx">
<view class="absolute right-0 top-10rpx excharge w-178rpx h-80rpx leading-80rpx text-[#fff] text-center font-bold text-24rpx leading-34rpx" @click="orderList.handleToExcharge">
去兑换
</view>
</view>
@ -50,6 +50,8 @@
import ComboCard from '@/components/order/ComboCard.vue'
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
import { GroupBuyingCategory } from '@/utils/groupBuying'
/* mescroll */
const { mescrollInit, downCallback } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook
@ -117,6 +119,13 @@
// })
},
// 去兑换
handleToExcharge: () => {
uni.navigateTo({
url: '/bundle/group-buying/douyin/excharge'
})
},
// 切换菜单
handleChangeMenu: (type: number) => {
currentType.value = type

View File

@ -142,38 +142,13 @@
</view>
</view>
<!-- 售后订单 -->
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx" v-if="orderType === GroupBuyingCategoryOrderStatus.Refunded">
<view class="text-[#303133] text-32rpx leading-44rpx">售后订单</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>售后原因</view>
<view>买多了/买错了</view>
</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>退款金额</view>
<view>159.22</view>
</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>申请时间</view>
<view>2019-05-16 13:20:26</view>
</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>退款编号</view>
<view>
<text>7327328627526903</text>
<wd-divider vertical />
<text class="text-[#4C9F44]">复制</text>
</view>
</view>
</view>
<!-- 操作按钮 -->
<view class="w-full fixed bottom-0 left-0 right-0 bg-white h-152rpx">
<view class="mt-34rpx">
<!-- 待使用 -->
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderType === GroupBuyingCategoryOrderStatus.ToUse">
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx">申请退款</view>
<view class="w-330rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]">立即预定</view>
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="directOrderDetail.handleToRefund">申请退款</view>
<view class="w-330rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="directOrderDetail.handleToChooseTeaRoom">立即预定</view>
</view>
<!-- 已使用 -->
@ -186,7 +161,7 @@
</template>
<script lang="ts" setup>
import { GroupBuyingCategory, GroupBuyingCategoryOrderStatus, GroupBuyingStatusTitle } from '@/utils/order'
import { GroupBuyingCategory, GroupBuyingCategoryOrderStatus, GroupBuyingStatusTitle } from '@/utils/groupBuying'
import {toast} from '@/utils/toast'
@ -227,11 +202,26 @@
handleCallPhone: () => {
},
// 跳转到申请退款页面
handleToRefund: () => {
uni.navigateTo({
url: `/bundle/group-buying/after-sales/after-sales?type=direct&orderType=${GroupBuyingCategoryOrderStatus.AfterSaleApply}`
})
},
// 跳转到立即预定页面(选择茶室)
handleToChooseTeaRoom: () => {
uni.navigateTo({
url: `/bundle/reserve-room/choose-room`
})
},
}
</script>
<style lang="scss" scoped>
<style lang="scss">
page {
background-color: $cz-page-background;
}

View File

@ -17,11 +17,6 @@
<view class="text-[#909399] text-26rpx leading-36rpx mx-102rpx mb-40rpx">
<text v-if="orderType === GroupBuyingCategoryOrderStatus.ToUse">请在2025.12.31()前使用</text>
<text v-if="orderType === GroupBuyingCategoryOrderStatus.Used">品一口香茗让生活慢下来从一杯好茶开始</text>
<view v-if="orderType === GroupBuyingCategoryOrderStatus.Refunded" class="text-center mt-14rpx">
<view class="text-40rpx text-[#303133] leading-56rpx">退款成功128.00</view>
<view class="text-28rpx text-[#606266] leading-54rpx mt-20rpx">谢谢您的信任我们一定会做的更好</view>
<view class="text-24rpx text-[#606266] leading-34rpx mt-12rpx">2025年4月13日 18:22</view>
</view>
</view>
<!-- 待使用下显示 -->
@ -183,7 +178,7 @@
</template>
<script lang="ts" setup>
import { GroupBuyingCategory, GroupBuyingCategoryOrderStatus, GroupBuyingStatusTitle } from '@/utils/order'
import { GroupBuyingCategory, GroupBuyingCategoryOrderStatus, GroupBuyingStatusTitle } from '@/utils/groupBuying'
import {toast} from '@/utils/toast'
const OSS = inject('OSS')
@ -227,7 +222,7 @@
</script>
<style lang="scss" scoped>
<style lang="scss">
page {
background-color: $cz-page-background;
}

View File

@ -0,0 +1,275 @@
<!-- 使用 type="home" 属性设置首页其他页面不需要设置默认为page -->
<route lang="jsonc" type="page">{
"layout": "tabbar",
"style": {
"navigationStyle": "custom"
}
}</route>
<template>
<view class="pb-200rpx">
<view>
<navbar layoutLeft>
<template #left>
<view class="flex items-center">
<view class="text-[#4C9F44] text-32rpx leading-44rpx flex items-center">
<view class="w-40rpx h-40rpx leading-36rpx rounded-40rpx bg-[#E1F3DE] mr-10rpx">1</view>
<view>选择茶室</view>
</view>
<view class="flex items-center mx-10rpx">
<wd-img width="50rpx" height="14rpx" :src="`${OSS}icon/icon_switch_left2.png`"></wd-img>
</view>
<view class="text-[#4C9F44] text-32rpx leading-44rpx flex items-center">
<view class="w-40rpx h-40rpx leading-36rpx rounded-40rpx bg-[#E1F3DE] mr-10rpx">2</view>
<view>预定</view>
</view>
</view>
</template>
</navbar>
</view>
<view class="">
<!-- 轮播图 -->
<view class="mt-32rpx mx-30rpx">
<wd-swiper value-key="image" height="240rpx" indicatorPosition="bottom-left"
:indicator="{ type: 'dots-bar' }" :list="swiperList" v-model:current="current"
@click="chooseRoomReserve.handleClick" @change="chooseRoomReserve.onChange" mode="aspectFit"></wd-swiper>
</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="html"></rich-text>
</view>
</view>
<!-- 预定时间 -->
<view class="bg-white rounded-16rpx py-26rpx px-30rpx mt-24rpx mx-30rpx" @click="showBookTimePopup = true">
<view class="text-[#303133] text-32rpx leading-44rpx font-bold mb-24rpx">预定时间</view>
<view class="flex items-center justify-between">
<view class="text-[26rpx] text-[#606266] leading-36rpx">3小时起订</view>
<view class="flex items-center">
<view class="text-[28rpx] text-[#909399] leading-40rpx">
3小时起订
</view>
<view class="mt-4rpx">
<wd-icon name="chevron-right" size="22px" color="#909399"></wd-icon>
</view>
</view>
</view>
</view>
<!-- 适用门店 -->
<view class="bg-white rounded-16rpx px-30rpx pb-32rpx mx-30rpx mt-20rpx">
<view class="pt-32rpx text-[#303133] text-32rpx leading-44rpx">适用门店</view>
<view class="mt-26rpx flex items-center">
<view class="mr-24rpx">
<wd-img width="170rpx" height="170rpx" :src="`${OSS}images/home/home_image5.png`"></wd-img>
</view>
<view class="flex-1 flex justify-between items-center relative">
<view class="">
<view class="text-[#303133] text-30rpx leading-40rpx line-2">这是商家的名称这是</view>
<view class="mt-26rpx text-[#909399] text-24rpx leading-34rpx">距您9km</view>
<view class="flex items-center mt-14rpx">
<view class="mr-8rpx">
<wd-img width="28rpx" height="28rpx" :src="`${OSS}icon/icon_location.png`"/>
</view>
<view class="ml-2rpx text-26rpx text-[#606266] line-2 w-300rpx">青浦区仓路478号青浦区仓路478号青浦区仓路478号青浦区仓路478号青浦区仓路478号青浦区仓路478号</view>
</view>
</view>
<view class="flex absolute top-1/2 right-0 -translate-y-1/2">
<view class="text-center mr-20rpx" @click="chooseRoomReserve.handleLocation">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_nav.png`"/>
</view>
<view class="text-center" @click="chooseRoomReserve.handleCallPhone">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_phone.png`"/>
</view>
</view>
</view>
</view>
</view>
<!-- 选择茶室包间 -->
<view class="bg-white mx-30rpx rounded-16rpx px-30rpx pb-32rpx mx-30rpx mt-20rpx">
<view class="text-32rpx text-[#303133] leading-44rpx pt-32rpx">选择茶室包间</view>
<view class="mt-26rpx">
<mescroll-body @init="mescrollInit" @down="downCallback" @up="chooseRoomReserve.upCallback">
<room-list :is-reserve="true" :store-type="storeType"></room-list>
</mescroll-body>
</view>
</view>
<!-- 操作按钮 -->
<view class="w-full fixed bottom-0 left-0 right-0 bg-white h-152rpx flex items-center justify-center">
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center">
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]">下一步</view>
</view>
</view>
</view>
<booking-time v-model="showBookTimePopup"></booking-time>
</view>
</template>
<script lang="ts" setup>
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
import RoomList from '@/components/reserve/RoomList.vue'
import BookingTime from '@/components/BookingTime.vue'
import {toast} from '@/utils/toast'
const OSS = inject('OSS')
/** 轮播图 **/
const swiperList = ref<string[]>([
`${OSS}images/banner1.png`,
`${OSS}images/banner1.png`,
`${OSS}images/banner1.png`
])
const current = ref<number>(0)
/** 结束 **/
/** 轮播图 **/
const showBookTimePopup = ref<boolean>(false)
/** 结束 **/
const html: string = '<p>这里是富文本内容,需要后台传递</p>'
const showAction = ref<boolean>(false)
const sheetMenu = ref([])
const showServicePopup = ref<boolean>(false)
const storeType = ref<number>(1) // 1直营 2加盟
/* mescroll */
const { mescrollInit, downCallback } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook
onLoad(() => {
})
const chooseRoomReserve = {
upCallback: (mescroll) => {
// 需要留一下数据为空的时候显示的空数据图标内容
// list({
// page: mescroll.num,
// size: mescroll.size
// }).then((res: { list: Array<any>, totalPages: Number }) => {
// const curPageData = res.list || [] // 当前页数据
// if(mescroll.num == 1) goods.value = []; // 第一页需手动制空列表
// goods.value = goods.value.concat(curPageData); //追加新数据
// console.log("🚀 ~ goods:", goods)
// mescroll.endByPage(curPageData.length, res.totalPages); //必传参数(当前页的数据个数, 总页数)
// }).catch(() => {
// mescroll.endErr(); // 请求失败, 结束加载
// })
// apiGoods(mescroll.num, mescroll.size).then(res=>{
// const curPageData = res.list || [] // 当前页数据
// if(mescroll.num == 1) goods.value = []; // 第一页需手动制空列表
// goods.value = goods.value.concat(curPageData); //追加新数据
// //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
// //mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
// //方法一(推荐): 后台接口有返回列表的总页数 totalPage
// //mescroll.endByPage(curPageData.length, totalPage); //必传参数(当前页的数据个数, 总页数)
// //方法二(推荐): 后台接口有返回列表的总数据量 totalSize
// //mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
// //方法三(推荐): 您有其他方式知道是否有下一页 hasNext
// //mescroll.endSuccess(curPageData.length, hasNext); //必传参数(当前页的数据个数, 是否有下一页true/false)
// //方法四 (不推荐),会存在一个小问题:比如列表共有20条数据,每页加载10条,共2页.如果只根据当前页的数据个数判断,则需翻到第三页才会知道无更多数据.
// mescroll.endSuccess(curPageData.length); // 请求成功, 结束加载
// }).catch(()=>{
mescroll.endErr(); // 请求失败, 结束加载
// })
},
// 收藏和取消收藏
handleCollect: () => {
// 处理收藏逻辑
toast.info('收藏成功')
},
// 打开客服弹窗
handleService: () => {
showServicePopup.value = true
},
// 处理菜单选择
handleSelectMenu: (item: any) => {
console.log("🚀 ~ item:", item)
if (chooseRoomReserve.sheetMenuType == 'service') {
// 处理客服相关的菜单项
if (item.value === 'saveImage') {
// 处理保存图片逻辑
toast.success('图片已保存')
} else if (item.value === 'addWeChat') {
// 处理添加微信逻辑
toast.success('已添加门店微信')
}
} else if (chooseRoom.sheetMenuType == 'call' && item.index == 1) {
uni.makePhoneCall({
phoneNumber: item.value // 替换为实际电话号码
})
}
showAction.value = false // 关闭菜单
},
// 处理导航逻辑
handleLocation: () => {
toast.info('正在导航...')
// 可以使用uni.navigateTo或其他方式打开地图应用
uni.navigateTo({
url: '/pages/map/map' // 假设有一个地图页面
})
},
// 处理拨打电话逻辑
handleCallPhone: () => {
chooseRoom.sheetMenuType = 'call'
showAction.value = true
sheetMenu.value = [
{
name: 15005837859,
value: ''
},
{
name: '呼叫',
value: 15005837859
}
]
},
// tab切换获取index
handleChangeTab: (item: { index: number }) => {
// tabIndexs.value = item.index
// scrollToLastY()
},
handleClick: (item: any) => {
// 处理点击事件
console.log('Clicked item:', item)
},
onChange: (e: any) => {
// 设置 current.value 为当前轮播索引
current.value = e.current
},
handleToRecharge: () => {
uni.navigateTo({
url: '/bundle/store-recharge/store-recharge'
})
}
}
</script>
<style lang="scss">
page {
background-color: $cz-page-background;
}
</style>

View File

@ -0,0 +1,227 @@
<!-- 使用 type="home" 属性设置首页其他页面不需要设置默认为page -->
<route lang="jsonc" type="page">{
"layout": "tabbar",
"style": {
"navigationStyle": "custom"
}
}</route>
<template>
<view class="pb-200rpx">
<view>
<navbar layoutLeft>
<template #left>
<view class="flex items-center">
<view class="text-[#4C9F44] text-32rpx leading-44rpx flex items-center">
<view class="w-40rpx h-40rpx leading-36rpx rounded-40rpx bg-[#E1F3DE] mr-10rpx">1</view>
<view>选择茶室</view>
</view>
<view class="flex items-center mx-10rpx">
<wd-img width="50rpx" height="14rpx" :src="`${OSS}icon/icon_switch_left.png`"></wd-img>
</view>
<view class="text-32rpx leading-44rpx flex items-center">
<view class="w-40rpx h-40rpx leading-36rpx rounded-40rpx bg-[#BFC2CC] text-[#fff] mr-10rpx">2</view>
<view class="text-[#606266]">预定</view>
</view>
</view>
</template>
</navbar>
</view>
<!-- 适用门店 -->
<view class="bg-white rounded-16rpx px-30rpx pb-32rpx mx-30rpx mt-20rpx">
<view class="pt-32rpx text-[#303133] text-32rpx leading-44rpx">适用门店</view>
<view class="mt-26rpx flex items-center">
<view class="mr-24rpx">
<wd-img width="170rpx" height="170rpx" :src="`${OSS}images/home/home_image5.png`"></wd-img>
</view>
<view class="flex-1 flex justify-between items-center relative">
<view class="">
<view class="text-[#303133] text-30rpx leading-40rpx line-2">这是商家的名称这是</view>
<view class="mt-26rpx text-[#909399] text-24rpx leading-34rpx">距您9km</view>
<view class="flex items-center mt-14rpx">
<view class="mr-8rpx">
<wd-img width="28rpx" height="28rpx" :src="`${OSS}icon/icon_location.png`"/>
</view>
<view class="ml-2rpx text-26rpx text-[#606266] line-2 w-300rpx">青浦区仓路478号青浦区仓路478号青浦区仓路478号青浦区仓路478号青浦区仓路478号青浦区仓路478号</view>
</view>
</view>
<view class="flex absolute top-1/2 right-0 -translate-y-1/2">
<view class="text-center mr-20rpx" @click="chooseRoom.handleLocation">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_nav.png`"/>
</view>
<view class="text-center" @click="chooseRoom.handleCallPhone">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_phone.png`"/>
</view>
</view>
</view>
</view>
</view>
<!-- 选择茶室包间 -->
<view class="bg-white mx-30rpx rounded-16rpx px-30rpx pb-32rpx mx-30rpx mt-20rpx">
<view class="text-32rpx text-[#303133] leading-44rpx pt-32rpx">选择茶室包间</view>
<view class="mt-26rpx">
<mescroll-body @init="mescrollInit" @down="downCallback" @up="chooseRoom.upCallback">
<room-list :is-reserve="true" :store-type="storeType"></room-list>
</mescroll-body>
</view>
</view>
<!-- 操作按钮 -->
<view class="w-full fixed bottom-0 left-0 right-0 bg-white h-152rpx flex items-center justify-center">
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center">
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]">下一步</view>
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
import RoomList from '@/components/reserve/RoomList.vue'
import {toast} from '@/utils/toast'
const OSS = inject('OSS')
// tab
const tab = ref<number>(0)
const goods = ref<Array<any>[]>([])
const showAction = ref<boolean>(false)
const sheetMenu = ref([])
const showServicePopup = ref<boolean>(false)
const storeType = ref<number>(1) // 1直营 2加盟
/* mescroll */
const { mescrollInit, downCallback } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook
onLoad(() => {
})
const chooseRoom = {
sheetMenuType: '', // 记录菜单类型
// 上拉加载的回调: 其中num:当前页 从1开始, size:每页数据条数,默认10
upCallback: (mescroll) => {
// 需要留一下数据为空的时候显示的空数据图标内容
// list({
// page: mescroll.num,
// size: mescroll.size
// }).then((res: { list: Array<any>, totalPages: Number }) => {
// const curPageData = res.list || [] // 当前页数据
// if(mescroll.num == 1) goods.value = []; // 第一页需手动制空列表
// goods.value = goods.value.concat(curPageData); //追加新数据
// console.log("🚀 ~ goods:", goods)
// mescroll.endByPage(curPageData.length, res.totalPages); //必传参数(当前页的数据个数, 总页数)
// }).catch(() => {
// mescroll.endErr(); // 请求失败, 结束加载
// })
// apiGoods(mescroll.num, mescroll.size).then(res=>{
// const curPageData = res.list || [] // 当前页数据
// if(mescroll.num == 1) goods.value = []; // 第一页需手动制空列表
// goods.value = goods.value.concat(curPageData); //追加新数据
// //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
// //mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
// //方法一(推荐): 后台接口有返回列表的总页数 totalPage
// //mescroll.endByPage(curPageData.length, totalPage); //必传参数(当前页的数据个数, 总页数)
// //方法二(推荐): 后台接口有返回列表的总数据量 totalSize
// //mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
// //方法三(推荐): 您有其他方式知道是否有下一页 hasNext
// //mescroll.endSuccess(curPageData.length, hasNext); //必传参数(当前页的数据个数, 是否有下一页true/false)
// //方法四 (不推荐),会存在一个小问题:比如列表共有20条数据,每页加载10条,共2页.如果只根据当前页的数据个数判断,则需翻到第三页才会知道无更多数据.
// mescroll.endSuccess(curPageData.length); // 请求成功, 结束加载
// }).catch(()=>{
mescroll.endErr(); // 请求失败, 结束加载
// })
},
// 收藏和取消收藏
handleCollect: () => {
// 处理收藏逻辑
toast.info('收藏成功')
},
// 打开客服弹窗
handleService: () => {
showServicePopup.value = true
},
// 处理菜单选择
handleSelectMenu: (item: any) => {
console.log("🚀 ~ item:", item)
if (chooseRoom.sheetMenuType == 'service') {
// 处理客服相关的菜单项
if (item.value === 'saveImage') {
// 处理保存图片逻辑
toast.success('图片已保存')
} else if (item.value === 'addWeChat') {
// 处理添加微信逻辑
toast.success('已添加门店微信')
}
} else if (chooseRoom.sheetMenuType == 'call' && item.index == 1) {
uni.makePhoneCall({
phoneNumber: item.value // 替换为实际电话号码
})
}
showAction.value = false // 关闭菜单
},
// 处理导航逻辑
handleLocation: () => {
toast.info('正在导航...')
// 可以使用uni.navigateTo或其他方式打开地图应用
uni.navigateTo({
url: '/pages/map/map' // 假设有一个地图页面
})
},
// 处理拨打电话逻辑
handleCallPhone: () => {
chooseRoom.sheetMenuType = 'call'
showAction.value = true
sheetMenu.value = [
{
name: 15005837859,
value: ''
},
{
name: '呼叫',
value: 15005837859
}
]
},
// tab切换获取index
handleChangeTab: (item: { index: number }) => {
// tabIndexs.value = item.index
// scrollToLastY()
},
handleClick: (item: any) => {
// 处理点击事件
console.log('Clicked item:', item)
},
handleToRecharge: () => {
uni.navigateTo({
url: '/bundle/store-recharge/store-recharge'
})
}
}
</script>
<style lang="scss">
page {
background-color: $cz-page-background;
}
</style>

View File

@ -142,7 +142,7 @@
</view>
<view class="fixed left-0 right-0 bottom-0 z-2 bg-[#fff]"
:style="{ height: '140rpx', bottom: 'env(safe-area-inset-bottom)' }">
:style="{ height: '140rpx' }">
<view class="mt-12rpx w-full" v-if="!isGroupBuying">
<wd-gap height="2rpx" bgColor="#ECECEC"></wd-gap>
</view>
@ -300,6 +300,7 @@
<script lang="ts" setup>
import {toast} from '@/utils/toast'
import PriceFormat from '@/components/PriceFormat.vue'
import {ReserveServiceCategory} from '@/utils/platformService'
const OSS = inject('OSS')
@ -354,13 +355,12 @@
const showCostPopup = ref<boolean>(false) // 费用明细popup
const showPayPopup = ref<boolean>(false) // 支付popup
onLoad(() => {
if (isGroupBuying) {
onLoad((args) => {
if (args.type == ReserveServiceCategory.GroupBuying) {
// TODO 如果是团购套餐则直接微信支付?
pay.value = 3
console.log("🚀 ~ pay.value:", pay.value)
}
})
const detail = {

View File

@ -88,7 +88,7 @@
<wd-tab title="团购套餐">
<view class="content mx-30rpx mt-34rpx">
<mescroll-body @init="mescrollInit" @down="downCallback" @up="room.upCallback">
<room-list :is-group-buying="true" :is-reserve="false" :store-type="storeType"></room-list>
<room-list :is-group-buying="true" :store-type="storeType"></room-list>
</mescroll-body>
</view>
</wd-tab>

View File

@ -0,0 +1,156 @@
<template>
<wd-popup v-model="showPopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
<view class="relative pb-78rpx">
<view class="absolute top-18rpx right-30rpx" @click="showPopup = false">
<wd-img width="60rpx" height='60rpx' :src="`${OSS}icon/icon_close.png`"></wd-img>
</view>
<view class="text-36rpx text-[#121212] leading-50rpx text-center pt-50rpx pb-40rpx">选择时间</view>
<view class="">
<view class="booking-time ">
<wd-tabs v-model="selectedDay" color="#4C9F44">
<block v-for="item in days" :key="item">
<scroll-view scroll-y>
<wd-tab :title="`${item}`" :name="item">
<view class="">
<view class="!h-500rpx mt-30rpx">
<view class="grid grid-cols-4 gap-x-20rpx gap-y-20rpx mx-30rpx">
<view v-for="item in timeList" :key="item.time"
class="h-72rpx rounded-16rpx flex items-center justify-center text-28rpx leading-40rpx"
:class="[
item.disabled
? 'bg-[#F7F7F7] text-[#C9C9C9]' // 禁用高亮
: selectedTime.includes(item.time)
? 'bg-[#F1F8F0] text-[#4C9F44]' // 选中高亮
: 'bg-[#F7F7F7] text-[#303133]', // 可选高亮
]" @click="!item.disabled && bookingTime.handleSelectTime(item.time)">
{{ item.time }}
</view>
</view>
</view>
<view class="">
<view>
<wd-gap height="2rpx" bg-color="#E5E5E5"></wd-gap>
</view>
<view class="">
<view class="w-full fixed bottom-0 left-0 right-0 bg-white h-152rpx text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center">
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="bookingTime.resetSelectedTime">重置</view>
<view class="w-330rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="bookingTime.handleConfirmSelectedTime">
<text>确定</text>
<text v-if="countSelectedTime">{{countSelectedTime}}小时</text>
</view>
</view>
</view>
</view>
</view>
</wd-tab>
</scroll-view>
</block>
</wd-tabs>
</view>
</view>
</view>
</wd-popup>
</template>
<script lang="ts" setup name="BookingTime">
const OSS = inject('OSS')
/**
* BookingTime 预约时间
* @description 茶室预约时间选择组件
*/
const props = defineProps({
modelValue: {
type: Boolean,
default: false
},
// ...其它props
})
// 初始化时间
onMounted(() => {
bookingTime.handleInitTime()
})
/** 日期相关 **/
const timeList = [
{ time: '09:00', disabled: true },
{ time: '09:30', disabled: false },
{ time: '10:00', disabled: false },
{ time: '10:30', disabled: false },
{ time: '11:00', disabled: false },
{ time: '11:30', disabled: false },
]
const weekMap = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
const days = ref<string[]>([])
const selectedDay = ref<number>(0)
const selectedTime = ref<string[]>([])
const countSelectedTime = ref<number>(0)
const bookingTime = {
// 初始化时间逻辑
handleInitTime: () => {
const today = new Date()
const result: string[] = []
for (let i = 0; i < 7; i++) {
const d = new Date(today)
d.setDate(today.getDate() + i)
const month = d.getMonth() + 1
const date = d.getDate()
const week = weekMap[d.getDay()]
result.push(`${month}/${date}${week}`)
}
days.value = result
},
// 选择的时间高亮显示
handleSelectTime: (time: string) => {
const idx = selectedTime.value.indexOf(time)
if (idx > -1) {
selectedTime.value.splice(idx, 1) // 取消选中
} else {
selectedTime.value.push(time) // 选中
}
// 计算时长
countSelectedTime.value = selectedTime.value.length * 0.5
},
// 确认选择的时间
handleConfirmSelectedTime: () => {
console.log('确认选择的时间:', selectedDay.value, selectedTime.value)
showPopup.value = false
},
// 重置选择的时间
resetSelectedTime: () => {
selectedTime.value = []
},
}
const showPopup = computed({
get: () => props.modelValue,
set: (val: boolean) => emit('update:modelValue', val)
})
const emit = defineEmits(['update:modelValue'])
</script>
<script lang="ts">
export default {}
</script>
<style lang="scss" scoped>
.booking-time {
:deep() {
.wd-tabs__line {
background-color: #4C9F44;
}
}
}
</style>

View File

@ -27,7 +27,6 @@
* @description 对wd-navbar进行二次封装满足不同页面的需求
*/
import { ref, inject } from 'vue'
import { getNavBarHeight } from '@/utils/index'
const OSS = inject('OSS')

View File

@ -1,21 +1,21 @@
<template>
<view class="">
<!-- 平台团购直营店 -->
<view v-if="type === 'Direct'" class="bg-white rounded-10rpx p-30rpx">
<view v-if="type === GroupBuyingCategory.Direct" class="bg-white rounded-10rpx p-30rpx">
<view class="flex justify-between items-center">
<view class="flex items-center">
<view class="w-40rpx h-40rpx mr-10rpx">
<wd-img width="100%" height="100%" :src="`${OSS}icon/icon_tea.png`"></wd-img>
<view class="mr-10rpx flex items-center">
<wd-img width="40rpx" height="40rpx" :src="`${OSS}icon/icon_tea_room.png`"></wd-img>
</view>
<view class="flex items-center" @click="comboCard.handleToStore">
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx w-400rpx line-1">这是茶馆的名称这是茶馆的名称这是茶馆的名称</view>
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
</view>
</view>
<view class="font-400 text-28rpx leading-40rpx mt-12rpx">
<view class="font-400 text-28rpx leading-40rpx">
<text class="text-[#4C9F44]" v-if="orderType === GroupBuyingCategoryOrderStatus.ToUse">待使用</text>
<text class="text-[#606266]" v-if="orderType === GroupBuyingCategoryOrderStatus.Used">已使用</text>
<text class="text-[#C9C9C9]" v-if="orderType === GroupBuyingCategoryOrderStatus.AfterSaleFinished">已退款</text>
<text class="text-[#C9C9C9]" v-if="orderType === GroupBuyingCategoryOrderStatus.Refunded">已退款</text>
</view>
</view>
<view class="mt-22rpx">
@ -45,11 +45,11 @@
</view>
<!-- 平台团购加盟店和抖音团购 -->
<view v-if="type === 'Franchise' || type === 'DouYin'" class="bg-white rounded-10rpx p-30rpx">
<view v-if="type === GroupBuyingCategory.Franchise || type === GroupBuyingCategory.DouYin" class="bg-white rounded-10rpx p-30rpx">
<view class="flex justify-between items-center">
<view class="flex items-center">
<view class="w-40rpx h-40rpx mr-10rpx">
<wd-img width="100%" height="100%" :src="`${OSS}icon/icon_tea.png`"></wd-img>
<view class="mr-10rpx flex items-center">
<wd-img width="40rpx" height="40rpx" :src="`${OSS}icon/icon_tea_room.png`"></wd-img>
</view>
<view class="flex items-center" @click="comboCard.handleToStore">
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx w-400rpx line-1">这是茶馆的名称这是茶馆的名称这是茶馆的名称</view>
@ -76,8 +76,44 @@
</view>
<view class="text-center flex items-center text-28rpx mt-28rpx justify-end">
<view class="w-178rpx h-70rpx leading-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133] mr-28rpx" v-if="type === 'Franchise'">申请退款</view>
<view class="w-178rpx h-70rpx leading-70rpx rounded-8rpx border-[2rpx] border-[#4C9F44] text-[#4C9F44]" v-if="type === 'DouYin'">立即预定</view>
<view class="w-178rpx h-70rpx leading-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133] mr-28rpx" v-if="type === GroupBuyingCategory.Franchise">申请退款</view>
<view class="w-178rpx h-70rpx leading-70rpx rounded-8rpx border-[2rpx] border-[#4C9F44] text-[#4C9F44]" v-if="type === GroupBuyingCategory.DouYin">立即预定</view>
</view>
</view>
</view>
</view>
</view>
<!-- 茶室预约 -->
<view v-if="type === ReserveCategory.TeaRoom" class="bg-white rounded-10rpx p-30rpx">
<view class="flex justify-between items-center">
<view class="flex items-center">
<view class="mr-10rpx flex items-center">
<wd-img width="40rpx" height="40rpx" :src="`${OSS}icon/icon_tea_room.png`"></wd-img>
</view>
<view class="flex items-center" @click="comboCard.handleToStore">
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx w-400rpx line-1">这是茶馆的名称这是茶馆的名称这是茶馆的名称</view>
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
</view>
</view>
<view class="font-400 text-28rpx leading-40rpx mt-12rpx">
<text class="text-[#4C9F44]" v-if="orderType === ReserveCategoryOrderStatus.Consuming">消费中</text>
<text class="text-[#606266]" v-if="orderType === ReserveCategoryOrderStatus.Reserved">已预约</text>
<text class="text-[#C9C9C9]" v-if="orderType === ReserveCategoryOrderStatus.Serving">服务中</text>
</view>
</view>
<view class="mt-22rpx">
<view class="flex items-center">
<view class="w-200rpx h-200rpx mr-28rpx">
<wd-img width="100%" height="100%" :src="`${OSS}images/home/home_image5.png`"></wd-img>
</view>
<view class="flex-1">
<view @click="comboCard.handleToOrderDetail">
<view class="font-500 text-30rpx text-[#303133] leading-42rpx line-1 w-400rpx">这是茶室包间的名称</view>
<view class="font-400 leading-36rpx text-26rpx text-[#606266] mt-34rpx">
<view>预约时间03/18 08:00-12:00</view>
<view class="mt-18rpx">预约时长2小时</view>
</view>
</view>
</view>
</view>
@ -87,7 +123,8 @@
</template>
<script lang="ts" setup name="ComboCard">
import { GroupBuyingCategoryOrderStatus } from '@/utils/order'
import { GroupBuyingCategory, GroupBuyingCategoryOrderStatus } from '@/utils/groupBuying'
import { ReserveCategory, ReserveCategoryOrderStatus } from '@/utils/platformService'
/**
* ComboCard 套餐卡片组件
@ -98,11 +135,11 @@
const props = defineProps({
/**
* 类型: 直营(Direct)、加盟(Franchise)、抖音(DouYin) 等
* 类型: 直营(direct)、加盟(franchise)、抖音(douyin) 等
*/
type: {
type: String,
default: 'Direct'
default: GroupBuyingCategory.Direct
},
/**
* 订单类型: 待使用、退款等
@ -110,7 +147,7 @@
*/
orderType: {
type: String,
default: 'toUse'
default: GroupBuyingCategoryOrderStatus.ToUse
}
})

View File

@ -131,7 +131,7 @@
</template>
<script lang="ts" setup name="ComboCoupon">
import { GroupBuyingCategoryOrderStatus } from '@/utils/order'
import { GroupBuyingCategoryOrderStatus } from '@/utils/groupBuying'
/**
* Combo 套餐券组件

View File

@ -72,6 +72,7 @@
*/
import PriceFormat from '@/components/PriceFormat.vue'
import {ReserveServiceCategory} from '@/utils/platformService'
const OSS = inject('OSS')
@ -85,7 +86,7 @@
// 是否开启预定
isReserve: {
type: Boolean,
default: true
default: false
},
// 是否是团购
isGroupBuying: {
@ -102,8 +103,9 @@
const roomList = {
toPage: (type: string, id: number) => {
if (type === 'detail') {
let type = props.isGroupBuying ? ReserveServiceCategory.GroupBuying : ReserveServiceCategory.ReserveRoom
uni.navigateTo({
url: `/bundle/reserve-room/detail?id=${id}`
url: `/bundle/reserve-room/detail?id=${id}&type=${type}`
})
}
}

View File

@ -146,7 +146,8 @@
"type": "page",
"layout": "tabbar",
"style": {
"navigationStyle": "custom"
"navigationStyle": "custom",
"navigationBarTitleText": "首页"
}
},
{
@ -178,6 +179,22 @@
"navigationBarTitleText": "分包页面"
}
},
{
"path": "reserve-room/choose-room-reserve",
"type": "page",
"layout": "tabbar",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "reserve-room/choose-room",
"type": "page",
"layout": "tabbar",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "reserve-room/detail",
"type": "page",
@ -202,6 +219,14 @@
"navigationStyle": "custom"
}
},
{
"path": "group-buying/after-sales/after-sales",
"type": "page",
"layout": "default",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "group-buying/douyin/douyin-order-detail",
"type": "page",

View File

@ -11,7 +11,9 @@
<template>
<view class="">
<view class="search-box mx-30rpx mt-30rpx">
<wd-search placeholder="请输入城市名称" :placeholder-left="true" placeholderStyle="text-align:left;padding-left: 24rpx;line-heigt: 44rpx;color: #C9C9C9; font-size: 32rpx;font-weight: normal;"></wd-search>
<wd-search
placeholder="请输入城市名称"
placeholder-left></wd-search>
</view>
<view class="mt-52rpx mx-30rpx">
@ -78,11 +80,6 @@ page {
}
.wd-search__input {
// #ifdef MP
padding-left: 32px !important;
padding-right: 32px !important;
// #endif
// #ifndef MP
padding-right: 0 !important;
// #endif

View File

@ -113,13 +113,15 @@
const OSS = inject('OSS')
const navbarHeight = inject('navbarHeight')
/** 轮播图 **/
const swiperList = ref<string[]>([
`${OSS}images/banner1.png`,
`${OSS}images/banner1.png`,
`${OSS}images/banner1.png`
])
const current = ref<number>(0)
/** 结束 **/
const { mescrollInit, downCallback } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook
onLoad(() => {

View File

@ -6,7 +6,7 @@
}</route>
<template>
<view class="">
<view>
<view class="home-bg w-[100%] fixed top-0 left-0 z-100">
<wd-navbar safeAreaInsetTop :bordered="false" custom-style="background-color: transparent !important;">
<template #right>

View File

@ -2,54 +2,203 @@
<route lang="jsonc" type="page">{
"layout": "tabbar",
"style": {
"navigationStyle": "custom"
// 'custom' 表示开启自定义导航栏,默认 'default'
"navigationStyle": "custom",
"navigationBarTitleText": "首页"
}
}</route>
<template>
<view>
<view class="">
<wd-navbar safeAreaInsetTop :bordered="false">
<view class="home-bg w-[100%] fixed top-0 left-0 z-100">
<wd-navbar safeAreaInsetTop :bordered="false" custom-style="background-color: transparent !important;">
<template #left>
<view class="h-88rpx flex items-center">
<view class="text-[#303133] text-36rpx ml-24rpx">预约茶室</view>
</view>
</template>
<template #right>
<view class="flex items-center ml-114rpx right-slot">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_sc.png`" class="mr-16rpx"></wd-img>
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_kefu.png`"></wd-img>
<view class="search-box flex items-center ml-26rpx" @click="reserve.toSearch">
<wd-search placeholder="搜索茶址名称" hide-cancel disabled :placeholder-left="true"
placeholderStyle="text-align:left;padding-left: 24rpx;line-heigt: 44rpx;color: #C9C9C9; font-size: 32rpx;font-weight: normal;">
</wd-search>
</view>
</template>
</wd-navbar>
<view class="tabs">
<wd-tabs v-model="tab" swipeable slidable="always" @change="reserve.handleChangeTab" :lazy="false">
<wd-tab title="茶室预约"></wd-tab>
<wd-tab title="茶艺师预约"></wd-tab>
</wd-tabs>
</view>
</view>
<view class="mx-30rpx" :style="{ paddingTop: navbarHeight + 'px' }">
<mescroll-body @init="mescrollInit" @down="downCallback" @up="reserve.upCallback" :up="upOption">
<view v-for="(item, index) in 5" :key="index" >
<view class="mb-20rpx" v-if="tab === 0">
<combo-card :type="ReserveCategory.TeaRoom" :order-type="ReserveCategoryOrderStatus.Consuming"></combo-card>
</view>
</view>
</mescroll-body>
</view>
</view>
</template>
<script lang="ts" setup>
import { ref, inject } from 'vue'
import { getNavBarHeight } from '@/utils/index'
import ComboCard from '@/components/order/ComboCard.vue'
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
import { ReserveCategory, ReserveCategoryOrderStatus } from '@/utils/platformService'
let navbarHeight = ref<number>(0)
let OSS = inject('OSS')
const rightPadding = ref<string>('24rpx')
const OSS = inject('OSS')
const navbarHeight = Number(inject('navbarHeight')) + 42 + 14 // 42为tabs的高度 14是边距值
/** tab **/
const tab = ref<number>(0)
const reserveType = ref<number>(0) // 0:茶室预约 1:茶艺师预约
/** 结束 **/
/** mescroll **/
const { mescrollInit, downCallback } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook
const upOption = reactive({
empty: {
icon : OSS + 'icon/icon_reserver_empty.png',
}
})
/** 结束 **/
onLoad(() => {
navbarHeight.value = getNavBarHeight()
// #ifdef MP-WEIXIN
const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
rightPadding.value = menuButtonInfo.width + 16 + 'px'
// #endif
})
const reserve = {
// 上拉加载的回调: 其中num:当前页 从1开始, size:每页数据条数,默认10
upCallback: (mescroll) => {
// 需要留一下数据为空的时候显示的空数据图标内容
// list({
// page: mescroll.num,
// size: mescroll.size
// }).then((res: { list: Array<any>, totalPages: Number }) => {
// const curPageData = res.list || [] // 当前页数据
// if(mescroll.num == 1) goods.value = []; // 第一页需手动制空列表
// goods.value = goods.value.concat(curPageData); //追加新数据
// console.log("🚀 ~ goods:", goods)
// mescroll.endByPage(curPageData.length, res.totalPages); //必传参数(当前页的数据个数, 总页数)
// }).catch(() => {
// mescroll.endErr(); // 请求失败, 结束加载
// })
// apiGoods(mescroll.num, mescroll.size).then(res=>{
// const curPageData = res.list || [] // 当前页数据
// if(mescroll.num == 1) goods.value = []; // 第一页需手动制空列表
// goods.value = goods.value.concat(curPageData); //追加新数据
// //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
// //mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
// //方法一(推荐): 后台接口有返回列表的总页数 totalPage
// //mescroll.endByPage(curPageData.length, totalPage); //必传参数(当前页的数据个数, 总页数)
// //方法二(推荐): 后台接口有返回列表的总数据量 totalSize
// //mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
// //方法三(推荐): 您有其他方式知道是否有下一页 hasNext
// //mescroll.endSuccess(curPageData.length, hasNext); //必传参数(当前页的数据个数, 是否有下一页true/false)
// //方法四 (不推荐),会存在一个小问题:比如列表共有20条数据,每页加载10条,共2页.如果只根据当前页的数据个数判断,则需翻到第三页才会知道无更多数据.
// mescroll.endSuccess(curPageData.length); // 请求成功, 结束加载
// }).catch(()=>{
mescroll.endErr(); // 请求失败, 结束加载
// })
},
// 搜索
toSearch: () => {
uni.navigateTo({
url: '/pages/search/search'
})
},
// tab切换获取index
handleChangeTab: (item: { index: number }) => {
// tabIndexs.value = item.index
// scrollToLastY()
},
// 处理点击事件
handleClick: (item: any) => {
console.log('Clicked item:', item)
},
}
</script>
<style lang="scss">
page {
background-color: #fff;
background-color: $cz-page-background;
}
.right-slot {
padding-right: v-bind(rightPadding);
.home-bg {
background-color: $cz-page-background;
background-image: url(#{$OSS}images/home/home_bg.png);
background-size: 100% 280rpx;
background-repeat: no-repeat;
background-position: top center;
}
.search-box {
display: flex;
height: 100%;
margin-right: 40px;
--wot-search-padding: 0;
--wot-search-side-padding: 0;
:deep() {
.wd-search {
background: transparent !important;
width: 100% !important;
}
.wd-search__block {
background-color: #fff !important;
}
.wd-search__input {
// #ifdef MP
padding-left: 32px !important;
padding-right: 32px !important;
// #endif
// #ifndef MP
padding-right: 0 !important;
// #endif
}
}
}
.tabs {
:deep() {
.wd-tabs,
.wd-tabs__nav {
background: transparent !important;
}
.wd-tabs__nav-item {
font-size: 32rpx !important;
color: #303133 !important;
line-height: 42rpx !important;
padding: 0 30rpx !important;
}
.wd-tabs__nav-item.is-active {
font-weight: 500 !important;
}
.wd-tabs__line {
bottom: 0 !important;
width: 60rpx !important;
height: 16rpx !important;
background-color: transparent !important;
background-image: url(#{$OSS}images/reserve_room/reserve_room_image1.png) !important;
background-size: cover !important;
}
}
}
</style>

View File

@ -19,8 +19,8 @@
</template>
<template #title>
<view class="search-box flex items-center ml-26rpx">
<wd-search placeholder="搜索茶址名称" hide-cancel :placeholder-left="true"
placeholderStyle="text-align:left;padding-left: 24rpx;line-heigt: 44rpx;color: #C9C9C9; font-size: 32rpx;font-weight: normal;"></wd-search>
<wd-search v-model="keywords" placeholder="搜索茶址名称" hide-cancel placeholder-left
placeholderStyle="text-align:left;line-heigt: 44rpx;color: #C9C9C9; font-size: 32rpx;font-weight: normal;"></wd-search>
</view>
</template>
</wd-navbar>
@ -50,6 +50,8 @@
let navbarHeight = ref(0)
let OSS = inject('OSS')
const keywords = ref<string>('')
onLoad(() => {
navbarHeight.value = getNavBarHeight()
})
@ -91,11 +93,6 @@ page {
}
.wd-search__input {
// #ifdef MP
padding-left: 32px !important;
padding-right: 32px !important;
// #endif
// #ifndef MP
padding-right: 0 !important;
// #endif

View File

@ -78,4 +78,5 @@ $uni-font-size-paragraph: 15px;
/* chazhi 自定义 */
$cz-page-background: #F6F7F9; // 页面背景色
$cz-theme-color: #4C9F44; // 页面背景色
$OSS: 'https://shchazhi.oss-cn-hangzhou.aliyuncs.com/fronted/';

View File

@ -0,0 +1,73 @@
// 预约服务分类
export enum ReserveServiceCategory {
ReserveRoom = 'ReserveRoom', // 预约茶室
GroupBuying = 'GroupBuying', // 团购
}
/** 售后服务分类 **/
// 个人原因
enum PersonalReasonEnum {
OverBought = 1, // 买多了/买错了
NoLongerNeeded = 2 // 计划有变,暂时不需要的
}
// 商家原因
enum MerchantReasonEnum {
CannotContact = 3, // 电话联系不上商家
NotServing = 4, // 商家营业但不接待
Renovating = 5 // 商家停止装修
}
// 个人原因映射
export const PersonalReasonMap: { label: string, value: PersonalReasonEnum }[] = [
{ label: '买多了/买错了', value: PersonalReasonEnum.OverBought },
{ label: '计划有变,暂时不需要的', value: PersonalReasonEnum.NoLongerNeeded }
]
// 商家原因映射
export const MerchantReasonMap: { label: string, value: MerchantReasonEnum }[] = [
{ label: '电话联系不上商家', value: MerchantReasonEnum.CannotContact },
{ label: '商家营业但不接待', value: MerchantReasonEnum.NotServing },
{ label: '商家停止装修', value: MerchantReasonEnum.Renovating }
]
// 售后原因映射(用于提交时的参数转换)
export const ReasonMap: Record<number, string> = {
[PersonalReasonEnum.OverBought]: '买多了/买错了',
[PersonalReasonEnum.NoLongerNeeded]: '计划有变,暂时不需要的',
[MerchantReasonEnum.CannotContact]: '已退款',
[MerchantReasonEnum.NotServing]: '申请售后',
[MerchantReasonEnum.Renovating]: '申请售后中'
}
/** 结束 **/
/** 预约(茶室、茶艺师预约) **/
// 预约类型
export enum ReserveCategory {
TeaRoom = 'teaRoom', // 直营店
TeaSpecialist = 'teaSpecialist' // 茶艺师
}
// 预约类型对应名称
export const ReserveCategoryText: Record<ReserveCategory, string> = {
[ReserveCategory.TeaRoom]: '茶室预约',
[ReserveCategory.TeaSpecialist]: '茶艺师预约',
}
// 通用订单状态
export enum ReserveCategoryOrderStatus {
Consuming = 'consuming', // 消费中
Reserved = 'reserved', // 已预约
Serving = 'serving' // 服务中(茶艺师订单独有的)
}
// 对应名称
export const ReserveCategoryOrderStatusText: Record<ReserveCategoryOrderStatus, string> = {
[ReserveCategoryOrderStatus.Consuming]: '消费中',
[ReserveCategoryOrderStatus.Reserved]: '已预约',
[ReserveCategoryOrderStatus.Serving]: '服务中'
}
/** 结束 **/