Browse Source

样式和切换曲谱

liushengqiang 2 năm trước cách đây
mục cha
commit
733968610d

+ 0 - 2
src/page-gym/musci-list/choosePartName/index.module.less

@@ -1,7 +1,6 @@
 .container {
   min-width: 260px;
   width: 50vw;
-  height: 85vh;
   max-height: 500px;
   border-radius: 8px;
   padding: 10px;
@@ -34,7 +33,6 @@
 
   .picker {
     padding: 20px 0;
-    height: calc(85vh - 80px);
     :global {
       .van-picker-column__item {
         font-size: 16px;

+ 2 - 2
src/page-gym/musci-list/choosePartName/index.tsx

@@ -1,4 +1,4 @@
-import { computed, defineComponent, ref } from "vue";
+import { computed, defineComponent, onMounted, ref } from "vue";
 import { Picker, Button, PickerOption, Icon } from "vant";
 import styles from "./index.module.less";
 import state from "/src/state";
@@ -29,7 +29,7 @@ export default defineComponent({
 					class={styles.picker}
 					showToolbar={false}
 					columns={columns.value}
-					visibleOptionNum={4}
+					visibleOptionNum={Math.ceil(document.body.clientHeight / 44 / 3)}
 					onChange={(row) => {
 						selectIndex.value = row.selectedValues[0];
 					}}

+ 5 - 2
src/page-gym/musci-list/index.tsx

@@ -121,8 +121,11 @@ export default defineComponent({
 					<Popup v-model:show={musicData.partShow} teleport="body" defaultStyle={false}>
 						<ChoosePartName
 							onClose={(index: number) => {
-								musicData.selectedPartIndex = index;
-								openWevView();
+								if ((index ?? -1) > -1) {
+									musicData.selectedPartIndex = index;
+									openWevView();
+								}
+
 								musicData.partShow = false;
 							}}
 						/>