添加页面
This commit is contained in:
parent
2b18f725b6
commit
99b73eb0cf
@ -9,9 +9,13 @@
|
|||||||
<!-- 标题-->
|
<!-- 标题-->
|
||||||
<h1>{{state.info.title}}</h1>
|
<h1>{{state.info.title}}</h1>
|
||||||
<!-- 简介-->
|
<!-- 简介-->
|
||||||
<div class="introduction">
|
<div class="introduction" v-if="state.info.introduction">
|
||||||
{{state.info.introduction}}
|
{{state.info.introduction}}
|
||||||
</div>
|
</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">
|
<div class="tag">
|
||||||
<el-tag v-for="tag in state.info.tags" :key="tag">{{tag}}</el-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="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">
|
<el-button type="primary" @click="handleFavorite">
|
||||||
{{state.isFavorite?'已收藏':'收藏'}}
|
{{state.isFavorite?'已收藏':'收藏'}}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-menu
|
<el-menu
|
||||||
:default-active="activeIndex"
|
:default-active="nav.frontPath"
|
||||||
mode="horizontal"
|
mode="horizontal"
|
||||||
@select="handleSelect"
|
@select="handleSelect"
|
||||||
router
|
router
|
||||||
@ -20,7 +20,8 @@
|
|||||||
</el-menu>
|
</el-menu>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3">
|
<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-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<!-- <el-avatar :src="userStore().frontUserInfo.avatar" />-->
|
<!-- <el-avatar :src="userStore().frontUserInfo.avatar" />-->
|
||||||
@ -39,16 +40,14 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getFrontList } from '~/utils/utils'
|
import { getFrontList } from '~/utils/utils'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { logoutFront } from '~/api/user/frontUserApi'
|
import { logoutFront } from '~/api/user/frontUserApi'
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const nav = navStore()
|
||||||
const activeIndex = ref('1')
|
|
||||||
const handleSelect = (key: string, keyPath: string[]) => {
|
const handleSelect = (key: string, keyPath: string[]) => {
|
||||||
console.log(key, keyPath)
|
nav.frontPath = key.fullPath
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 退出登录
|
* 退出登录
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<!--轮播图-->
|
<!--轮播图-->
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<div class="h-350px">
|
<div class="h-300px">
|
||||||
<carousel></carousel>
|
<carousel></carousel>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
<!--轮播图-->
|
<!--轮播图-->
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<div class="h-350px">
|
<div class="h-300px">
|
||||||
<carousel></carousel>
|
<carousel></carousel>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<div class="h-350px">
|
<div class="h-300px">
|
||||||
<carousel></carousel>
|
<carousel></carousel>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -4,6 +4,7 @@ export default defineStore('navStore', {
|
|||||||
state() {
|
state() {
|
||||||
return {
|
return {
|
||||||
adminPath: "/",
|
adminPath: "/",
|
||||||
|
frontPath: "/front/",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
Loading…
Reference in New Issue
Block a user