tangning преди 9 месеца
родител
ревизия
17099c51ba
променени са 6 файла, в които са добавени 80 реда и са изтрити 25 реда
  1. 0 15
      components.d.ts
  2. 2 2
      src/App.vue
  3. 10 3
      src/router/index.ts
  4. 9 0
      src/router/routes.ts
  5. 14 5
      src/views/airshow/index.vue
  6. 45 0
      src/views/airshow/success.vue

+ 0 - 15
components.d.ts

@@ -7,35 +7,20 @@ export {}
 
 declare module 'vue' {
   export interface GlobalComponents {
-    AButton: typeof import('ant-design-vue/es')['Button']
-    ACascader: typeof import('ant-design-vue/es')['Cascader']
     AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
-    AForm: typeof import('ant-design-vue/es')['Form']
-    AFormItem: typeof import('ant-design-vue/es')['FormItem']
-    AInput: typeof import('ant-design-vue/es')['Input']
-    ASelect: typeof import('ant-design-vue/es')['Select']
-    ATextarea: typeof import('ant-design-vue/es')['Textarea']
-    AUpload: typeof import('ant-design-vue/es')['Upload']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
     TitleBar: typeof import('./src/components/TitleBar/index.vue')['default']
     VanButton: typeof import('vant/es')['Button']
-    VanCascader: typeof import('vant/es')['Cascader']
     VanCellGroup: typeof import('vant/es')['CellGroup']
     VanDatePicker: typeof import('vant/es')['DatePicker']
-    VanDatetimePicker: typeof import('vant/es')['DatetimePicker']
-    VanDivider: typeof import('vant/es')['Divider']
     VanField: typeof import('vant/es')['Field']
     VanForm: typeof import('vant/es')['Form']
     VanIcon: typeof import('vant/es')['Icon']
-    VanList: typeof import('vant/es')['List']
     VanPicker: typeof import('vant/es')['Picker']
     VanPopup: typeof import('vant/es')['Popup']
     VanRadio: typeof import('vant/es')['Radio']
     VanRadioGroup: typeof import('vant/es')['RadioGroup']
-    VanRate: typeof import('vant/es')['Rate']
-    VanTab: typeof import('vant/es')['Tab']
-    VanTabs: typeof import('vant/es')['Tabs']
     VanUploader: typeof import('vant/es')['Uploader']
   }
 }

+ 2 - 2
src/App.vue

@@ -29,14 +29,14 @@
       document.title = t('feedback.title');
     } else if (wxOpenId.value) {
       console.log('已登录', wxOpenId.value);
-    } else if (routersName == 'airshow') {
+    } else if (routersName == 'airshow' || routersName == 'airshowsuccess') {
       console.log('已登录', wxOpenId.value);
     } else if (code) {
       //存在code
       userStore.setWxOpenId(code);
     } else {
       //进行微信登录
-      // getCodeApi(123);
+      getCodeApi(123);
     }
     let clear = getUrlKey('clear'); //获取url参数code
     if (clear) {

+ 10 - 3
src/router/index.ts

@@ -19,16 +19,23 @@ router.beforeEach(async (_to, _from, next) => {
       mytitle = 'Feedback';
     }
     document.title = mytitle;
-  } else if (_to.name == 'airshow') {
+  } else if (_to.name == 'airshow' || _to.name == 'airshowsuccess') {
     document.title = '[第十五届中国国际航空航天博览会」报名申请';
   } else {
     document.title = '四维时代售后';
   }
   console.log('wxOpenId', _to);
-  if (wxOpenId || _to.name == 'feedback' || _to.name == 'airshow' || _to.name == 'feedbacksuccess' || getUrlKey('code')) {
+  if (
+    wxOpenId ||
+    _to.name == 'feedback' ||
+    _to.name == 'airshow' ||
+    _to.name == 'airshowsuccess' ||
+    _to.name == 'feedbacksuccess' ||
+    getUrlKey('code')
+  ) {
     next();
   } else {
-    // getCodeApi(123);
+    getCodeApi(123);
   }
 });
 

