skyblued 2 years ago
parent
commit
dc767d3c9e

+ 13 - 11
src/teacher/piano-room/class-arrangement/class-info/index.tsx

@@ -9,6 +9,7 @@ import {
   Radio,
   RadioGroup,
   Stepper,
+  Sticky,
   Tag,
   Toast
 } from 'vant'
@@ -252,17 +253,18 @@ export default defineComponent({
                   )
                 }}
               />
-
-              <Button
-                block
-                type="primary"
-                round
-                nativeType="submit"
-                style={{ margin: '0 auto', width: '90%', marginTop: '20px' }}
-                // onClick={() => setParmas()}
-              >
-                下一步
-              </Button>
+              <Sticky offsetBottom={0} position="bottom">
+                <Button
+                  block
+                  type="primary"
+                  round
+                  nativeType="submit"
+                  style={{ margin: '0 auto', width: '90%', marginTop: '20px' }}
+                  // onClick={() => setParmas()}
+                >
+                  下一步
+                </Button>
+              </Sticky>
             </div>
           </Form>
 

+ 20 - 7
src/teacher/piano-room/class-arrangement/create-class/index.tsx

@@ -16,18 +16,31 @@ import styles from './index.module.less'
 import { params as classInfo } from '../class-info'
 import { Button, Cell, Dialog, Popup, Sticky, Tag, Toast } from 'vant'
 import { getWeekCh } from '@/helpers/utils'
-import { active } from '../index'
 import { useRouter } from 'vue-router'
 import CourseSchedule from '../course-schedule'
 
 export default defineComponent({
   name: 'createClass',
-  setup() {
-    watch(active, () => {
-      if (active.value === 2) {
-        getList()
+  props: {
+    active: {
+      type: Number,
+      default: 1
+    },
+    onBack: {
+      type: Function,
+      default: () => () => {}
+    }
+  },
+  setup(props) {
+    watch(
+      () => props.active,
+      val => {
+        console.log(val)
+        if (val === 2) {
+          getList()
+        }
       }
-    })
+    )
     //日期设置
     const data = reactive({
       calendarList: {},
@@ -247,7 +260,7 @@ export default defineComponent({
                 type="primary"
                 plain
                 onClick={() => {
-                  active.value = 1
+                  props.onBack && props.onBack()
                   // 重置选择的课次
                   data.selectList = []
                 }}

+ 3 - 2
src/teacher/piano-room/class-arrangement/index.tsx

@@ -7,10 +7,11 @@ import education from '../images/icon_education.png'
 import educationActive from '../images/icon_education_active.png'
 import ClassInfo from './class-info'
 import CreateClass from './create-class'
-export const active = ref(1)
+
 export default defineComponent({
   name: 'ClassArrangement',
   setup() {
+    const active = ref(1)
     return () => {
       return (
         <div class={styles.classWrap}>
@@ -42,7 +43,7 @@ export default defineComponent({
             />
           </div>
           <div style={{ display: active.value === 2 ? 'block' : 'none' }}>
-            <CreateClass />
+            <CreateClass onBack={() => active.value = 1} active={active.value} />
           </div>
         </div>
       )