Files
city-store-transfer/pages/index/index.vue

116 lines
2.4 KiB
Vue

<template>
<view class="home-base-bg">
<InputAndSwiper type='0' :bannerURL="swiperList"></InputAndSwiper>
<view class="home-content">
<view class="service">
<u-image src="/static/statistics/sy_icon_lxkf.png" width="108rpx" height="108rpx"/>
</view>
<HomeNavCard></HomeNavCard>
<HomeNoticeBar :text="notice" />
<Statistics :data="statisticsNum" />
<view class="show-and-search">
<view class="show-tab list-tab" :class="{ 'tab-activate': chooseIndex === 0 }" @click="this.chooseIndex=0">
<text>店铺列表</text>
</view>
<view class="search-tab list-tab" :class="{ 'tab-activate': chooseIndex === 1 }" @click="this.chooseIndex=1">
<text>找店列表</text>
</view>
</view>
<SearchShopList v-if="chooseIndex" />
<ShowShopList v-else />
</view>
<TabBar :current-page="0"></TabBar>
</view>
</template>
<script>
import HomeNoticeBar from "./HomeMainContent/HomeNoticeBar.vue"
import HomeNavCard from "./HomeMainContent/HomeNavCard.vue"
import Statistics from "./HomeMainContent/Statistics.vue"
export default {
components: {
HomeNavCard,
HomeNoticeBar,
Statistics
},
data() {
return {
notice: [],
chooseIndex: 0,
statisticsNum: [231753, 1345],
swiperList:[]
}
},
onLoad() {
this.getBanner()
this.getNotice()
this.getStat()
},
methods: {
getBanner(){
this.$api.getBanner().then(res=>{
this.swiperList = res.data.data.map(item=>item.img)
})
},
getNotice(){
this.$api.getHotInfo().then(res=>{
this.notice = res.data.data.map(item=>item.title)
})
},
getStat(){
this.$api.getStat().then(res=>{
this.statisticsNum = res.data.data
})
}
},
computed: {
}
}
</script>
<style lang="scss" scoped>
.home-base-bg {
background-color: $uni-bg-color-grey;
width: 100%;
.home-content {
margin: 0 10px;
.service {
position: fixed;
right: 17rpx;
top: 1109rpx;
z-index: 1;
}
}
.show-and-search {
display: flex;
.list-tab {
z-index: 2;
width: 259rpx;
height: 70rpx;
background: #B7EBD2;
border-radius: 11px 100px 0px 0px;
color: #fff;
font-size: 15px;
line-height: 21px;
font-weight: 500;
display: flex;
align-items: center;
justify-content: center;
}
.search-tab {
z-index: 1;
transform: translateX(-61rpx);
}
.tab-activate {
background: linear-gradient(#E86262, #CC3333);
z-index: 3;
}
}
}
</style>