提交 93d28ef9 authored 作者: matian's avatar matian

修改tab

上级 e0eaaf31
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"query-string": "^7.1.1", "query-string": "^7.1.1",
"querystring": "^0.2.1", "querystring": "^0.2.1",
"swiper": "^8.4.4", "swiper": "^8.4.4",
"vant": "^3.6.5", "vant": "^3.6.11",
"vue": "^3.2.45", "vue": "^3.2.45",
"vue-router": "^4.1.6" "vue-router": "^4.1.6"
}, },
...@@ -4418,9 +4418,9 @@ ...@@ -4418,9 +4418,9 @@
} }
}, },
"node_modules/vant": { "node_modules/vant": {
"version": "3.6.5", "version": "3.6.11",
"resolved": "https://registry.npmjs.org/vant/-/vant-3.6.5.tgz", "resolved": "https://registry.npmmirror.com/vant/-/vant-3.6.11.tgz",
"integrity": "sha512-TVTs5impkF6qPvCn+qhpcuNyxy0rCRA161JYkK5rFpKhwWftq4TOSTZAHGCW2kVFtrwl0Zp715GXEed/hxivYw==", "integrity": "sha512-ueEu4rOePQUoeP6mjuVHogmg3t05yejrYkFCG/NMWY2haOscvQTFGDVuUazmNdjgizqL1D9rH6xV0qy2aRWF9Q==",
"dependencies": { "dependencies": {
"@vant/icons": "^1.8.0", "@vant/icons": "^1.8.0",
"@vant/popperjs": "^1.2.1", "@vant/popperjs": "^1.2.1",
...@@ -7931,9 +7931,9 @@ ...@@ -7931,9 +7931,9 @@
} }
}, },
"vant": { "vant": {
"version": "3.6.5", "version": "3.6.11",
"resolved": "https://registry.npmjs.org/vant/-/vant-3.6.5.tgz", "resolved": "https://registry.npmmirror.com/vant/-/vant-3.6.11.tgz",
"integrity": "sha512-TVTs5impkF6qPvCn+qhpcuNyxy0rCRA161JYkK5rFpKhwWftq4TOSTZAHGCW2kVFtrwl0Zp715GXEed/hxivYw==", "integrity": "sha512-ueEu4rOePQUoeP6mjuVHogmg3t05yejrYkFCG/NMWY2haOscvQTFGDVuUazmNdjgizqL1D9rH6xV0qy2aRWF9Q==",
"requires": { "requires": {
"@vant/icons": "^1.8.0", "@vant/icons": "^1.8.0",
"@vant/popperjs": "^1.2.1", "@vant/popperjs": "^1.2.1",
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
"query-string": "^7.1.1", "query-string": "^7.1.1",
"querystring": "^0.2.1", "querystring": "^0.2.1",
"swiper": "^8.4.4", "swiper": "^8.4.4",
"vant": "^3.6.5", "vant": "^3.6.11",
"vue": "^3.2.45", "vue": "^3.2.45",
"vue-router": "^4.1.6" "vue-router": "^4.1.6"
}, },
......
...@@ -8,9 +8,9 @@ import ElementPlus from 'element-plus' ...@@ -8,9 +8,9 @@ import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn' import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/dist/index.css' import 'element-plus/dist/index.css'
import { Overlay,ActionSheet} from 'vant'; import { Overlay, ActionSheet, Tab, Tabs } from 'vant'
// 2. 引入组件样式 // 2. 引入组件样式
import 'vant/lib/index.css'; import 'vant/lib/index.css'
// 公共css // 公共css
import './assets/css/base.css' import './assets/css/base.css'
...@@ -19,10 +19,8 @@ import AppCard from '@/components/base/AppCard.vue' ...@@ -19,10 +19,8 @@ import AppCard from '@/components/base/AppCard.vue'
import AppContainer from '@/components/base/AppContainer.vue' import AppContainer from '@/components/base/AppContainer.vue'
import modules from './modules' import modules from './modules'
const app = createApp(App)
const app = createApp(App)
// 注册公共组件 // 注册公共组件
app.component('AppCard', AppCard).component('AppContainer', AppContainer) app.component('AppCard', AppCard).component('AppContainer', AppContainer)
...@@ -31,6 +29,8 @@ app.component('AppCard', AppCard).component('AppContainer', AppContainer) ...@@ -31,6 +29,8 @@ app.component('AppCard', AppCard).component('AppContainer', AppContainer)
modules({ router }) modules({ router })
app.use(Overlay) app.use(Overlay)
app.use(ActionSheet) app.use(ActionSheet)
app.use(Tab)
app.use(Tabs)
app.use(createPinia()) app.use(createPinia())
app.use(router) app.use(router)
app.use(ElementPlus, { locale: zhCn }) app.use(ElementPlus, { locale: zhCn })
......
<script lang="ts" setup> <script lang="ts" setup>
import CourseList from '../components/CourseList.vue' import CourseList from '../components/CourseList.vue'
import { useShopStore } from '@/stores/shop' import { useShopStore } from '@/stores/shop'
import { useDevice } from '@/composables/useDevice'
const { mobile } = useDevice()
const shopStore = useShopStore() const shopStore = useShopStore()
const handleTabClick = (tab: any) => { const handleTabClick = (tab: any) => {
if (tab.index === '4') { if (tab.index === '4') {
...@@ -11,7 +13,7 @@ const handleTabClick = (tab: any) => { ...@@ -11,7 +13,7 @@ const handleTabClick = (tab: any) => {
</script> </script>
<template> <template>
<div class="main_shop"> <div class="main_shop" v-if="!mobile">
<img src="https://webapp-pub.ezijing.com/project_online/fi/shop_banner.jpg" class="shop_banner" /> <img src="https://webapp-pub.ezijing.com/project_online/fi/shop_banner.jpg" class="shop_banner" />
<div class="shop_con"> <div class="shop_con">
<div class="con_tab"> <div class="con_tab">
...@@ -26,6 +28,14 @@ const handleTabClick = (tab: any) => { ...@@ -26,6 +28,14 @@ const handleTabClick = (tab: any) => {
</div> </div>
</div> </div>
</div> </div>
<div class="main_shop" v-else>
<img src="https://webapp-pub.ezijing.com/project_online/fi/shop_banner.jpg" class="shop_banner" />
<van-tabs>
<van-tab :title="item.label" v-for="(item, index) in shopStore.filters" :key="index" lazy>
<CourseList :type="item.value" :courseList="shopStore.shopList" :key="index" />
</van-tab>
</van-tabs>
</div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.is-pc { .is-pc {
...@@ -109,12 +119,15 @@ const handleTabClick = (tab: any) => { ...@@ -109,12 +119,15 @@ const handleTabClick = (tab: any) => {
font-weight: 500; font-weight: 500;
line-height: 34px; line-height: 34px;
color: #eda020; color: #eda020;
padding: 0 0.1rem !important; padding: 0 0.4rem !important;
box-sizing: border-box; box-sizing: border-box;
} }
:deep(.el-tabs__nav-scroll) { :deep(.el-tabs__nav-scroll) {
padding: 0 0.5rem; padding: 0 0.5rem;
} }
:deep(.van-tabs__nav--line) {
overflow-x: scroll;
}
} }
:deep(.el-tabs__nav-scroll) { :deep(.el-tabs__nav-scroll) {
...@@ -142,17 +155,29 @@ const handleTabClick = (tab: any) => { ...@@ -142,17 +155,29 @@ const handleTabClick = (tab: any) => {
} }
:deep(.van-tab--active) { :deep(.van-tab--active) {
.van-tab__text { .van-tab__text {
color: #c1ab85 !important; color: #eda020 !important;
font-size: 0.28rem; font-size: 0.28rem;
} }
} }
:deep(.van-tab) { :deep(.van-tab) {
padding: 0 0.2rem;
.van-tab__text { .van-tab__text {
color: #333333; color: #333333;
font-size: 0.28rem; font-size: 0.28rem;
} }
.van-tabs__nav {
background: none;
}
} }
:deep(.van-tabs__line) { :deep(.van-tabs__line) {
background: #c1ab85 !important; background: #eda023 !important;
}
:deep(.van-tab__panel) {
margin-top: 0.3rem;
}
:deep(.van-tabs__nav--line) {
overflow: scroll;
white-space: nowrap;
} }
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论