|
@ -1,28 +1,83 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="track_container"> |
|
|
<div class="track_container"> |
|
|
|
|
|
<div class="card_wrap"> |
|
|
<div |
|
|
<div |
|
|
:class="item.bg ? 'card bg' : 'card'" |
|
|
:class="item.bg ? 'card bg' : 'card'" |
|
|
v-for="item in trackList" |
|
|
v-for="item in trackList" |
|
|
:key="item.id" |
|
|
:key="item.id" |
|
|
> |
|
|
> |
|
|
|
|
|
<div v-if="item.id != activeTab" class="stand"> |
|
|
<img class="icon" :src="item.pic" /> |
|
|
<img class="icon" :src="item.pic" /> |
|
|
<p class="title">{{ item.title }}</p> |
|
|
<p class="title">{{ item.title }}</p> |
|
|
<div class="btn">点击查看更多</div> |
|
|
|
|
|
|
|
|
<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 { |
|
|
|
|
|
.card_wrap { |
|
|
display: grid; |
|
|
display: grid; |
|
|
grid-template-columns: repeat(3, 1fr); |
|
|
grid-template-columns: repeat(3, 1fr); |
|
|
grid-template-rows: repeat(3, 1fr); |
|
|
grid-template-rows: repeat(3, 1fr); |
|
@ -30,10 +85,11 @@ const props = defineProps({ |
|
|
.card { |
|
|
.card { |
|
|
flex: 1; |
|
|
flex: 1; |
|
|
background: #fff; |
|
|
background: #fff; |
|
|
padding: 30px 0; |
|
|
|
|
|
|
|
|
.stand { |
|
|
display: flex; |
|
|
display: flex; |
|
|
flex-direction: column; |
|
|
flex-direction: column; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
|
|
|
padding: 30px 0; |
|
|
.icon { |
|
|
.icon { |
|
|
width: auto; |
|
|
width: auto; |
|
|
height: 20px; |
|
|
height: 20px; |
|
@ -59,8 +115,23 @@ const props = defineProps({ |
|
|
white-space: nowrap; |
|
|
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; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
.bg { |
|
|
.bg { |
|
|
background: #fafafa; |
|
|
background: #fafafa; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |