liyongli 1 nedēļu atpakaļ
vecāks
revīzija
5c522ae72e

+ 9 - 12
src/view/fenghui/form.vue

@@ -5,7 +5,7 @@
         <div>
             <span style="font-size: 1rem;margin-left: 10px;" v-text="lang[langType].signUp"></span>
         </div>
-        <van-form ref="form" @submit="onSubmit" @failed="failed" label-width="8em">
+        <van-form ref="form" @submit="onSubmit" label-width="8em">
             <!-- 国家/地区 -->
             <van-field size=“large” input-align="right"
                 :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].countryRegionContent }]" required
@@ -53,7 +53,7 @@
             </van-field>
             <van-popup v-model:show="showBirthday" destroy-on-close round position="bottom">
                 <van-date-picker :confirm-button-text="lang[langType].confirm"
-                    :cancel-button-text="lang[langType].cancel" @confirm="packerConfirm"
+                :cancel-button-text="lang[langType].cancel" @confirm="packerConfirm"
                     :title="lang[langType].birthday" @cancel="showBirthday = false" :min-date="new Date(1970, 0, 1)"
                     :max-date="new Date()" />
             </van-popup>
@@ -279,19 +279,19 @@
                 </template>
                 <template #input>
                     <van-checkbox-group checked-color="#3F5AC8" v-model="activitiesAttended">
-                        <van-cell clickable :title="lang[langType].active4">
+                        <van-cell clickable :title="lang[langType].active4" @click="checkboxRefs[0].toggle()">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active4" @click.stop shape="square" />
+                                <van-checkbox :ref="el => checkboxRefs[0] = el" style="margin-right: 5px;" name="active4" @click.stop shape="square" />
                             </template>
                         </van-cell>
-                        <van-cell clickable :title="lang[langType].active5">
+                        <van-cell clickable :title="lang[langType].active5" @click="checkboxRefs[1].toggle()">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active5" @click.stop shape="square" />
+                                <van-checkbox :ref="el => checkboxRefs[1] = el" style="margin-right: 5px;" name="active5" @click.stop shape="square" />
                             </template>
                         </van-cell>
-                        <van-cell clickable :title="lang[langType].active6">
+                        <van-cell clickable :title="lang[langType].active6" @click="checkboxRefs[2].toggle()">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active6" @click.stop shape="square" />
+                                <van-checkbox :ref="el => checkboxRefs[2] = el" style="margin-right: 5px;" name="active6" @click.stop shape="square" />
                             </template>
                         </van-cell>
                     </van-checkbox-group>
@@ -391,15 +391,12 @@ const showLeavingTime = ref(false)
 const showCheckOutTime = ref(false)
 const showUnitType = ref(false)
 const photo = ref([]);
+const checkboxRefs = ref([]);
 
 const onClickLeft = () => {
     emits('closeComponent');
 };
 
-const failed = (res) => {
-    console.log(res)
-}
-
 const reset = () => {
     form.value.resetValidation();
 }

+ 7 - 6
src/view/fenghui/form1.vue

@@ -260,19 +260,19 @@
                 </template>
                 <template #input>
                     <van-checkbox-group checked-color="#3F5AC8" v-model="activitiesAttended">
-                        <van-cell clickable :title="lang[langType].active4">
+                        <van-cell clickable :title="lang[langType].active4" @click="checkboxRefs[0].toggle()">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active4" @click.stop shape="square" />
+                                <van-checkbox :ref="el => checkboxRefs[0] = el" style="margin-right: 5px;" name="active4" @click.stop shape="square" />
                             </template>
                         </van-cell>
-                        <van-cell clickable :title="lang[langType].active5">
+                        <van-cell clickable :title="lang[langType].active5" @click="checkboxRefs[1].toggle()">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active5" @click.stop shape="square" />
+                                <van-checkbox :ref="el => checkboxRefs[1] = el" style="margin-right: 5px;" name="active5" @click.stop shape="square" />
                             </template>
                         </van-cell>
-                        <van-cell clickable :title="lang[langType].active6">
+                        <van-cell clickable :title="lang[langType].active6" @click="checkboxRefs[2].toggle()">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active6" @click.stop shape="square" />
+                                <van-checkbox :ref="el => checkboxRefs[2] = el" style="margin-right: 5px;" name="active6" @click.stop shape="square" />
                             </template>
                         </van-cell>
                     </van-checkbox-group>
