home.vue
2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<template>
<view class="home_container">
<SearchHead />
<view class="content_box">
<Banner />
<BallNav @showList="onShowList"/>
<u-notice-bar :text="text"></u-notice-bar>
<HotVnue />
<BookingNavlist />
</view>
<!-- 选项列表 -->
<u-popup :show="showMenu" mode="right" @close="showMenu = false" :safeAreaInsetBottom="false" :overlayOpacity="0.1" bgColor="transparent">
<view class="popupBox">
<view v-for="(item, index) in navList" :key="index" class="item_nav" :class="{active: ballActive == index }" @click="handleItem(index)">
<view
class="iconfont item_icon"
:class="[item.iconName]"
></view>
<text>{{ item.name }}</text>
</view>
</view>
</u-popup>
<CommonTabbar />
</view>
</template>
<script>
import SearchHead from './components/searchHead.vue'
import Banner from './components/banner.vue'
import BallNav from './components/ballNav.vue'
import HotVnue from './components/hotvenue.vue'
import BookingNavlist from './components/bookingNavlist.vue'
import { getSportList } from '@/api/sport.js'
export default {
components: { SearchHead, Banner, BallNav, HotVnue, BookingNavlist },
data() {
return {
showMenu: false, // 是否显示下拉列表
ballActive: 0,
text: '用户45553发起了琅东羽毛球场约球...',
navList: [
{ name: '羽毛球', iconName: 'icon-yumaoqiu1' },
{ name: '足球', iconName: 'icon-zuqiu' },
{ name: '篮球', iconName: 'icon-lanqiu' },
{ name: '排球', iconName: 'icon-paiqiu' },
{ name: '乒乓球', iconName: 'icon-pingpangqiu' },
{ name: '网球', iconName: 'icon-wangqiu1' },
{ name: '排球', iconName: 'icon-paiqiu' },
{ name: '台球', iconName: 'icon-taiqiu' },
{ name: '高尔夫球', iconName: 'icon-gaoerfu2' },
{ name: '棒球', iconName: 'icon-bangqiu' }
],
};
},
async onLoad() {
// const res = await getSportList({pageNum: 1, pageSize: 10})
// console.log(res)
},
methods: {
onShowList(value){
this.showMenu = value
},
handleItem(index){
this.ballActive = index
}
}
}
</script>
<style lang="scss" scoped>
@import './commonHomeStyle.scss';
.home_container{
background-color: #f6f6f6;
min-height: calc(100vh - 88rpx);
padding-bottom: 60rpx;
.content_box{
padding: 0 30rpx;
}
}
</style>