完善茶艺师接口对接
This commit is contained in:
@ -9,15 +9,14 @@
|
||||
|
||||
<template>
|
||||
<view class="pb-254rpx">
|
||||
|
||||
<!-- 一键续订 -->
|
||||
<wd-popup v-model="showRenewPopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
|
||||
<view class="relative pb-26rpx">
|
||||
<view class="absolute top-18rpx right-30rpx" @click="showRenewPopup = 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="text-36rpx text-[#121212] leading-50rpx text-center pt-50rpx pb-40rpx">续订茶艺师</view>
|
||||
<view>
|
||||
<scroll-view scroll-y class="h-[660rpx] pb-20rpx">
|
||||
<view class="mx-60rpx">
|
||||
@ -25,8 +24,8 @@
|
||||
<view class="grid grid-cols-4 gap-x-20rpx gap-y-20rpx mt-28rpx">
|
||||
<view v-for="item in timeList" :key="item.id"
|
||||
class="h-72rpx rounded-16rpx flex items-center justify-center text-28rpx leading-40rpx"
|
||||
:class="[item.id == selectedRenewTime ? 'bg-[#4C9F44] text-[#fff]' : 'bg-[#F7F7F7] text-[#606266]']"
|
||||
@click="selectedRenewTime = item.id">
|
||||
:class="[item.id == selectedRenewTime ? 'bg-[#4C9F44] text-[#fff]' : 'bg-[#F7F7F7] text-[#606266]']"
|
||||
@click="selectedRenewTime = item.id; OrderDetail.handleTotalCostPrice()">
|
||||
{{ item.time }}
|
||||
</view>
|
||||
</view>
|
||||
@ -41,30 +40,11 @@
|
||||
class="h-110rpx rounded-16rpx flex flex-col items-center justify-center text-28rpx leading-40rpx"
|
||||
:class="selectedRenewTea.includes(item.id) ? 'bg-[#4C9F44] text-[#fff]' : 'bg-[#F7F7F7] text-[#606266]'"
|
||||
@click="OrderDetail.handleToggleRenewTea(item.id)">
|
||||
<view>{{item.title}}</view>
|
||||
<view>{{item.price}}</view>
|
||||
<view>{{ item.name }}</view>
|
||||
<view>{{ item.price }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mx-60rpx mt-60rpx">
|
||||
<view class="text-[#01000D] text-32rpx leading-44rpx">支付方式</view>
|
||||
<view class="mt-28rpx">
|
||||
<wd-radio-group v-model="pay" shape="dot" checked-color="#4C9F44">
|
||||
<view class="flex justify-between items-center mb-40rpx" v-for="(item, index) in payList" :key="index" @click="pay = item.id">
|
||||
<view class="flex items-center">
|
||||
<wd-img width="50rpx" height="50rpx" :src="item.icon"></wd-img>
|
||||
<view class="ml-20rpx text-30rpx text-[#303133] leading-42rpx">{{ item.name }}</view>
|
||||
</view>
|
||||
<view class="flex items-center">
|
||||
<wd-radio :value="item.value">
|
||||
<view class="text-[#303133] text-26rpx leading-36rpx mr-20rpx" v-if="item.id == 1">可用202.22</view>
|
||||
</wd-radio>
|
||||
</view>
|
||||
</view>
|
||||
</wd-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view>
|
||||
@ -75,14 +55,11 @@
|
||||
<view class="flex items-center">
|
||||
<view class="text-24rpx text-[#303133] leading-34rpx">合计:</view>
|
||||
<view class="flex items-center h-56rpx mr-16rpx">
|
||||
<price-format color="#FF5951" :first-size="40" :second-size="40" :subscript-size="28" :price="23.02"></price-format>
|
||||
<view class="ml-20rpx">
|
||||
<price-format color="#909399" :first-size="26" :second-size="26" :subscript-size="26" :price="23.02" lineThrough></price-format>
|
||||
</view>
|
||||
<price-format color="#FF5951" :first-size="40" :second-size="40" :subscript-size="28" :price="renewCostPrice"></price-format>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<wd-button custom-class='!bg-[#4C9F44] !rounded-8rpx !h-70rpx'>立即预定</wd-button>
|
||||
<wd-button custom-class='!bg-[#4C9F44] !rounded-8rpx !h-70rpx' @click="OrderDetail.handleNowRenew">立即预定</wd-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -99,23 +76,22 @@
|
||||
</view>
|
||||
<view class="text-[#303133] text-36rpx leading-46rpx text-center mt-48rpx">茶艺师续订成功</view>
|
||||
<view class="text-[#9CA3AF] text-28rpx leading-44rpx mt-16rpx text-center">可以刷新页面查看预约时间</view>
|
||||
<view class="w-630rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff] mt-174rpx mx-auto">好的</view>
|
||||
<view class="w-630rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff] mt-174rpx mx-auto" @click="showRenewSuccessPopup = false">好的</view>
|
||||
</view>
|
||||
</wd-popup>
|
||||
|
||||
<!-- 退款规则 -->
|
||||
<wd-popup v-model="showRefundRule" custom-class="rounded-16rpx" lock-scroll>
|
||||
<wd-popup v-model="showRefundRulePopup" custom-class="rounded-16rpx" lock-scroll>
|
||||
<view class="w-592rpx py-52rpx">
|
||||
<view class="text-36rpx text-[#303133] leading-50rpx text-center">确定申请退款吗?</view>
|
||||
<view class="font-400 text-32rpx text-[#303133] leading-44rpx text-center mt-40rpx">退款按照如下规则,请谨慎操作。</view>
|
||||
<view class="font-400 text-32rpx text-[#303133] leading-44rpx px-54rpx mt-18rpx">
|
||||
<view>1)茶艺师未出发,100%退款;</view>
|
||||
<view>2)茶艺师已出发未到达目的地,不退车马费;</view>
|
||||
<view>3)茶艺师出发并到达目的地,不退车马费,并且支付茶艺师50%服务费。</view>
|
||||
<view>2)茶艺师已出发未到达目的地,不退车马费,并且支付茶艺师30%服务费。</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="mt-54rpx text-32rpx leading-44rpx flex items-center justify-center leading-80rpx text-center">
|
||||
<view class="w-240rpx h-80rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="showRefundRule = false">取消</view>
|
||||
<view class="w-240rpx h-80rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="showRefundRulePopup = false">取消</view>
|
||||
<view class="w-240rpx h-80rpx bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleConfirmRefund">确定退款</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -124,8 +100,8 @@
|
||||
<!-- 取消订单 -->
|
||||
<wd-message-box selector="wd-message-box-slot"></wd-message-box>
|
||||
|
||||
<!-- 费用详情 -->
|
||||
<wd-popup v-model="showCostPopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
|
||||
<!-- TODO 费用详情-暂时不要 -->
|
||||
<!-- <wd-popup v-model="showCostPopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
|
||||
<view class="relative pb-30rpx">
|
||||
<view class="absolute top-18rpx right-30rpx" @click="showCostPopup = false">
|
||||
<wd-img width="60rpx" height='60rpx' :src="`${OSS}icon/icon_close.png`"></wd-img>
|
||||
@ -179,7 +155,7 @@
|
||||
<view>¥158</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="px-30rpx">
|
||||
<view class="flex justify-between items-center">
|
||||
@ -204,71 +180,98 @@
|
||||
<view>¥698.90</view>
|
||||
</view>
|
||||
</view>
|
||||
</wd-popup> -->
|
||||
|
||||
<!-- 用户订单备注内容 -->
|
||||
<wd-popup v-model="showOrderMarksPopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
|
||||
<view class="relative pb-26rpx">
|
||||
<view class="absolute top-18rpx right-30rpx" @click="showOrderMarksPopup = 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="px-32rpx">
|
||||
<wd-textarea v-model="order.remark" readonly
|
||||
custom-class='!rounded-18rpx !border-2rpx !border-[#EFF0EF] !bg-[#F8F9FA] !mt-20rpx'
|
||||
custom-textarea-class='!bg-[#F8F9FA] !h-500rpx' />
|
||||
</view>
|
||||
</view>
|
||||
</wd-popup>
|
||||
|
||||
<view>
|
||||
<navbar :title="title" custom-class='!bg-[#F6F7F8]' :leftArrow="false"></navbar>
|
||||
</view>
|
||||
|
||||
<!-- 导航栏 -->
|
||||
<navbar :title="title" custom-class='!bg-[#F6F7F8]' :leftArrow="false"></navbar>
|
||||
|
||||
<view class="text-[#909399] text-26rpx leading-36rpx mb-40rpx">
|
||||
<view class="text-center" v-if="orderStatus == TeaSpecialistOrderStatus.Serving || orderStatus == TeaSpecialistOrderStatus.Pay">使用过程中有任何问题,请联系客服</view>
|
||||
<view class="flex items-center justify-center" v-if="orderStatus == TeaSpecialistOrderStatus.Pending">
|
||||
<view class="text-center" v-if="orderStatus == TeaSpecialistOrderStatus.Arrived || orderStatus == TeaSpecialistOrderStatus.Accepted">使用过程中有任何问题,请联系客服</view>
|
||||
<view class="flex items-center justify-center" v-if="(orderStatus == TeaSpecialistOrderStatus.Unpaid || orderStatus == TeaSpecialistOrderStatus.Pending) && order.timekeeping > 0">
|
||||
<view class="flex items-center mr-6rpx">
|
||||
<wd-img width="36rpx" height="36rpx" :src="`${OSS}icon/icon_time.png`"/>
|
||||
</view>
|
||||
<view class="flex items-center text-26rpx leading-36rpx text-[#909399]">
|
||||
<view>还剩</view>
|
||||
<view class="mx-6rpx">
|
||||
<wd-count-down :time="order.time1" custom-class="!text-[#FF5951]" />
|
||||
<wd-count-down :time="order.timekeeping" custom-class="!text-[#FF5951]" />
|
||||
</view>
|
||||
<view>订单自动取消</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ml-80rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Finished">感谢您的选择,期待再续茶香!</view>
|
||||
<view class="ml-80rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Confirm">您的服务已经结束,请及时确认订单</view>
|
||||
<view class="ml-80rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Completed">感谢您的选择,期待再续茶香!</view>
|
||||
<view v-if="orderStatus >= TeaSpecialistOrderStatus.SpecialistRefund" class="text-center mt-14rpx">
|
||||
<view class="text-40rpx text-[#303133] leading-56rpx">
|
||||
<view>退款成功¥{{ order.refund_price }}</view>
|
||||
</view>
|
||||
<view class="text-28rpx text-[#606266] leading-54rpx mt-20rpx">谢谢您的信任,我们一定会做的更好</view>
|
||||
<view class="text-24rpx text-[#606266] leading-34rpx mt-12rpx">{{ order.refund_time }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 信息模块 -->
|
||||
<view class="mx-30rpx coupon-bg" >
|
||||
<view class="mx-30rpx coupon-bg" v-if="orderStatus < TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<view class="flex items-center px-30rpx pt-30rpx">
|
||||
<view class="mr-30rpx">
|
||||
<wd-img width="190rpx" height="190rpx" :src="order.teamaster.image" mode="scaleToFill"></wd-img>
|
||||
<wd-img width="190rpx" height="190rpx" :src="order.image" mode="scaleToFill"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1">
|
||||
<view class="flex justify-between items-center">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx line-1 w-280rpx">
|
||||
{{ order.teamaster.name }}
|
||||
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
|
||||
{{ order.title }}
|
||||
</view>
|
||||
<view class="text-26rpx leading-36rpx text-[#909399]">¥{{ order.order_amount }}</view>
|
||||
<view class="text-26rpx leading-36rpx text-[#909399]">¥{{ order.server_all_price }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between items-center text-26rpx leading-36rpx text-[#909399] mt-18rpx">
|
||||
<view>¥{{ order.teamaster.price }}/小时</view>
|
||||
<view>¥{{ order.server_price }}/小时</view>
|
||||
<view>x{{ order.hours }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between items-center text-26rpx leading-36rpx text-[#909399] mt-18rpx">
|
||||
<view class="w-300rpx line-1">车马费(¥{{ order.fare_price }}元/公里)</view>
|
||||
<view>¥{{ order.fare_distance_price }}/小时</view>
|
||||
<view class="w-300rpx line-1">车马费(¥{{ order.mileage_price }}元/公里)</view>
|
||||
<view>¥{{ order.mileage_server_price }}</view>
|
||||
</view>
|
||||
<view class="text-[#606266] text-right mt-26rpx" v-if="orderStatus !== TeaSpecialistOrderStatus.Pending">
|
||||
<text class="text-24rpx leading-34rpx mr-12rpx">实付</text>
|
||||
<text class="tetx-32rpx leading-36rpx">¥{{ order.order_amount }}</text>
|
||||
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mt-70rpx">
|
||||
<view class="mt-70rpx relative">
|
||||
<view class="flex items-center absolute right-0 top-10rpx right-44rpx" v-if="order.is_renewal">
|
||||
<wd-img :src="`${OSS}icon/icon_renew.png`" width="40rpx" height="40rpx"></wd-img>
|
||||
<view class="font-bold text-28rpx leading-40rpx text-[#4C9F44] ml-8px">订单已续订</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="orderStatus === TeaSpecialistOrderStatus.Arrived"
|
||||
class="renewOrder absolute right-0 bottom-36rpx w-170rpx h-56rpx text-center leading-56rpx font-bold text-28rpx text-[#fff] bg-[#4C9F44]"
|
||||
@click="showRenewPopup = true">一键续订</view>
|
||||
|
||||
<view class="text-30rpx leading-42rpx text-[#303133] px-30rpx">预约信息</view>
|
||||
<view class="font-500 text-26rpx leading-48rpx text-[#606266] mt-20rpx pb-28rpx"
|
||||
v-if="orderStatus == TeaSpecialistOrderStatus.Pending || orderStatus == TeaSpecialistOrderStatus.Pay || orderStatus == TeaSpecialistOrderStatus.Serving || orderStatus == TeaSpecialistOrderStatus.Confirm">
|
||||
<view class="mb-20rpx px-30rpx">预约时间:{{ order.start_time }} - {{ order.end_time }}</view>
|
||||
<view class="font-500 text-26rpx leading-48rpx text-[#606266] mt-20rpx pb-28rpx">
|
||||
<view class="mb-20rpx px-30rpx">预约时间:{{ order.day_time }} {{ order.start_time }} - {{ order.end_time }}</view>
|
||||
<view class="flex justify-between items-center pl-30rpx">
|
||||
<view>预约时长:{{ order.hours }}小时</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="font-500 text-26rpx leading-48rpx text-[#606266] mt-20rpx pb-28rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Cancelled || orderStatus == TeaSpecialistOrderStatus.Finished">
|
||||
<view class="font-500 text-26rpx leading-48rpx text-[#606266] mt-20rpx pb-28rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Completed">
|
||||
<view class="mb-20rpx px-30rpx">服务时间:{{ order.start_time }} - {{ order.end_time }}</view>
|
||||
<view class="flex justify-between items-center pl-30rpx">
|
||||
<view>服务时长:{{ order.hours }}小时</view>
|
||||
@ -277,53 +280,135 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 退款下单独处理一个信息模块 -->
|
||||
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx" v-if="orderStatus >= TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<view class="flex items-center pt-30rpx">
|
||||
<view class="mr-30rpx">
|
||||
<wd-img width="190rpx" height="190rpx" :src="order.image" mode="scaleToFill"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1">
|
||||
<view class="flex justify-between items-center">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx line-1 w-280rpx">
|
||||
{{ order.title }}
|
||||
</view>
|
||||
<view class="text-26rpx leading-36rpx text-[#909399]">¥{{ order.server_all_price }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between items-center text-26rpx leading-36rpx text-[#909399] mt-18rpx">
|
||||
<view>¥{{ order.server_price }}/小时</view>
|
||||
<view>x{{ order.hours }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between items-center text-26rpx leading-36rpx text-[#909399] mt-18rpx">
|
||||
<view class="w-300rpx line-1">车马费(¥{{ order.mileage_price }}元/公里)</view>
|
||||
<view>¥{{ order.mileage_server_price }}</view>
|
||||
</view>
|
||||
<view class="text-[#606266] text-right mt-26rpx" v-if="orderStatus !== TeaSpecialistOrderStatus.Pending">
|
||||
<text class="text-24rpx leading-34rpx mr-12rpx">实付</text>
|
||||
<text class="tetx-32rpx leading-36rpx">¥{{ order.order_amount }}</text>
|
||||
<!-- <wd-icon name="chevron-right" size="32rpx"></wd-icon> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 茶艺服务 -->
|
||||
<view class="bg-white rounded-16rpx px-30rpx pb-32rpx mx-30rpx mt-20rpx" v-if="orderStatus < TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<view class="pt-32rpx text-[#303133] text-32rpx leading-44rpx">茶艺服务</view>
|
||||
<view>
|
||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
||||
<view class="text-[#606266] mr-54rpx w-120rpx whitespace-nowrap">服务人数</view>
|
||||
<view class="text-[#303133]">{{ order.server_number }}人</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
||||
<view class="text-[#606266] mr-54rpx w-120rpx whitespace-nowrap">预定茶叶</view>
|
||||
<view class="text-[#303133]">{{ order.leaf_name }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
||||
<view class="text-[#606266] mr-54rpx w-120rpx whitespace-nowrap">茶具使用</view>
|
||||
<view class="text-[#303133]">{{ order.is_teacup == 1 ? '茶艺师提供' : '客户自备' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-32rpx" v-if="order.is_renewal">
|
||||
<view class="renew-border"></view>
|
||||
<view class="mt-22rpx">
|
||||
<view class="font-bold text-28rpx leading-40rpx text-[#4C9F44]">续订信息</view>
|
||||
<view class="mt-16rpx">
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center">
|
||||
<view class="mr-50rpx">续订时长</view>
|
||||
<view>{{ order.renew_hour }}小时</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center mt-18rpx">
|
||||
<view class="mr-50rpx">续订金额</view>
|
||||
<view>{{ order.renew_price }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center mt-18rpx">
|
||||
<view class="mr-50rpx">续订茶叶金额</view>
|
||||
<view>{{ order.renew_tea_price }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bg-white px-30rpx mx-30rpx mt-20rpx rounded-16rpx h-80rpx flex justify-between items-center" v-if="(orderStatus === TeaSpecialistOrderStatus.Accepted || orderStatus === TeaSpecialistOrderStatus.Arrived) && orderStatus < TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<view class="font-500 text-24rpx leading-48rpx text-[#909399]">想问问茶艺师到哪里了?</view>
|
||||
<view class="flex items-center" @click="OrderDetail.handleCall">
|
||||
<wd-img :src="`${OSS}icon/icon_phone2.png`" width="34rpx" height="34rpx"></wd-img>
|
||||
<view class="text-26rpx leading-36rpx text-[#4C9F44] ml-6rpx">联系茶艺师</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- TODO 订单备注有内容在显示 -->
|
||||
<view class="bg-[#FFFDF7] px-30rpx py-20rpx rounded-16rpx mt-20rpx mx-30rpx" @click="showOrderMarksPopup = true" v-if="order.remark && orderStatus < TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<view class="flex items-center">
|
||||
<wd-img :src="`${OSS}icon/icon_tips2.png`" width="40rpx" height="40rpx"></wd-img>
|
||||
<view class="ml-12rpx">订单备注</view>
|
||||
</view>
|
||||
<view class="flex items-start mt-22rpx">
|
||||
<text class="text-28rpx leading-40rpx text-[#606266]">备注信息</text>
|
||||
<text class="text-28rpx text-[#303133] ml-50rpx line-2 w-450rpx">{{ order.remark }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 服务方式 -->
|
||||
<view class="bg-white rounded-16rpx px-30rpx pb-32rpx mx-30rpx mt-20rpx">
|
||||
<view class="bg-white rounded-16rpx px-30rpx pb-32rpx mx-30rpx mt-20rpx" v-if="orderStatus < TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<view class="pt-32rpx text-[#303133] text-32rpx leading-44rpx">服务方式</view>
|
||||
<view>
|
||||
<view class="flex justify-between items-center relative">
|
||||
<view>
|
||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
||||
<view class="text-[#606266] mr-54rpx">服务方式</view>
|
||||
<view class="text-[#303133]">{{ Number(order.service_type) == 1 ? '到店服务' : '上门服务'}}</view>
|
||||
<view class="text-[#303133]">{{ order.service_type == 1 ? '到店服务' : '上门服务'}}</view>
|
||||
</view>
|
||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
||||
<view class="text-[#606266] mr-54rpx">{{ Number(order.service_type) == 1 ? '服务门店' : '服务地址'}}</view>
|
||||
<view class="text-[#303133] line-1 w-300rpx" v-if="Number(order.service_type) == 1">{{ order.store_address.name }}</view>
|
||||
<view class="text-[#303133] line-1 w-300rpx" v-if="Number(order.service_type) != 1">
|
||||
{{ order.address.province }} {{ order.address.city }} {{ order.address.district }} {{ order.address.address }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
||||
<view class="text-[#606266] mr-54rpx">到达时长</view>
|
||||
<view class="text-[#303133]">{{ order.reach_time }}分钟左右到达</view>
|
||||
<view class="text-[#606266] mr-54rpx">{{ order.service_type == 1 ? '服务门店' : '服务地址'}}</view>
|
||||
<view class="text-[#303133] line-1 w-300rpx">{{ order.address }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex absolute top-1/2 right-0 -translate-y-1/2">
|
||||
<view class="text-center mr-20rpx" @click="OrderDetail.handleOpenMap">
|
||||
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_nav.png`"/>
|
||||
</view>
|
||||
<view class="text-center" v-if="orderStatus != TeaSpecialistOrderStatus.Pending" @click="OrderDetail.handleCallService">
|
||||
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_phone.png`"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单信息 -->
|
||||
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx">
|
||||
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx" v-if="orderStatus < TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<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>
|
||||
<text>{{ order.order_sn }}</text>
|
||||
<wd-divider vertical />
|
||||
<text class="text-[#4C9F44]" @click="OrderDetail.handleCopy(order.order_sn)">复制</text>
|
||||
<text class="text-[#4C9F44]" @click="copy(order.order_sn)">复制</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx" v-if="orderStatus != TeaSpecialistOrderStatus.Pending && order.pay_way">
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx" v-if="orderStatus != TeaSpecialistOrderStatus.Unpaid && order.pay_way">
|
||||
<view>交易方式</view>
|
||||
<view>{{ order.pay_way_title }}</view>
|
||||
</view>
|
||||
@ -331,39 +416,65 @@
|
||||
<view>创建时间</view>
|
||||
<view>{{ order.dtime }}</view>
|
||||
</view>
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx" v-if="orderStatus != TeaSpecialistOrderStatus.Pending && orderStatus != TeaSpecialistOrderStatus.Cancelled">
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx" v-if="orderStatus != TeaSpecialistOrderStatus.Unpaid">
|
||||
<view>付款时间</view>
|
||||
<view>{{ order.update_dtime }}</view>
|
||||
<view>{{ order.pay_time }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 退款订单 -->
|
||||
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx" v-if="orderStatus >= TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<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>{{ order.refund_time }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>订单编号</view>
|
||||
<view>
|
||||
<text>{{ order.order_sn }}</text>
|
||||
<wd-divider vertical />
|
||||
<text class="text-[#4C9F44]" @click="copy(order.order_sn)">复制</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<view class="w-full fixed bottom-0 left-0 right-0 bg-white h-152rpx" v-if="orderStatus != TeaSpecialistOrderStatus.Cancelled && orderStatus != TeaSpecialistOrderStatus.Finished">
|
||||
<view class="w-full fixed bottom-0 left-0 right-0 bg-white h-152rpx"
|
||||
v-if="orderStatus === TeaSpecialistOrderStatus.Unpaid ||
|
||||
orderStatus === TeaSpecialistOrderStatus.Arrived ||
|
||||
orderStatus === TeaSpecialistOrderStatus.Accepted ||
|
||||
orderStatus === TeaSpecialistOrderStatus.Completed ||
|
||||
orderStatus === TeaSpecialistOrderStatus.Pending ||
|
||||
orderStatus === TeaSpecialistOrderStatus.Departed">
|
||||
<view class="mt-34rpx">
|
||||
<!-- 预约单、服务中 -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center mt-34rpx" v-if="orderStatus === TeaSpecialistOrderStatus.Serving || orderStatus == TeaSpecialistOrderStatus.Confirm">
|
||||
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleConfirmOrder">确认订单</view>
|
||||
</view>
|
||||
|
||||
<!-- 待付款 -->
|
||||
<view class="flex items-center justify-between mx-58rpx mt-34rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Pending">
|
||||
<view class="flex items-center justify-between mx-58rpx mt-34rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Unpaid">
|
||||
<view class="flex items-center">
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] mr-16rpx" @click="OrderDetail.handleCancelOrder">取消订单</view>
|
||||
</view>
|
||||
<view class="w-360rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleToPay">立即支付¥{{ order.order_amount }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 服务中 -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center mt-34rpx" v-if="orderStatus === TeaSpecialistOrderStatus.Arrived">
|
||||
<view class="w-630rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="OrderDetail.handleAgainReserve">再次预定</view>
|
||||
</view>
|
||||
|
||||
<!-- 已预约 -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus == TeaSpecialistOrderStatus.Pay">
|
||||
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="showRefundRule = true">申请退款</view>
|
||||
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133]" @click="OrderDetail.handleCallService">联系客服</view>
|
||||
<view
|
||||
class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center"
|
||||
v-if="orderStatus === TeaSpecialistOrderStatus.Pending || orderStatus === TeaSpecialistOrderStatus.Accepted || orderStatus === TeaSpecialistOrderStatus.Departed ">
|
||||
<view class="w-630rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="showRefundRulePopup = true">申请退款</view>
|
||||
</view>
|
||||
|
||||
<!-- 交易完成 -->
|
||||
<!-- <view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center mt-34rpx"
|
||||
v-if="orderStatus == TeaSpecialistOrderStatus.Finished || orderStatus == TeaSpecialistOrderStatus.Cancelled">
|
||||
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]">再次预定</view>
|
||||
</view> -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center mt-34rpx"
|
||||
v-if="orderStatus == TeaSpecialistOrderStatus.Completed">
|
||||
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleAgainReserve">再次预定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -371,26 +482,28 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { TeaSpecialistOrderStatusTextValue, TeaSpecialistOrderStatus } from '@/utils/order'
|
||||
import { getTeaSpecialistOrderDetails } from '@/api/teaSpecialist-order'
|
||||
import { toast } from '@/utils/toast'
|
||||
import { useMessage } from 'wot-design-uni'
|
||||
import { handleCancelOrderHooks, handleToPayHooks, handleDeleteOrderHooks, handleConfirmOrderHooks, handleRefundOrderHooks } from '@/hooks/useTeaSpecialistOrder'
|
||||
import { useMessage, useToast } from 'wot-design-uni'
|
||||
import { TeaSpecialistManageOrderStatusText, TeaSpecialistManageStatusTextValue, TeaSpecialistOrderStatus} from '@/utils/teaSpecialistOrder'
|
||||
import { handleCancelOrderHooks, handleRefundTeaSpecialistOrderHooks } from '@/hooks/useTeaSpecialistOrder'
|
||||
import { router, copy, toPlus } from '@/utils/tools'
|
||||
import { OrderType } from '@/utils/order'
|
||||
import { getTeaTypeList } from '@/api/tea'
|
||||
import { getTeaSpecialistFeeDetails, createTeaSpecialistRenewOrder } from '@/api/tea-specialist'
|
||||
import type { ITeaTypeListResult } from '@/api/types/tea'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
|
||||
const toast = useToast()
|
||||
const title = ref<string>('')
|
||||
const orderStatus = ref<number>(0) // 订单状态:待使用、退款等
|
||||
const showRefundRule = ref<boolean>(false) // 退款规则弹窗
|
||||
|
||||
// 订单倒计时取消
|
||||
const time = ref<number>(30 * 60 * 60 * 1000)
|
||||
const showRefundRulePopup = ref<boolean>(false) // 退款规则弹窗
|
||||
|
||||
// 取消订单弹窗
|
||||
const message = useMessage('wd-message-box-slot')
|
||||
|
||||
// 费用明细
|
||||
const showCostPopup = ref<boolean>(false) // 是否显示退款详情弹出框
|
||||
const renewCostPrice = ref<number>(0)
|
||||
|
||||
/** 续订 **/
|
||||
const showRenewPopup = ref<boolean>(false)
|
||||
@ -421,99 +534,107 @@
|
||||
}
|
||||
])
|
||||
|
||||
const teaList = [
|
||||
{id: 1, title: '红茶(3泡)', price: '¥128.00'},
|
||||
{id: 2, title: '铁观音(3泡)', price: '¥128.00'},
|
||||
{id: 3, title: '红茶(3泡)', price: '¥128.00'},
|
||||
{id: 4, title: '红茶(3泡)', price: '¥128.00'},
|
||||
{id: 5, title: '红茶(3泡)', price: '¥128.00'},
|
||||
]
|
||||
const teaList = ref<ITeaTypeListResult[]>([]) // 茶叶列表
|
||||
const selectedRenewTea = ref<Array<any>>([]) // 选择的续订时间
|
||||
const showRenewSuccessPopup = ref<boolean>(false)
|
||||
|
||||
// 订单备注
|
||||
const showOrderMarksPopup = ref<boolean>(false)
|
||||
|
||||
// 订单
|
||||
const orderId = ref<number>(0)
|
||||
const order = ref<any>({})
|
||||
const order = ref({
|
||||
id: 0, // 订单ID
|
||||
order_status: 0, // 订单状态
|
||||
order_sn: '', // 订单编号
|
||||
timekeeping: 0, // 倒计时
|
||||
order_amount: 0, // 订单金额
|
||||
refund_time: '', // 退款时间
|
||||
image: '', // 茶艺师图片
|
||||
title: '', // 茶艺师标题
|
||||
hours: 0, // 预定小时
|
||||
server_all_price: 0, // 服务费
|
||||
server_price: 0, // 服务费单价
|
||||
mileage_price: 0, // 车马费
|
||||
mileage_server_price: 0, // 车马费总价
|
||||
day_time: '', // 预约日期
|
||||
start_time: '', // 开始日期
|
||||
end_time: '', // 结束日期0
|
||||
service_type: 1, // 服务方式 1到店服务 2上门服务
|
||||
address: '', // 服务地址
|
||||
longitude: 0, // 经度
|
||||
latitude: 0, // 纬度
|
||||
server_number: 0, // 服务人数
|
||||
leaf_name: '', // 预定茶叶
|
||||
is_teacup: 0, // 是否使用茶具
|
||||
remark: '', // 订单备注
|
||||
pay_way: '', // 支付方式
|
||||
pay_way_title: '', // 支付方式标题
|
||||
dtime: '', // 创建时间
|
||||
pay_time: '', // 付款时间
|
||||
team_mobile: '', // 茶艺师电话
|
||||
is_renewal: 0, // 是否有一键续订
|
||||
team_user_id: 0, // 茶艺师ID
|
||||
refund_price: 0, // 退款金额
|
||||
renew_hour: 0, // 续订小时
|
||||
renew_price: 0, // 续订金额
|
||||
renew_tea_price: 0, // 续订茶叶金额
|
||||
})
|
||||
|
||||
onLoad(async (args) => {
|
||||
orderId.value = args.orderId
|
||||
// 获取订单详情
|
||||
OrderDetail.handleInit()
|
||||
})
|
||||
|
||||
|
||||
onUnload(() => {
|
||||
uni.$off('refreshOrderDetail')
|
||||
})
|
||||
|
||||
const OrderDetail = {
|
||||
// 获取订单详情
|
||||
/**
|
||||
* 获取订单详情和茶叶列表
|
||||
*/
|
||||
handleInit: async () => {
|
||||
const res = await getTeaSpecialistOrderDetails({id: orderId.value})
|
||||
const data = res.details
|
||||
order.value = data
|
||||
title.value = TeaSpecialistOrderStatusTextValue[data.order_status].title || '订单详情'
|
||||
console.log("🚀 ~ title.value:", title.value)
|
||||
orderStatus.value = data.order_status
|
||||
},
|
||||
order.value = res
|
||||
title.value = TeaSpecialistManageStatusTextValue[res.order_status].pageTitle || '订单详情'
|
||||
orderStatus.value = res.order_status
|
||||
|
||||
// 确认订单
|
||||
handleConfirmOrder: () => {
|
||||
message.confirm({
|
||||
title: '确认订单',
|
||||
msg: '为保障您的权益,请茶艺师服务完成后在确认订单',
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
cancelButtonProps: {
|
||||
customClass: '!bg-[#F6F7F8] !text-[#303133] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
},
|
||||
confirmButtonProps: {
|
||||
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
}
|
||||
}).then((res) => {
|
||||
// 点击确认按钮回调事件
|
||||
if (res.action == 'confirm') {
|
||||
uni.$on('refreshOrderDetail', () => {
|
||||
OrderDetail.handleInit()
|
||||
uni.$off('refreshOrderDetail')
|
||||
})
|
||||
|
||||
handleConfirmOrderHooks(orderId.value)
|
||||
}
|
||||
}).catch(() => {
|
||||
// 点击取消按钮回调事件
|
||||
})
|
||||
// 获取茶叶列表
|
||||
const tea = await getTeaTypeList()
|
||||
teaList.value = tea
|
||||
},
|
||||
|
||||
// 续订茶艺师
|
||||
handleToggleRenewTea: (id: number) => {
|
||||
handleToggleRenewTea: (id: number ) => {
|
||||
const idx = selectedRenewTea.value.indexOf(id)
|
||||
if (idx > -1) {
|
||||
selectedRenewTea.value.splice(idx, 1) // 已选中则移除
|
||||
} else {
|
||||
selectedRenewTea.value.push(id) // 未选中则添加
|
||||
}
|
||||
},
|
||||
|
||||
// 再次预定
|
||||
handleAgainReeserve: () => {
|
||||
showRenewSuccessPopup.value = true
|
||||
showRenewPopup.value = false
|
||||
OrderDetail.handleTotalCostPrice()
|
||||
},
|
||||
|
||||
// 申请退款
|
||||
handleConfirmRefund: () => {
|
||||
uni.$on('refreshOrderDetail', () => {
|
||||
showRefundRule.value = false
|
||||
handleConfirmRefund: async () => {
|
||||
showRefundRulePopup.value = false
|
||||
toast.loading('加载中...')
|
||||
const res = await handleRefundTeaSpecialistOrderHooks(order.value.id, 10) // 固定传10
|
||||
console.log("🚀 ~ res:", res)
|
||||
toast.close()
|
||||
|
||||
if (res) {
|
||||
OrderDetail.handleInit()
|
||||
uni.$off('refreshOrderDetail')
|
||||
})
|
||||
|
||||
// handleRefundOrderHooks(orderId.value, 'order')
|
||||
|
||||
toast.show('订单退款成功')
|
||||
}
|
||||
},
|
||||
|
||||
// 取消订单
|
||||
/**
|
||||
* 取消订单
|
||||
*/
|
||||
handleCancelOrder: () => {
|
||||
message.confirm({
|
||||
title: '确定取消订单?',
|
||||
@ -526,66 +647,148 @@
|
||||
confirmButtonProps: {
|
||||
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
}
|
||||
}).then((res) => {
|
||||
}).then(async (res) => {
|
||||
if (res.action == 'confirm') {
|
||||
// 点击确认按钮回调事件
|
||||
uni.$on('refreshOrderDetail', () => {
|
||||
toast.loading('加载中...')
|
||||
const res = await handleCancelOrderHooks(orderId.value)
|
||||
toast.close()
|
||||
|
||||
if (res) {
|
||||
OrderDetail.handleInit()
|
||||
uni.$off('refreshOrderDetail')
|
||||
})
|
||||
|
||||
handleCancelOrderHooks(orderId.value)
|
||||
toast.show('订单取消成功')
|
||||
}
|
||||
}
|
||||
toast.info('订单取消成功')
|
||||
}).catch(() => {
|
||||
// 点击取消按钮回调事件
|
||||
})
|
||||
},
|
||||
|
||||
// 支付
|
||||
handleToPay: () => {
|
||||
uni.$on('refreshOrderDetail', () => {
|
||||
OrderDetail.handleInit()
|
||||
uni.$off('refreshOrderDetail')
|
||||
})
|
||||
|
||||
handleToPayHooks(orderId.value, order.value.teamaster.id)
|
||||
},
|
||||
|
||||
// 打开地图
|
||||
handleOpenMap: () => {
|
||||
if (Number(order.value.service_type) == 1) {
|
||||
uni.openLocation({
|
||||
latitude: Number(order.value.store_address.latitude),
|
||||
longitude: Number(order.value.store_address.longitude),
|
||||
name: order.value.store_address.name,
|
||||
address: order.value.store_address.address,
|
||||
})
|
||||
|
||||
} else {
|
||||
uni.openLocation({
|
||||
latitude: Number(order.value.address.latitude),
|
||||
longitude: Number(order.value.address.longitude),
|
||||
name: order.value.address.address,
|
||||
address: order.value.address.province + ' ' + order.value.address.city + ' ' + order.value.address.district + ' ' + order.value.address.address,
|
||||
})
|
||||
}
|
||||
}).catch(() => { })
|
||||
},
|
||||
|
||||
// 联系客服
|
||||
handleCallService: () => {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: order.value.customer_service_phone, // 替换为需要拨打的电话号码
|
||||
});
|
||||
/**
|
||||
* 一键续订的金额
|
||||
*/
|
||||
handleTotalCostPrice: async () => {
|
||||
let params = {
|
||||
hours: 0,
|
||||
tea_id: '',
|
||||
longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
|
||||
latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
|
||||
user_coupon_id: 0,
|
||||
is_teacup: 0,
|
||||
team_user_id: order.value.team_user_id
|
||||
}
|
||||
|
||||
if (selectedRenewTime.value > 0) {
|
||||
// 选定了时间
|
||||
params.hours = selectedRenewTime.value
|
||||
}
|
||||
|
||||
if (selectedRenewTea.value.length > 0) {
|
||||
// 选定了茶叶
|
||||
params.tea_id = selectedRenewTea.value.join(',')
|
||||
}
|
||||
|
||||
const res = await getTeaSpecialistFeeDetails(params)
|
||||
renewCostPrice.value = Number(toPlus(res.server_all_price, res.leaf_amount))
|
||||
},
|
||||
|
||||
// 复制订单号
|
||||
handleCopy: (text: string) => {
|
||||
uni.setClipboardData({
|
||||
data: text,
|
||||
success: () => {
|
||||
toast.info('复制成功')
|
||||
}
|
||||
/**
|
||||
* 去支付
|
||||
*/
|
||||
handleToPay: () => {
|
||||
uni.$off("payment")
|
||||
uni.$on('payment', params => {
|
||||
setTimeout(() => {
|
||||
uni.$off("payment")
|
||||
if (params.result) {
|
||||
toast.show('支付成功')
|
||||
setTimeout(() => {
|
||||
OrderDetail.handleInit()
|
||||
}, 500)
|
||||
} else {
|
||||
toast.show('支付失败')
|
||||
}
|
||||
}, 1000)
|
||||
})
|
||||
router.navigateTo(`/pages/cashier/cashier?from=${OrderType.TeaSpecialist}&orderId=${order.value.id}&teaSpecialistName=${order.value.title}&renewPrice=1`)
|
||||
},
|
||||
|
||||
/**
|
||||
* 提交续单订单
|
||||
*/
|
||||
handleNowRenew: async () => {
|
||||
if (selectedRenewTime.value == 0 && selectedRenewTea.value.length == 0) {
|
||||
toast.show('请选择续单内容')
|
||||
return false
|
||||
}
|
||||
|
||||
toast.loading('创建订单中')
|
||||
let params = {
|
||||
id: order.value.id,
|
||||
type: 0,
|
||||
hours: 0,
|
||||
tea_id: ''
|
||||
}
|
||||
|
||||
if (selectedRenewTime.value > 0 && selectedRenewTea.value.length > 0) {
|
||||
// 选择了茶叶和时间,定义类型为3
|
||||
params.type = 3
|
||||
params.hours = selectedRenewTime.value
|
||||
params.tea_id = selectedRenewTea.value.join(',')
|
||||
} else if (selectedRenewTime.value > 0) {
|
||||
// 选择了时间但是没有选择茶叶,定义类型为1
|
||||
params.type = 1
|
||||
params.hours = selectedRenewTime.value
|
||||
} else if (selectedRenewTea.value.length > 0) {
|
||||
// 选择了茶叶但是没有选择时间,定义类型为2
|
||||
params.type = 2
|
||||
params.tea_id = selectedRenewTea.value.join(',')
|
||||
}
|
||||
const res = await createTeaSpecialistRenewOrder(params)
|
||||
console.log("🚀 ~ res:", res)
|
||||
toast.close()
|
||||
if (res.order_id) {
|
||||
uni.$off("payment")
|
||||
uni.$on('payment', params => {
|
||||
setTimeout(() => {
|
||||
uni.$off("payment")
|
||||
if (params.result) {
|
||||
showRenewSuccessPopup.value = true
|
||||
setTimeout(() => {
|
||||
OrderDetail.handleInit()
|
||||
}, 500)
|
||||
} else {
|
||||
toast.show('支付失败')
|
||||
}
|
||||
}, 1000)
|
||||
})
|
||||
|
||||
showRenewPopup.value = false
|
||||
router.navigateTo(`/pages/cashier/cashier?from=${OrderType.TeaSpecialist}&orderId=${order.value.id}&renewOrderId=${res.order_id}&teaSpecialistName=${order.value.title}&teaSpecialistOrderAmount=${res.price}`)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 导航
|
||||
*/
|
||||
handleOpenMap: () => {
|
||||
uni.openLocation({
|
||||
latitude: Number(order.value.latitude),
|
||||
longitude: Number(order.value.longitude),
|
||||
address: order.value.address,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 茶艺师-再次预定
|
||||
*/
|
||||
handleAgainReserve: () => {
|
||||
router.navigateTo(`/bundle_b/pages/tea-specialist/list`)
|
||||
},
|
||||
|
||||
/**
|
||||
* 拨打电话
|
||||
*/
|
||||
handleCall: () => {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: order.value.team_mobile
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -602,4 +805,12 @@
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.renewOrder {
|
||||
border-radius: 100rpx 0rpx 0rpx 100rpx;
|
||||
}
|
||||
|
||||
.renew-border {
|
||||
border-top: 2rpx dashed #E5E7EB;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user