diff --git a/src/api/tea.ts b/src/api/tea.ts index 5d5670d..f807b44 100644 --- a/src/api/tea.ts +++ b/src/api/tea.ts @@ -1,5 +1,5 @@ import { http } from '@/http/alova' -import type { ITeaSpecialistDetailsResult } from '@/api/types/tea' +import type { ITeaSpecialistDetailsResult, ITeaSpecialistFuture7DaysResult } from '@/api/types/tea' /** * 获取茶艺师详情 @@ -39,4 +39,36 @@ export function collectTeaSpecialist(data: ICollectTeaSpecialistParams) { */ 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') } \ No newline at end of file diff --git a/src/api/types/tea.ts b/src/api/types/tea.ts index cc0d2eb..19b3799 100644 --- a/src/api/types/tea.ts +++ b/src/api/types/tea.ts @@ -37,3 +37,23 @@ export interface ITeaSpecialistRewardAmountsResult { 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 +} \ No newline at end of file diff --git a/src/api/user.ts b/src/api/user.ts index 8c27885..c475a10 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -27,6 +27,7 @@ export function getUserAddress() { * 用户添加地址 */ export interface IAddUserAddressParams { + id: number contact: string telephone: string province: string diff --git a/src/components/BookingTime.vue b/src/components/BookingTime.vue index 86577c0..5cbbd61 100644 --- a/src/components/BookingTime.vue +++ b/src/components/BookingTime.vue @@ -7,24 +7,24 @@ 选择时间 - - - + + + - + - - {{ item.time }} + ]" @click="item2.disabled == 1 && bookingTime.handleSelectTime(item2.start_time)"> + {{ item2.start_time }} @@ -55,6 +55,8 @@ diff --git a/src/pages/address/list.vue b/src/pages/address/list.vue index b9cc02f..f8a5012 100644 --- a/src/pages/address/list.vue +++ b/src/pages/address/list.vue @@ -26,7 +26,7 @@ - + 默认 @@ -56,10 +56,17 @@ const OSS = inject('OSS') + const from = ref('') + // 地址列表 const addressList = ref([]) - onLoad(() => { + onLoad((args) => { + if (args.from) { + from.value = args.from as string + } + + // 监听地址列表刷新 uni.$on('refreshAddressList', () => { Address.handleInit() }) @@ -87,6 +94,14 @@ // 编辑地址 handleEditAddress: (id: number) => { router.navigateTo(`/pages/address/add?id=${id}`) + }, + + // 选择地址 + handleChooseAddress(item: IUserAddressListResult) { + if (from.value === 'reserve') { + uni.$emit('chooseAddress', item) + uni.navigateBack() + } } } diff --git a/src/pages/address/store.vue b/src/pages/address/store.vue new file mode 100644 index 0000000..84eb5f3 --- /dev/null +++ b/src/pages/address/store.vue @@ -0,0 +1,124 @@ + +{ + "layout": "default", + "style": { + "navigationStyle": "custom" + } +} + + + + + + + + diff --git a/src/pages/index/detail.vue b/src/pages/index/detail.vue index fd93072..4c96e6e 100644 --- a/src/pages/index/detail.vue +++ b/src/pages/index/detail.vue @@ -167,6 +167,16 @@ + + + + + + 内容{{ item}} + + + + @@ -285,6 +295,15 @@ const OSS = inject('OSS') + // tab + const tab = ref(0) + const tabList = ref>([ + {type: 1, name: '费用说明'}, + {type: 2, name: '项目介绍'}, + {type: 3, name: '禁忌说明'}, + {type: 4, name: '下单须知'}, + ]) + // 用户信息 const userInfo = ref(null) @@ -447,4 +466,20 @@ page { background: $cz-page-background; } + + .content-tab { + :deep() { + .wd-tabs__line { + background-color: #006C2D !important; + } + + .wd-tabs__nav-item { + color: #303133 !important; + } + + .wd-tabs__nav-item.is-active { + color: #006C2D !important; + } + } + } diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 0fdad77..0301176 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -179,6 +179,10 @@ } const latitude = ref(import.meta.env.VITE_DEFAULT_LATITUDE) // 纬度 const longitude = ref(import.meta.env.VITE_DEFAULT_LONGITUDE) // 经度 + // 存储经纬度 + uni.setStorageSync('latitude', latitude.value) + uni.setStorageSync('longitude', longitude.value) + const defaultCity = ref(import.meta.env.VITE_DEFAULT_ADDRESS) // 默认城市 const list = ref>([]) // 茶艺师列表 const teaSpecialistName = ref('') // 茶艺师名称 @@ -186,10 +190,16 @@ const cityValue = ref('') onLoad(async () => { + // 授权获取地址 await wxGetLocation((res) => { latitude.value = res.latitude longitude.value = res.longitude + + // 授权后存储经纬度 + uni.setStorageSync('latitude', latitude.value) + uni.setStorageSync('longitude', longitude.value) + Index.handleSearch() }) diff --git a/src/pages/reserve/tea-room.vue b/src/pages/reserve/tea-room.vue index e4d2611..744e025 100644 --- a/src/pages/reserve/tea-room.vue +++ b/src/pages/reserve/tea-room.vue @@ -8,7 +8,7 @@