You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

536 lines
13 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 weeks ago
4 months ago
4 months ago
4 months ago
4 weeks ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. <template>
  2. <div class="homepage">
  3. <!-- <BackToHomeButton /> -->
  4. <!-- 顶部主图背景 -->
  5. <!-- <div class="main-icon"></div> -->
  6. <img class="main-icon" :src="robot" alt="AI小财神" />
  7. <!-- 按钮区域 -->
  8. <div class="buttons-container">
  9. <!-- 第一行夺宝奇兵模块和AI情绪模块 -->
  10. <div class="first-row">
  11. <div class="btn-item" @click="goToDBQBmodel" ref="topLeftBtn">
  12. <div class="btn-icon btn-dbqb"></div>
  13. <div class="btn-ball"></div>
  14. <div class="btn-text btn-text-dbqb"></div>
  15. </div>
  16. <div class="btn-item" @click="goToEmotionsmodel" ref="topRightBtn">
  17. <div class="btn-icon btn-ai"></div>
  18. <div class="btn-ball"></div>
  19. <div class="btn-text btn-text-ai"></div>
  20. </div>
  21. </div>
  22. <!-- 连接线SVG -->
  23. <svg class="connection-lines" ref="svgContainer" width="100%" height="100px" preserveAspectRatio="none">
  24. <!-- 连接线上面两个模块到下面模块的曲线 -->
  25. <path v-if="pathData.leftPath" :d="pathData.leftPath" class="connection-line" />
  26. <path v-if="pathData.rightPath" :d="pathData.rightPath" class="connection-line" />
  27. </svg>
  28. <!-- 第二行深度九大模型模块 -->
  29. <div class="second-row">
  30. <div class="btn-item" @click="goToDeepNineModel" ref="bottomBtn">
  31. <div class="btn-icon btn-deepnine"></div>
  32. <div class="btn-ball"></div>
  33. <div class="btn-text btn-text-deepnine"></div>
  34. </div>
  35. </div>
  36. </div>
  37. <!-- 底部口号与说明 -->
  38. <div class="footer-wrapper">
  39. <div class="footer-text1"></div>
  40. <div class="footer-text2"></div>
  41. </div>
  42. </div>
  43. </template>
  44. <script setup>
  45. import { onMounted, ref, reactive, nextTick } from "vue";
  46. import { useRouter } from "vue-router";
  47. import { setHeight } from "@/utils/setHeight";
  48. import { useDataStore } from "@/store/dataList.js";
  49. const { getQueryVariable, setActiveTabIndex, getUserInfo } = useDataStore();
  50. import robot from "@/assets/img/Selectmodel/机器人 拷贝.png";
  51. import BackToHomeButton from "@/views/components/BackToHomeButton.vue";
  52. import { useAppBridge } from "@/assets/js/useAppBridge.js";
  53. const router = useRouter();
  54. const pageRef = ref(null);
  55. // 添加引用
  56. const topLeftBtn = ref(null);
  57. const topRightBtn = ref(null);
  58. const bottomBtn = ref(null);
  59. const svgContainer = ref(null);
  60. // 路径数据
  61. const pathData = reactive({
  62. leftPath: '',
  63. rightPath: ''
  64. });
  65. onMounted(() => {
  66. // setHeight(pageRef.value)
  67. const isPhone =
  68. /phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(
  69. navigator.userAgent
  70. );
  71. !isPhone &&
  72. localStorage.setItem(
  73. "localToken",
  74. decodeURIComponent(String(getQueryVariable("token")))
  75. );
  76. fnGetToken()
  77. // localStorage.setItem(
  78. // "localToken",
  79. // "pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q"
  80. // );
  81. getUserInfo();
  82. // 计算连接线路径
  83. calculatePaths();
  84. // 窗口大小改变时重新计算
  85. window.addEventListener('resize', calculatePaths);
  86. });
  87. // 获取元素中心点位置
  88. const getElementCenter = (el) => {
  89. if (!el) return { x: 0, y: 0 };
  90. const rect = el.getBoundingClientRect();
  91. const containerRect = svgContainer.value.getBoundingClientRect();
  92. return {
  93. x: rect.left + rect.width / 2 - containerRect.left,
  94. y: rect.top + rect.height / 2 - containerRect.top
  95. };
  96. };
  97. // 计算SVG路径
  98. const calculatePaths = () => {
  99. nextTick(() => {
  100. if (!topLeftBtn.value || !topRightBtn.value || !bottomBtn.value || !svgContainer.value) {
  101. return;
  102. }
  103. const topLeft = getElementCenter(topLeftBtn.value);
  104. const topRight = getElementCenter(topRightBtn.value);
  105. const bottom = getElementCenter(bottomBtn.value);
  106. // 计算控制点(用于创建曲线效果)
  107. const leftControlX = (topLeft.x + bottom.x) / 2;
  108. const leftControlY = (topLeft.y + bottom.y) / 2 - 30;
  109. const rightControlX = (topRight.x + bottom.x) / 2;
  110. const rightControlY = (topRight.y + bottom.y) / 2 - 30;
  111. // 创建路径字符串
  112. pathData.leftPath = `M ${topLeft.x} ${topLeft.y} Q ${leftControlX} ${leftControlY} ${bottom.x} ${bottom.y}`;
  113. pathData.rightPath = `M ${topRight.x} ${topRight.y} Q ${rightControlX} ${rightControlY} ${bottom.x} ${bottom.y}`;
  114. });
  115. };
  116. // 获取token的核心函数
  117. const fnGetToken = () => {
  118. console.log('进入fnGetToken')
  119. window.JWready = (ress) => {
  120. console.log('进入JWready')
  121. try {
  122. ress = JSON.parse(ress);
  123. // console.log(ress, 'ress')
  124. } catch (error) {
  125. console.log(error, "fnGetToken error");
  126. } //platform为5是app端
  127. // platform.value = ress.data.platform
  128. // 处理平台判断
  129. console.log(ress.data.platform, "ress.data.platform");
  130. if (!ress.data.platform) {
  131. // 非App环境通过URL参数获取
  132. localStorage.setItem(
  133. "localToken",
  134. decodeURIComponent(String(getQueryVariable("token")))
  135. );
  136. // localStorage.setItem('localToken', "+SsksARQgUHIbIG3rRnnbZi0+fEeMx8pywnIlrmTxo5EOPR/wjWDV7w7+ZUseiBtf9kFa/atmNx6QfSpv5w")
  137. } else {
  138. // App环境通过桥接获取
  139. useAppBridge().packageFun(
  140. "JWgetStorage",
  141. (response) => {
  142. const res = JSON.parse(response); // 解析返回的结果
  143. localStorage.setItem("localToken", res.data);
  144. // localStorage.setItem('localToken', "+SsksARQgUHIbIG3rRnnbZi0+fEeMx8pywnIlrmTxo5EOPR/wjWDV7w7+ZUseiBtf9kFa/atmNx6QfSpv5w")
  145. },
  146. 5,
  147. {
  148. key: "token",
  149. }
  150. );
  151. }
  152. };
  153. // console.log('出来了')
  154. // 触发App桥接
  155. useAppBridge().packageFun("JWwebReady", () => {}, 5, {});
  156. };
  157. const goToDBQBmodel = () => {
  158. router.push("/DBQBmodel");
  159. };
  160. const goToEmotionsmodel = () => {
  161. router.push("/Emotionsmodel");
  162. };
  163. const goToDeepNineModel = () => {
  164. router.push("/DeepNineModel");
  165. };
  166. </script>
  167. <style scoped>
  168. .homepage {
  169. background-image: url("@/assets/img/Selectmodel/bg.png");
  170. background-size: 100% 100%;
  171. background-position: center;
  172. background-repeat: no-repeat;
  173. width: 100vw;
  174. height: 100vh;
  175. /* min-height: 100vh; */
  176. /* overflow-x: hidden; */
  177. display: flex;
  178. flex-direction: column;
  179. align-items: center;
  180. /* box-sizing: border-box;
  181. text-align: center; */
  182. background-attachment: fixed;
  183. justify-content: center;
  184. }
  185. .main-icon {
  186. max-width: 350px;
  187. width: 28vw;
  188. /* max-width: 280px; */
  189. height: auto;
  190. position: absolute;
  191. top: 20vh;
  192. }
  193. /* ===== 默认(PC端)按钮区域 ===== */
  194. .buttons-container {
  195. margin-top: 4vh;
  196. position: absolute;
  197. z-index: 5;
  198. width: 100%;
  199. display: flex;
  200. flex-direction: column;
  201. align-items: center;
  202. }
  203. .connection-lines {
  204. width: 60vw;
  205. height: 100px;
  206. position: relative;
  207. z-index: 1;
  208. margin: 0 auto;
  209. }
  210. .connection-line {
  211. stroke: #409eff;
  212. stroke-width: 2;
  213. fill: none;
  214. stroke-dasharray: 5, 5;
  215. animation: dash 1s linear infinite;
  216. }
  217. @keyframes dash {
  218. to {
  219. stroke-dashoffset: -10;
  220. }
  221. }
  222. /* 第一行:夺宝奇兵模块和AI情绪模块 */
  223. .first-row {
  224. display: flex;
  225. justify-content: center;
  226. gap: 30vw;
  227. margin-bottom: 0;
  228. position: relative;
  229. z-index: 2;
  230. }
  231. /* 第二行:深度九大模型模块 */
  232. .second-row {
  233. display: flex;
  234. justify-content: center;
  235. position: relative;
  236. z-index: 2;
  237. margin-top: -30px;
  238. }
  239. .btn-item {
  240. position: relative;
  241. display: flex;
  242. flex-direction: column;
  243. align-items: center;
  244. width: 90vw;
  245. max-width: 200px;
  246. cursor: pointer;
  247. animation: breathing 1.5s ease-in-out infinite;
  248. }
  249. /* 呼吸动效关键帧 */
  250. @keyframes breathing {
  251. 0%,
  252. 100% {
  253. transform: scale(1);
  254. }
  255. 50% {
  256. transform: scale(1.02);
  257. }
  258. }
  259. .btn-icon {
  260. /* height: 80px;
  261. width: 100%; */
  262. background-size: contain;
  263. background-repeat: no-repeat;
  264. background-position: center;
  265. }
  266. .btn-dbqb {
  267. height: 150px;
  268. width: 100%;
  269. background-image: url("@/assets/img/Selectmodel/-s-夺宝奇兵logo.png");
  270. scale: 0.8;
  271. }
  272. .btn-ai {
  273. height: 150px;
  274. width: 100%;
  275. background-image: url("@/assets/img/Selectmodel/金轮 拷贝.png");
  276. z-index: 3;
  277. }
  278. .btn-deepnine {
  279. height: 150px;
  280. width: 100%;
  281. background-image: url("https://d31zlh4on95l9h.cloudfront.net/images/35bf808538183be0062e4647570a9abd.png");
  282. z-index: 3;
  283. }
  284. .btn-ball {
  285. height: 150px;
  286. width: 150%;
  287. margin-top: -30px;
  288. background-image: url("@/assets/img/Selectmodel/球.png");
  289. background-size: contain;
  290. background-repeat: no-repeat;
  291. background-position: center;
  292. position: relative;
  293. }
  294. .btn-text {
  295. height: 200px;
  296. width: 150%;
  297. position: absolute;
  298. bottom: -20px;
  299. left: 50%;
  300. transform: translateX(-50%);
  301. background-size: contain;
  302. background-repeat: no-repeat;
  303. background-position: center;
  304. }
  305. .btn-text-dbqb {
  306. background-image: url("@/assets/img/Selectmodel/-s-夺宝奇兵大模型.png");
  307. }
  308. .btn-text-ai {
  309. background-image: url("@/assets/img/Selectmodel/-s-AI情绪大模型.png");
  310. }
  311. .btn-text-deepnine {
  312. background-image: url("https://d31zlh4on95l9h.cloudfront.net/images/203dc0bcf1ae5d7187412a864a3263ee.png");
  313. }
  314. /* ===== 底部口号区域 ===== */
  315. .footer-wrapper {
  316. /* margin-top: 6vh; */
  317. display: flex;
  318. flex-direction: column;
  319. align-items: center;
  320. gap: 5vh;
  321. position: absolute;
  322. bottom: 20px;
  323. }
  324. .footer-text1 {
  325. /* width: 200vw; */
  326. /* max-width: 200vw; */
  327. height: 6vw;
  328. background-image: url("@/assets/img/Selectmodel/智能体 拷贝.png");
  329. background-size: 100% 100%;
  330. background-size: contain;
  331. background-repeat: no-repeat;
  332. background-position: center;
  333. width: 100vw;
  334. }
  335. .footer-text2 {
  336. width: 70vw;
  337. max-width: 360px;
  338. height: 30px;
  339. /* margin-bottom: 60px; */
  340. background-image: url("@/assets/img/Selectmodel/-s-弘历团队.png");
  341. background-size: contain;
  342. background-repeat: no-repeat;
  343. background-position: center;
  344. }
  345. /* 手机适配 */
  346. @media screen and (max-width: 768px) {
  347. .homepage {
  348. background-image: url("@/assets/img/Selectmodel/手机bg.png");
  349. /* height: auto; */
  350. /* 解决底部留白 */
  351. /* width: 100%; */
  352. min-height: 100%;
  353. background-size: 100% 100%;
  354. overflow-x: hidden;
  355. }
  356. .main-icon {
  357. background-image: url("@/assets/img/Selectmodel/机器人手机.png");
  358. width: 70%;
  359. height: auto;
  360. background-repeat: no-repeat;
  361. background-size: 100% 100%;
  362. }
  363. .buttons-container {
  364. margin-top: 8rem;
  365. position: relative;
  366. width: 100%;
  367. }
  368. .connection-lines {
  369. width: 80vw;
  370. height: 80px;
  371. }
  372. .connection-line {
  373. stroke-width: 1.5;
  374. }
  375. .first-row {
  376. gap: 10vw;
  377. margin-bottom: 0;
  378. }
  379. .second-row {
  380. margin-top: -20px;
  381. }
  382. /* 手机端倒三角布局 */
  383. .buttons-container .btn-item:nth-child(2),
  384. .buttons-container .btn-item:nth-child(3) {
  385. margin-top: 0;
  386. }
  387. .buttons-container .btn-item:nth-child(2) {
  388. align-self: flex-end;
  389. }
  390. .buttons-container .btn-item:nth-child(3) {
  391. margin-left: 10vw;
  392. align-self: flex-start;
  393. margin-top: -150px; /* 负值使第三个按钮与第二个按钮在同一行 */
  394. }
  395. .buttons-container .btn-item:first-child {
  396. margin-top: 8vh;
  397. align-self: center;
  398. }
  399. .btn-item {
  400. width: 40vw;
  401. display: flex;
  402. flex-direction: column;
  403. align-items: center;
  404. position: relative;
  405. padding-bottom: 20px;
  406. }
  407. .btn-icon {
  408. height: 80px;
  409. margin-bottom: -10px;
  410. }
  411. .btn-ball {
  412. height: 80px;
  413. margin-top: -10px;
  414. position: relative;
  415. z-index: 1;
  416. }
  417. .btn-text {
  418. position: absolute;
  419. bottom: 45px;
  420. width: 90%;
  421. height: 40px;
  422. z-index: 2;
  423. }
  424. .footer-text1 {
  425. background-image: url("@/assets/img/Selectmodel/智能体.png");
  426. width: 100vw;
  427. height: 10vw;
  428. margin-top: 10px;
  429. background-size: 100% 100%;
  430. /* 保证全宽显示 */
  431. }
  432. .footer-text2 {
  433. width: 70vw;
  434. margin-top: 10px;
  435. }
  436. .footer-wrapper{
  437. gap: 0;
  438. }
  439. }
  440. /* 平板适配 */
  441. /* @media screen and (min-width: 769px) and (max-width: 1024px) {
  442. .homepage {
  443. background-image: url("@/assets/img/Selectmodel/手机bg.png");
  444. }
  445. .btn-item {
  446. padding-top: 20px;
  447. width: 300vw;
  448. position: relative;
  449. }
  450. .buttons-container {
  451. gap: 30vw;
  452. margin-top: 5vh;
  453. }
  454. .btn-icon,
  455. .btn-ball {
  456. height: 100px;
  457. width: 300px;
  458. }
  459. .btn-text {
  460. height: 90px;
  461. width: 100%;
  462. top: 70%;
  463. left: 50%;
  464. transform: translate(-50%, -50%);
  465. }
  466. } */
  467. </style>