|
@@ -1,30 +1,58 @@
|
|
<template>
|
|
<template>
|
|
<div
|
|
<div
|
|
class="category-container">
|
|
class="category-container">
|
|
|
|
+ <!--商家-->
|
|
|
|
+ <div class="business-list">
|
|
|
|
+ <van-tabs
|
|
|
|
+ v-model="businessValue"
|
|
|
|
+ :color="'#ee0a24'"
|
|
|
|
+ :title-active-color="'#FFF'"
|
|
|
|
+ :title-inactive-color="'#8A8A8A'"
|
|
|
|
+ :background="'#fff'"
|
|
|
|
+ ref="fbtBusinessList">
|
|
|
|
+ <van-tab
|
|
|
|
+ v-for="index in 10"
|
|
|
|
+ :key="index">
|
|
|
|
+ <template #title>
|
|
|
|
+ <img src="" alt="">
|
|
|
|
+ <i>选项</i>
|
|
|
|
+ </template>
|
|
|
|
+ </van-tab>
|
|
|
|
+ </van-tabs>
|
|
|
|
+ </div>
|
|
|
|
+ <!--分类-->
|
|
<div
|
|
<div
|
|
class="cate-header">
|
|
class="cate-header">
|
|
<van-tabs
|
|
<van-tabs
|
|
v-model="cateValue"
|
|
v-model="cateValue"
|
|
- :color="'#ee0a24'"
|
|
|
|
- :background="'#fff'">
|
|
|
|
|
|
+ :color="'#F09E38'"
|
|
|
|
+ :title-active-color="'#333333'"
|
|
|
|
+ :title-inactive-color="'#515151'"
|
|
|
|
+ :background="'#fff'"
|
|
|
|
+ ref="fbtCateList">
|
|
<van-tab
|
|
<van-tab
|
|
- v-for="index in 8"
|
|
|
|
|
|
+ v-for="index in 10"
|
|
:key="index">
|
|
:key="index">
|
|
<template #title>
|
|
<template #title>
|
|
- <van-icon
|
|
|
|
- name="more-o"/>
|
|
|
|
- 选项
|
|
|
|
|
|
+ {{ index % 2 === 0 ? '选项选项' : '选项' }}
|
|
</template>
|
|
</template>
|
|
- 内容 {{ index }}
|
|
|
|
</van-tab>
|
|
</van-tab>
|
|
</van-tabs>
|
|
</van-tabs>
|
|
<van-dropdown-menu
|
|
<van-dropdown-menu
|
|
class="fbt-van-dropdown-menu">
|
|
class="fbt-van-dropdown-menu">
|
|
<van-dropdown-item
|
|
<van-dropdown-item
|
|
- title="筛选"
|
|
|
|
- ref="item">
|
|
|
|
- <p>111</p>
|
|
|
|
- <p>222</p>
|
|
|
|
|
|
+ ref="fbtCateDropdownMenu">
|
|
|
|
+ <template #title>
|
|
|
|
+ <van-icon name="arrow-down"/>
|
|
|
|
+ </template>
|
|
|
|
+ <ul>
|
|
|
|
+ <li
|
|
|
|
+ :class="{'active': i === cateValue}"
|
|
|
|
+ v-for="i in 10"
|
|
|
|
+ :key="i"
|
|
|
|
+ @click="onConfirm(i)">选项选项{{ i }}
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
</van-dropdown-item>
|
|
</van-dropdown-item>
|
|
</van-dropdown-menu>
|
|
</van-dropdown-menu>
|
|
</div>
|
|
</div>
|
|
@@ -35,7 +63,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { Tab, Tabs, Button, Icon, DropdownMenu, DropdownItem, Toast } from 'vant'
|
|
|
|
|
|
+import { Tab, Tabs, Button, DropdownMenu, DropdownItem, Icon, Toast } from 'vant'
|
|
import { apiCateList } from './api/api'
|
|
import { apiCateList } from './api/api'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -43,13 +71,14 @@ export default {
|
|
components: {
|
|
components: {
|
|
'van-tabs': Tabs,
|
|
'van-tabs': Tabs,
|
|
'van-tab': Tab,
|
|
'van-tab': Tab,
|
|
- 'van-icon': Icon,
|
|
|
|
'van-dropdown-menu': DropdownMenu,
|
|
'van-dropdown-menu': DropdownMenu,
|
|
'van-dropdown-item': DropdownItem,
|
|
'van-dropdown-item': DropdownItem,
|
|
|
|
+ 'van-icon': Icon,
|
|
'van-button': Button
|
|
'van-button': Button
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
|
|
+ businessValue: 'jd',
|
|
cateValue: 0
|
|
cateValue: 0
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -57,6 +86,10 @@ export default {
|
|
if (!this.$route.meta.isUseCache) {
|
|
if (!this.$route.meta.isUseCache) {
|
|
this.fetchCateList()
|
|
this.fetchCateList()
|
|
}
|
|
}
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.$refs.fbtBusinessList.resize()
|
|
|
|
+ this.$refs.fbtCateList.resize()
|
|
|
|
+ }, 500)
|
|
this.$route.meta.isUseCache = false
|
|
this.$route.meta.isUseCache = false
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -69,6 +102,12 @@ export default {
|
|
Toast(msg)
|
|
Toast(msg)
|
|
}
|
|
}
|
|
} catch (e) {}
|
|
} catch (e) {}
|
|
|
|
+ },
|
|
|
|
+ onConfirm (val) {
|
|
|
|
+ this.cateValue = val
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.fbtCateDropdownMenu.toggle()
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -84,21 +123,128 @@ export default {
|
|
width: 100%;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.business-list {
|
|
|
|
+ position: relative;
|
|
|
|
+ left: 0;
|
|
|
|
+ top: 0;
|
|
|
|
+ width: 100%;
|
|
|
|
+
|
|
|
|
+ ::v-deep .van-tabs__nav--line {
|
|
|
|
+ .van-tab {
|
|
|
|
+ width: 75px;
|
|
|
|
+ padding: 0;
|
|
|
|
+
|
|
|
|
+ &--active {
|
|
|
|
+
|
|
|
|
+ .van-tab__text {
|
|
|
|
+ background: #EA483F !important;;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .van-tab__text {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ width: 67px;
|
|
|
|
+ height: 23px;
|
|
|
|
+ padding: 0 12px;
|
|
|
|
+ background: #F3F3F3;
|
|
|
|
+ border-radius: 12px;
|
|
|
|
+
|
|
|
|
+ img {
|
|
|
|
+ width: 16px;
|
|
|
|
+ height: 16px;
|
|
|
|
+ margin-right: 3px;
|
|
|
|
+ background: pink;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ i {
|
|
|
|
+ font-size: 11px;
|
|
|
|
+ color: inherit;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .van-tabs__line {
|
|
|
|
+ display: none;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
.cate-header {
|
|
.cate-header {
|
|
position: relative;
|
|
position: relative;
|
|
left: 0;
|
|
left: 0;
|
|
top: 0;
|
|
top: 0;
|
|
width: 100%;
|
|
width: 100%;
|
|
|
|
|
|
|
|
+ ::v-deep .van-tabs {
|
|
|
|
+ width: calc(100% - 42px);
|
|
|
|
+
|
|
|
|
+ .van-tabs__nav--line {
|
|
|
|
+ .van-tab {
|
|
|
|
+ &--active {
|
|
|
|
+
|
|
|
|
+ .van-tab__text {
|
|
|
|
+ font-size: 16px !important;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .van-tab__text {
|
|
|
|
+ font-size: 13px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
.fbt-van-dropdown-menu {
|
|
.fbt-van-dropdown-menu {
|
|
position: absolute;
|
|
position: absolute;
|
|
right: 0;
|
|
right: 0;
|
|
top: 0;
|
|
top: 0;
|
|
- width: 100px;
|
|
|
|
|
|
+ width: 42px;
|
|
|
|
+ height: 100%;
|
|
|
|
+
|
|
|
|
+ ::v-deep .van-dropdown-menu__bar {
|
|
|
|
+ height: 100%;
|
|
|
|
+ box-shadow: none;
|
|
|
|
|
|
- ::v-deep .van-dropdown-menu__title {
|
|
|
|
- &::after {
|
|
|
|
- visibility: hidden;
|
|
|
|
|
|
+ .van-dropdown-menu__title {
|
|
|
|
+ &::after {
|
|
|
|
+ visibility: hidden;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ul {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-flow: row wrap;
|
|
|
|
+ align-content: flex-start;
|
|
|
|
+ width: 375px;
|
|
|
|
+ min-height: 177px;
|
|
|
|
+ background: #F8F8F8;
|
|
|
|
+ padding: 12px 0 2px;
|
|
|
|
+
|
|
|
|
+ li {
|
|
|
|
+ width: 75px;
|
|
|
|
+ height: 24px;
|
|
|
|
+ margin-left: 15px;
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+ border-radius: 12px;
|
|
|
|
+ color: #515151;
|
|
|
|
+ background: #ECECEC;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ line-height: 24px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+
|
|
|
|
+ &.active {
|
|
|
|
+ color: #FFFFFF;
|
|
|
|
+ background: #EA483F;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|