|
@@ -1,4 +1,15 @@
|
|
|
-import { Button, Cell, Icon, Image, Popup, Swipe, SwipeItem, Tag } from 'vant'
|
|
|
+import {
|
|
|
+ ActionSheet,
|
|
|
+ Button,
|
|
|
+ Cell,
|
|
|
+ CountDown,
|
|
|
+ Icon,
|
|
|
+ Image,
|
|
|
+ Popup,
|
|
|
+ Swipe,
|
|
|
+ SwipeItem,
|
|
|
+ Tag
|
|
|
+} from 'vant'
|
|
|
import { defineComponent, reactive, ref } from 'vue'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import NoticeStart from '../model/notice-start'
|
|
@@ -8,17 +19,23 @@ import iconCountDown from '../images/icon-count-down.png'
|
|
|
import iconButtonList from '../images/icon-button-list.png'
|
|
|
import OSticky from '@/components/o-sticky'
|
|
|
import ChoiceQuestion from '../model/choice-question'
|
|
|
+import { useCountDown } from '@vant/use'
|
|
|
+import AnswerList from '../model/answer-list'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'unit-detail',
|
|
|
setup() {
|
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
|
+ const countDownRef = ref()
|
|
|
const swipeRef = ref()
|
|
|
const state = reactive({
|
|
|
visiableNotice: false,
|
|
|
- answerList: {}
|
|
|
+ visiableAnswer: true,
|
|
|
+ answerList: {},
|
|
|
+ time: 30 * 60 * 1000
|
|
|
})
|
|
|
+
|
|
|
return () => (
|
|
|
<div class={styles.unitDetail}>
|
|
|
<Cell center class={styles.unitSection}>
|
|
@@ -32,7 +49,13 @@ export default defineComponent({
|
|
|
</div>
|
|
|
<div class={styles.qNums}>
|
|
|
<Icon class={styles.icon} name={iconCountDown} />
|
|
|
- 剩余时长:39:30
|
|
|
+ 剩余时长:
|
|
|
+ <CountDown
|
|
|
+ ref={countDownRef}
|
|
|
+ time={state.time}
|
|
|
+ format={'mm:ss'}
|
|
|
+ autoStart={false}
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
)
|
|
@@ -71,6 +94,12 @@ export default defineComponent({
|
|
|
</div>
|
|
|
</OSticky>
|
|
|
|
|
|
+ {/* 题目集合 */}
|
|
|
+ {/* <Popup v-model:show={state.visiableAnswer}></Popup> */}
|
|
|
+ <ActionSheet v-model:show={state.visiableAnswer} title="题目列表" safeAreaInsetBottom>
|
|
|
+ <AnswerList />
|
|
|
+ </ActionSheet>
|
|
|
+
|
|
|
{/* 测验须知 */}
|
|
|
<Popup
|
|
|
v-model:show={state.visiableNotice}
|
|
@@ -85,6 +114,8 @@ export default defineComponent({
|
|
|
}}
|
|
|
onConfirm={() => {
|
|
|
console.log('start')
|
|
|
+ countDownRef.value.start()
|
|
|
+ state.visiableNotice = false
|
|
|
}}
|
|
|
/>
|
|
|
</Popup>
|