完善接口
This commit is contained in:
@ -23,6 +23,7 @@ export function getTeaSpecialistOrderList(data: ITeaSpecialistOrderListParams) {
|
|||||||
export interface ITeaSpecialistOrderDetailsParams {
|
export interface ITeaSpecialistOrderDetailsParams {
|
||||||
id: number
|
id: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTeaSpecialistOrderDetails(data: ITeaSpecialistOrderDetailsParams) {
|
export function getTeaSpecialistOrderDetails(data: ITeaSpecialistOrderDetailsParams) {
|
||||||
return http.Post<IOrderDetailsResult>('/api/order/orderDetails',
|
return http.Post<IOrderDetailsResult>('/api/order/orderDetails',
|
||||||
data
|
data
|
||||||
@ -35,8 +36,49 @@ export function getTeaSpecialistOrderDetails(data: ITeaSpecialistOrderDetailsPar
|
|||||||
export interface ICancelTeaSpecialistOrderParams {
|
export interface ICancelTeaSpecialistOrderParams {
|
||||||
id: number
|
id: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export function cancelTeaSpecialistOrder(data: ICancelTeaSpecialistOrderParams) {
|
export function cancelTeaSpecialistOrder(data: ICancelTeaSpecialistOrderParams) {
|
||||||
return http.Post('/api/order/cancelOrder',
|
return http.Post('/api/order/cancelOrder',
|
||||||
data
|
data
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除订单
|
||||||
|
*/
|
||||||
|
export interface IDeleteTeaSpecialistOrderParams {
|
||||||
|
id: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteTeaSpecialistOrder(data: IDeleteTeaSpecialistOrderParams) {
|
||||||
|
return http.Post('/api/order/delOrder',
|
||||||
|
data
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认(完成)订单
|
||||||
|
*/
|
||||||
|
export interface IConfirmTeaSpecialistOrderParams {
|
||||||
|
id: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export function confirmTeaSpecialistOrder(data: IConfirmTeaSpecialistOrderParams) {
|
||||||
|
return http.Post('/api/order/userConfirmOrder',
|
||||||
|
data
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单退款
|
||||||
|
*/
|
||||||
|
export interface IRefundTeaSpecialistOrderParams {
|
||||||
|
id: number
|
||||||
|
order_type: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function refundTeaSpecialistOrder(data: IRefundTeaSpecialistOrderParams) {
|
||||||
|
return http.Post('/api/pay/refund',
|
||||||
|
data
|
||||||
|
)
|
||||||
}
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
import { http } from '@/http/alova'
|
import { http } from '@/http/alova'
|
||||||
import type { IUserAddressListResult, IUserAddressDetailsResult, IUserCouponListResult } from '@/api/types/user'
|
import type { IUserAddressListResult, IUserAddressDetailsResult, IUserCouponListResult } from '@/api/types/user'
|
||||||
|
import type { IOrderListResult } from '@/api/types/order'
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -76,7 +77,7 @@ export function userAddressDetails(data: IUserAddressDetailsParams) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 优惠券列表
|
* 优惠券列表(从订单页获取)
|
||||||
*/
|
*/
|
||||||
export interface IGetCouponsParams {
|
export interface IGetCouponsParams {
|
||||||
id: number
|
id: number
|
||||||
@ -85,4 +86,46 @@ export interface IGetCouponsParams {
|
|||||||
|
|
||||||
export function getCoupons(data: IGetCouponsParams) {
|
export function getCoupons(data: IGetCouponsParams) {
|
||||||
return http.Post<IUserCouponListResult>('/api/UserCoupon/UserCoupinList', data)
|
return http.Post<IUserCouponListResult>('/api/UserCoupon/UserCoupinList', data)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 优惠券列表(从个人中心点击进去)
|
||||||
|
*/
|
||||||
|
export interface IGetMyCouponsParams {
|
||||||
|
status: number
|
||||||
|
}
|
||||||
|
export function getMyCoupons(data: IGetMyCouponsParams) {
|
||||||
|
return http.Post('/api/UserCoupon/orderCoupinList', data)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个人中心优惠券
|
||||||
|
*/
|
||||||
|
export function getMyCoupon() {
|
||||||
|
return http.Post<IUserCouponListResult>('/api/UserCoupon/coupinList')
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领取个人中心优惠券
|
||||||
|
*/
|
||||||
|
export interface IClaimMyCouponParams {
|
||||||
|
id: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export function claimMyCoupon(data: IClaimMyCouponParams) {
|
||||||
|
return http.Post('/api/UserCoupon/receiveCoupon', data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 金额使用记录
|
||||||
|
*/
|
||||||
|
export interface IGetUserMoneyLogParams {
|
||||||
|
page: number
|
||||||
|
size: number
|
||||||
|
month: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getUserMoneyLog(data: IGetUserMoneyLogParams) {
|
||||||
|
return http.Post<IOrderListResult>('/api/user/moneyLogList', data)
|
||||||
}
|
}
|
||||||
@ -11,59 +11,34 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="pb-180rpx">
|
<view class="pb-180rpx">
|
||||||
<view>
|
<view>
|
||||||
<navbar title="优惠券" custom-class='!bg-[#F6F7F8]'></navbar>
|
<navbar title="优惠券" custom-class='!bg-[#F6F7F8]' :leftArrow="false"></navbar>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<view class="coupon-tab">
|
<view class="coupon-tab">
|
||||||
<wd-tabs v-model="tab" swipeable slidable="always" @click="myCoupon.handleChangeTab" :lazy="false">
|
<wd-tabs v-model="tab" swipeable slidable="always" @click="MyCoupon.handleChangeTab" :lazy="false">
|
||||||
<wd-tab title="茶室优惠券">
|
|
||||||
<view class="mx-30rpx">
|
|
||||||
<view class="flex">
|
|
||||||
<view v-for="(item, index) in tag" :key="index"
|
|
||||||
@click="myCoupon.handleChangeTag(item)"
|
|
||||||
class="font-400 text-28rpx leading-40rpx w-116rpx h-64rpx flex justify-center items-center border-2rpx border-solid rounded-12rpx mr-20rpx"
|
|
||||||
:class="item === currentTag ? ' border-[#4C9F44] bg-[#F0F6EF] text-[#4C9F44]' : 'border-[#fff] bg-[#fff]'">
|
|
||||||
{{ item }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="mt-32rpx">
|
|
||||||
<coupon
|
|
||||||
v-for="(item, index) in couponList"
|
|
||||||
:key="item.id"
|
|
||||||
:coupon="item"
|
|
||||||
canUse
|
|
||||||
:showChecked="false"
|
|
||||||
:checked="item.id === checkedId"
|
|
||||||
:onCheck="myCoupon.handleCouponCheck"
|
|
||||||
:class="index !== couponList.length - 1 ? 'mb-20rpx' : ''"
|
|
||||||
></coupon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</wd-tab>
|
|
||||||
<wd-tab title="茶艺师优惠券">
|
<wd-tab title="茶艺师优惠券">
|
||||||
<view class="mx-30rpx">
|
<view class="mx-30rpx">
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<view v-for="(item, index) in tag" :key="index"
|
<view v-for="(item, index) in tag" :key="index"
|
||||||
@click="myCoupon.handleChangeTag(item)"
|
@click="MyCoupon.handleChangeTag(item.value)"
|
||||||
class="font-400 text-28rpx leading-40rpx w-116rpx h-64rpx flex justify-center items-center border-2rpx border-solid rounded-12rpx mr-20rpx"
|
class="font-400 text-28rpx leading-40rpx w-116rpx h-64rpx flex justify-center items-center border-2rpx border-solid rounded-12rpx mr-20rpx"
|
||||||
:class="item === currentTag ? ' border-[#4C9F44] bg-[#F0F6EF] text-[#4C9F44]' : 'border-[#fff] bg-[#fff]'">
|
:class="item.value == currentTag ? ' border-[#4C9F44] bg-[#F0F6EF] text-[#4C9F44]' : 'border-[#fff] bg-[#fff]'">
|
||||||
{{ item }}
|
{{ item.label }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="mt-32rpx">
|
<view class="mt-32rpx">
|
||||||
<coupon
|
<template v-for="(item, index) in couponList" :key="index">
|
||||||
v-for="(item, index) in couponList"
|
<template v-if="item.expire == 1">
|
||||||
:key="item.id"
|
<!-- 可用 -->
|
||||||
:coupon="item"
|
<coupon :coupon="item" canUse :checked="item.id === checkedId" :onCheck="MyCoupon.handleCouponCheck" :showChecked="false"></coupon>
|
||||||
canUse
|
</template>
|
||||||
:showChecked="false"
|
<template v-if="item.expire == 2">
|
||||||
:checked="item.id === checkedId"
|
<!-- 过期 -->
|
||||||
:onCheck="myCoupon.handleCouponCheck"
|
<coupon :coupon="item" :canUse="false" :checked="item.id === checkedId" :onCheck="MyCoupon.handleCouponCheck" :showChecked="false"></coupon>
|
||||||
:class="index !== couponList.length - 1 ? 'mb-20rpx' : ''"
|
</template>
|
||||||
></coupon>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</wd-tab>
|
</wd-tab>
|
||||||
@ -76,20 +51,22 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {ref} from 'vue'
|
import {ref} from 'vue'
|
||||||
import Coupon from '@/components/coupon/Coupon.vue'
|
import Coupon from '@/components/coupon/Coupon.vue'
|
||||||
import GroupCoupon from '@/components/coupon/GroupCoupon.vue'
|
import { getMyCoupons } from '@/api/user'
|
||||||
|
import List from '@/pages/address/list.vue'
|
||||||
|
|
||||||
//
|
//
|
||||||
const tab = ref<number>(0)
|
const tab = ref<number>(0)
|
||||||
const tag = ref<Array<string>>(['全部', '快过期', '已使用'])
|
const tag = ref<Array<any>>([
|
||||||
const currentTag = ref<string>('全部')
|
{label: '全部', value: 0 },
|
||||||
|
{label: '已使用', value: 1 },
|
||||||
|
{label: '快过期', value: 3 },
|
||||||
|
])
|
||||||
|
const currentTag = ref<number>(0)
|
||||||
|
|
||||||
const couponType = ref<number>(2) // couponType 1:优惠券 2:团购券
|
const couponType = ref<number>(2) // couponType 1:优惠券 2:团购券
|
||||||
const OSS = inject('OSS')
|
const OSS = inject('OSS')
|
||||||
|
|
||||||
const couponList = ref([
|
const couponList = ref<any[]>([])
|
||||||
{ id: 1, amount: 20, limit: 100, expire: '2024.08.20' },
|
|
||||||
{ id: 2, amount: 10, limit: 50, expire: '2024.08.25' }
|
|
||||||
])
|
|
||||||
const checkedId = ref<number>(0)
|
const checkedId = ref<number>(0)
|
||||||
|
|
||||||
const unCouponList = ref([
|
const unCouponList = ref([
|
||||||
@ -101,21 +78,40 @@
|
|||||||
if (args.type) {
|
if (args.type) {
|
||||||
couponType.value = args.type
|
couponType.value = args.type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MyCoupon.handleInit()
|
||||||
})
|
})
|
||||||
|
|
||||||
const myCoupon = {
|
const MyCoupon = {
|
||||||
// 切换tab
|
handleInit: async () => {
|
||||||
handleChangeTab: (index: number) => {
|
const res: any = await getMyCoupons({status: currentTag.value})
|
||||||
tab.value = index
|
|
||||||
currentTag.value = '全部'
|
if (Array.isArray(res)) {
|
||||||
|
res.map((res) => {
|
||||||
|
couponList.value.push({
|
||||||
|
id: res.coupon_id,
|
||||||
|
coupon_price: res.userCouponType[0].coupon_price,
|
||||||
|
use_price: res.userCouponType[0].use_price,
|
||||||
|
title: res.userCouponType[0].title,
|
||||||
|
effect_time: res.userCouponType[0].effect_time,
|
||||||
|
user_coupon_id: res.coupon_id,
|
||||||
|
expire: res.expire
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 切换tab
|
||||||
|
handleChangeTab: (index: number) => {},
|
||||||
|
|
||||||
// 切换tag
|
// 切换tag
|
||||||
handleChangeTag: (item: string) => {
|
handleChangeTag: (value: number) => {
|
||||||
currentTag.value = item
|
currentTag.value = value
|
||||||
console.log("🚀 ~ currentTag.value :", currentTag.value )
|
couponList.value = []
|
||||||
|
MyCoupon.handleInit()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// 选择优惠券-保留这个函数,暂时用不着
|
// 选择优惠券-保留这个函数,暂时用不着
|
||||||
handleCouponCheck: (id: number) => {
|
handleCouponCheck: (id: number) => {
|
||||||
checkedId.value = id
|
checkedId.value = id
|
||||||
|
|||||||
@ -211,7 +211,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="text-[#909399] text-26rpx leading-36rpx mb-40rpx">
|
<view class="text-[#909399] text-26rpx leading-36rpx mb-40rpx">
|
||||||
<view class="ml-80rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Serving || orderStatus == TeaSpecialistOrderStatus.Pay">使用过程中有任何问题,请联系客服</view>
|
<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="flex items-center justify-center" v-if="orderStatus == TeaSpecialistOrderStatus.Pending">
|
||||||
<view class="flex items-center mr-6rpx">
|
<view class="flex items-center mr-6rpx">
|
||||||
<wd-img width="36rpx" height="36rpx" :src="`${OSS}icon/icon_time.png`"/>
|
<wd-img width="36rpx" height="36rpx" :src="`${OSS}icon/icon_time.png`"/>
|
||||||
@ -230,13 +230,13 @@
|
|||||||
|
|
||||||
<!-- 信息模块 -->
|
<!-- 信息模块 -->
|
||||||
<view class="mx-30rpx coupon-bg" >
|
<view class="mx-30rpx coupon-bg" >
|
||||||
<view class="flex items-center px-30rpx pt-30rpx pb-40rpx">
|
<view class="flex items-center px-30rpx pt-30rpx">
|
||||||
<view class="mr-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.teamaster.image" mode="scaleToFill"></wd-img>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-1">
|
<view class="flex-1">
|
||||||
<view class="flex justify-between items-center">
|
<view class="flex justify-between items-center">
|
||||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx line-1 w-300rpx">
|
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx line-1 w-280rpx">
|
||||||
{{ order.teamaster.name }}
|
{{ order.teamaster.name }}
|
||||||
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
|
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
|
||||||
</view>
|
</view>
|
||||||
@ -247,7 +247,7 @@
|
|||||||
<view>x{{ order.hours }}</view>
|
<view>x{{ order.hours }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex justify-between items-center text-26rpx leading-36rpx text-[#909399] mt-18rpx">
|
<view class="flex justify-between items-center text-26rpx leading-36rpx text-[#909399] mt-18rpx">
|
||||||
<view>车马费(¥{{ order.fare_price }}元/公里)</view>
|
<view class="w-300rpx line-1">车马费(¥{{ order.fare_price }}元/公里)</view>
|
||||||
<view>¥{{ order.fare_distance_price }}/小时</view>
|
<view>¥{{ order.fare_distance_price }}/小时</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-[#606266] text-right mt-26rpx" v-if="orderStatus !== TeaSpecialistOrderStatus.Pending">
|
<view class="text-[#606266] text-right mt-26rpx" v-if="orderStatus !== TeaSpecialistOrderStatus.Pending">
|
||||||
@ -258,32 +258,20 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="mt-28rpx pb-28rpx">
|
<view class="mt-70rpx">
|
||||||
<view class="text-30rpx leading-42rpx text-[#303133] px-30rpx">预约信息</view>
|
<view class="text-30rpx leading-42rpx text-[#303133] px-30rpx">预约信息</view>
|
||||||
<view class="font-500 text-26rpx leading-48rpx text-[#606266] mt-20rpx">
|
<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="mb-20rpx px-30rpx">预约时间:{{ order.start_time }} - {{ order.end_time }}</view>
|
||||||
<view class="flex justify-between items-center pl-30rpx">
|
<view class="flex justify-between items-center pl-30rpx">
|
||||||
<view>预约时长:3小时</view>
|
<view>预约时长:{{ order.hours }}小时</view>
|
||||||
<view
|
|
||||||
v-if="orderStatus == TeaSpecialistOrderStatus.Reserved || orderStatus == TeaSpecialistOrderStatus.Consuming"
|
|
||||||
class="bg-[#4C9F44] rounded-[100rpx_0rpx_0rpx_100rpx] font-bold text-28rpx leading-40rpx text-[#fff] w-170rpx h-56rpx flex justify-center items-center"
|
|
||||||
@click="showRenewPopup = true">一键续订</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</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="mx-30rpx mt-20rpx bg-white rounded-16rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Serving || orderStatus == TeaSpecialistOrderStatus.Reserved">
|
<view class="mb-20rpx px-30rpx">服务时间:{{ order.start_time }} - {{ order.end_time }}</view>
|
||||||
<view class="px-30rpx"> 地图显示</view>
|
<view class="flex justify-between items-center pl-30rpx">
|
||||||
<view class="px-30rpx flex justify-between items-center">
|
<view>服务时长:{{ order.hours }}小时</view>
|
||||||
<view class="font-500 text-24rpx text-[#909399] leading-42rpx">信息没有更新,想问问茶艺师到哪里了?</view>
|
|
||||||
<view class="flex items-center">
|
|
||||||
<view class="flex items-center mr-6rpx">
|
|
||||||
<wd-img width="34rpx" height="34rpx" :src="`${OSS}icon/icon_phone2.png`" mode="scaleToFill"></wd-img>
|
|
||||||
</view>
|
|
||||||
<view class="text-26rpx leading-36rpx text-[#4C9F44]">
|
|
||||||
联系茶艺师
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -297,22 +285,26 @@
|
|||||||
<view>
|
<view>
|
||||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
||||||
<view class="text-[#606266] mr-54rpx">服务方式</view>
|
<view class="text-[#606266] mr-54rpx">服务方式</view>
|
||||||
<view class="text-[#303133]">{{ order.service_type }}</view>
|
<view class="text-[#303133]">{{ Number(order.service_type) == 1 ? '到店服务' : '上门服务'}}</view>
|
||||||
</view>
|
|
||||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx" v-if="orderStatus !== TeaSpecialistOrderStatus.Pending">
|
|
||||||
<view class="text-[#606266] mr-54rpx">服务门店</view>
|
|
||||||
<view class="text-[#303133] line-1 w-300rpx">{{ order.store_address }}</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
||||||
<view class="text-[#606266] mr-54rpx"> {{ orderStatus === TeaSpecialistOrderStatus.Serving ? '门店地址' : '服务地址' }}</view>
|
<view class="text-[#606266] mr-54rpx">{{ Number(order.service_type) == 1 ? '服务门店' : '服务地址'}}</view>
|
||||||
<view class="text-[#303133]">青浦区仓桥路478号</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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex absolute top-1/2 right-0 -translate-y-1/2">
|
<view class="flex absolute top-1/2 right-0 -translate-y-1/2">
|
||||||
<view class="text-center mr-20rpx" >
|
<view class="text-center mr-20rpx" @click="OrderDetail.handleOpenMap">
|
||||||
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_nav.png`"/>
|
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_nav.png`"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center" v-if="orderStatus === TeaSpecialistOrderStatus.Serving">
|
<view class="text-center" v-if="orderStatus != TeaSpecialistOrderStatus.Pending" @click="OrderDetail.handleCallService">
|
||||||
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_phone.png`"/>
|
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_phone.png`"/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -320,29 +312,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 支付方式 -->
|
|
||||||
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Pending">
|
|
||||||
<wd-radio-group v-model="pay" shape="dot" checked-color="#4C9F44">
|
|
||||||
<block v-for="(item, index) in PayList" :key="index">
|
|
||||||
<view
|
|
||||||
class="flex justify-between items-center"
|
|
||||||
:class="index !== PayList.length - 1 ? 'mb-40rpx' : ''"
|
|
||||||
v-if="item.id != 2"
|
|
||||||
>
|
|
||||||
<view class="flex items-center">
|
|
||||||
<wd-img width="50rpx" height="50rpx" :src="`${OSS}${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.type != PayCategory.WeChatPay">可用202.22</view>
|
|
||||||
</wd-radio>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
</wd-radio-group>
|
|
||||||
</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">
|
||||||
<view class="text-[#303133] text-32rpx leading-44rpx">订单信息</view>
|
<view class="text-[#303133] text-32rpx leading-44rpx">订单信息</view>
|
||||||
@ -354,57 +323,47 @@
|
|||||||
<text class="text-[#4C9F44]" @click="OrderDetail.handleCopy(order.order_sn)">复制</text>
|
<text class="text-[#4C9F44]" @click="OrderDetail.handleCopy(order.order_sn)">复制</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx" v-if="orderStatus != TeaSpecialistOrderStatus.Pending">
|
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx" v-if="orderStatus != TeaSpecialistOrderStatus.Pending && order.pay_way">
|
||||||
<view>交易方式</view>
|
<view>交易方式</view>
|
||||||
<view>{{ PayValueText[order.pay_way] }}</view>
|
<view>{{ order.pay_way_title }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||||
<view>创建时间</view>
|
<view>创建时间</view>
|
||||||
<view>{{ order.dtime }}</view>
|
<view>{{ order.dtime }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx" v-if="orderStatus != TeaSpecialistOrderStatus.Pending">
|
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx" v-if="orderStatus != TeaSpecialistOrderStatus.Pending && orderStatus != TeaSpecialistOrderStatus.Cancelled">
|
||||||
<view>付款时间</view>
|
<view>付款时间</view>
|
||||||
<view>{{ order.update_dtime }}</view>
|
<view>{{ order.update_dtime }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 操作按钮 -->
|
<!-- 操作按钮 -->
|
||||||
<view class="w-full fixed bottom-0 left-0 right-0 bg-white h-152rpx">
|
<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="mt-34rpx">
|
<view class="mt-34rpx">
|
||||||
<!-- 预约单、服务中 -->
|
<!-- 预约单、服务中 -->
|
||||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus === TeaSpecialistOrderStatus.Serving || orderStatus == TeaSpecialistOrderStatus.Confirm">
|
<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-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="OrderDetail.handleAgainReeserve">再次预定</view>
|
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleConfirmOrder">确认订单</view>
|
||||||
<view class="w-330rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleConfirmOrder">确认订单</view>
|
|
||||||
</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.Pending">
|
||||||
<view class="flex items-center">
|
<view class="flex items-center">
|
||||||
<view class="text-28rpx leading-40rpx text-[#606266] mr-16rpx" @click="OrderDetail.handleCancelOrder">取消</view>
|
<view class="text-28rpx leading-40rpx text-[#606266] mr-16rpx" @click="OrderDetail.handleCancelOrder">取消订单</view>
|
||||||
<view class="flex items-center">
|
|
||||||
<view class="mr-16rpx mt-[-8rpx]">
|
|
||||||
<price-format color="#FF5951" :first-size="40" :second-size="40" :subscript-size="28" :price="23.02"></price-format>
|
|
||||||
</view>
|
|
||||||
<view class="flex items-center text-[#4C9F44]" >
|
|
||||||
<view class="text-24rpx mr-10rpx" @click="showCostPopup = true">费用明细</view>
|
|
||||||
<wd-icon name="arrow-down" size="24rpx" color="#4C9F44"></wd-icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="w-178rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff]">立即预定</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>
|
||||||
|
|
||||||
<!-- 已预约 -->
|
<!-- 已预约 -->
|
||||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus == TeaSpecialistOrderStatus.Reserved">
|
<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] mr-30rpx" @click="showRefundRule = true">申请退款</view>
|
||||||
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133]" @click="OrderDetail.handleService">联系客服</view>
|
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133]" @click="OrderDetail.handleCallService">联系客服</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 交易完成 -->
|
<!-- 交易完成 -->
|
||||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center mt-34rpx"
|
<!-- <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">
|
v-if="orderStatus == TeaSpecialistOrderStatus.Finished || orderStatus == TeaSpecialistOrderStatus.Cancelled">
|
||||||
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]">再次预定</view>
|
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]">再次预定</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -412,11 +371,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { OrderStatusTitle, OrderStatus, OrderSource, TeaSpecialistOrderStatusTextValue, TeaSpecialistOrderStatus } from '@/utils/order'
|
import { TeaSpecialistOrderStatusTextValue, TeaSpecialistOrderStatus } from '@/utils/order'
|
||||||
import { getTeaSpecialistOrderDetails } from '@/api/order'
|
import { getTeaSpecialistOrderDetails } from '@/api/order'
|
||||||
import { toast } from '@/utils/toast'
|
import { toast } from '@/utils/toast'
|
||||||
import { useMessage } from 'wot-design-uni'
|
import { useMessage } from 'wot-design-uni'
|
||||||
import { PayList, PayCategory, PayValue, PayValueText } from '@/utils/pay'
|
import { handleCancelOrderHooks, handleToPayHooks, handleDeleteOrderHooks, handleConfirmOrderHooks, handleRefundOrderHooks } from '@/hooks/useOrder'
|
||||||
|
import { wxOpenMap } from '@/utils/jwexin'
|
||||||
|
|
||||||
const OSS = inject('OSS')
|
const OSS = inject('OSS')
|
||||||
|
|
||||||
@ -480,7 +440,6 @@
|
|||||||
orderId.value = args.orderId
|
orderId.value = args.orderId
|
||||||
// 获取订单详情
|
// 获取订单详情
|
||||||
OrderDetail.handleInit()
|
OrderDetail.handleInit()
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const OrderDetail = {
|
const OrderDetail = {
|
||||||
@ -490,6 +449,7 @@
|
|||||||
const data = res.details
|
const data = res.details
|
||||||
order.value = data
|
order.value = data
|
||||||
title.value = TeaSpecialistOrderStatusTextValue[data.order_status].title || '订单详情'
|
title.value = TeaSpecialistOrderStatusTextValue[data.order_status].title || '订单详情'
|
||||||
|
console.log("🚀 ~ title.value:", title.value)
|
||||||
orderStatus.value = data.order_status
|
orderStatus.value = data.order_status
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -508,7 +468,14 @@
|
|||||||
}
|
}
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
// 点击确认按钮回调事件
|
// 点击确认按钮回调事件
|
||||||
toast.info('订单取消成功')
|
if (res.action == 'confirm') {
|
||||||
|
uni.$on('refreshOrderDetail', () => {
|
||||||
|
OrderDetail.handleInit()
|
||||||
|
uni.$off('refreshOrderDetail')
|
||||||
|
})
|
||||||
|
|
||||||
|
handleConfirmOrderHooks(orderId.value)
|
||||||
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// 点击取消按钮回调事件
|
// 点击取消按钮回调事件
|
||||||
})
|
})
|
||||||
@ -532,6 +499,15 @@
|
|||||||
|
|
||||||
// 申请退款
|
// 申请退款
|
||||||
handleConfirmRefund: () => {
|
handleConfirmRefund: () => {
|
||||||
|
uni.$on('refreshOrderDetail', () => {
|
||||||
|
showRefundRule.value = false
|
||||||
|
|
||||||
|
OrderDetail.handleInit()
|
||||||
|
uni.$off('refreshOrderDetail')
|
||||||
|
})
|
||||||
|
|
||||||
|
handleRefundOrderHooks(orderId.value, 'order')
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 取消订单
|
// 取消订单
|
||||||
@ -548,19 +524,59 @@
|
|||||||
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||||
}
|
}
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
// 点击确认按钮回调事件
|
if (res.action == 'confirm') {
|
||||||
|
// 点击确认按钮回调事件
|
||||||
|
uni.$on('refreshOrderDetail', () => {
|
||||||
|
OrderDetail.handleInit()
|
||||||
|
uni.$off('refreshOrderDetail')
|
||||||
|
})
|
||||||
|
|
||||||
|
handleCancelOrderHooks(orderId.value)
|
||||||
|
}
|
||||||
toast.info('订单取消成功')
|
toast.info('订单取消成功')
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// 点击取消按钮回调事件
|
// 点击取消按钮回调事件
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 联系客服
|
|
||||||
handleService: () => {
|
|
||||||
|
|
||||||
|
// 支付
|
||||||
|
handleToPay: () => {
|
||||||
|
uni.$on('refreshOrderDetail', () => {
|
||||||
|
OrderDetail.handleInit()
|
||||||
|
uni.$off('refreshOrderDetail')
|
||||||
|
})
|
||||||
|
|
||||||
|
handleToPayHooks(orderId.value, order.value.teamaster.id)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 打开地图
|
||||||
|
handleOpenMap: () => {
|
||||||
|
if (Number(order.value.service_type) == 1) {
|
||||||
|
wxOpenMap({
|
||||||
|
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 {
|
||||||
|
wxOpenMap({
|
||||||
|
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,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 联系客服
|
||||||
|
handleCallService: () => {
|
||||||
|
uni.makePhoneCall({
|
||||||
|
phoneNumber: order.value.customer_service_phone, // 替换为需要拨打的电话号码
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 复制订单号
|
||||||
handleCopy: (text: string) => {
|
handleCopy: (text: string) => {
|
||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
data: text,
|
data: text,
|
||||||
|
|||||||
@ -95,12 +95,21 @@
|
|||||||
const tab = ref<string>('all')
|
const tab = ref<string>('all')
|
||||||
|
|
||||||
onLoad((args) => {
|
onLoad((args) => {
|
||||||
|
uni.$on('refreshOrderList', () => {
|
||||||
|
list.value = []
|
||||||
|
getMescroll().resetUpScroll()
|
||||||
|
})
|
||||||
|
|
||||||
// 根据传过来的参数决定显示哪个tab
|
// 根据传过来的参数决定显示哪个tab
|
||||||
if (args.orderStatus) {
|
if (args.orderStatus) {
|
||||||
tab.value = args.orderStatus
|
tab.value = args.orderStatus
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onUnload(() => {
|
||||||
|
uni.$off('refreshOrderList')
|
||||||
|
})
|
||||||
|
|
||||||
const orderList = {
|
const orderList = {
|
||||||
// 上拉加载的回调: 其中num:当前页 从1开始, size:每页数据条数,默认10
|
// 上拉加载的回调: 其中num:当前页 从1开始, size:每页数据条数,默认10
|
||||||
upCallback: (mescroll) => {
|
upCallback: (mescroll) => {
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="pb-30rpx">
|
<view class="pb-30rpx">
|
||||||
<view class="order-list">
|
<view class="order-list">
|
||||||
<navbar layoutLeft custom-class='!bg-[#F6F7F8]'>
|
<navbar layoutLeft custom-class='!bg-[#F6F7F8]' :leftArrow="false">
|
||||||
<template #left>
|
<template #left>
|
||||||
<view class="ml-24rpx flex items-center">
|
<view class="ml-24rpx flex items-center">
|
||||||
<view class="text-36rpx leading-50rpx text-[#303133] mr-24rpx">我的钱包</view>
|
<view class="text-36rpx leading-50rpx text-[#303133] mr-24rpx">我的钱包</view>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
<view class="font-400 text-28rpx leading-40rpx text-[#303133]">余额</view>
|
<view class="font-400 text-28rpx leading-40rpx text-[#303133]">余额</view>
|
||||||
<view class="flex justify-between items-center mt-24rpx">
|
<view class="flex justify-between items-center mt-24rpx">
|
||||||
<view>
|
<view>
|
||||||
<price-format color="#000" :first-size="48" :second-size="48" :subscript-size="28" :price="23.02"></price-format>
|
<price-format color="#000" :first-size="48" :second-size="48" :subscript-size="28" :price="user?.user_money || 0"></price-format>
|
||||||
</view>
|
</view>
|
||||||
<view class="w-200rpx h-80rpx bg-[#4C9F44] rounded-8rpx font-bold text-28rpx leading-80rpx text-center text-[#fff]" @click="wallet.handleToRecharge">
|
<view class="w-200rpx h-80rpx bg-[#4C9F44] rounded-8rpx font-bold text-28rpx leading-80rpx text-center text-[#fff]" @click="wallet.handleToRecharge">
|
||||||
充值
|
充值
|
||||||
@ -64,14 +64,14 @@
|
|||||||
<view>
|
<view>
|
||||||
<!-- 最后一个元素不显示border -->
|
<!-- 最后一个元素不显示border -->
|
||||||
<mescroll-body @init="mescrollInit" @down="downCallback" @up="wallet.upCallback" :up="upOption">
|
<mescroll-body @init="mescrollInit" @down="downCallback" @up="wallet.upCallback" :up="upOption">
|
||||||
<view class="h-144rpx leading-144rpx mt-18rpx border-b border-b-solid border-b-[#E5E5E5] flex flex-col justify-center" @click="wallet.handleToBillDetail(item)" v-for="(item, index) in 5" :key="index">
|
<view class="h-144rpx leading-144rpx mt-18rpx border-b border-b-solid border-b-[#E5E5E5] flex flex-col justify-center" @click="wallet.handleToBillDetail(item)" v-for="(item, index) in list" :key="index">
|
||||||
<view class="text-28rpx leading-40rpx text-[#303133] flex justify-between items-center">
|
<view class="text-28rpx leading-40rpx text-[#303133] flex justify-between items-center">
|
||||||
<view>茶艺师预定</view>
|
<view>茶艺师预定</view>
|
||||||
<view>-402.33</view>
|
<view>{{ item.amount }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-24rpx leading-34rpx text-[#909399] flex justify-between items-center mt-10rpx">
|
<view class="text-24rpx leading-34rpx text-[#909399] flex justify-between items-center mt-10rpx">
|
||||||
<view>2025-03-18 11:20</view>
|
<view>{{ item.create_time }}</view>
|
||||||
<view>余额24.55</view>
|
<view>余额{{ item.balance }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</mescroll-body>
|
</mescroll-body>
|
||||||
@ -86,70 +86,76 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
|
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
|
||||||
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
|
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
|
||||||
|
import { useUserStore } from '@/store'
|
||||||
|
import { getUserInfo, getUserMoneyLog } from '@/api/user'
|
||||||
|
|
||||||
const OSS = inject('OSS')
|
const OSS = inject('OSS')
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const userInfo = ref<any>(null)
|
||||||
|
const user = ref<any>(null)
|
||||||
|
|
||||||
|
|
||||||
/* mescroll */
|
/* mescroll */
|
||||||
const upOption = reactive({
|
const upOption = reactive({
|
||||||
empty: {
|
empty: {
|
||||||
icon : OSS + 'icon/icon_reserver_empty.png',
|
icon : OSS + 'icon/icon_reserver_empty.png',
|
||||||
}
|
},
|
||||||
|
auto: true,
|
||||||
|
textNoMore: '~ 已经到底啦 ~', //无更多数据的提示
|
||||||
})
|
})
|
||||||
const { mescrollInit, downCallback, getMescroll } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook
|
const { mescrollInit, downCallback, getMescroll } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook
|
||||||
|
const list = ref<Array<any>>([]) // 明细列表
|
||||||
|
|
||||||
// 日期过滤
|
// 日期过滤
|
||||||
const value = ref<number>(Date.now())
|
const value = ref<number>(Date.now())
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
const code = getUrlCode().code // 截取code
|
||||||
|
const userStore = useUserStore()
|
||||||
|
console.log("🚀 ~ userStore:", userStore.userInfo)
|
||||||
|
if (userStore.userInfo.mobile) {
|
||||||
|
userInfo.value = userStore.userInfo
|
||||||
|
|
||||||
|
// 获取用户详情信息接口
|
||||||
|
getUserInfo().then(res => {
|
||||||
|
user.value = res
|
||||||
|
})
|
||||||
|
|
||||||
|
} else if (code && !userStore.userInfo.token) {
|
||||||
|
// 这里是微信授权之后跳转回到本页面获取到code但是没有登录状态的话需要进行登录操作
|
||||||
|
snsapiBaseAuthorize()
|
||||||
|
}
|
||||||
|
})
|
||||||
const wallet = {
|
const wallet = {
|
||||||
// 上拉加载的回调: 其中num:当前页 从1开始, size:每页数据条数,默认10
|
// 上拉加载的回调: 其中num:当前页 从1开始, size:每页数据条数,默认10
|
||||||
upCallback: (mescroll) => {
|
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)
|
const d = new Date(value.value)
|
||||||
|
const year = d.getFullYear()
|
||||||
|
const month = d.getMonth() + 1
|
||||||
|
|
||||||
// mescroll.endByPage(curPageData.length, res.totalPages); //必传参数(当前页的数据个数, 总页数)
|
const filter = {
|
||||||
|
page: mescroll.num,
|
||||||
// }).catch(() => {
|
size: mescroll.size,
|
||||||
// mescroll.endErr(); // 请求失败, 结束加载
|
month: `${year}-${month}`,
|
||||||
// })
|
}
|
||||||
// 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
|
getUserMoneyLog(filter).then(res => {
|
||||||
// //mescroll.endByPage(curPageData.length, totalPage); //必传参数(当前页的数据个数, 总页数)
|
const curPageData = res.list || [] // 当前页数据
|
||||||
|
if(mescroll.num == 1) list.value = [] // 第一页需手动制空列表
|
||||||
// //方法二(推荐): 后台接口有返回列表的总数据量 totalSize
|
list.value = list.value.concat(curPageData) //追加新数据
|
||||||
// //mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
|
mescroll.endSuccess(curPageData.length, Boolean(res.more))
|
||||||
|
}).catch(() => {
|
||||||
// //方法三(推荐): 您有其他方式知道是否有下一页 hasNext
|
mescroll.endErr() // 请求失败, 结束加载
|
||||||
// //mescroll.endSuccess(curPageData.length, hasNext); //必传参数(当前页的数据个数, 是否有下一页true/false)
|
})
|
||||||
|
|
||||||
// //方法四 (不推荐),会存在一个小问题:比如列表共有20条数据,每页加载10条,共2页.如果只根据当前页的数据个数判断,则需翻到第三页才会知道无更多数据.
|
|
||||||
// mescroll.endSuccess(curPageData.length); // 请求成功, 结束加载
|
|
||||||
// }).catch(()=>{
|
|
||||||
mescroll.endErr(); // 请求失败, 结束加载
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 确认日期-
|
// 确认日期-
|
||||||
handleConfirmDate: (date: {value: number}) => {
|
handleConfirmDate: (date: {value: number}) => {
|
||||||
const d = new Date(date.value)
|
value.value = date.value
|
||||||
console.log("🚀 ~ d:", d)
|
list.value = []
|
||||||
const year = d.getFullYear()
|
getMescroll().resetUpScroll()
|
||||||
const month = d.getMonth() + 1
|
|
||||||
console.log(`${year}年${month}月`);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 去充值
|
// 去充值
|
||||||
|
|||||||
@ -162,7 +162,7 @@
|
|||||||
<text v-if="order.order_status === TeaSpecialistOrderStatus.Serving">服务中</text>
|
<text v-if="order.order_status === TeaSpecialistOrderStatus.Serving">服务中</text>
|
||||||
<text v-if="order.order_status === TeaSpecialistOrderStatus.Confirm" class="text-[#F29747]">待确认</text>
|
<text v-if="order.order_status === TeaSpecialistOrderStatus.Confirm" class="text-[#F29747]">待确认</text>
|
||||||
<text v-if="order.order_status === TeaSpecialistOrderStatus.Finished" class="text-[#606266]">完成</text>
|
<text v-if="order.order_status === TeaSpecialistOrderStatus.Finished" class="text-[#606266]">完成</text>
|
||||||
<text v-if="order.order_status === TeaSpecialistOrderStatus.Cancelled" class="text-[#C9C9C9]" >订单取消</text>
|
<text v-if="order.order_status === TeaSpecialistOrderStatus.Cancelled" class="text-[#C9C9C9]">订单取消</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -225,6 +225,7 @@
|
|||||||
import { TeaSpecialistOrderStatus, TeaSpecialistOrderStatusText } from '@/utils/order'
|
import { TeaSpecialistOrderStatus, TeaSpecialistOrderStatusText } from '@/utils/order'
|
||||||
import {TeaSpecialistLevelValue} from '@/utils/teaSpecialist'
|
import {TeaSpecialistLevelValue} from '@/utils/teaSpecialist'
|
||||||
import { router } from '@/utils/tools'
|
import { router } from '@/utils/tools'
|
||||||
|
import { handleCancelOrderHooks, handleToPayHooks } from '@/hooks/useOrder'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ComboCard 套餐卡片组件
|
* ComboCard 套餐卡片组件
|
||||||
@ -282,28 +283,29 @@
|
|||||||
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||||
}
|
}
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
switch (source) {
|
if (res.action == 'confirm') {
|
||||||
case OrderSource.Direct:
|
switch (source) {
|
||||||
// TODO 这里调用删除直营订单的接口
|
case OrderSource.Direct:
|
||||||
break;
|
// TODO 这里调用删除直营订单的接口
|
||||||
case OrderSource.Franchise:
|
break;
|
||||||
// TODO 这里调用删除加盟订单的接口
|
case OrderSource.Franchise:
|
||||||
break;
|
// TODO 这里调用删除加盟订单的接口
|
||||||
case OrderSource.DouYin:
|
break;
|
||||||
// TODO 这里调用删除抖音订单的接口
|
case OrderSource.DouYin:
|
||||||
break;
|
// TODO 这里调用删除抖音订单的接口
|
||||||
case OrderSource.TeaRoom:
|
break;
|
||||||
// TODO 这里调用删除茶室订单的接口
|
case OrderSource.TeaRoom:
|
||||||
break;
|
// TODO 这里调用删除茶室订单的接口
|
||||||
case OrderSource.TeaSpecialist:
|
break;
|
||||||
// TODO 这里调用删除茶室订单的接口
|
case OrderSource.TeaSpecialist:
|
||||||
break;
|
// TODO 这里调用删除茶室订单的接口
|
||||||
default:
|
handleDeleteOrderHooks(props.order.id)
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 点击确认按钮回调事件
|
|
||||||
toast.info('删除订单成功')
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// 点击取消按钮回调事件
|
// 点击取消按钮回调事件
|
||||||
})
|
})
|
||||||
@ -323,27 +325,9 @@
|
|||||||
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||||
}
|
}
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
switch (source) {
|
if (res.action == 'confirm') {
|
||||||
case OrderSource.Direct:
|
handleCancelOrderHooks(props.order.id)
|
||||||
// TODO 这里调用删除直营订单的接口
|
|
||||||
break;
|
|
||||||
case OrderSource.Franchise:
|
|
||||||
// TODO 这里调用删除加盟订单的接口
|
|
||||||
break;
|
|
||||||
case OrderSource.DouYin:
|
|
||||||
// TODO 这里调用删除抖音订单的接口
|
|
||||||
break;
|
|
||||||
case OrderSource.TeaRoom:
|
|
||||||
// TODO 这里调用删除茶室订单的接口
|
|
||||||
break;
|
|
||||||
case OrderSource.TeaSpecialist:
|
|
||||||
// TODO 这里调用删除茶室订单的接口
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
// 点击确认按钮回调事件
|
|
||||||
toast.info('订单取消成功')
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// 点击取消按钮回调事件
|
// 点击取消按钮回调事件
|
||||||
})
|
})
|
||||||
@ -363,35 +347,7 @@
|
|||||||
|
|
||||||
// 支付
|
// 支付
|
||||||
handleToPayOrder: (source: string) => {
|
handleToPayOrder: (source: string) => {
|
||||||
switch (source) {
|
handleToPayHooks(props.order.id, props.order.teamaster_id)
|
||||||
case OrderSource.Direct:
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/bundle/order/platform/direct-order-detail?orderStatus=${props.orderStatus}&toPay=true`
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
case OrderSource.Franchise:
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/bundle/order/platform/franchise-order-detail?orderStatus=${props.orderStatus}&toPay=true`
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
case OrderSource.DouYin:
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/bundle/order/douyin/douyin-order-detail?orderStatus=${props.orderStatus}&toPay=true`
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
case OrderSource.TeaRoom:
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/bundle/order/tea-room/order-detail?orderStatus=${props.orderStatus}&toPay=true`
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
case OrderSource.TeaSpecialist:
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/bundle/order/tea-specialist/order-detail?orderStatus=${props.orderStatus}&toPay=true`
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,11 +1,95 @@
|
|||||||
import { router } from '@/utils/tools'
|
import { router } from '@/utils/tools'
|
||||||
import { toast } from '@/utils/toast'
|
import { toast } from '@/utils/toast'
|
||||||
import { cancelTeaSpecialistOrder } from '@/api/order'
|
import { cancelTeaSpecialistOrder, deleteTeaSpecialistOrder, confirmTeaSpecialistOrder, refundTeaSpecialistOrder } from '@/api/order'
|
||||||
|
|
||||||
// 取消订单
|
/**
|
||||||
export async function handleCancelOrder(id: number) {
|
* 取消订单
|
||||||
|
* @param orderId 订单ID
|
||||||
|
*/
|
||||||
|
export async function handleCancelOrderHooks(orderId: number) {
|
||||||
try {
|
try {
|
||||||
const response = await cancelTeaSpecialistOrder({ id })
|
const response = await cancelTeaSpecialistOrder({ id: orderId })
|
||||||
|
uni.$emit('refreshOrderList')
|
||||||
|
uni.$emit('refreshOrderDetail')
|
||||||
|
} catch (error) {
|
||||||
|
router.navigateBack()
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重新支付
|
||||||
|
* @param orderId 订单ID
|
||||||
|
* @param teaSpecialistId 茶艺师ID
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function handleToPayHooks(orderId: number, teaSpecialistId: number) {
|
||||||
|
try {
|
||||||
|
uni.$on('payment', params => {
|
||||||
|
console.log("🚀 ~ params:", params)
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.$off("payment")
|
||||||
|
uni.$emit('refreshOrderList')
|
||||||
|
uni.$emit('refreshOrderDetail')
|
||||||
|
if (params.result) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: `/pages/notice/reserve?type=teaSpecialist&orderId=${params.orderId}`
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/bundle/order/tea-specialist/order-list'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
router.navigateTo(`/pages/cashier/cashier?from=order&orderId=${orderId}&teaSpecialistId=${teaSpecialistId}`)
|
||||||
|
}, 800)
|
||||||
|
} catch (error) {
|
||||||
|
toast.info('订单提交失败,请稍后重试')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除订单
|
||||||
|
*/
|
||||||
|
export async function handleDeleteOrderHooks(orderId: number) {
|
||||||
|
try {
|
||||||
|
const response = await deleteTeaSpecialistOrder({ id: orderId })
|
||||||
|
uni.$emit('refreshOrderList')
|
||||||
|
uni.$emit('refreshOrderDetail')
|
||||||
|
} catch (error) {
|
||||||
|
router.navigateBack()
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认(完成)订单
|
||||||
|
*/
|
||||||
|
export async function handleConfirmOrderHooks(orderId: number) {
|
||||||
|
try {
|
||||||
|
const response = await confirmTeaSpecialistOrder({ id: orderId })
|
||||||
|
uni.$emit('refreshOrderList')
|
||||||
|
uni.$emit('refreshOrderDetail')
|
||||||
|
} catch (error) {
|
||||||
|
router.navigateBack()
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单退款
|
||||||
|
* @param orderId 订单ID
|
||||||
|
* @param orderType 订单类型
|
||||||
|
*/
|
||||||
|
export async function handleRefundOrderHooks(orderId: number, orderType: string) {
|
||||||
|
try {
|
||||||
|
const response = await refundTeaSpecialistOrder({ id: orderId, order_type: orderType })
|
||||||
|
uni.$emit('refreshOrderList')
|
||||||
|
uni.$emit('refreshOrderDetail')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
router.navigateBack()
|
router.navigateBack()
|
||||||
throw error
|
throw error
|
||||||
|
|||||||
@ -27,7 +27,7 @@ export const getUrlCode = (): { [key: string]: string | undefined } => {
|
|||||||
*/
|
*/
|
||||||
export async function snsapiBaseAuthorize() {
|
export async function snsapiBaseAuthorize() {
|
||||||
// TODO 测试代码
|
// TODO 测试代码
|
||||||
wxSnsapiBaseLogin({code: '0417vVGa1MfYBK0binIa1xEQQB37vVGV'}).then((res: IUserInfoVo) => {
|
wxSnsapiBaseLogin({code: '031dX13w3vRqT539Mo0w30juM84dX13s'}).then((res: IUserInfoVo) => {
|
||||||
console.log("登录成功 ~ snsapiBaseAuthorize ~ res:", res)
|
console.log("登录成功 ~ snsapiBaseAuthorize ~ res:", res)
|
||||||
// 映射 IUserLogin 到 IUserInfoVo
|
// 映射 IUserLogin 到 IUserInfoVo
|
||||||
useUserStore().setUserInfo(res)
|
useUserStore().setUserInfo(res)
|
||||||
|
|||||||
@ -121,7 +121,7 @@ const alovaInstance = createAlova({
|
|||||||
|
|
||||||
if (config.meta?.toast !== false) {
|
if (config.meta?.toast !== false) {
|
||||||
toast.info(msg)
|
toast.info(msg)
|
||||||
router.switchTab('/pages/my/my')
|
router.switchTab('/pages/my/my', 1000)
|
||||||
}
|
}
|
||||||
throw new Error(`登录超时[${code}]:${msg}`)
|
throw new Error(`登录超时[${code}]:${msg}`)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,8 +12,10 @@
|
|||||||
<view class="home-bg w-[100%] fixed top-0 left-0 z-100">
|
<view class="home-bg w-[100%] fixed top-0 left-0 z-100">
|
||||||
<wd-navbar safeAreaInsetTop :bordered="false" custom-style="background-color: transparent !important;">
|
<wd-navbar safeAreaInsetTop :bordered="false" custom-style="background-color: transparent !important;">
|
||||||
<template #right>
|
<template #right>
|
||||||
<view class="mr-16rpx flex items-center right-slot" @click="My.handleShowService">
|
<view class="mr-16rpx flex items-center right-slot">
|
||||||
<wd-img width="36rpx" height="36rpx" :src="`${OSS}icon/icon_service.png`"></wd-img>
|
<a :href="'tel:' + userInfo.mobile">
|
||||||
|
<wd-img width="36rpx" height="36rpx" :src="`${OSS}icon/icon_service.png`"></wd-img>
|
||||||
|
</a>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</wd-navbar>
|
</wd-navbar>
|
||||||
@ -25,7 +27,8 @@
|
|||||||
<view>
|
<view>
|
||||||
<wd-img width="120rpx" height="120rpx" :src="`${OSS}icon/icon_avatar.png`" mode="aspectFill" round />
|
<wd-img width="120rpx" height="120rpx" :src="`${OSS}icon/icon_avatar.png`" mode="aspectFill" round />
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-1 ml-22rpx flex justify-between items-center" @click="My.handleToProfile">
|
<!-- <view class="flex-1 ml-22rpx flex justify-between items-center" @click="My.handleToProfile"> -->
|
||||||
|
<view class="flex-1 ml-22rpx flex justify-between items-center">
|
||||||
<view>
|
<view>
|
||||||
<view class="text-[#303133] text-36rpx leading-50rpx ml-8rpx">{{ isLogin ? userInfo.nickname : '立即登录' }}</view>
|
<view class="text-[#303133] text-36rpx leading-50rpx ml-8rpx">{{ isLogin ? userInfo.nickname : '立即登录' }}</view>
|
||||||
<view v-if="isLogin" class="flex justify-center items-center vip-bg mt-10rpx" >
|
<view v-if="isLogin" class="flex justify-center items-center vip-bg mt-10rpx" >
|
||||||
@ -39,7 +42,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="w-178rpx h-80rpx relative">
|
<view class="w-178rpx h-80rpx relative">
|
||||||
<wd-img width="100%" height="100%" mode="aspectFill" :src="`${OSS}images/my/my_image2.png`"></wd-img>
|
<wd-img width="100%" height="100%" mode="aspectFill" :src="`${OSS}images/my/my_image2.png`"></wd-img>
|
||||||
<view class="absolute left-36rpx top-28rpx flex items-center" @click="My.handleShowPromoCode">
|
<view class="absolute left-36rpx top-28rpx flex items-center" @click.stop="My.handleShowPromoCode">
|
||||||
<view class="flex items-center mr-8rpx">
|
<view class="flex items-center mr-8rpx">
|
||||||
<wd-img width="32rpx" height="32rpx" mode="aspectFill" :src="`${OSS}icon/icon_ercode.png`"></wd-img>
|
<wd-img width="32rpx" height="32rpx" mode="aspectFill" :src="`${OSS}icon/icon_ercode.png`"></wd-img>
|
||||||
</view>
|
</view>
|
||||||
@ -53,11 +56,11 @@
|
|||||||
<view class="mt-16rpx mx-30rpx flex justify-between">
|
<view class="mt-16rpx mx-30rpx flex justify-between">
|
||||||
<view class="flex items-center">
|
<view class="flex items-center">
|
||||||
<view class="w-160rpx text-[#303133] text-center" @click="My.handleToCoupon">
|
<view class="w-160rpx text-[#303133] text-center" @click="My.handleToCoupon">
|
||||||
<view class="font-bold text-36rpx leading-50rpx"> {{ isLogin ? 51 : '- -' }}</view>
|
<view class="font-bold text-36rpx leading-50rpx"> {{ isLogin ? user.coupon_count : '- -' }}</view>
|
||||||
<view class="text-24rpx leading-34rpx">优惠券</view>
|
<view class="text-24rpx leading-34rpx">优惠券</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="w-160rpx text-[#303133] text-center" @click="My.handleToCollect">
|
<view class="w-160rpx text-[#303133] text-center" @click="My.handleToCollect">
|
||||||
<view class="font-bold text-36rpx leading-50rpx"> {{ isLogin ? 51 : '- -' }}</view>
|
<view class="font-bold text-36rpx leading-50rpx"> {{ isLogin ? user.collect_count : '- -' }}</view>
|
||||||
<view class="text-24rpx leading-34rpx">收藏</view>
|
<view class="text-24rpx leading-34rpx">收藏</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -66,7 +69,7 @@
|
|||||||
<wd-img width="100%" height="100%" :src="`${OSS}images/my/my_image3.png`" mode="aspectFill"></wd-img>
|
<wd-img width="100%" height="100%" :src="`${OSS}images/my/my_image3.png`" mode="aspectFill"></wd-img>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-[#303133] absolute bottom-12rpx left-24rpx text-center">
|
<view class="text-[#303133] absolute bottom-12rpx left-24rpx text-center">
|
||||||
<view class="text-30rpx leading-36rpx fon-bold">{{ isLogin ? user.user_money : '- -' }}</view>
|
<view class="text-30rpx leading-36rpx fon-bold">{{ isLogin ? user?.user_money : '- -' }}</view>
|
||||||
<view class="text-20rpx leading-28rpx ml-10rpx">平台余额</view>
|
<view class="text-20rpx leading-28rpx ml-10rpx">平台余额</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -104,16 +107,16 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="mt-50rpx ml-24rpx">
|
<view class="mt-50rpx ml-24rpx">
|
||||||
<scroll-view class="w-[100%] whitespace-nowrap" :scroll-x="true" scroll-left="120">
|
<scroll-view class="w-[100%] whitespace-nowrap" :scroll-x="true" scroll-left="120">
|
||||||
<view class="scroll-item mr-20rpx" v-for="(item, index) in 10" :key="index">
|
<view class="scroll-item mr-20rpx" v-for="(item, index) in couponList" :key="index">
|
||||||
<view class="font-bold text-22rpx text-[#AF6400] leading-32rpx mt-6rpx">茶室券</view>
|
<view class="font-bold text-22rpx text-[#AF6400] leading-32rpx mt-6rpx">{{ item.title }}</view>
|
||||||
<view class="font-bold text-[#1C1C1D] leading-34rpx mt-8rpx">
|
<view class="font-bold text-[#1C1C1D] leading-34rpx mt-8rpx">
|
||||||
<text class="text-24rpx">¥</text>
|
<text class="text-24rpx">¥</text>
|
||||||
<text class="text-30rpx">20</text>
|
<text class="text-30rpx">{{ item.coupon_price }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="font-400 text-20rpx leading-28rpx text-[#1C1C1D]">满200可用</view>
|
<view class="font-400 text-20rpx leading-28rpx text-[#1C1C1D]">{{ item.name }}</view>
|
||||||
<view class="font-400 text-20rpx w-126rpx h-40rpx rounded-20rpx mt-18rpx leading-40rpx mx-auto"
|
<view class="font-400 text-20rpx w-126rpx h-40rpx rounded-20rpx mt-18rpx leading-40rpx mx-auto"
|
||||||
:class="isClaimCoupon ? 'bg-[#E6E3DF]' : 'bg-[#FCCA84]'" @click="isClaimCoupon = true">
|
:class="item.use == 1 ? 'bg-[#E6E3DF]' : 'bg-[#FCCA84]'" @click="My.handleClaimCoupon(item.id)">
|
||||||
{{ isClaimCoupon ? '已领取' : '立即领取' }}
|
{{ item.use == 1 ? '已领取' : '立即领取' }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@ -148,6 +151,21 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 我的地址 -->
|
||||||
|
<view class="bg-white rounded-16rpx mx-30rpx mt-20rpx px-30rpx py-28rpx">
|
||||||
|
<view class="flex items-center justify-between" @click="router.navigateTo('/pages/address/list')">
|
||||||
|
<view class="flex items-center">
|
||||||
|
<view class="flex items-center mr-28rpx">
|
||||||
|
<wd-img :src="`${OSS}icon/icon_location.png`" width="44rpx" height="44rpx"></wd-img>
|
||||||
|
</view>
|
||||||
|
<view class="font-400 text-28rpx leading-40rpx text-[#313131]">我的地址</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<wd-icon name="chevron-right" size="22px"></wd-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 推广码 -->
|
<!-- 推广码 -->
|
||||||
@ -182,7 +200,8 @@
|
|||||||
import { toast } from '@/utils/toast'
|
import { toast } from '@/utils/toast'
|
||||||
import { useUserStore } from '@/store'
|
import { useUserStore } from '@/store'
|
||||||
import { getUrlCode, snsapiBaseAuthorize } from '@/hooks/useWeiXin'
|
import { getUrlCode, snsapiBaseAuthorize } from '@/hooks/useWeiXin'
|
||||||
import { getUserInfo } from '@/api/user'
|
import { getUserInfo, getMyCoupon, claimMyCoupon } from '@/api/user'
|
||||||
|
import { router } from '@/utils/tools'
|
||||||
|
|
||||||
const OSS = inject('OSS')
|
const OSS = inject('OSS')
|
||||||
const navbarHeight = inject('navbarHeight')
|
const navbarHeight = inject('navbarHeight')
|
||||||
@ -211,6 +230,7 @@
|
|||||||
const sheetMenu = ref<{ name: string}[]>([])
|
const sheetMenu = ref<{ name: string}[]>([])
|
||||||
|
|
||||||
// 领取优惠券
|
// 领取优惠券
|
||||||
|
const couponList = ref<any[]>([])
|
||||||
const isClaimCoupon = ref<boolean>(false)
|
const isClaimCoupon = ref<boolean>(false)
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
@ -243,6 +263,8 @@
|
|||||||
}
|
}
|
||||||
// 你可以在这里做跳转或弹窗提示
|
// 你可以在这里做跳转或弹窗提示
|
||||||
})
|
})
|
||||||
|
|
||||||
|
My.handleInit()
|
||||||
})
|
})
|
||||||
|
|
||||||
onUnload(() => {
|
onUnload(() => {
|
||||||
@ -250,6 +272,19 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
const My = {
|
const My = {
|
||||||
|
handleInit: () => {
|
||||||
|
getMyCoupon().then(res => {
|
||||||
|
couponList.value = Array.isArray(res) ? res : []
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 领取优惠券
|
||||||
|
handleClaimCoupon: async (id: number) => {
|
||||||
|
const res = await claimMyCoupon({id})
|
||||||
|
toast.info('领取成功')
|
||||||
|
My.handleInit()
|
||||||
|
},
|
||||||
|
|
||||||
// 点击显示客服电话
|
// 点击显示客服电话
|
||||||
handleShowService: () => {
|
handleShowService: () => {
|
||||||
showServiceMobile.value = true
|
showServiceMobile.value = true
|
||||||
@ -260,9 +295,8 @@
|
|||||||
|
|
||||||
// 选择菜单-拨打客服电话
|
// 选择菜单-拨打客服电话
|
||||||
handleSelectMenu: (item: any) => {
|
handleSelectMenu: (item: any) => {
|
||||||
uni.makePhoneCall({
|
// window.location.href = 'tel: ' + item.item.name
|
||||||
phoneNumber: item.item.name
|
// console.log("🚀 ~ item.item.name:", item.item.name)
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 显示推广码
|
// 显示推广码
|
||||||
@ -272,9 +306,7 @@
|
|||||||
} else {
|
} else {
|
||||||
toast.info('请先登录')
|
toast.info('请先登录')
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateTo({
|
router.navigateTo('/pages/login/login')
|
||||||
url: '/pages/login/login'
|
|
||||||
})
|
|
||||||
}, 800)
|
}, 800)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -282,9 +314,7 @@
|
|||||||
// 跳转到个人信息
|
// 跳转到个人信息
|
||||||
handleToProfile: async () => {
|
handleToProfile: async () => {
|
||||||
if (isLogin.value) {
|
if (isLogin.value) {
|
||||||
uni.navigateTo({
|
router.navigateTo('/bundle/profile/profile')
|
||||||
url: '/bundle/profile/profile'
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
await snsapiBaseAuthorize()
|
await snsapiBaseAuthorize()
|
||||||
}
|
}
|
||||||
@ -292,30 +322,22 @@
|
|||||||
|
|
||||||
// 跳转到会员权益
|
// 跳转到会员权益
|
||||||
handleToVipBenefits: () => {
|
handleToVipBenefits: () => {
|
||||||
uni.navigateTo({
|
router.navigateTo('/bundle/vip/benefits')
|
||||||
url: '/bundle/vip/benefits'
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 跳转到优惠券
|
// 跳转到优惠券
|
||||||
handleToCoupon: () => {
|
handleToCoupon: () => {
|
||||||
uni.navigateTo({
|
router.navigateTo('/bundle/coupon/my-coupon')
|
||||||
url: '/bundle/coupon/my-coupon'
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 跳转到收藏
|
// 跳转到收藏
|
||||||
handleToCollect: () => {
|
handleToCollect: () => {
|
||||||
uni.navigateTo({
|
router.navigateTo('/bundle/collect/collect')
|
||||||
url: '/bundle/collect/collect'
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 跳转到我的钱包
|
// 跳转到我的钱包
|
||||||
handleToWallet: () => {
|
handleToWallet: () => {
|
||||||
uni.navigateTo({
|
router.navigateTo('/bundle/wallet/wallet')
|
||||||
url: '/bundle/wallet/wallet'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
<reserve-notice title="茶艺师预约成功" desc="可以点击下方查看预约单具体信息">
|
<reserve-notice title="茶艺师预约成功" desc="可以点击下方查看预约单具体信息">
|
||||||
<template #layout>
|
<template #layout>
|
||||||
<view class="pb-22rpx mt-40rpx mx-30rpx flex justify-between items-center text-[32rpx] text-center">
|
<view class="pb-22rpx mt-40rpx mx-30rpx flex justify-between items-center text-[32rpx] text-center">
|
||||||
<view class='bg-[#F6F7F8] text-[#303133] rounded-24rpx h-90rpx leading-90rpx mr-28rpx w-300rpx' @click="reserve.handleRoomSeeOrder">查看订单</view>
|
<view class='bg-[#fff] text-[#303133] rounded-24rpx h-90rpx leading-90rpx mr-28rpx w-300rpx' @click="reserve.handleRoomSeeOrder">查看订单</view>
|
||||||
<view class='bg-[#4C9F44] text-[#fff] rounded-24rpx h-90rpx leading-90rpx w-300rpx' @click="reserve.handleRoomDone">完成</view>
|
<view class='bg-[#4C9F44] text-[#fff] rounded-24rpx h-90rpx leading-90rpx w-300rpx' @click="reserve.handleRoomDone">完成</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -54,7 +54,7 @@
|
|||||||
const reserve = {
|
const reserve = {
|
||||||
// 预约茶室 - 查看订单
|
// 预约茶室 - 查看订单
|
||||||
handleRoomSeeOrder: () => {
|
handleRoomSeeOrder: () => {
|
||||||
router.navigateTo('/bundle/tea-room/order')
|
router.navigateTo('/bundle/order/tea-specialist/order-list')
|
||||||
},
|
},
|
||||||
|
|
||||||
// 预约茶室 - 完成
|
// 预约茶室 - 完成
|
||||||
|
|||||||
@ -640,7 +640,6 @@
|
|||||||
hours: bill.value.service.num
|
hours: bill.value.service.num
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await createTeaSpecialistOrder(params)
|
const res = await createTeaSpecialistOrder(params)
|
||||||
|
|
||||||
|
|||||||
@ -70,6 +70,24 @@ export async function wxGetLocation(callback: (res: any) => void ) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 打开地图
|
||||||
|
export async function wxOpenMap(data: {latitude: number, longitude: number, name: string, address: string}) {
|
||||||
|
if (!isWechat()) {
|
||||||
|
console.log('不是微信客户端')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
await initJweixinSDK()
|
||||||
|
wx.ready(function() {
|
||||||
|
wx.openLocation({
|
||||||
|
latitude: data.latitude, // 纬度,浮点数,范围为90 ~ -90
|
||||||
|
longitude: data.longitude, // 经度,浮点数,范围为180 ~ -180。
|
||||||
|
name: data.name, // 位置名
|
||||||
|
address: data.address, // 地址详情说明
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 分享
|
// 分享
|
||||||
export async function wxShare(data:IJweiXinShareParams) {
|
export async function wxShare(data:IJweiXinShareParams) {
|
||||||
if (!isWechat()) {
|
if (!isWechat()) {
|
||||||
|
|||||||
@ -195,19 +195,19 @@ export const TeaSpecialistOrderStatusTextValue: Record<TeaSpecialistOrderStatus,
|
|||||||
title: '等待付款'
|
title: '等待付款'
|
||||||
},
|
},
|
||||||
[TeaSpecialistOrderStatus.Pay]: {
|
[TeaSpecialistOrderStatus.Pay]: {
|
||||||
title: '等待付款'
|
title: '已预约'
|
||||||
},
|
},
|
||||||
[TeaSpecialistOrderStatus.Cancelled]: {
|
[TeaSpecialistOrderStatus.Cancelled]: {
|
||||||
title: '等待付款'
|
title: '订单取消'
|
||||||
},
|
},
|
||||||
[TeaSpecialistOrderStatus.Confirm]: {
|
[TeaSpecialistOrderStatus.Confirm]: {
|
||||||
title: '等待付款'
|
title: '订单待确认'
|
||||||
},
|
},
|
||||||
[TeaSpecialistOrderStatus.Serving]: {
|
[TeaSpecialistOrderStatus.Serving]: {
|
||||||
title: '等待付款'
|
title: '服务中'
|
||||||
},
|
},
|
||||||
[TeaSpecialistOrderStatus.Finished]: {
|
[TeaSpecialistOrderStatus.Finished]: {
|
||||||
title: '等待付款'
|
title: '交易完成'
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user