Bläddra i källkod

修改动画效果

lex 2 år sedan
förälder
incheckning
18df0da6a4

+ 52 - 31
src/school/practice-rewards/detail.tsx

@@ -1,13 +1,17 @@
 import OHeader from '@/components/o-header'
-import { Cell, CellGroup, Grid, GridItem, Image, Picker, Popup, Tag } from 'vant'
+import { Cell, CellGroup, Grid, GridItem, Image, List, Picker, Popup, Tag } from 'vant'
 import { defineComponent, onMounted, reactive } from 'vue'
 import styles from './index.module.less'
 import iconStudent from '@/common/images/icon_student.png'
 import request from '@/helpers/request'
+import OFullRefresh from '@/components/o-full-refresh'
+import OEmpty from '@/components/o-empty'
+import { useRoute } from 'vue-router'
 
 export default defineComponent({
   name: 'practice-detail',
   setup() {
+    const route = useRoute()
     const state = reactive({
       subjectStatus: false,
       subjectList: [],
@@ -51,7 +55,8 @@ export default defineComponent({
           '/api-school/schoolWeekSalaryRecord/detailInfo/trainingPage',
           {
             data: {
-              ...state.params
+              ...state.params,
+              id: route.query.id
             }
           }
         )
@@ -75,6 +80,15 @@ export default defineComponent({
       }
     }
 
+    const onRefresh = () => {
+      state.params.page = 1
+      state.list = []
+      state.listState.dataShow = true // 判断是否有数据
+      state.listState.loading = false
+      state.listState.finished = false
+      getList()
+    }
+
     onMounted(() => {
       getSubjects()
     })
@@ -137,45 +151,52 @@ export default defineComponent({
             <div>全部声部</div>
           </span>
         </div>
-        {/* {form.listState.dataShow ? (
+        {state.listState.dataShow ? (
           <OFullRefresh
-            v-model:modelValue={form.listState.refreshing}
+            v-model:modelValue={state.listState.refreshing}
             onRefresh={onRefresh}
             style={{
-              minHeight: `calc(100vh - ${form.listState.height}px)`
+              minHeight: 'auto' //`calc(100vh - ${state.listState.height}px)`
             }}
           >
             <List
-              // v-model:loading={form.listState.loading}
-              finished={form.listState.finished}
+              // v-model:loading={state.listState.loading}
+              finished={state.listState.finished}
               finishedText=" "
               class={[styles.liveList]}
               onLoad={getList}
               immediateCheck={false}
-            ></List> */}
-        <CellGroup inset class={styles.cellGroup}>
-          <Cell center>
-            {{
-              icon: () => <Image src={iconStudent} class={styles.img} />,
-              title: () => (
-                <div class={styles.userInfo}>
-                  <div class={styles.userName}>测试</div>
-                  <div class={styles.subjectNames}>
-                    <Tag type="primary">长笛</Tag>
-                  </div>
-                </div>
-              ),
-              value: () => (
-                <div class={styles.mins}>
-                  <div class={styles.nums}>
-                    <span>70</span> 分钟
-                  </div>
-                  <div class={styles.text}>练习时长</div>
-                </div>
-              )
-            }}
-          </Cell>
-        </CellGroup>
+            >
+              <CellGroup inset class={styles.cellGroup}>
+                {state.list.map((item: any) => (
+                  <Cell center>
+                    {{
+                      icon: () => <Image src={iconStudent} class={styles.img} />,
+                      title: () => (
+                        <div class={styles.userInfo}>
+                          <div class={styles.userName}>测试</div>
+                          <div class={styles.subjectNames}>
+                            <Tag type="primary">长笛</Tag>
+                          </div>
+                        </div>
+                      ),
+                      value: () => (
+                        <div class={styles.mins}>
+                          <div class={styles.nums}>
+                            <span>70</span> 分钟
+                          </div>
+                          <div class={styles.text}>练习时长</div>
+                        </div>
+                      )
+                    }}
+                  </Cell>
+                ))}
+              </CellGroup>
+            </List>
+          </OFullRefresh>
+        ) : (
+          <OEmpty btnStatus={false} tips="暂无数据" />
+        )}
 
         <Popup v-model:show={state.subjectStatus} position="bottom" round>
           <Picker

+ 1 - 1
src/school/practice-rewards/index.tsx

@@ -95,7 +95,7 @@ export default defineComponent({
         {state.listState.dataShow ? (
           state.list.map((item: any) => (
             <div class={styles.gridGroup}>
-              <Cell center isLink>
+              <Cell center isLink to={'/practice-detail?id=' + item.id}>
                 {{
                   title: () => (
                     <div class={styles.itemTitle}>

+ 2 - 2
src/views/coursewarePlay/index.tsx

@@ -498,12 +498,12 @@ export default defineComponent({
         prev: {
           shadow: true,
           translate: [0, 0, -800],
-          rotate: [180, 0, 0]
+          rotate: [-180, 0, 0]
         },
         next: {
           shadow: true,
           translate: [0, 0, -800],
-          rotate: [-180, 0, 0]
+          rotate: [180, 0, 0]
         }
       },
       {