Jelajahi Sumber

修改问题

lex 1 tahun lalu
induk
melakukan
bfa3639514

+ 30 - 15
src/school/orchestra/orchestra-information-list.tsx

@@ -143,27 +143,32 @@ export default defineComponent({
       getList()
     })
     return () => (
-      <div class={[styles.information, !state.listState.dataShow && 'emptyRootContainer']}>
+      <div class={[styles.information]}>
+        {props.type === '1' && (
+          <Button
+            style={{ marginTop: '12px', marginBottom: '12px' }}
+            icon="plus"
+            block
+            class={styles.addPhoneBtn}
+            onClick={() => {
+              router.push('/add-information')
+            }}
+          >
+            添加资讯
+          </Button>
+        )}
+
         {state.listState.dataShow ? (
           <OFullRefresh
             v-model:modelValue={state.listState.refreshing}
             onRefresh={onSearch}
             style={{
-              minHeight: `calc(100vh - ${props.headHeight}px - var(--van-tabs-line-height) - 12px) `
+              minHeight:
+                props.type === '1'
+                  ? `calc(100vh - var(--header-height) - var(--van-button-default-height) - 24px)`
+                  : `calc(100vh - var(--header-height))`
             }}
           >
-            <div style="background: #f6f8f9; overflow: hidden;">
-              <Button
-                icon="plus"
-                block
-                class={styles.addPhoneBtn}
-                onClick={() => {
-                  router.push('/add-information')
-                }}
-              >
-                添加资讯
-              </Button>
-            </div>
             <List
               // v-model:loading={state.listState.loading}
               finished={state.listState.finished}
@@ -220,7 +225,17 @@ export default defineComponent({
             </List>
           </OFullRefresh>
         ) : (
-          <OEmpty btnStatus={false} tips="暂无资讯" />
+          <div
+            style={{
+              minHeight:
+                props.type === '1'
+                  ? `calc(100vh - var(--header-height) - var(--van-button-default-height) - 24px)`
+                  : `calc(100vh - var(--header-height))`
+            }}
+            class={!state.listState.dataShow && 'emptyRootContainer'}
+          >
+            <OEmpty btnStatus={false} tips="暂无资讯" />
+          </div>
         )}
 
         <ActionSheet

+ 1 - 1
src/school/orchestra/orchestra-information.module.less

@@ -18,7 +18,7 @@
 
 
   .addPhoneBtn {
-    margin: 0 13px 13px;
+    margin: 0 13px 0;
     width: calc(100% - 26px);
     font-size: 16px;
     font-weight: 500;

+ 30 - 27
src/school/orchestra/orchestra-information.tsx

@@ -11,6 +11,7 @@ export default defineComponent({
   name: 'orchestra-information',
   setup() {
     const tabName = sessionStorage.getItem('orchestra-information-tab')
+    const router = useRouter()
     const state = reactive({
       activeName: tabName || 'publish',
       listState: {
@@ -41,35 +42,37 @@ export default defineComponent({
           }}
         >
           <OHeader border={false} />
+
+          <Tabs
+            sticky
+            lineWidth={20}
+            lineHeight={4}
+            v-model:active={state.activeName}
+            onChange={(val: string) => {
+              sessionStorage.setItem('orchestra-information-tab', val)
+            }}
+          >
+            <Tab title={`已发布(${state.publishedCount})`} name="publish"></Tab>
+            <Tab title={`已下架(${state.offlineCount})`} name="offline"></Tab>
+          </Tabs>
         </OSticky>
 
-        <Tabs
-          sticky
-          lineWidth={20}
-          lineHeight={4}
-          animated
-          v-model:active={state.activeName}
-          offsetTop={state.listState.height}
-          swipeable
-          onChange={(val: string) => {
-            sessionStorage.setItem('orchestra-information-tab', val)
-          }}
-        >
-          <Tab title={`已发布(${state.publishedCount})`} name="publish">
-            <OrchestraInformationList
-              headHeight={state.listState.height}
-              type="1"
-              onChangeList={getStat}
-            />
-          </Tab>
-          <Tab title={`已下架(${state.offlineCount})`} name="offline">
-            <OrchestraInformationList
-              headHeight={state.listState.height}
-              type="0"
-              onChangeList={getStat}
-            />
-          </Tab>
-        </Tabs>
+        {state.activeName === 'publish' && (
+          <OrchestraInformationList
+            key="publish"
+            headHeight={state.listState.height}
+            type="1"
+            onChangeList={getStat}
+          />
+        )}
+        {state.activeName === 'offline' && (
+          <OrchestraInformationList
+            key="offline"
+            headHeight={state.listState.height}
+            type="0"
+            onChangeList={getStat}
+          />
+        )}
       </div>
     )
   }

+ 2 - 1
src/views/unit-test/unit-create/unit-edit-test/index.tsx

@@ -73,8 +73,9 @@ export default defineComponent({
       // if (unitData['level' + state.level]?.questionList.length <= 0) {
       unitData['level' + state.level].totalScore = query.totalScore
       unitData['level' + state.level].questionNum = query.questionNum
+
       if (unitData['level' + state.level].passScore <= 0) {
-        unitData['level' + state.level].passScore = query.totalScore
+        unitData['level' + state.level].passScore = query.passScore
       }
       if (unitData['level' + state.level].timeMinutes <= 0) {
         unitData['level' + state.level].timeMinutes = query.timeMinutes