|
@@ -0,0 +1,113 @@
|
|
|
+<template>
|
|
|
+ <div class="af-place-list-container">
|
|
|
+ <!--头部-->
|
|
|
+ <div class="header">
|
|
|
+ <div class="store-name">
|
|
|
+ <p>
|
|
|
+ <img src="./image/icon_music@2x.png" alt="">
|
|
|
+ <span>{{ objCurrentBarInfo.bar_name }}</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--预约日期-->
|
|
|
+ <van-tabs
|
|
|
+ class="af-van-tab"
|
|
|
+ :background="'transparent'"
|
|
|
+ :ellipsis="false"
|
|
|
+ :sticky="true"
|
|
|
+ v-model="active"
|
|
|
+ @change="handleChange"
|
|
|
+ ref="afTabs">
|
|
|
+ <van-tab
|
|
|
+ v-for="(item, index) in showPlanList"
|
|
|
+ :key="index">
|
|
|
+ <template #title>
|
|
|
+ <p class="week">{{ item.week }}</p>
|
|
|
+ <p class="date">{{ item.time }}</p>
|
|
|
+ </template>
|
|
|
+ <div class="place-list"
|
|
|
+ v-for="(place, idx) in item.list"
|
|
|
+ :key="idx">
|
|
|
+ </div>
|
|
|
+ </van-tab>
|
|
|
+ </van-tabs>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { Tabs, Tab, Toast } from 'vant'
|
|
|
+import { apiBarList, apiShowPlanList } from './api'
|
|
|
+import { getCookieValue } from '../../../utils'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ components: {
|
|
|
+ 'van-tabs': Tabs,
|
|
|
+ 'van-tab': Tab
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ BarList: [], // 门店列表
|
|
|
+ objCurrentBarInfo: {}, // 当前门店信息
|
|
|
+ showPlanList: [],
|
|
|
+ active: 0,
|
|
|
+ listData: [],
|
|
|
+ bar_id: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ phone () {
|
|
|
+ return this.$store.getters['common/phone'] || getCookieValue('afhousephone')
|
|
|
+ },
|
|
|
+ token () {
|
|
|
+ return this.$store.getters['common/token'] || getCookieValue('afhousetoken')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.fetchBarList()
|
|
|
+ },
|
|
|
+ async mounted () {
|
|
|
+ await this.$nextTick()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleChange () {},
|
|
|
+ // 获取门店列表
|
|
|
+ async fetchBarList () {
|
|
|
+ try {
|
|
|
+ const { data, status, msg } = await apiBarList()
|
|
|
+ if (status) {
|
|
|
+ this.BarList = data
|
|
|
+ if (this.BarList.length) {
|
|
|
+ // 暂时只有一家门店
|
|
|
+ const { id } = this.BarList[0]
|
|
|
+ this.bar_id = id
|
|
|
+ this.objCurrentBarInfo = this.BarList[0]
|
|
|
+ this.fetchPlaceList()
|
|
|
+ } else {
|
|
|
+ Toast('门店不存在')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Toast(msg)
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取订座列表
|
|
|
+ async fetchPlaceList () {
|
|
|
+ try {
|
|
|
+ const { data, status, msg } = await apiShowPlanList(this.bar_id)
|
|
|
+ if (status) {
|
|
|
+ this.showPlanList = data
|
|
|
+ } else {
|
|
|
+ Toast(msg)
|
|
|
+ }
|
|
|
+ } catch (err) {}
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import "./style/index";
|
|
|
+</style>
|