@@ -373,6 +373,7 @@ const showCheckOutTime = ref(false)
 const activitiesAttended = ref([])
 const form = ref(null);
 const photo = ref([]);
+const checkboxRefs = ref([]);
 
 const reset = () => {
     form.value.resetFields();

+ 8 - 11
src/view/fenghui/form1Recurrence.vue

@@ -5,7 +5,7 @@
         <div>
             <span style="font-size: 1rem;margin-left: 10px;" v-text="lang[langType].signUpZH"></span>
         </div>
-        <van-form ref="form" @submit="onSubmit" @failed="failed" label-width="8em">
+        <van-form ref="form" @submit="onSubmit" label-width="8em">
             <!-- 姓名 -->
             <van-field size=“large” input-align="right"
                 :rules="[{ required: formData, trigger: 'onBlur', message: lang[langType].nameContent }]" required
@@ -269,19 +269,19 @@
                 </template>
                 <template #input>
                     <van-checkbox-group checked-color="#3F5AC8" v-model="activitiesAttended">
-                        <van-cell clickable :title="lang[langType].active4">
+                        <van-cell clickable :title="lang[langType].active4" @click="checkboxRefs[0].toggle()">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active4" @click.stop shape="square" />
+                                <van-checkbox :ref="el => checkboxRefs[0] = el" style="margin-right: 5px;" name="active4" @click.stop shape="square" />
                             </template>
                         </van-cell>
-                        <van-cell clickable :title="lang[langType].active5">
+                        <van-cell clickable :title="lang[langType].active5" @click="checkboxRefs[1].toggle()">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active5" @click.stop shape="square" />
+                                <van-checkbox :ref="el => checkboxRefs[1] = el" style="margin-right: 5px;" name="active5" @click.stop shape="square" />
                             </template>
                         </van-cell>
-                        <van-cell clickable :title="lang[langType].active6">
+                        <van-cell clickable :title="lang[langType].active6" @click="checkboxRefs[2].toggle()">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active6" @click.stop shape="square" />
+                                <van-checkbox :ref="el => checkboxRefs[2] = el" style="margin-right: 5px;" name="active6" @click.stop shape="square" />
                             </template>
                         </van-cell>
                     </van-checkbox-group>
@@ -383,6 +383,7 @@ const showCheckOutTime = ref(false)
 const form = ref(null);
 const activitiesAttended = ref([])
 const photo = ref([]);
+const checkboxRefs = ref([]);
 
 /**
  * 将subData数据转换为formData
@@ -449,10 +450,6 @@ const onClickLeft = () => {
     emits('closeComponent');
 };
 
-const failed = (err) => {
-    console.log(err);
-}
-
 const createTextDate = values => values.slice(0, 3).join('-') + ' ' + values.slice(3).join(':');
 const packerConfirm = (values) => {
     showBirthday.value = false;

+ 7 - 6
src/view/fenghui/formRecurrence.vue

@@ -278,19 +278,19 @@
                 </template>
                 <template #input>
                     <van-checkbox-group checked-color="#3F5AC8" v-model="activitiesAttended">
-                        <van-cell clickable :title="lang[langType].active4">
+                        <van-cell clickable :title="lang[langType].active4" @click="checkboxRefs[0].toggle()">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active4" @click.stop shape="square" />
+                                <van-checkbox :ref="el => checkboxRefs[0] = el" style="margin-right: 5px;" name="active4" @click.stop shape="square" />
                             </template>
                         </van-cell>
-                        <van-cell clickable :title="lang[langType].active5">
+                        <van-cell clickable :title="lang[langType].active5" @click="checkboxRefs[1].toggle()">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active5" @click.stop shape="square" />
+                                <van-checkbox :ref="el => checkboxRefs[1] = el" style="margin-right: 5px;" name="active5" @click.stop shape="square" />
                             </template>
                         </van-cell>
-                        <van-cell clickable :title="lang[langType].active6">
+                        <van-cell clickable :title="lang[langType].active6" @click="checkboxRefs[2].toggle()">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active6" @click.stop shape="square" />
+                                <van-checkbox :ref="el => checkboxRefs[2] = el" style="margin-right: 5px;" name="active6" @click.stop shape="square" />
                             </template>
                         </van-cell>
                     </van-checkbox-group>
@@ -390,6 +390,7 @@ const showCheckOutTime = ref(false)
 const showUnitType = ref(false)
 const activitiesAttended = ref([])
 const photo = ref([]);
+const checkboxRefs = ref([]);
 
 const onClickLeft = () => {
     emits('closeComponent');

+ 27 - 12
src/view/fenghui/index.vue

@@ -6,7 +6,8 @@
                 <van-icon name="arrow-down" />
             </div>
             <van-popup v-model:show="showLange" destroy-on-close round position="bottom">
-                <van-picker :model-value="[langSelect]" :columns="langObj" @cancel="showLange = false"
+                <van-picker :confirm-button-text="lang[langSelect].confirm"
+                :cancel-button-text="lang[langSelect].cancel" :model-value="[langSelect]" :columns="langObj" @cancel="showLange = false"
                     @confirm="langChange" />
             </van-popup>
         </div>
@@ -19,11 +20,11 @@
         <Work25 ref="work25" v-if="componentId === 'work25'" :verificationCode="verificationCode" :langType="langSelect"
             @closeComponent="closeComponent" />
 
-        <Fore25-recurrence ref="fore25" v-if="componentId === 'fore25Recurrence'" :subData="subData"
+        <Fore25-recurrence ref="fore25Recurrence" v-if="componentId === 'fore25Recurrence'" :subData="subData"
             :verificationCode="verificationCode" :langType="langSelect" @closeComponent="closeComponent" />
-        <Chin25-recurrence ref="chin25" v-if="componentId === 'chin25Recurrence'" :subData="subData"
+        <Chin25-recurrence ref="chin25Recurrence" v-if="componentId === 'chin25Recurrence'" :subData="subData"
             :verificationCode="verificationCode" :langType="langSelect" @closeComponent="closeComponent" />
-        <Work25-recurrence ref="work25" v-if="componentId === 'work25Recurrence'" :subData="subData"
+        <Work25-recurrence ref="work25Recurrence" v-if="componentId === 'work25Recurrence'" :subData="subData"
             :verificationCode="verificationCode" :langType="langSelect" @closeComponent="closeComponent" />
     </div>
 </template>
@@ -45,6 +46,9 @@ const showLange = ref(false);
 const fore25 = ref(null); // 引入子组件的实例,用于调用子组件的方法
 const chin25 = ref(null); // 引入子组件的实例,用于调用子组件的方法
 const work25 = ref(null); // 引入子组件的实例,用于调用子组件的方法
+const fore25Recurrence = ref(null); // 引入子组件的实例,用于调用子组件的方法
+const chin25Recurrence = ref(null); // 引入子组件的实例,用于调用子组件的方法
+const work25Recurrence = ref(null); // 引入子组件的实例,用于调用子组件的方法
 
 const subData = ref({})
 
@@ -78,14 +82,25 @@ const closeComponent = () => {
 const langChange = ({ selectedValues }) => {
     langSelect.value = selectedValues[0];
     localStorage.setItem('langSelect', selectedValues[0]);
-    // const cardTypeList = ref(lang.value[langSelect.value].cardTypeList)
-    // const countryOrRegionList = ref(lang.value[langSelect.value].countryOrRegionList)
-    if (componentId.value === 'fore25') {
-        fore25.value.reset(); // 调用子组件的方法 
-    } else if (componentId.value === 'chin25') {
-        chin25.value.reset(); // 调用子组件的方法 
-    } else if (componentId.value === 'work25') {
-        work25.value.reset(); // 调用子组件的方法
+    switch (componentId.value) {
+        case 'fore25':
+            fore25.value.reset(); // 调用子组件的方法
+            break;
+        case 'chin25':
+            chin25.value.reset(); // 调用子组件的方法
+            break;
+        case 'work25':
+            work25.value.reset(); // 调用子组件的方法
+            break;
+        case 'fore25Recurrence':
+            fore25Recurrence.value.reset(); // 调用子组件的方法
+            break;
+        case 'chin25Recurrence':
+            chin25Recurrence.value.reset(); // 调用子组件的方法
+            break;
+        case 'work25Recurrence':
+            work25Recurrence.value.reset(); // 调用子组件的方法
+            break;
     }
     showLange.value = false;
 };