Browse Source

fix: 生成报告增加信息提示以及首页去除缓存

周玉环 15 hours ago
parent
commit
bb255ac061

+ 2 - 2
xinkeaboard-promotion-portal/src/components/TopContent.vue

@@ -11,7 +11,7 @@
       </span>
       <div class="head-content-wrap__step">
         <span class="label">只需三步</span>
-        <span class="tip">(每月可免费获取3次商品分析)</span>
+        <span class="tip">(每月可获取3次商品分析)</span>
       </div>
       <div class="head-content-wrap__info">
         <CountrySelct ref="CountrySelctRef" v-show="currentStep === 1"></CountrySelct>
@@ -129,7 +129,7 @@ const validateCompetitorWebsite = (site: string) => {
 const dialogConfirmCallback = () => {
   const formData = getFormData();
   btnLoading.value = false;
-  mainStore.setCacheViews(['Home'])
+  mainStore.setCacheViews([])
   mainStore.setFormData(formData);
 };
 

+ 1 - 1
xinkeaboard-promotion-portal/src/store/index.ts

@@ -34,7 +34,7 @@ export const useMainStore = defineStore('main', {
     isShowCompetitor: false,
     phone: '',
     id: '',
-    cacheViews: ['Home', 'Record'],
+    cacheViews: ['Record'],
   }),
   actions: {
     setCacheViews(val: string[]) {

+ 1 - 1
xinkeaboard-promotion-portal/src/utils/pdf.ts

@@ -35,7 +35,7 @@ async function generatePDFBlob(
   }
 
   try {
-    if (!pdfContent) pdfContent = document.querySelector('.record') as HTMLElement;
+    if (!pdfContent) pdfContent = document.getElementById('Record') as HTMLElement;
     if (!expanded.value) {
       mainStore.setExpanded(true);
       await nextTick();

+ 6 - 6
xinkeaboard-promotion-portal/src/views/Home.vue

@@ -5,10 +5,10 @@
         <TopContent></TopContent>
       </div>
     </div>
-    <div class="promotion-portal-tab record">
+    <div class="promotion-portal-tab record-tab">
       <RecordHelp></RecordHelp>
     </div>
-    <div class="promotion-portal-tab cando">
+    <div class="promotion-portal-tab cando-tab">
       <CanDo></CanDo>
     </div>
   </div>
@@ -19,9 +19,9 @@ import { onMounted, onUnmounted } from 'vue';
 import TopContent from '@/components/TopContent.vue';
 import RecordHelp from '@/components/RecordHelp.vue';
 import CanDo from "@/components/CanDo.vue";
-import { useMainStore } from '../store';
+// import { useMainStore } from '../store';
 
-const mainStore = useMainStore();
+// const mainStore = useMainStore();
 
 const AiBgImage = 'https://assets.njnaexport.com//images/lookeen/ai-bg.png';
 
@@ -55,12 +55,12 @@ onUnmounted(() => {});
     }
   }
 
-  &-tab.record {
+  &-tab.record-tab {
     width: 100%;
     height: 750px;
   }
 
-  &-tab.cando {
+  &-tab.cando-tab {
     width: 100%;
     height: 750px;
   }

+ 8 - 2
xinkeaboard-promotion-portal/src/views/Record.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="record">
+  <div class="record" id="Record">
     <div
       class="record-head"
       :style="{
@@ -75,6 +75,7 @@ import AiAnalysisPng from '../assets/images/ai-analysis.png';
 import RecordTop from '@/assets/images/record-top.png';
 import Logo from "@/assets/images/logo.png";
 import { handlePDF } from '@/utils/pdf';
+import { showMessage } from "@/utils/common";
 
 const mainStore = useMainStore();
 mainStore.initData();
@@ -93,8 +94,13 @@ const download = () => {
 };
 
 onMounted(() => {
-  mainStore.setCacheViews(['Home', 'Record'])
+  mainStore.setCacheViews(['Record'])
   mainStore.setCurrentStep(1);
+  showMessage({
+    type: 'info',
+    message: '报告生成中,约1分钟,刷新或退出将导致失败。',
+    duration: 5000,
+  })
 });
 
 watch(isLoadOver, (val) => {