8 changed files with 213 additions and 46 deletions
-
159src/components/CaseCard.vue
-
88src/components/SubNavigation.vue
-
1src/components/Top.vue
-
11src/pages/CaseShow.vue
-
0src/static/img/caseshow/smarthome.png
-
0src/static/img/caseshow/specialequip.png
@ -1,66 +1,137 @@ |
|||||
<template> |
<template> |
||||
<div class="track_container"> |
<div class="track_container"> |
||||
<div |
|
||||
:class="item.bg ? 'card bg' : 'card'" |
|
||||
v-for="item in trackList" |
|
||||
:key="item.id" |
|
||||
> |
|
||||
<img class="icon" :src="item.pic" /> |
|
||||
<p class="title">{{ item.title }}</p> |
|
||||
<div class="btn">点击查看更多</div> |
|
||||
|
<div class="card_wrap"> |
||||
|
<div |
||||
|
:class="item.bg ? 'card bg' : 'card'" |
||||
|
v-for="item in trackList" |
||||
|
:key="item.id" |
||||
|
> |
||||
|
<div v-if="item.id != activeTab" class="stand"> |
||||
|
<img class="icon" :src="item.pic" /> |
||||
|
<p class="title">{{ item.title }}</p> |
||||
|
<div class="btn" @click="toClassifyPage(item.id)">点击查看更多</div> |
||||
|
</div> |
||||
|
<div v-else class="selected"> |
||||
|
<img :src="getImg(item.id)" alt="" class="img" /> |
||||
|
</div> |
||||
|
</div> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script setup> |
<script setup> |
||||
import { trackList } from '@/mock' |
import { trackList } from '@/mock' |
||||
|
import A1 from '@/static/img/caseshow/healthcare.png' |
||||
|
import A2 from '@/static/img/caseshow/hardware.png' |
||||
|
import A3 from '@/static/img/caseshow/industry.png' |
||||
|
import A4 from '@/static/img/caseshow/railway.png' |
||||
|
import A5 from '@/static/img/caseshow/outdoors.png' |
||||
|
import A6 from '@/static/img/caseshow/specialequip.png' |
||||
|
import A7 from '@/static/img/caseshow/healthcare.png' |
||||
|
import A8 from '@/static/img/caseshow/smarthome.png' |
||||
|
import A9 from '@/static/img/caseshow/electronics.png' |
||||
|
import router from '@/router' |
||||
const props = defineProps({ |
const props = defineProps({ |
||||
activeTab: { |
activeTab: { |
||||
type: Number, |
type: Number, |
||||
}, |
}, |
||||
}) |
}) |
||||
|
const toClassifyPage = id => { |
||||
|
router.push({ |
||||
|
path: '/case-show', |
||||
|
query: { |
||||
|
t: id, |
||||
|
}, |
||||
|
}) |
||||
|
} |
||||
|
const getImg = id => { |
||||
|
if (id == 1) { |
||||
|
return A1 |
||||
|
} |
||||
|
if (id == 2) { |
||||
|
return A2 |
||||
|
} |
||||
|
if (id == 3) { |
||||
|
return A3 |
||||
|
} |
||||
|
if (id == 4) { |
||||
|
return A4 |
||||
|
} |
||||
|
if (id == 5) { |
||||
|
return A5 |
||||
|
} |
||||
|
if (id == 6) { |
||||
|
return A6 |
||||
|
} |
||||
|
if (id == 7) { |
||||
|
return A7 |
||||
|
} |
||||
|
if (id == 8) { |
||||
|
return A8 |
||||
|
} |
||||
|
if (id == 9) { |
||||
|
return A9 |
||||
|
} |
||||
|
} |
||||
</script> |
</script> |
||||
|
|
||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||
.track_container { |
.track_container { |
||||
display: grid; |
|
||||
grid-template-columns: repeat(3, 1fr); |
|
||||
grid-template-rows: repeat(3, 1fr); |
|
||||
box-sizing: border-box; |
|
||||
.card { |
|
||||
flex: 1; |
|
||||
background: #fff; |
|
||||
padding: 30px 0; |
|
||||
display: flex; |
|
||||
flex-direction: column; |
|
||||
align-items: center; |
|
||||
.icon { |
|
||||
width: auto; |
|
||||
height: 20px; |
|
||||
margin-bottom: 11px; |
|
||||
} |
|
||||
.title { |
|
||||
font-size: 8px; |
|
||||
font-family: Alibaba PuHuiTi; |
|
||||
font-weight: 400; |
|
||||
color: #262626; |
|
||||
margin-bottom: 9px; |
|
||||
|
.card_wrap { |
||||
|
display: grid; |
||||
|
grid-template-columns: repeat(3, 1fr); |
||||
|
grid-template-rows: repeat(3, 1fr); |
||||
|
box-sizing: border-box; |
||||
|
.card { |
||||
|
flex: 1; |
||||
|
background: #fff; |
||||
|
.stand { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
align-items: center; |
||||
|
padding: 30px 0; |
||||
|
.icon { |
||||
|
width: auto; |
||||
|
height: 20px; |
||||
|
margin-bottom: 11px; |
||||
|
} |
||||
|
.title { |
||||
|
font-size: 8px; |
||||
|
font-family: Alibaba PuHuiTi; |
||||
|
font-weight: 400; |
||||
|
color: #262626; |
||||
|
margin-bottom: 9px; |
||||
|
} |
||||
|
.btn { |
||||
|
border: 1px solid #262626; |
||||
|
padding: 3px 6px; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
font-size: 6px; |
||||
|
font-family: Alibaba PuHuiTi; |
||||
|
font-weight: 300; |
||||
|
color: #262626; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
} |
||||
|
.selected { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
flex: 1; |
||||
|
height: 100%; |
||||
|
.img { |
||||
|
width: 90px; |
||||
|
height: 90px; |
||||
|
box-shadow: 0px 2px 7px 0px rgba(8, 69, 71, 0.09); |
||||
|
border-radius: 11px; |
||||
|
} |
||||
|
} |
||||
} |
} |
||||
.btn { |
|
||||
border: 1px solid #262626; |
|
||||
padding: 3px 6px; |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
justify-content: center; |
|
||||
font-size: 6px; |
|
||||
font-family: Alibaba PuHuiTi; |
|
||||
font-weight: 300; |
|
||||
color: #262626; |
|
||||
white-space: nowrap; |
|
||||
|
.bg { |
||||
|
background: #fafafa; |
||||
} |
} |
||||
} |
} |
||||
.bg { |
|
||||
background: #fafafa; |
|
||||
} |
|
||||
} |
} |
||||
</style> |
</style> |
Before Width: 260 | Height: 260 | Size: 8.4 KiB After Width: 260 | Height: 260 | Size: 8.4 KiB |
Before Width: 260 | Height: 260 | Size: 8.3 KiB After Width: 260 | Height: 260 | Size: 8.3 KiB |
Write
Preview
Loading…
Cancel
Save
Reference in new issue