generated from maochaoying/dreamworks-frontend-template
7 changed files with 167 additions and 34 deletions
-
88src/components/Steps.vue
-
32src/components/Tabs.vue
-
15src/components/operation/LiquidInjection.vue
-
17src/pages/Home.vue
-
5src/store/index.js
-
27src/store/modules/count.js
-
17src/store/modules/tab.js
@ -0,0 +1,88 @@ |
|||||
|
<template> |
||||
|
<div class="steps_container"> |
||||
|
<div :class="tabStore.activeTab == 1 ? 'tab_wrap active' : 'tab_wrap'"> |
||||
|
<div class="number">1</div> |
||||
|
<p class="text">注入液氮</p> |
||||
|
</div> |
||||
|
<div :class="tabStore.activeTab == 2 ? 'tab_wrap active' : 'tab_wrap'"> |
||||
|
<div class="number">2</div> |
||||
|
<p class="text">抽取真空</p> |
||||
|
</div> |
||||
|
<div :class="tabStore.activeTab == 3 ? 'tab_wrap active' : 'tab_wrap'"> |
||||
|
<div class="number">3</div> |
||||
|
<p class="text">转移液氮</p> |
||||
|
</div> |
||||
|
<div :class="tabStore.activeTab == 4 ? 'tab_wrap active' : 'tab_wrap'"> |
||||
|
<div class="number">4</div> |
||||
|
<p class="text">开始加热</p> |
||||
|
</div> |
||||
|
<div :class="tabStore.activeTab == 5 ? 'tab_wrap active' : 'tab_wrap'"> |
||||
|
<div class="number">5</div> |
||||
|
<p class="text">充入空气</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script setup> |
||||
|
import { useTabStore } from '@/store' |
||||
|
|
||||
|
const tabStore = useTabStore() |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.steps_container { |
||||
|
width: 760px; |
||||
|
height: 70px; |
||||
|
border-radius: 35px; |
||||
|
background: #f0f6fb; |
||||
|
padding: 7px; |
||||
|
box-sizing: border-box; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
.tab_wrap { |
||||
|
width: 149px; |
||||
|
height: 56px; |
||||
|
border-radius: 28px; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
box-sizing: border-box; |
||||
|
padding: 0 22px 0 17px; |
||||
|
.number { |
||||
|
font-family: Poppins; |
||||
|
font-size: 16px; |
||||
|
font-weight: 500; |
||||
|
line-height: normal; |
||||
|
letter-spacing: 0.04em; |
||||
|
color: #9395a0; |
||||
|
width: 26px; |
||||
|
height: 26px; |
||||
|
background: #eaeaea; |
||||
|
border-radius: 50%; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
margin-right: 9px; |
||||
|
} |
||||
|
.text { |
||||
|
font-family: Source Han Sans CN; |
||||
|
font-size: 18px; |
||||
|
font-weight: 500; |
||||
|
line-height: normal; |
||||
|
letter-spacing: 0.04em; |
||||
|
color: #9395a0; |
||||
|
} |
||||
|
} |
||||
|
.active { |
||||
|
background: linear-gradient(180deg, #616af6 15%, #424bde 87%); |
||||
|
box-shadow: 0px 4px 6px 0px rgba(30, 39, 122, 0.3), |
||||
|
inset 0px 4px 10px 0px rgba(30, 46, 186, 0.3); |
||||
|
.number { |
||||
|
color: #565ee4; |
||||
|
background: #ffffff; |
||||
|
} |
||||
|
.text { |
||||
|
color: #ffffff; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,32 @@ |
|||||
|
<template> |
||||
|
<div class="tabs_container"> |
||||
|
<div class="tab_wrap active"></div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script setup></script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.tabs_container { |
||||
|
width: 760px; |
||||
|
height: 90px; |
||||
|
border-radius: 45px; |
||||
|
background: #f0f6fb; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
box-sizing: border-box; |
||||
|
padding: 10px; |
||||
|
.tab_wrap { |
||||
|
width: 246px; |
||||
|
height: 70px; |
||||
|
border-radius: 35px; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
.active { |
||||
|
background: linear-gradient(180deg, #616af6 15%, #424bde 87%); |
||||
|
border: 2px solid #6e75f2; |
||||
|
box-shadow: 0px 4px 6px 0px rgba(30, 39, 122, 0.3), |
||||
|
inset 0px 4px 10px 0px rgba(30, 46, 186, 0.3); |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,15 @@ |
|||||
|
<template> |
||||
|
<div class="liquid_injection_container"></div> |
||||
|
</template> |
||||
|
|
||||
|
<script setup></script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.liquid_injection_container { |
||||
|
width: 760px; |
||||
|
height: 490px; |
||||
|
border-radius: 16px; |
||||
|
background: #f0f6fb; |
||||
|
margin: 20px 0; |
||||
|
} |
||||
|
</style> |
@ -1,6 +1,7 @@ |
|||||
import { createPinia } from 'pinia' |
import { createPinia } from 'pinia' |
||||
import { useCountStore } from './modules/count' |
|
||||
|
import { useWebSocketStore } from './modules/websocket' |
||||
|
import { useTabStore } from './modules/tab' |
||||
const store = createPinia() |
const store = createPinia() |
||||
|
|
||||
export default store |
export default store |
||||
export { useCountStore } |
|
||||
|
export { useWebSocketStore, useTabStore } |
@ -1,27 +0,0 @@ |
|||||
import { defineStore } from 'pinia' |
|
||||
export const useCountStore = defineStore({ |
|
||||
id: 'count', // id必填,且需要唯一
|
|
||||
// state
|
|
||||
state: () => { |
|
||||
return { |
|
||||
count: 0, |
|
||||
} |
|
||||
}, |
|
||||
// getters
|
|
||||
getters: { |
|
||||
doubleCount: state => { |
|
||||
return state.count * 2 |
|
||||
}, |
|
||||
}, |
|
||||
// actions
|
|
||||
actions: { |
|
||||
// actions 同样支持异步写法
|
|
||||
countAdd() { |
|
||||
// 可以通过 this 访问 state 中的内容
|
|
||||
this.count++ |
|
||||
}, |
|
||||
countReduce() { |
|
||||
this.count-- |
|
||||
}, |
|
||||
}, |
|
||||
}) |
|
@ -0,0 +1,17 @@ |
|||||
|
import { defineStore } from 'pinia' |
||||
|
|
||||
|
export const useTabStore = defineStore({ |
||||
|
id: 'tab', // id必填,且需要唯一
|
||||
|
// state
|
||||
|
state: () => { |
||||
|
return { |
||||
|
activeTab: 1, |
||||
|
} |
||||
|
}, |
||||
|
// actions
|
||||
|
actions: { |
||||
|
updateActiveTab(activeTab) { |
||||
|
this.activeTab = activeTab |
||||
|
}, |
||||
|
}, |
||||
|
}) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue