添加页面

This commit is contained in:
闵宪瑞 2025-01-10 17:26:48 +08:00
parent 2b18f725b6
commit 99b73eb0cf
5 changed files with 15 additions and 11 deletions

View File

@ -9,9 +9,13 @@
<!-- 标题-->
<h1>{{state.info.title}}</h1>
<!-- 简介-->
<div class="introduction">
<div class="introduction" v-if="state.info.introduction">
{{state.info.introduction}}
</div>
<!-- 价格-->
<div class="tag" v-if="state.info.price">
<span style="color: red;font-size: 26px"> <span style="font-weight: 700">{{state.info.price}}</span></span>
</div>
<!--标签-->
<div class="tag">
<el-tag v-for="tag in state.info.tags" :key="tag">{{tag}}</el-tag>
@ -21,7 +25,7 @@
<!-- 加入购物车-->
<!-- <el-button type="primary" @click="handleCart">加入购物车</el-button>-->
<!-- 立即购买-->
<el-button type="primary" @click="handleBuy">立即购买</el-button>
<el-button type="primary" @click="handleBuy" v-if="state.info.price">立即购买</el-button>
<!-- 收藏-->
<el-button type="primary" @click="handleFavorite">
{{state.isFavorite?'已收藏':'收藏'}}

View File

@ -6,7 +6,7 @@
</el-col>
<el-col :span="12">
<el-menu
:default-active="activeIndex"
:default-active="nav.frontPath"
mode="horizontal"
@select="handleSelect"
router
@ -20,7 +20,8 @@
</el-menu>
</el-col>
<el-col :span="3">
<el-dropdown>
<el-button v-if="userStore().frontUserInfo" style="margin-top: 12px" type="primary" round @click="router.push('/login')">登录</el-button>
<el-dropdown v-else>
<el-row :gutter="20">
<el-col :span="8">
<!-- <el-avatar :src="userStore().frontUserInfo.avatar" />-->
@ -39,16 +40,14 @@
</el-col>
</el-row>
</template>
<script setup lang="ts">
import { getFrontList } from '~/utils/utils'
import { useRouter } from 'vue-router'
import { logoutFront } from '~/api/user/frontUserApi'
const router = useRouter()
const activeIndex = ref('1')
const nav = navStore()
const handleSelect = (key: string, keyPath: string[]) => {
console.log(key, keyPath)
nav.frontPath = key.fullPath
}
/**
* 退出登录

View File

@ -2,7 +2,7 @@
<!--轮播图-->
<el-row :gutter="20">
<el-col :span="12">
<div class="h-350px">
<div class="h-300px">
<carousel></carousel>
</div>
</el-col>

View File

@ -2,12 +2,12 @@
<!--轮播图-->
<el-row :gutter="20">
<el-col :span="12">
<div class="h-350px">
<div class="h-300px">
<carousel></carousel>
</div>
</el-col>
<el-col :span="12">
<div class="h-350px">
<div class="h-300px">
<carousel></carousel>
</div>
</el-col>

View File

@ -4,6 +4,7 @@ export default defineStore('navStore', {
state() {
return {
adminPath: "/",
frontPath: "/front/",
}
},
actions: {