+ 9 - 0
src/router/routes.ts

@@ -23,6 +23,15 @@ const routes = [
         },
       },
       {
+        path: 'airshowsuccess',
+        name: 'airshowsuccess',
+        component: () => import('/@/views/airshow/success.vue'),
+        meta: {
+          title: '申请成功',
+          keepAlive: true,
+        },
+      },
+      {
         path: 'detail/:id',
         name: 'detail',
         component: () => import('/@/views/detail/index.vue'),

+ 14 - 5
src/views/airshow/index.vue

@@ -113,7 +113,12 @@
           @click="showPicker.birthday = true"
         />
         <van-popup v-model:show="showPicker.birthday" position="bottom">
-          <van-date-picker @confirm="(val) => onConfirmdate(val, 'birthday')" @cancel="showPicker.birthday = false" />
+          <van-date-picker
+            :min-date="dataDay.minDate"
+            :max-date="dataDay.maxDate"
+            @confirm="(val) => onConfirmdate(val, 'birthday')"
+            @cancel="showPicker.birthday = false"
+          />
         </van-popup>
         <div class="myTitle required"><span class="number">10</span>计划参观日期</div>
         <van-field
@@ -146,7 +151,7 @@
                   v-model="formData.thumb"
                 />
               </div>
-              <div class="tips" v-html="t('feedback.fileTipsPc')"></div>
+              <div class="tips" v-html="'请上传图片</br>支持jpg、png格式,不大于5MB;'"></div>
             </div>
           </template>
         </van-field>
@@ -169,13 +174,16 @@
   import { ref, watch } from 'vue';
   import nationalityList from './country.json';
   import { addRoster } from '/@/api/index';
+  import { useRouter } from 'vue-router';
   import axios from 'axios';
   // const areaList = ref({});
   import { showToast } from 'vant';
+  const router = useRouter();
+
   const dataDay = ref({
-    // minDate: new Date(1924, 01, 01),
-    // maxDate: new Date(2024, 12, 12)
-  })
+    minDate: new Date(1924, 1, 1),
+    maxDate: new Date(2024, 12, 12),
+  });
   const columns = ref({
     industryOptionId: [
       {
@@ -279,6 +287,7 @@
     let param = { ...formData.value };
     param.thumb = param.thumb[0]?.url;
     await addRoster(param);
+    router.push('/airshowsuccess');
   };
   // const beforeUpload = (file) => {
   //   console.log('beforeUpload', file);

+ 45 - 0
src/views/airshow/success.vue

@@ -0,0 +1,45 @@
+<template>
+  <div class="success">
+    <div class="centent">
+      <van-icon color="#50C418" size="60" name="checked" />
+      <p>提交成功</p>
+      <div>谢谢您的参与!</div>
+    </div>
+  </div>
+</template>
+
+<script lang="ts" setup>
+  import { useI18n } from 'vue-i18n';
+  const { t } = useI18n();
+</script>
+
+<style lang="scss" scoped>
+  .success {
+    height: 100vh;
+    width: 100vw;
+    font-size: 14px;
+    font-family: Microsoft YaHei, Microsoft YaHei;
+    font-weight: 400;
+    color: rgba(0, 0, 0, 0.45);
+    line-height: 24px;
+    text-align: center;
+    background-color: #e5edf9;
+    padding: 126px 32px;
+    p {
+      font-size: 16px;
+      font-family: Microsoft YaHei, Microsoft YaHei;
+      font-weight: 400;
+      color: rgba(0, 0, 0, 0.85);
+      line-height: 32px;
+      margin: 18px 0 8px 0;
+    }
+  }
+  @media screen and (max-width: 450px) {
+    .success {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      padding: 0 32px;
+    }
+  }
+</style>