tangning 1 år sedan
förälder
incheckning
0fac179450
5 ändrade filer med 57 tillägg och 3 borttagningar
  1. 1 0
      components.d.ts
  2. 1 1
      src/router/index.ts
  3. 9 0
      src/router/routes.ts
  4. 4 2
      src/views/feedback/index.vue
  5. 42 0
      src/views/feedback/success.vue

+ 1 - 0
components.d.ts

@@ -23,6 +23,7 @@ declare module 'vue' {
     VanCellGroup: typeof import('vant/es')['CellGroup']
     VanField: typeof import('vant/es')['Field']
     VanForm: typeof import('vant/es')['Form']
+    VanIcon: typeof import('vant/es')['Icon']
     VanPicker: typeof import('vant/es')['Picker']
     VanPopup: typeof import('vant/es')['Popup']
     VanRate: typeof import('vant/es')['Rate']

+ 1 - 1
src/router/index.ts

@@ -9,7 +9,7 @@ const router: Router = createRouter({
 router.beforeEach(async (_to, _from, next) => {
   console.log('_to', _to);
   let wxOpenId = useCookies().get('wxOpenId');
-  if (wxOpenId || _to.name == 'feedback' || getUrlKey('code')) {
+  if (wxOpenId || _to.name == 'feedback' || _to.name == 'feedbacksuccess' || getUrlKey('code')) {
     next();
   } else {
     getCodeApi(123);

+ 9 - 0
src/router/routes.ts

@@ -68,6 +68,15 @@ const routes = [
         },
       },
       {
+        path: 'feedbacksuccess',
+        name: 'feedbacksuccess',
+        component: () => import('/@/views/feedback/success.vue'),
+        meta: {
+          title: '用户意见反馈',
+          keepAlive: true,
+        },
+      },
+      {
         path: 'invoice/:id',
         name: 'invoice',
         component: () => import('/@/views/detail/invoice.vue'),

+ 4 - 2
src/views/feedback/index.vue

@@ -18,6 +18,7 @@
   import { showToast, showSuccessToast } from 'vant';
   import mcSubmit from './mcSubmit.vue';
   import pcSubmit from './pcSubmit.vue';
+import { useRouter } from 'vue-router';
   import axios from 'axios';
   // import useAxiosApi from '/@/utils/useAxiosApi';
   // import { Toast } from '@nutui/nutui';
@@ -27,6 +28,7 @@
   const emit = defineEmits(['setActive']);
   const submitPc = ref(null);
   const submitMc = ref(null);
+  const router = useRouter();
   const userStore = useUserStore();
   const wxOpenId = computed(() => {
     return userStore.getWxOpenId;
@@ -49,9 +51,9 @@
         return ele.response ? ele.response.data : ele.url;
       } ),
     };
-    const { response } = await feedbackAdd(apiData);
-    let data = unref(response);
+    await feedbackAdd(apiData);
     showSuccessToast('提交成功');
+    router.push('/feedbacksuccess');
     formData.problemDesc = '';
     formData.problemDescImgs = [];
     formData.solution = '';

+ 42 - 0
src/views/feedback/success.vue

@@ -0,0 +1,42 @@
+<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></script>
+
+<style lang="scss" scoped>
+  .success {
+    height: 100vh;
+    width: 100vw;
+    font-size: 12px;
+    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>