Record.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <div class="record">
  3. <div class="record-head"></div>
  4. <div class="record-wrap" ref="pdfContent">
  5. <div class="record-wrap-content">
  6. <div class="record-wrap-content__overview" v-loading="loading">
  7. <span>概述关于你的产品的描述,通常的英语表述为</span>
  8. <span class="active">{{ keywordEn }},</span>
  9. <span>在互联网上搜索的关键词为</span>
  10. <span class="active">{{ keywords }}</span>
  11. </div>
  12. <div class="overview-left">概述</div>
  13. <div class="overview-right">
  14. <el-button v-show="!expanded" @click="download">下载报告</el-button>
  15. </div>
  16. <div class="record-wrap-content__keyword">
  17. <img :src="keywordPng" />
  18. <div class="content">
  19. <div class="content-left">
  20. <KeywordSearch></KeywordSearch>
  21. </div>
  22. <div class="content-right">
  23. <KeywordTable></KeywordTable>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="record-wrap-content__competitor" v-if="competitorWebsiteList.length">
  28. <img :src="CompetitorPng" />
  29. <div class="list">
  30. <CompetitorList></CompetitorList>
  31. </div>
  32. </div>
  33. <div class="record-wrap-content__ai">
  34. <img :src="AiAnalysisPng" />
  35. <AiAnalysis></AiAnalysis>
  36. </div>
  37. <div class="record-wrap-content__tips">
  38. <span
  39. >以上内容为AI根据三方网站获取的数据生成的内容,仅供参考,请仔细甄别。我司不对报告的真伪负责。</span
  40. >
  41. <span>如果需要更详细研究请联系我们:contact@njnaexport.cn</span>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </template>
  47. <script lang="ts" setup>
  48. import { ref, computed } from 'vue';
  49. import { useMainStore } from '../store';
  50. import KeywordSearch from '../components/keyword/search.vue';
  51. import KeywordTable from '../components/keyword/table.vue';
  52. import CompetitorList from '../components/competitor/list.vue';
  53. import AiAnalysis from '@/components/AiAnalysis.vue';
  54. import keywordPng from '../assets/images/keyword.png';
  55. import CompetitorPng from '../assets/images/competitor.png';
  56. import AiAnalysisPng from '../assets/images/ai-analysis.png';
  57. import { downloadPDF } from '@/utils/pdf';
  58. import { showMessage } from '@/utils/common';
  59. const mainStore = useMainStore();
  60. mainStore.initData();
  61. const pdfContent = ref<HTMLElement | null>(null);
  62. const keywordData = computed(() => mainStore.getKeywordInfo);
  63. const loading = computed(() => keywordData.value.loading);
  64. const keywordEn = computed(() => keywordData.value.data?.keywordEn);
  65. const keywords = computed(() => keywordData.value?.data?.keywords?.join(','));
  66. const expanded = computed(() => mainStore.getExpanded);
  67. const formData = computed(() => mainStore.getFormData);
  68. const competitorWebsiteList = computed(() => {
  69. const list = formData.value.competitorWebsite?.split(',') || [];
  70. return list.filter((item) => item.trim() !== '');
  71. });
  72. const download = () => {
  73. downloadPDF(pdfContent.value!);
  74. };
  75. </script>
  76. <style lang="scss" scoped>
  77. .record {
  78. position: relative;
  79. max-width: 1920px;
  80. height: 100%;
  81. // overflow: auto;
  82. background-color: #fff;
  83. &-head {
  84. height: 1330px;
  85. background-image: url('../assets/images/record-top.svg');
  86. background-repeat: no-repeat; /* 不重复 */
  87. background-position: center center; /* 居中显示 */
  88. background-size: cover;
  89. }
  90. &-wrap {
  91. position: absolute;
  92. top: 460px;
  93. width: 100%;
  94. display: flex;
  95. justify-content: center;
  96. background-color: rgba(246, 248, 250, 0.5);
  97. &-content {
  98. position: relative;
  99. width: 1336px;
  100. &__overview {
  101. display: flex;
  102. // justify-content: center;
  103. align-items: center;
  104. height: 179px;
  105. padding: 0 58px;
  106. background: rgba(255, 255, 255, 0.65);
  107. box-shadow: -9px 13px 22px 0px rgba(5, 112, 183, 0.06);
  108. border-radius: 4px;
  109. margin-top: 35px;
  110. font-weight: bold;
  111. font-size: 20px;
  112. color: #282e30;
  113. .active {
  114. color: var(--promotion--color-primary);
  115. }
  116. }
  117. .overview-left {
  118. position: absolute;
  119. top: 0;
  120. left: 30px;
  121. width: 136px;
  122. height: 70px;
  123. background: #ffffff;
  124. text-align: center;
  125. line-height: 70px;
  126. box-shadow: 0px 10px 30px 0px rgba(0, 98, 165, 0.2);
  127. border-radius: 8px;
  128. font-weight: bold;
  129. font-size: 32px;
  130. color: #282e30;
  131. z-index: 2000;
  132. }
  133. .overview-right {
  134. position: absolute;
  135. top: 14px;
  136. right: 30px;
  137. z-index: 2000;
  138. :deep(.el-button) {
  139. width: 126px;
  140. height: 48px;
  141. font-weight: 400;
  142. font-size: 16px;
  143. color: #ffffff;
  144. border-radius: 0;
  145. border: none;
  146. background: var(--promotion--color-primary);
  147. }
  148. }
  149. &__keyword {
  150. display: flex;
  151. flex-direction: column;
  152. justify-content: center;
  153. align-items: center;
  154. margin-top: 40px;
  155. img {
  156. width: 584px;
  157. height: 166px;
  158. }
  159. .content {
  160. width: 100%;
  161. display: flex;
  162. justify-content: space-between;
  163. margin-top: 20px;
  164. &-left {
  165. width: 666px;
  166. height: 317px;
  167. padding: 45px 60px;
  168. box-sizing: border-box;
  169. background: linear-gradient(
  170. 90deg,
  171. rgba(255, 255, 255, 0.65) 0%,
  172. rgba(255, 255, 255, 0) 100%
  173. );
  174. }
  175. &-right {
  176. width: 650px;
  177. height: 317px;
  178. }
  179. }
  180. }
  181. &__competitor {
  182. display: flex;
  183. flex-direction: column;
  184. justify-content: center;
  185. align-items: center;
  186. margin-top: 65px;
  187. img {
  188. width: 624px;
  189. height: 166px;
  190. }
  191. .list {
  192. width: 100%;
  193. margin-top: 20px;
  194. }
  195. }
  196. &__ai {
  197. display: flex;
  198. flex-direction: column;
  199. justify-content: center;
  200. align-items: center;
  201. margin-top: 60px;
  202. img {
  203. width: 624px;
  204. height: 166px;
  205. }
  206. }
  207. &__tips {
  208. display: flex;
  209. flex-direction: column;
  210. justify-content: center;
  211. width: 100%;
  212. height: 124px;
  213. padding-left: 40px;
  214. box-sizing: border-box;
  215. background: #ecf0f3;
  216. span {
  217. font-weight: 400;
  218. font-size: 16px;
  219. color: #d20000;
  220. }
  221. }
  222. }
  223. }
  224. }
  225. </style>