Browse Source

修改显示

lex 1 year ago
parent
commit
d97bc4f499

+ 61 - 39
src/views/student-register/index.tsx

@@ -178,7 +178,9 @@ export default defineComponent({
       instrumentCode: null as any, // 乐器编码
       activeOverTime: 0, // 活动结束时间
       activeOverStatus: true, // 活动是否结束 默认已结束
+      gradePopupShow: false,
       gradePopupIndex: [] as any, // 年级下拉索引
+      classPopupShow: false,
       classPopupIndex: [] as any // 班级下拉索引
     });
 
@@ -1670,52 +1672,72 @@ export default defineComponent({
           round
           safeAreaInsetBottom
           lazyRender={false}
-          class={'popupBottomSearch'}>
-          <Picker
-            showToolbar
-            v-model={forms.gradePopupIndex}
-            columns={forms.gradeList}
-            onCancel={() => (forms.gradeStatus = false)}
-            onConfirm={(val: any) => {
-              const selectedOption = val.selectedOptions[0];
-              studentInfo.extra.currentGradeNum = selectedOption.value;
-              forms.gradeNumText = selectedOption.text;
-              forms.gradeStatus = false;
-              if (['SCHOOL', 'GRADE'].includes(forms.schoolInstrumentSetType)) {
-                forms.instrumentCode = selectedOption.instrumentCode;
-              }
+          class={'popupBottomSearch'}
+          onOpen={() => {
+            forms.gradePopupShow = true;
+          }}
+          onClosed={() => {
+            forms.gradePopupShow = false;
+          }}>
+          {forms.gradePopupShow && (
+            <Picker
+              showToolbar
+              v-model={forms.gradePopupIndex}
+              columns={forms.gradeList}
+              onCancel={() => (forms.gradeStatus = false)}
+              onConfirm={(val: any) => {
+                const selectedOption = val.selectedOptions[0];
+                studentInfo.extra.currentGradeNum = selectedOption.value;
+                forms.gradeNumText = selectedOption.text;
+                forms.gradeStatus = false;
+                if (
+                  ['SCHOOL', 'GRADE'].includes(forms.schoolInstrumentSetType)
+                ) {
+                  forms.instrumentCode = selectedOption.instrumentCode;
+                }
 
-              if (forms.schoolInstrumentSetType === 'CLASS') {
-                forms.classList = selectedOption.classList;
-              }
-              if (['CLASS', 'GRADE'].includes(forms.schoolInstrumentSetType)) {
-                forms.currentClassText = '';
-                studentInfo.extra.currentClass = '';
-              }
-            }}
-          />
+                if (forms.schoolInstrumentSetType === 'CLASS') {
+                  forms.classList = selectedOption.classList;
+                }
+                if (
+                  ['CLASS', 'GRADE'].includes(forms.schoolInstrumentSetType)
+                ) {
+                  forms.currentClassText = '';
+                  studentInfo.extra.currentClass = '';
+                }
+              }}
+            />
+          )}
         </Popup>
         {/* 班级 */}
         <Popup
           v-model:show={forms.classStatus}
           position="bottom"
           round
-          class={'popupBottomSearch'}>
-          <Picker
-            showToolbar
-            v-model={forms.classPopupIndex}
-            columns={forms.classList}
-            onCancel={() => (forms.classStatus = false)}
-            onConfirm={(val: any) => {
-              const selectedOption = val.selectedOptions[0];
-              studentInfo.extra.currentClass = selectedOption.value;
-              forms.currentClassText = selectedOption.text;
-              forms.classStatus = false;
-              if (['CLASS'].includes(forms.schoolInstrumentSetType)) {
-                forms.instrumentCode = selectedOption.instrumentCode;
-              }
-            }}
-          />
+          class={'popupBottomSearch'}
+          onOpen={() => {
+            forms.classPopupShow = true;
+          }}
+          onClosed={() => {
+            forms.classPopupShow = false;
+          }}>
+          {forms.classPopupShow && (
+            <Picker
+              showToolbar
+              v-model={forms.classPopupIndex}
+              columns={forms.classList}
+              onCancel={() => (forms.classStatus = false)}
+              onConfirm={(val: any) => {
+                const selectedOption = val.selectedOptions[0];
+                studentInfo.extra.currentClass = selectedOption.value;
+                forms.currentClassText = selectedOption.text;
+                forms.classStatus = false;
+                if (['CLASS'].includes(forms.schoolInstrumentSetType)) {
+                  forms.instrumentCode = selectedOption.instrumentCode;
+                }
+              }}
+            />
+          )}
         </Popup>
 
         {/* 已经购买过样品 */}

+ 44 - 29
src/views/student-register/register-member/index.tsx

@@ -103,7 +103,9 @@ export default defineComponent({
       showMessage: '请使用微信打开',
       showOtherSchool: false,
       showOtherMessage: '',
+      gradePopupShow: false,
       gradePopupIndex: [] as any, // 年级下拉索引
+      classPopupShow: false,
       classPopupIndex: [] as any // 班级下拉索引
     });
     const otherParams = reactive({
@@ -657,41 +659,54 @@ export default defineComponent({
           round
           safeAreaInsetBottom
           lazyRender={false}
-          class={'popupBottomSearch'}>
-          <Picker
-            showToolbar
-            v-model={forms.gradePopupIndex}
-            columns={gradeList.value as any}
-            onCancel={() => (forms.gradeStatus = false)}
-            onConfirm={(val: any) => {
-              const selectedOption = val.selectedOptions[0];
-              studentInfo.extra.currentGradeNum = selectedOption.value;
-              forms.gradeNumText = selectedOption.text;
-              forms.gradeStatus = false;
-            }}
-          />
+          class={'popupBottomSearch'}
+          onOpen={() => {
+            forms.gradePopupShow = true;
+          }}
+          onClosed={() => {
+            forms.gradePopupShow = false;
+          }}>
+          {forms.gradePopupShow && (
+            <Picker
+              showToolbar
+              v-model={forms.gradePopupIndex}
+              columns={gradeList.value as any}
+              onCancel={() => (forms.gradeStatus = false)}
+              onConfirm={(val: any) => {
+                const selectedOption = val.selectedOptions[0];
+                studentInfo.extra.currentGradeNum = selectedOption.value;
+                forms.gradeNumText = selectedOption.text;
+                forms.gradeStatus = false;
+              }}
+            />
+          )}
         </Popup>
         {/* 班级 */}
         <Popup
           v-model:show={forms.classStatus}
           position="bottom"
           round
-          class={'popupBottomSearch'}>
-          <Picker
-            showToolbar
-            v-model={forms.classPopupIndex}
-            columns={classList}
-            onCancel={() => (forms.classStatus = false)}
-            onConfirm={(val: any) => {
-              const selectedOption = val.selectedOptions[0];
-              studentInfo.extra.currentClass = selectedOption.value;
-              forms.currentClassText = selectedOption.text;
-              forms.classStatus = false;
-            }}
-            // onChange={val => {
-            //   console.log(forms.classPopupIndex, 'classPopupIndex');
-            // }}
-          />
+          class={'popupBottomSearch'}
+          onOpen={() => {
+            forms.classPopupShow = true;
+          }}
+          onClosed={() => {
+            forms.classPopupShow = false;
+          }}>
+          {forms.classPopupShow && (
+            <Picker
+              showToolbar
+              v-model={forms.classPopupIndex}
+              columns={classList}
+              onCancel={() => (forms.classStatus = false)}
+              onConfirm={(val: any) => {
+                const selectedOption = val.selectedOptions[0];
+                studentInfo.extra.currentClass = selectedOption.value;
+                forms.currentClassText = selectedOption.text;
+                forms.classStatus = false;
+              }}
+            />
+          )}
         </Popup>
         {/* 是否在微信中打开 */}
         <OWxTip

+ 55 - 27
src/views/student-register/register-new/index.tsx

@@ -103,7 +103,11 @@ export default defineComponent({
       giftVipDay: null as any,
       showTips: false,
       showButton: false,
-      showMessage: '请使用微信打开'
+      showMessage: '请使用微信打开',
+      gradePopupShow: false,
+      gradePopupIndex: [] as any, // 年级下拉索引
+      classPopupShow: false,
+      classPopupIndex: [] as any // 班级下拉索引
     });
     const otherParams = reactive({
       showOtherSchool: false,
@@ -647,7 +651,10 @@ export default defineComponent({
                 readonly
                 clickable={false}
                 modelValue={forms.gradeNumText}
-                onClick={() => (forms.gradeStatus = true)}
+                onClick={() => {
+                  forms.gradePopupIndex = [studentInfo.extra.currentGradeNum];
+                  forms.gradeStatus = true;
+                }}
                 required
                 input-align="right"
               />
@@ -659,7 +666,10 @@ export default defineComponent({
                 readonly
                 clickable={false}
                 modelValue={forms.currentClassText}
-                onClick={() => (forms.classStatus = true)}
+                onClick={() => {
+                  forms.classPopupIndex = [studentInfo.extra.currentClass];
+                  forms.classStatus = true;
+                }}
                 required
                 input-align="right"
               />
@@ -727,36 +737,54 @@ export default defineComponent({
           round
           safeAreaInsetBottom
           lazyRender={false}
-          class={'popupBottomSearch'}>
-          <Picker
-            showToolbar
-            columns={gradeList.value as any}
-            onCancel={() => (forms.gradeStatus = false)}
-            onConfirm={(val: any) => {
-              const selectedOption = val.selectedOptions[0];
-              studentInfo.extra.currentGradeNum = selectedOption.value;
-              forms.gradeNumText = selectedOption.text;
-              forms.gradeStatus = false;
-            }}
-          />
+          class={'popupBottomSearch'}
+          onOpen={() => {
+            forms.gradePopupShow = true;
+          }}
+          onClosed={() => {
+            forms.gradePopupShow = false;
+          }}>
+          {forms.gradePopupShow && (
+            <Picker
+              showToolbar
+              v-model={forms.gradePopupIndex}
+              columns={gradeList.value as any}
+              onCancel={() => (forms.gradeStatus = false)}
+              onConfirm={(val: any) => {
+                const selectedOption = val.selectedOptions[0];
+                studentInfo.extra.currentGradeNum = selectedOption.value;
+                forms.gradeNumText = selectedOption.text;
+                forms.gradeStatus = false;
+              }}
+            />
+          )}
         </Popup>
         {/* 班级 */}
         <Popup
           v-model:show={forms.classStatus}
           position="bottom"
           round
-          class={'popupBottomSearch'}>
-          <Picker
-            showToolbar
-            columns={classList}
-            onCancel={() => (forms.classStatus = false)}
-            onConfirm={(val: any) => {
-              const selectedOption = val.selectedOptions[0];
-              studentInfo.extra.currentClass = selectedOption.value;
-              forms.currentClassText = selectedOption.text;
-              forms.classStatus = false;
-            }}
-          />
+          class={'popupBottomSearch'}
+          onOpen={() => {
+            forms.classPopupShow = true;
+          }}
+          onClosed={() => {
+            forms.classPopupShow = false;
+          }}>
+          {forms.classPopupShow && (
+            <Picker
+              showToolbar
+              v-model={forms.classPopupIndex}
+              columns={classList}
+              onCancel={() => (forms.classStatus = false)}
+              onConfirm={(val: any) => {
+                const selectedOption = val.selectedOptions[0];
+                studentInfo.extra.currentClass = selectedOption.value;
+                forms.currentClassText = selectedOption.text;
+                forms.classStatus = false;
+              }}
+            />
+          )}
         </Popup>
         {/* 是否在微信中打开 */}
         <OWxTip