diff --git a/src/api/pay.ts b/src/api/pay.ts new file mode 100644 index 0000000..b92170b --- /dev/null +++ b/src/api/pay.ts @@ -0,0 +1,16 @@ +import { http } from '@/http/alova' + +/** + * 给茶艺师打赏 + */ +interface ITipTeaSpecialistParams { + id: number + tip_price: number + pay_type: number +} + +export function payTipTeaSpecialist(data: ITipTeaSpecialistParams) { + return http.Post('/api/Teamaster/giveTeamasterTipAmount', + data + ) +} \ No newline at end of file diff --git a/src/api/tea-room.ts b/src/api/tea-room.ts index 0db1bdd..58ba315 100644 --- a/src/api/tea-room.ts +++ b/src/api/tea-room.ts @@ -1,10 +1,11 @@ import { http } from '@/http/alova' -import type { IHomeTeaRoomListResult, IOpenCityListResult, ITeaRoomDetailResult } from '@/api/types/tea-room' +import type { IHomeTeaRoomListResult, IOpenCityListResult, ITeaRoomDetailResult, ITeaRoomBalanceResult, IOrderListResult } from '@/api/types/tea-room' +import type { ITeaSpecialistFuture7DaysResult, ITeaSpecialistOrderDetailsResult } from '@/api/types/tea' /** - * 获取茶室列表 + * 获取门店列表 */ -export interface IHomeTeaRoomListParams { +export interface IHomeTeaStoreListParams { page: number size: number search: string @@ -12,7 +13,7 @@ export interface IHomeTeaRoomListParams { longitude: number } -export function getHomeTeaRoomList(data: any) { +export function getHomeTeaStoreList(data: IHomeTeaStoreListParams) { return http.Post('/api/teaStore/teaStoreLists', data, { @@ -88,4 +89,117 @@ export function getCollectTeaRoomList(data: ICollectTeaRoomListParams) { return http.Post('/api/teaStore/teaStoreCollectList', data ) +} + +/** + * 获取门店下的茶室列表 + */ +export interface IStoreTeaRoomListParams { + id: number + page: number + size: number +} + +export function getStoreTeaRoomList(data: IStoreTeaRoomListParams) { + return http.Post('/api/teaStore/teaStoreRoomLists', + data, + { + meta: { ignoreAuth: true } + } + ) +} + +/** + * 获取未来7天时间 + */ +export function getNext7Days() { + return http.Post('/api/Common/get7Time') +} + +/** + * 获取门店余额 + */ +export interface ITeaRoomBalanceParams { + store_id: number +} + +export function getTeaRoomBalance(data: ITeaRoomBalanceParams) { + return http.Post('/api/user/userStoreMoney', data) +} + +/** + * 创建门店包间订单 + */ +export interface ICreateTeaRoomOrderParams { + store_id: number + room_id: number + day_time: string + start_time: string + end_time: string + hours: number + user_coupon_id: number +} + +export function createTeaRoomOrder(data: ICreateTeaRoomOrderParams) { + return http.Post<{id: number}>('/api/order/submitStoreOrder', data) +} + +/** + * 获取门店包间订单详情 + */ +export interface ITeaRoomOrderDetailParams { + id: number + latitude: number + longitude: number +} + +export function getTeaRoomOrderDetail(data: ITeaRoomOrderDetailParams) { + return http.Post('/api/order/orderStoreDetails', data) +} + +/** + * 门店包间订单列表 + */ +export interface ITeaRoomOrderListParams { + page: number + size: number + order_status: string + search: string +} + +export function getTeaRoomOrderList(data: ITeaRoomOrderListParams) { + return http.Post('/api/order/orderStoreList', data) +} + +/** + * 取消包间订单 + */ +export interface ICancelTeaRoomOrderParams { + id: number +} + +export function cancelTeaRoomOrder(data: ICancelTeaRoomOrderParams) { + return http.Post('/api/order/cancelOrderStore', data) +} + +/** + * 删除包间订单 + */ +export interface IDeleteTeaRoomOrderParams { + id: number +} + +export function deleteTeaRoomOrder(data: IDeleteTeaRoomOrderParams) { + return http.Post('/api/order/delOrderStore', data) +} + +/** + * 确认包间订单 + */ +export interface IConfirmTeaRoomOrderParams { + id: number +} + +export function confirmTeaRoomOrder(data: IConfirmTeaRoomOrderParams) { + return http.Post('/api/order/userConfirmOrderStore', data) } \ No newline at end of file diff --git a/src/api/tea.ts b/src/api/tea.ts new file mode 100644 index 0000000..03ec21e --- /dev/null +++ b/src/api/tea.ts @@ -0,0 +1,183 @@ +import { http } from '@/http/alova' +import type { + ITeaSpecialistDetailsResult, + ITeaSpecialistFuture7DaysResult, + ITeaTypeListResult, + ICollectTeaSpecialistResult, + ICreateTeaSpecialistOrderResult, + ITeaSpecialistOrderDetailsResult, + ITeaSpecialistPrepayResult } from '@/api/types/tea' + +/** + * 获取茶艺师详情 + */ +export interface ITeaSpecialistDetailsParams { + id: number + longitude: number | '' + latitude: number | '' + user_id: number | '' +} + +export function getTeaSpecialistDetails(data: ITeaSpecialistDetailsParams) { + return http.Post('/api/Teamaster/teamasterDetails', + data, + { + meta: { ignoreAuth: true } + } + ) +} + +/** + * 收藏和取消收藏茶艺师 + */ +export interface ICollectTeaSpecialistParams { + id: number + status: number +} + +export function collectTeaSpecialist(data: ICollectTeaSpecialistParams) { + return http.Post('/api/Teamaster/teamasterCollect', + data + ) +} + +/** + * 获取打赏金额 + */ +export function getTeaSpecialistRewardAmounts() { + return http.Post('/api/Teamaster/teamasterTipAmount') +} + +/** + * 获取门店地址 + */ +export interface ITeaHouseListParams { + page: number + size: number + latitude: number + longitude: number + search: string +} + +export function getTeaHouseList(data: ITeaHouseListParams) { + return http.Post('/api/Store/storeList', + data + ) +} + +/** + * 获取未来7天时间 + */ +export function getNext7Days() { + return http.Post('/api/Common/get7Time') +} + +/** + * 获取茶叶类型列表 + */ +export function getTeaTypeList() { + return http.Post('/api/Teamaster/teaType') +} + +/** + * 获取收藏列表 + */ +export interface IGetCollectTeaSpecialistParams { + page: number + size: number +} + +export function getCollect(data: IGetCollectTeaSpecialistParams) { + return http.Post('/api/Teamaster/teamasterCollectList', data) +} + +/** + * 茶艺师邀约 + */ +export interface ITeaSpecialistInviteParams { + id: number +} + +export function teaSpecialistInvite(data: ITeaSpecialistInviteParams) { + return http.Post('/api/Teamaster/invitation', data) +} + +/** + * 创建预约茶艺师订单 + */ +export interface ICreateTeaSpecialistOrderParams { + teamaster_id: number + address_id: number + start_time: number + end_time: number + nums: number + tea_id: string + service_type: number + store_id: number + latitude: number + longitude: number + remark: string + coupon_id: number + hours: number +} + +export function createTeaSpecialistOrder(data: ICreateTeaSpecialistOrderParams) { + return http.Post('/api/order/submitOrder', data) +} + +/*** + * 获取订单详情 + */ +export interface IGetTeaSpecialistOrderDetailsParams { + id: number +} + +export function getTeaSpecialistOrderDetails(data: IGetTeaSpecialistOrderDetailsParams) { + return http.Post('/api/order/orderDetails', data) +} + +/** + * 预支付 + */ +export interface ITeaSpecialistPrepayParams { + order_id: number + from: string + pay_way: number + order_source: number +} + +export function teaSpecialistPrepay(data: ITeaSpecialistPrepayParams) { + return http.Post('/api/pay/prepay', data) +} + +/** + * 支付接口 + */ +export interface ITeaSpecialistPayParams { + id: number +} + +export function teaSpecialistPay(data: ITeaSpecialistPayParams) { + return http.Post('/api/pay/yuePay', data) +} + +/** + * 团体预约 + */ +export interface ITeaSpecialistGroupReserveParams { + numbers: string + other_require: string + res_time: string + contact: string + phone: string + code: string + province: string + city: string + district: string + address: string + content: string +} + +export function teaSpecialistGroupReserve(data: ITeaSpecialistGroupReserveParams) { + return http.Post('/api/Teamaster/groupReservation', data) +} \ No newline at end of file diff --git a/src/api/types/tea-room.ts b/src/api/types/tea-room.ts index e534c76..4037f87 100644 --- a/src/api/types/tea-room.ts +++ b/src/api/types/tea-room.ts @@ -53,4 +53,30 @@ export interface ITeaRoomDetailResult { status: number update_dtime: string } -} \ No newline at end of file +} + +/** + * 门店余额接口返回数据 + */ +export interface ITeaRoomBalanceResult { + data: { + id: number + dtime: string + money: number + status: number + store_id: number + update_dtime: string + user_id: number + } +} + +/** + * 包间订单列表返回数据 + */ +export interface IOrderListResult { + count: number + list: Array + more: number + page: string + size: string +} diff --git a/src/api/types/tea.ts b/src/api/types/tea.ts new file mode 100644 index 0000000..ccc68a6 --- /dev/null +++ b/src/api/types/tea.ts @@ -0,0 +1,114 @@ +/** + * 茶艺师详情返回结果 + */ +export interface ITeaSpecialistDetailsResult { + teamaster: Array +} + +/** + * 茶艺师详情字段 + */ +export interface ITeaSpecialistDetailsFields { + id: 0, + name: string + star: number + image: string + reservation_num: number + distance: number + speed: number + real: { + gender: number + both: number + height: number + weight: number + interests: string + } + teamasterlabel: Array + teamasterLevel: Array + price: number + fare_price: number + collect: number + up_status: number + textarea: Array +} + +/** + * 茶艺师打赏金额 + */ +export interface ITeaSpecialistRewardAmountsResult { + id: number + status: number + tip_price: number +} + + +/** + * 茶艺师门店列表 + */ +export interface ITeaHouseListResult { + count: Number + list: Array + more: Number + page: string + size: string +} + +/** + * 获取未来7天时间列表 + */ +export interface ITeaSpecialistFuture7DaysResult { + minimum_time: number + time: Array +} + +/** + * 茶叶类型列表 + */ +export interface ITeaTypeListResult { + id: number + name: string + status: number + tea_price: number + dtime: string +} + +/** + * 首页列表数据返回 + */ +export interface ICollectTeaSpecialistResult { + count: Number + list: Array + more: Number + page: string + size: string +} + +/** + * 创建订单返回id + */ +export interface ICreateTeaSpecialistOrderResult { + id: number +} + +/** + * 订单详情返回结果 + */ +export interface ITeaSpecialistOrderDetailsResult { + details: { + amount_price: string + order_sn: string + } +} + +/** + * 预支付返回结果 + */ +export interface ITeaSpecialistPrepayResult { + pay_id: number +} + +/** + * 支付返回结果 + */ +export interface ITeaSpecialistPayResult { +} \ No newline at end of file diff --git a/src/api/user.ts b/src/api/user.ts index 7d8891f..7cc0b32 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -82,6 +82,7 @@ export function userAddressDetails(data: IUserAddressDetailsParams) { export interface IGetCouponsParams { id: number numbers: number + type_id: number } export function getCoupons(data: IGetCouponsParams) { @@ -93,6 +94,7 @@ export function getCoupons(data: IGetCouponsParams) { */ export interface IGetMyCouponsParams { status: number + type_id: number } export function getMyCoupons(data: IGetMyCouponsParams) { return http.Post('/api/UserCoupon/orderCoupinList', data) diff --git a/src/bundle/collect/collect.vue b/src/bundle/collect/collect.vue index 96cfae8..25ca9c5 100644 --- a/src/bundle/collect/collect.vue +++ b/src/bundle/collect/collect.vue @@ -1,6 +1,6 @@ { - // "needLogin": true, + "needLogin": true, "layout": "default", "style": { "navigationStyle": "custom" diff --git a/src/bundle/coupon/coupon.vue b/src/bundle/coupon/coupon.vue index 4418f30..79ca58a 100644 --- a/src/bundle/coupon/coupon.vue +++ b/src/bundle/coupon/coupon.vue @@ -1,5 +1,6 @@ { + "needLogin": true, "layout": "default", "style": { "navigationStyle": "custom" @@ -15,24 +16,24 @@ - + 可用优惠券 - 2张 + {{ couponList.no_use.length }}张 @@ -40,19 +41,19 @@ 不可用优惠券 - 2张 + {{ couponList.no_use.length }}张 @@ -74,7 +75,7 @@ :coupon="item" canUse :checked="item.id === checkedId" - :onCheck="coupons.handleCheck" + :onCheck="Coupons.handleCheck" :class="index !== couponList.length - 1 ? 'mb-20rpx' : ''" > @@ -93,7 +94,7 @@ :coupon="item" :canUse="false" :checked="item.id === checkedId" - :onCheck="coupons.handleCheck" + :onCheck="Coupons.handleCheck" :class="index !== couponList.length - 1 ? 'mb-20rpx' : ''" > @@ -104,26 +105,27 @@ - 已选择1张 + 已选择{{ checkedId ? 1 : 0 }}张 - 确定 + 确定 diff --git a/src/bundle/coupon/my-coupon.vue b/src/bundle/coupon/my-coupon.vue index f9cbf8c..280db20 100644 --- a/src/bundle/coupon/my-coupon.vue +++ b/src/bundle/coupon/my-coupon.vue @@ -1,6 +1,6 @@ { - // "needLogin": true, + "needLogin": true, "layout": "default", "style": { "navigationStyle": "custom" @@ -10,21 +10,21 @@