18 changed files with 384 additions and 78 deletions
-
2index.html
-
5package-lock.json
-
1package.json
-
3src/App.vue
-
1src/assets/return.svg
-
6src/eventBus.ts
-
6src/router/index.ts
-
12src/stores/counter.ts
-
0src/stores/index.ts
-
12src/views/Simple.vue
-
83src/views/Test.vue
-
31src/views/components/Header.vue
-
108src/views/components/SimpleCard.vue
-
36src/views/components/SimpleCardVertical.vue
-
1src/views/components/index.ts
-
8src/views/components/simple.ts
-
54src/views/style/simpleCard.css
-
81src/views/style/simpleCardVertical.css
@ -0,0 +1 @@ |
|||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="7.811767578125" height="13.949738502502441" viewBox="0 0 7.811767578125 13.949738502502441"><g><path d="M6.97503,13.9497C6.76072,13.9497,6.54649,13.8682,6.38292,13.7048L0.245222,7.56707C-0.0817409,7.24061,-0.0817409,6.71049,0.245222,6.38352L6.38292,0.245222C6.70997,-0.0817406,7.2395,-0.0817406,7.56655,0.245222C7.89351,0.571688,7.89351,1.10181,7.56655,1.42877L2.02088,6.97506L7.56655,12.5206C7.89351,12.8477,7.89351,13.3772,7.56655,13.7043C7.40358,13.8682,7.18925,13.9497,6.97503,13.9497Z" fill="#34495E" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></svg> |
@ -0,0 +1,6 @@ |
|||||
|
import mitt from 'mitt' |
||||
|
type Events = { |
||||
|
menuId: number, |
||||
|
} |
||||
|
|
||||
|
export const eventBus = mitt<Events>() |
@ -0,0 +1,83 @@ |
|||||
|
<template> |
||||
|
<div class="test_return"> |
||||
|
<van-nav-bar |
||||
|
title="测试页面" |
||||
|
left-text="返回" |
||||
|
left-arrow |
||||
|
@click-left="onReturn" |
||||
|
/> |
||||
|
<div class="card"> |
||||
|
<div v-for="(item, index) in 6" :key="index" class="test_card"> |
||||
|
{{ item }} |
||||
|
<div class="test_status"> |
||||
|
<div class="test_font">开始加样</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script lang="ts" setup> |
||||
|
import { ref } from 'vue' |
||||
|
import { useRouter } from 'vue-router' |
||||
|
import {eventBus} from '@/eventBus' |
||||
|
|
||||
|
let menuId = ref(1) |
||||
|
const router = useRouter() |
||||
|
|
||||
|
const onReturn = () => { |
||||
|
menuId.value = 0 |
||||
|
eventBus.emit("menuId", 0) |
||||
|
router.go(-1) |
||||
|
} |
||||
|
|
||||
|
const list = [6] |
||||
|
const cardList = ref(list) |
||||
|
const simpleCard = ref(cardList) |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.test_return{ |
||||
|
background: #ECF2FF; |
||||
|
.return{ |
||||
|
display: flex; |
||||
|
} |
||||
|
span{ |
||||
|
font-size: 12px; |
||||
|
} |
||||
|
|
||||
|
.card{ |
||||
|
display: flex; |
||||
|
justify-content: flex-start; |
||||
|
flex-wrap: wrap; |
||||
|
flex-direction: row; |
||||
|
} |
||||
|
|
||||
|
.test_card{ |
||||
|
width: 30%; |
||||
|
height: 110px; |
||||
|
background: #ffffff; |
||||
|
margin-top:10px; |
||||
|
margin-left: 10px; |
||||
|
text-align: center; |
||||
|
padding-top:10px; |
||||
|
border-radius: 5px; |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
|
||||
|
.test_status{ |
||||
|
height: 50px; |
||||
|
background: #1871F8; |
||||
|
border-radius: 5px; |
||||
|
margin: 17px 6px; |
||||
|
.test_font{ |
||||
|
font-size: 15px; |
||||
|
color: #FFFFFF; |
||||
|
padding-top: 14px; |
||||
|
padding-left: 3px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
</style> |
@ -0,0 +1,36 @@ |
|||||
|
<template> |
||||
|
<div class="simple_card"> |
||||
|
<div class="simple_content"> |
||||
|
<div class="simple_seq"> |
||||
|
{{ simpleCard.id }} |
||||
|
</div> |
||||
|
<div class="simple_time_icon"> |
||||
|
<img :src="remainingTime"/> |
||||
|
<div class="simple_remaining_time">剩余时间</div> |
||||
|
</div> |
||||
|
<div class="simple_countdown"> |
||||
|
12:00:00 |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="simple_btn"> |
||||
|
<button size="mini" class="simple_clear">确定</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
import { ref } from 'vue' |
||||
|
import remainingTime from '@/assets/simpleCard/remaining_time.png' |
||||
|
const count = ref(1) |
||||
|
const props = defineProps({ |
||||
|
simpleInfo:{ |
||||
|
type:Object, |
||||
|
default:()=>{} |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
const simpleCard = ref(props.simpleInfo) |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
@import "../style/simpleCardVertical.css" |
||||
|
</style> |
@ -1,2 +1,3 @@ |
|||||
import { default as SimpleCard } from './SimpleCard.vue' |
import { default as SimpleCard } from './SimpleCard.vue' |
||||
import { default as Header } from './Header.vue' |
import { default as Header } from './Header.vue' |
||||
|
import { default as SimpleCardVertical } from './SimpleCardVertical.vue' |
@ -0,0 +1,8 @@ |
|||||
|
|
||||
|
const clearTime = () => { |
||||
|
console.log('12') |
||||
|
} |
||||
|
|
||||
|
export { |
||||
|
clearTime |
||||
|
} |
@ -0,0 +1,54 @@ |
|||||
|
.simple_card{ |
||||
|
width: 100px; |
||||
|
height: 137px; |
||||
|
background: #FFFFFF; |
||||
|
border-radius: 8px; |
||||
|
opacity: 1; |
||||
|
.simple_pos{ |
||||
|
text-align: center; |
||||
|
font-family: HarmonyOS Sans SC; |
||||
|
font-size: 22px; |
||||
|
font-weight: bold; |
||||
|
line-height: normal; |
||||
|
color: #1871F8; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.simple_time{ |
||||
|
width: 90px; |
||||
|
height: 70px; |
||||
|
border-radius: 6px; |
||||
|
opacity: 1; |
||||
|
background: #1871F8; |
||||
|
padding-top:2px; |
||||
|
margin-left: 5px; |
||||
|
.simple_remaining_time{ |
||||
|
display: flex; |
||||
|
color: #FFFFFF; |
||||
|
text-align: center; |
||||
|
font-size: 12px; |
||||
|
font-weight: bold; |
||||
|
padding-top: 10px; |
||||
|
padding-left: 10px; |
||||
|
} |
||||
|
|
||||
|
.simple_countdown{ |
||||
|
width: 84px; |
||||
|
height: 32px; |
||||
|
border-radius: 6px; |
||||
|
opacity: 1; |
||||
|
background: #195DC4; |
||||
|
color: #FFFFFF; |
||||
|
padding-top: 5px; |
||||
|
text-align: center; |
||||
|
margin-left:3px; |
||||
|
margin-top:2px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.simple_btn{ |
||||
|
border-radius: 6px; |
||||
|
width: 90px; |
||||
|
margin-left:5px; |
||||
|
} |
||||
|
} |
@ -0,0 +1,81 @@ |
|||||
|
.simple_card{ |
||||
|
width: 310px; |
||||
|
height: 42px; |
||||
|
background: #FFFFFF; |
||||
|
border-radius: 8px; |
||||
|
opacity: 1; |
||||
|
display: flex; |
||||
|
gap: 5px; |
||||
|
|
||||
|
.simple_content{ |
||||
|
width: 198px; |
||||
|
height: 37px; |
||||
|
border-radius: 8px; |
||||
|
background: #5BE881; |
||||
|
margin: auto; |
||||
|
margin-left: 2px; |
||||
|
display:flex; |
||||
|
.simple_seq{ |
||||
|
color: #ffffff; |
||||
|
padding-left: 15px; |
||||
|
padding-top: 5px; |
||||
|
width: 35px; |
||||
|
} |
||||
|
|
||||
|
.simple_time_icon{ |
||||
|
display: flex; |
||||
|
img{ |
||||
|
width: 15px; |
||||
|
height: 15px; |
||||
|
margin: auto; |
||||
|
} |
||||
|
|
||||
|
.simple_remaining_time{ |
||||
|
display: flex; |
||||
|
color: #FFFFFF; |
||||
|
text-align: center; |
||||
|
font-size: 13px; |
||||
|
font-weight: bold; |
||||
|
padding-top: 10px; |
||||
|
padding-left: 5px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.simple_pos{ |
||||
|
height: 25px; |
||||
|
font-size: 22px; |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
.simple_countdown{ |
||||
|
width: 84px; |
||||
|
height: 32px; |
||||
|
border-radius: 6px; |
||||
|
opacity: 1; |
||||
|
background: #52D375; |
||||
|
color: #FFFFFF; |
||||
|
padding-top: 5px; |
||||
|
text-align: center; |
||||
|
margin-left:3px; |
||||
|
margin-top:2px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.simple_btn{ |
||||
|
border-radius: 6px; |
||||
|
width: 107px; |
||||
|
height: 37px; |
||||
|
margin-top:3px; |
||||
|
background: #5BE881; |
||||
|
font-weight: bold; |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
|
||||
|
.simple_clear{ |
||||
|
color:#FFFFFF; |
||||
|
} |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue