lex 2 年之前
父節點
當前提交
ef7b32613c

+ 1 - 0
src/school/companion-teacher/companion-teacher-register.tsx

@@ -201,6 +201,7 @@ export default defineComponent({
           '/api-school/open/orchestraSubjectConfig/pageByOrchestraId',
           {
             data: {
+              orchestraId: state.id,
               page: 1,
               rows: 50
             }

+ 2 - 0
src/school/companion-teacher/index.tsx

@@ -101,6 +101,8 @@ export default defineComponent({
           res.data.schoolId +
           '&name=' +
           res.data.schoolName
+
+        console.log(form.url)
       } catch {
         //
       }

+ 1 - 0
src/student/music-group/shop-address/address-operation.tsx

@@ -127,6 +127,7 @@ export default defineComponent({
             placeholder="请输入收货人手机号"
             v-model={state.phoneNumber}
             maxlength={11}
+            type="tel"
             formatter={onFormatterInt}
           />
           <Field

+ 49 - 0
src/views/unit-test/model/answer-list/index.module.less

@@ -0,0 +1,49 @@
+.anserList {
+  min-height: 20vh;
+  padding: 20px 0;
+
+  .status {
+    display: flex;
+    align-items: center;
+    padding: 0 20px 30px;
+    span {
+      display: flex;
+      align-items: center;
+      font-size: 16px;
+      font-weight: 500;
+      color: #333333;
+      & + span {
+        margin-left: 30px;
+      }
+    }
+    i {
+      display: inline-block;
+      width: 18px;
+      height: 18px;
+      background-color: #eaeaea;
+      border-radius: 50%;
+      margin-right: 8px;
+    }
+  }
+
+  .aList {
+    margin: 0 10px;
+    :global {
+      .van-grid-item__content {
+        padding: 0 0 13px;
+      }
+    }
+    span {
+      display: inline-flex;
+      align-items: center;
+      justify-content: center;
+      width: 45px;
+      height: 45px;
+      background: #ff8057;
+      font-size: 18px;
+      font-weight: 500;
+      color: #ffffff;
+      border-radius: 50%;
+    }
+  }
+}

+ 48 - 0
src/views/unit-test/model/answer-list/index.tsx

@@ -0,0 +1,48 @@
+import { Grid, GridItem } from 'vant'
+import { defineComponent } from 'vue'
+import styles from './index.module.less'
+
+export default defineComponent({
+  name: 'answer-list',
+  props: {
+    answerList: {
+      type: Array,
+      default: () => []
+    },
+    statusList: {
+      type: Array,
+      default: () => [
+        {
+          text: '已答',
+          color: '#FF8057'
+        },
+        {
+          text: '未答',
+          color: '#EAEAEA'
+        }
+      ]
+    }
+  },
+  setup(props) {
+    return () => (
+      <div class={styles.anserList}>
+        <div class={styles.status}>
+          {props.statusList.map((item: any) => (
+            <span>
+              <i style={{ backgroundColor: item.color }}></i>
+              {item.text}
+            </span>
+          ))}
+        </div>
+
+        <Grid class={styles.aList} columnNum={6} border={false}>
+          {[1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 9, 0, 10].map((item: any) => (
+            <GridItem>
+              <span>1</span>
+            </GridItem>
+          ))}
+        </Grid>
+      </div>
+    )
+  }
+})

+ 34 - 3
src/views/unit-test/unit-detail/index.tsx

@@ -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>