|
@@ -2,38 +2,13 @@
|
|
<div style="min-width: 1184px;" class="white-bgc">
|
|
<div style="min-width: 1184px;" class="white-bgc">
|
|
<!-- 搜索框 -->
|
|
<!-- 搜索框 -->
|
|
<div class="py-5 stickyBox">
|
|
<div class="py-5 stickyBox">
|
|
- <div class="default-width d-flex align-center justify-space-between">
|
|
|
|
- <div class="header-link">
|
|
|
|
- <span class="cursor-pointer" :class="{'active-route' : isActive('/mall')}" @click="router.push('/mall')">首页</span>
|
|
|
|
- <span class="mx-8 cursor-pointer">积分兑换</span>
|
|
|
|
- <span class="cursor-pointer">订单中心</span>
|
|
|
|
- <span class="mx-8 cursor-pointer">
|
|
|
|
- <v-icon size="20">mdi-cart-outline</v-icon>
|
|
|
|
- 购物车
|
|
|
|
- </span>
|
|
|
|
- </div>
|
|
|
|
- <div class="search d-flex align-center">
|
|
|
|
- <v-text-field
|
|
|
|
- v-model="inputVal"
|
|
|
|
- placeholder="请输入关键词"
|
|
|
|
- color="primary"
|
|
|
|
- variant="plain"
|
|
|
|
- density="compact"
|
|
|
|
- clearable
|
|
|
|
- :hide-details="true"
|
|
|
|
- class="ml-3 px-2"
|
|
|
|
- style="height: 100%; line-height: 100%;"
|
|
|
|
- @keyup.enter="handleSearch"
|
|
|
|
- ></v-text-field>
|
|
|
|
- <v-btn class="searchBtn" prepend-icon="mdi-shopping-search-outline" @click="handleSearch">搜索</v-btn>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <Navbar />
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- 轮播图 -->
|
|
<!-- 轮播图 -->
|
|
- <Carousel :templateData="template" class="mb-10" />
|
|
|
|
|
|
+ <Carousel :templateData="template" class="mb-10" style="max-height: 594.5px;" />
|
|
|
|
|
|
- <div class="default-width">
|
|
|
|
|
|
+ <div class="default-width pb-10">
|
|
<!-- 热门商品 -->
|
|
<!-- 热门商品 -->
|
|
<HotGoods :templateData="template" class="mb-10" />
|
|
<HotGoods :templateData="template" class="mb-10" />
|
|
|
|
|
|
@@ -48,24 +23,18 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
defineOptions({ name: 'mall-home-index'})
|
|
defineOptions({ name: 'mall-home-index'})
|
|
-import { ref, computed } from 'vue'
|
|
|
|
|
|
+import { ref } from 'vue'
|
|
|
|
+import Navbar from './components/navbar.vue'
|
|
import Carousel from './components/carousel.vue'
|
|
import Carousel from './components/carousel.vue'
|
|
import HotGoods from './components/hotGoods.vue'
|
|
import HotGoods from './components/hotGoods.vue'
|
|
-import PointExchange from './components/pointExchange'
|
|
|
|
|
|
+import PointExchange from '../pointExchange'
|
|
import loginPage from '@/views/common/loginDialog.vue'
|
|
import loginPage from '@/views/common/loginDialog.vue'
|
|
import { useMallStore } from '@/store/mall'
|
|
import { useMallStore } from '@/store/mall'
|
|
import { useUserStore } from '@/store/user'
|
|
import { useUserStore } from '@/store/user'
|
|
-import { useRouter } from 'vue-router'
|
|
|
|
|
|
|
|
// 获取装修模版
|
|
// 获取装修模版
|
|
useMallStore().getMallDiyTemplate()
|
|
useMallStore().getMallDiyTemplate()
|
|
|
|
|
|
-const router = useRouter()
|
|
|
|
-const isActive = computed(() => (path) => {
|
|
|
|
- const currentPath = router.currentRoute.value.path
|
|
|
|
- return currentPath.includes(path)
|
|
|
|
-})
|
|
|
|
-
|
|
|
|
let template = ref(JSON.parse(localStorage.getItem('mallTemplate')) || {})
|
|
let template = ref(JSON.parse(localStorage.getItem('mallTemplate')) || {})
|
|
useMallStore().$subscribe((mutation, state) => {
|
|
useMallStore().$subscribe((mutation, state) => {
|
|
if (state.template && Object.keys(state.template).length) template.value = state?.template
|
|
if (state.template && Object.keys(state.template).length) template.value = state?.template
|
|
@@ -93,29 +62,9 @@ const loginClose = () => {
|
|
showLogin.value = false
|
|
showLogin.value = false
|
|
Snackbar.warning('您已取消登录')
|
|
Snackbar.warning('您已取消登录')
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-const inputVal = ref('')
|
|
|
|
-const handleSearch = () => {}
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
-.active-route {
|
|
|
|
- position: relative;
|
|
|
|
- color: var(--v-primary-base);
|
|
|
|
- &::before {
|
|
|
|
- content: '';
|
|
|
|
- width: 100%;
|
|
|
|
- height: 3px;
|
|
|
|
- position: absolute;
|
|
|
|
- bottom: -8px;
|
|
|
|
- left: 0;
|
|
|
|
- background-color: var(--v-primary-base);
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-.header-link span:hover {
|
|
|
|
- color: var(--v-primary-base);
|
|
|
|
-}
|
|
|
|
.stickyBox {
|
|
.stickyBox {
|
|
position: sticky;
|
|
position: sticky;
|
|
top: 48px;
|
|
top: 48px;
|
|
@@ -123,20 +72,4 @@ const handleSearch = () => {}
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
// border-bottom: 1px solid #00897B;
|
|
// border-bottom: 1px solid #00897B;
|
|
}
|
|
}
|
|
-.search {
|
|
|
|
- height: 50px;
|
|
|
|
- width: 350px;
|
|
|
|
- border: 2px solid var(--v-primary-base);
|
|
|
|
- border-radius: 5px;
|
|
|
|
- .searchBtn {
|
|
|
|
- width: 100px;
|
|
|
|
- height: 49px;
|
|
|
|
- line-height: 48px;
|
|
|
|
- text-align: center;
|
|
|
|
- font-size: 18px;
|
|
|
|
- color: #fff;
|
|
|
|
- background-color: var(--v-primary-base);
|
|
|
|
- cursor: pointer;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
</style>
|
|
</style>
|