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.

1370 lines
37 KiB

1 month ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
  1. <template>
  2. <div class="interactive-container">
  3. <!-- 顶部区域 -->
  4. <div class="top-section">
  5. <!-- 主标题 -->
  6. <div class="main-title">
  7. <img src="@/assets/img/zhongchou/助力美股享实时数据.png" alt="">
  8. <div class="activity-period">活动时间{{ activityPeriod }}</div>
  9. </div>
  10. <!-- 活动规则按钮 -->
  11. <div class="rules-btn" @click="showRulesFunc">
  12. <img src="@/assets/img/zhongchou/活动需知.png" alt="活动规则" />
  13. <span class="rules-text">活动规则</span>
  14. </div>
  15. </div>
  16. <!-- 主要交互区域 -->
  17. <div class="main-interactive-area">
  18. <!-- 左侧美股区域 -->
  19. <div class="stock-area left-area" :class="{ active: activeArea === 'us', 'side': activeArea === 'hk' }">
  20. <div class="stock-content">
  21. <div class="stock-card us-card">
  22. <div class="card-content us-content">
  23. <!-- 周年庆装饰元素 -->
  24. <div class="anniversary-decoration"></div>
  25. <div class="progress-section">
  26. <div class="progress-bar">
  27. <div class="progress-fill"></div>
  28. </div>
  29. <!-- 美股区域刻度 -->
  30. <div class="time-markers">
  31. <div class="marker marker-text" v-for="time in timeMarkers" :key="time" :class="{
  32. 'reached': (15 - usUsedTime) <= time,
  33. 'gold': (15 - usUsedTime) > time
  34. }">
  35. {{ time }}
  36. </div>
  37. </div>
  38. </div>
  39. <!-- 美股剩余时间显示 -->
  40. <div class="stock-info" :class="{ 'time-almost-up': isTimeAlmostUp }">
  41. <h3>{{ marketName }}实时数据</h3>
  42. <h3>还剩{{ numberToChinese(usDisplayTime) }}分钟</h3>
  43. </div>
  44. </div>
  45. </div>
  46. <!-- 美股助力按钮和底座 -->
  47. <div class="boost-section">
  48. <div class="boost-btn us-boost-btn" :class="{ 'boosted': usBoostStatus }"
  49. @click.stop="handleBoostClick('us')"></div>
  50. <div class="base-image">
  51. <img src="@/assets/img/zhongchou/底座.png" alt="底座" />
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <!-- 中央火箭区域 -->
  57. <div class="rocket-area" :class="{ hidden: activeArea !== null }">
  58. <div class="rocket-container">
  59. <div class="rocket-body">
  60. <img src="@/assets/img/zhongchou/火箭.png" alt="火箭" />
  61. </div>
  62. </div>
  63. </div>
  64. <!-- 助力成功提示 -->
  65. <transition name="fade" appear>
  66. <div class="boost-success-container" v-if="showBoostSuccess">
  67. <img src="@/assets/img/zhongchou/助力成功.png" alt="助力成功" />
  68. </div>
  69. </transition>
  70. <!-- 右侧港股区域 -->
  71. <!-- <div class="stock-area right-area" @click="handleAreaClick('hk')"
  72. :class="{ active: activeArea === 'hk', 'side': activeArea === 'us' }">
  73. <div class="stock-content">
  74. <div class="stock-card hk-card">
  75. <div class="card-content hk-content">
  76. <div class="stock-info">
  77. <h3>距港股实时数据</h3>
  78. <h3>还剩{{ numberToChinese(hkDisplayTime) }}分钟</h3>
  79. </div>
  80. <div class="progress-section">
  81. <div class="progress-bar">
  82. <div class="progress-fill"></div>
  83. </div>
  84. <div class="time-markers">
  85. <div class="marker marker-text" v-for="time in timeMarkers" :key="time" :class="{
  86. 'reached': (15 - hkUsedTime) <= time,
  87. 'gold': (15 - hkUsedTime) > time
  88. }">
  89. {{ time }}
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="boost-section">
  96. <div class="boost-btn hk-boost-btn" :class="{ 'boosted': hkBoostStatus }"
  97. @click.stop="handleBoostClick('hk')"></div>
  98. <div class="base-image">
  99. <img src="@/assets/img/zhongchou/底座.png" alt="底座" />
  100. </div>
  101. </div>
  102. </div>
  103. </div> -->
  104. </div>
  105. <!-- 活动规则弹窗 -->
  106. <div v-if="showRulesModal" class="modal-overlay" @click="hideRules">
  107. <div class="modal-content" @click.stop>
  108. <div class="modal-background">
  109. <div class="modal-text">
  110. <div class="rules-list">
  111. <p>1. 活动时间为{{ activityPeriod }}</p>
  112. <p>2. 每人每天可以参与一次</p>
  113. <p>3. 初始时间为15分钟每一百人参与助力即可扣减一分钟</p>
  114. <p>4. 助力成功后对应股票市场将开放实时数据</p>
  115. <p>5. 实时数据众筹上线后您助力的次数会转化成对应天数的实时数据体验卡</p>
  116. </div>
  117. </div>
  118. <div class="close-btn" @click="hideRules"></div>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </template>
  124. <script setup>
  125. import { addRecordAPI, getActivity1API } from '../../api/zhongchouApi'
  126. import { ref, computed, onMounted, nextTick, watch } from 'vue'
  127. // 活动时间显示
  128. const activityPeriod = ref('加载中...')
  129. // 添加响应式变量存储活动ID和市场ID
  130. const activityId = ref(null)
  131. const usMarketId = ref(null)
  132. // 格式化日期函数
  133. const formatDate = (dateString) => {
  134. if (!dateString) return ''
  135. const date = new Date(dateString)
  136. const year = date.getFullYear()
  137. const month = String(date.getMonth() + 1).padStart(2, '0')
  138. const day = String(date.getDate()).padStart(2, '0')
  139. return `${year}/${month}/${day}`
  140. }
  141. // 在组件中使用
  142. async function fetchActivity() {
  143. try {
  144. const response = await getActivity1API()
  145. if (response.code === 200) {
  146. console.log('活动数据:', response.data)
  147. // 处理返回的数据
  148. const { activityId: id, data, startTime, endTime, totalcount } = response.data
  149. // 存储活动ID
  150. activityId.value = id
  151. if (startTime && endTime) {
  152. const formattedStartTime = formatDate(startTime)
  153. const formattedEndTime = formatDate(endTime)
  154. activityPeriod.value = `${formattedStartTime}~${formattedEndTime}`
  155. } else {
  156. activityPeriod.value = '时间待定'
  157. }
  158. // 处理市场数据
  159. if (data && data.length > 1) { // 确保至少有两个元素
  160. // 使用数组中的第二个元素(索引为1)
  161. const item = data[0] // 使用第二个数据
  162. // 存储市场ID
  163. usMarketId.value = item.marketId
  164. // 存储市场名称
  165. marketName.value = item.market
  166. // 根据marketStatus设置助力状态
  167. if (item.marketStatus === '已助力') {
  168. usBoostStatus.value = true
  169. } else {
  170. usBoostStatus.value = false
  171. }
  172. // 根据marketCount计算进度和剩余时间
  173. if (item.marketCount !== undefined) {
  174. const totalPeople = 1500 // 总人数1500人
  175. const currentCount = item.marketCount || 0 // 当前助力人数
  176. // 计算进度百分比 (0-100)
  177. const progressPercent = Math.min((currentCount / totalPeople) * 100, 100)
  178. // 根据进度计算剩余时间 (15分钟对应100%进度)
  179. const usedTime = (progressPercent / 100) * 15
  180. const remainingTime = Math.max(0, 15 - usedTime)
  181. usRemainingTime.value = Math.round(remainingTime)
  182. console.log(`${marketName.value}助力人数: ${currentCount}/${totalPeople}, 进度: ${progressPercent.toFixed(1)}%, 剩余时间: ${remainingTime.toFixed(1)}分钟`)
  183. // 更新进度条高度
  184. nextTick(() => {
  185. updateProgressDisplay()
  186. })
  187. }
  188. }
  189. } else {
  190. console.error('获取活动失败:', response.message)
  191. activityPeriod.value = '获取失败'
  192. }
  193. } catch (error) {
  194. console.error('请求错误:', error)
  195. activityPeriod.value = '网络错误'
  196. }
  197. }
  198. const numberToChinese = (num) => {
  199. const chineseNumbers = ['零', '一', '两', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二', '十三', '十四', '十五']
  200. return chineseNumbers[num] || num.toString()
  201. }
  202. // 进度条高度动态获取
  203. const progressBarRef = ref(null)
  204. const progressBarHeight = ref(0)
  205. // 更新进度条高度的函数
  206. const updateProgressBarHeight = () => {
  207. if (progressBarRef.value) {
  208. progressBarHeight.value = progressBarRef.value.offsetHeight
  209. }
  210. }
  211. // 时间刻度标记 - 从小到大排列(0在顶部,15在底部)
  212. const timeMarkers = computed(() => {
  213. return [0, 3, 6, 9, 12, 15]
  214. })
  215. // 获取进度条高度百分比 - 配合刻度逻辑
  216. const getProgressHeight = (remainingMinutes, totalMinutes = 15) => {
  217. // 剩余时间越少,进度条越满(从底部向上填充)
  218. // remainingMinutes = totalMinutes 时,返回 0%(空的,刚开始)
  219. // remainingMinutes = 0 时,返回 100%(满的,时间用完)
  220. const usedMinutes = totalMinutes - remainingMinutes
  221. return Math.max((usedMinutes / totalMinutes) * 100, 0)
  222. }
  223. // 添加活动规则弹窗状态
  224. const showRules = ref(false)
  225. // 原有的组件状态
  226. const activeArea = ref(null)
  227. const usBoostStatus = ref(false)
  228. // const hkBoostStatus = ref(false)
  229. const showRulesModal = ref(false)
  230. // 添加助力成功提示状态
  231. const showBoostSuccess = ref(false)
  232. // 剩余时间数据 - 从接口获取marketTwoCount计算
  233. const marketName = ref('美股') // 默认值为美股,将由API返回的数据更新
  234. const usRemainingTime = ref(15) // 美股剩余分钟,初始值15分钟
  235. // const hkRemainingTime = ref(6) // 港股剩余分钟
  236. const usTotalTime = ref(15) // 美股总时间15分钟
  237. // const hkTotalTime = ref(15) // 港股总时间15分钟
  238. // 计算属性:根据剩余时间计算进度条高度
  239. const usProgressHeight = computed(() => {
  240. return getProgressHeight(usRemainingTime.value, usTotalTime.value)
  241. })
  242. // const hkProgressHeight = computed(() => {
  243. // return getProgressHeight(hkRemainingTime.value, hkTotalTime.value)
  244. // })
  245. // 计算属性:显示的剩余时间
  246. const usDisplayTime = computed(() => {
  247. return Math.max(0, usRemainingTime.value)
  248. })
  249. // 计算属性:判断剩余时间是否小于等于3分钟
  250. const isTimeAlmostUp = computed(() => {
  251. return usRemainingTime.value <= 3
  252. })
  253. // const hkDisplayTime = computed(() => {
  254. // return Math.max(0, hkRemainingTime.value)
  255. // })
  256. // 计算已使用时间用于刻度显示
  257. const usUsedTime = computed(() => {
  258. return usTotalTime.value - usRemainingTime.value
  259. })
  260. // const hkUsedTime = computed(() => {
  261. // return hkTotalTime.value - hkRemainingTime.value
  262. // })
  263. // 监听剩余时间变化,更新进度条
  264. watch([usRemainingTime], () => {
  265. nextTick(() => {
  266. updateProgressDisplay()
  267. })
  268. })
  269. // 更新进度条显示
  270. const updateProgressDisplay = () => {
  271. // 更新美股进度条
  272. const usFill = document.querySelector('.us-content .progress-fill')
  273. if (usFill) {
  274. usFill.style.height = `${usProgressHeight.value}%`
  275. }
  276. // 更新港股进度条
  277. // const hkFill = document.querySelector('.hk-content .progress-fill')
  278. // if (hkFill) {
  279. // hkFill.style.height = `${hkProgressHeight.value}%`
  280. // }
  281. }
  282. const getQueryVariable = (variable) => {
  283. const query = window.location.search.substring(1)
  284. const vars = query.split('&')
  285. for (let i = 0; i < vars.length; i++) {
  286. const pair = vars[i].split('=')
  287. if (pair[0] === variable) {
  288. return pair[1]
  289. }
  290. }
  291. return ''
  292. }
  293. // 组件挂载时初始化
  294. onMounted(() => {
  295. showRulesModal.value = true
  296. nextTick(() => {
  297. // 页面加载时自动获取活动数据
  298. fetchActivity()
  299. updateProgressBarHeight()
  300. updateProgressDisplay()
  301. let token = '';
  302. token = getQueryVariable('token')
  303. localStorage.setItem('localToken', token);
  304. // 添加窗口大小改变监听
  305. window.addEventListener('resize', () => {
  306. nextTick(() => {
  307. updateProgressBarHeight()
  308. })
  309. })
  310. })
  311. })
  312. // const handleAreaClick = (area) => {
  313. // if (activeArea.value === area) {
  314. // activeArea.value = null
  315. // } else {
  316. // activeArea.value = area
  317. // }
  318. // }
  319. const handleBoostClick = async (area) => {
  320. if (area === 'us' && !usBoostStatus.value) {
  321. try {
  322. // 检查是否已获取到活动ID和市场ID
  323. if (!activityId.value || !usMarketId.value) {
  324. console.error('活动ID或市场ID未获取,请先获取活动数据')
  325. return
  326. }
  327. // 调用助力API,使用动态获取的值
  328. const response = await addRecordAPI({
  329. "activityId": activityId.value,
  330. "marketSign": usMarketId.value
  331. });
  332. if (response.code === 200) {
  333. console.log(`${marketName.value}助力成功:`, response.message)
  334. // 显示助力成功提示
  335. showBoostSuccess.value = true
  336. //助力成功动画1s
  337. setTimeout(() => {
  338. showBoostSuccess.value = false
  339. }, 1000)
  340. // 重新获取活动数据以更新按钮状态和进度
  341. await fetchActivity()
  342. console.log(`${marketName.value}已助力状态:`, usBoostStatus.value, '剩余时间:', usRemainingTime.value)
  343. } else {
  344. console.error(`${marketName.value}助力失败:`, response.message)
  345. }
  346. } catch (error) {
  347. console.error(`${marketName.value}助力请求失败:`, error)
  348. }
  349. }
  350. }
  351. const showRulesFunc = () => {
  352. showRulesModal.value = true
  353. }
  354. const hideRules = () => {
  355. showRulesModal.value = false
  356. }
  357. </script>
  358. <style scoped>
  359. /* 禁用页面滚动 */
  360. :global(html, body) {
  361. overflow: hidden;
  362. margin: 0;
  363. padding: 0;
  364. height: 100%;
  365. width: 100%;
  366. }
  367. :global(#app) {
  368. overflow: hidden;
  369. height: 100vh;
  370. width: 100vw;
  371. }
  372. .interactive-container {
  373. width: 100vw;
  374. height: 100vh;
  375. background: url('@/assets/img/zhongchou/bg.png') no-repeat center center;
  376. background-size: 100% 100%;
  377. position: fixed;
  378. top: 0;
  379. left: 0;
  380. overflow: hidden;
  381. display: flex;
  382. flex-direction: column;
  383. align-items: center;
  384. justify-content: center;
  385. }
  386. /* 顶部区域样式 */
  387. .top-section {
  388. display: flex;
  389. width: 100%;
  390. }
  391. /* 主标题样式 */
  392. .main-title {
  393. display: flex;
  394. flex-direction: column;
  395. align-items: center;
  396. justify-content: center;
  397. flex: 1;
  398. gap: 10px;
  399. margin-left: 70px;
  400. }
  401. /* 主标题图片响应式样式 */
  402. .main-title img {
  403. max-width: 100%;
  404. height: auto;
  405. width: auto;
  406. max-height: 80px;
  407. object-fit: contain;
  408. }
  409. /* 活动规则按钮样式 */
  410. .rules-btn {
  411. display: flex;
  412. flex-direction: column;
  413. margin-right: 3%;
  414. cursor: pointer;
  415. /* 确保按钮在屏幕缩放时保持比例 */
  416. transform-origin: center;
  417. transition: transform 0.2s ease;
  418. }
  419. .rules-btn img {
  420. width: auto;
  421. height: 45px;
  422. margin-bottom: 5px;
  423. object-fit: contain;
  424. /* 确保图片在屏幕缩放时保持比例 */
  425. image-rendering: -webkit-optimize-contrast;
  426. image-rendering: crisp-edges;
  427. transform-origin: center;
  428. }
  429. .rules-text {
  430. color: rgba(255, 255, 255, 0.9);
  431. font-size: 1rem;
  432. font-weight: 700;
  433. text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  434. white-space: nowrap;
  435. }
  436. .rules-btn:hover {
  437. transform: scale(1.1);
  438. }
  439. .main-title h1 {
  440. font-size: 3rem;
  441. color: #fff;
  442. margin: 0;
  443. text-shadow: 0 0 20px rgba(0, 150, 255, 0.8);
  444. background: linear-gradient(45deg, #00aaff, #0066cc);
  445. -webkit-background-clip: text;
  446. -webkit-text-fill-color: transparent;
  447. background-clip: text;
  448. }
  449. .activity-period {
  450. background-image: url("@/assets/img/zhongchou/时间边框.png");
  451. background-repeat: no-repeat;
  452. background-size: contain;
  453. background-position: center;
  454. font-size: 1.4rem;
  455. font-weight: 700;
  456. color: rgba(255, 255, 255, 0.9);
  457. display: inline-block;
  458. padding: 10px 20px;
  459. min-width: fit-content;
  460. /* 确保文字始终在容器内 */
  461. text-align: center;
  462. white-space: nowrap;
  463. overflow: hidden;
  464. text-overflow: ellipsis;
  465. box-sizing: border-box;
  466. max-width: 100%;
  467. }
  468. /* 主要交互区域 */
  469. .main-interactive-area {
  470. display: flex;
  471. justify-content: center;
  472. align-items: center;
  473. width: 100%;
  474. height: 700px;
  475. position: relative;
  476. /* perspective: 1200px; */
  477. transform-style: preserve-3d;
  478. }
  479. /* 股票区域基础样式 */
  480. .stock-area {
  481. position: absolute;
  482. width: 48vw;
  483. height: 38vw;
  484. min-width: 560px;
  485. min-height: 480px;
  486. max-width: 900px;
  487. max-height: 800px;
  488. display: flex;
  489. justify-content: center;
  490. align-items: center;
  491. transition: transform 1s ease;
  492. transform-style: preserve-3d;
  493. transform-origin: center center;
  494. }
  495. /* 为所有图片添加渲染优化 */
  496. /* .stock-card img,
  497. .rocket-body img,
  498. .base-image img {
  499. image-rendering: -webkit-optimize-contrast;
  500. image-rendering: crisp-edges;
  501. -webkit-backface-visibility: hidden;
  502. transform: translateZ(0);
  503. } */
  504. /* 美股卡片默认位置 - 居中显示,移除放大效果 */
  505. .left-area {
  506. transform: translateX(0) rotateY(0deg);
  507. z-index: 15;
  508. }
  509. /* 港股卡片默认位置 - 火箭右侧,向内倾斜 */
  510. /* .right-area {
  511. transform: translateX(25vw) rotateY(-25deg) scale(1.5);
  512. } */
  513. /* 美股hover效果 - 移除放大效果,仅保持轻微上移 */
  514. .left-area:hover:not(.active):not(.side) {
  515. transform: translateX(0) rotateY(0deg) translateY(-10px);
  516. transition: transform 0.3s ease;
  517. }
  518. /* 港股hover效果 - 在原有倾斜基础上轻微上移 */
  519. /* .right-area:hover:not(.active):not(.side) {
  520. transform: translateX(25vw) rotateY(-35deg) translateY(-10px) scale(1.55);
  521. transition: transform 0.3s ease;
  522. } */
  523. /* 美股激活时 - 移动到页面中心并取消倾斜,移除放大效果 */
  524. .left-area.active {
  525. transform: translateX(0) rotateY(0deg);
  526. z-index: 20;
  527. }
  528. /* 港股激活时 - 移动到页面中心并取消倾斜 */
  529. /* .right-area.active {
  530. transform: translateX(0) rotateY(0deg) scale(1.6);
  531. z-index: 20;
  532. } */
  533. /* 美股在港股激活时 - 移动到后面并保持倾斜 */
  534. /* .left-area.side {
  535. transform: translateX(-35vw) rotateY(25deg) scale(0.9) !important;
  536. z-index: 1 !important;
  537. opacity: 0.4;
  538. } */
  539. /* 港股在美股激活时 - 移动到后面并保持倾斜 */
  540. /* .right-area.side {
  541. transform: translateX(35vw) rotateY(-25deg) scale(0.9) !important;
  542. z-index: 1 !important;
  543. opacity: 0.4;
  544. } */
  545. /* 火箭区域 - 位于美股卡片右边,不覆盖卡片 */
  546. .rocket-area {
  547. position: absolute;
  548. z-index: 1;
  549. /* 位置调整到美股卡片右边,确保不覆盖 */
  550. top: 35%;
  551. /* 垂直居中 */
  552. left: calc(50% + 25vw);
  553. /* 美股卡片右边位置,增加间距 */
  554. transform: translate(0, -50%) translateZ(0);
  555. /* 左对齐,垂直居中 */
  556. }
  557. .rocket-area.hidden {
  558. opacity: 0.3;
  559. }
  560. /* 股票卡片样式 */
  561. .stock-card {
  562. width: 100%;
  563. height: 55vh;
  564. background-size: 100% 100%;
  565. background-position: center;
  566. background-repeat: no-repeat;
  567. }
  568. /* 美股卡片背景 */
  569. .us-card {
  570. background-image: url('@/assets/img/zhongchou/美股.png');
  571. position: relative;
  572. /* 确保子元素可以相对于它进行绝对定位 */
  573. }
  574. /* 周年庆装饰元素 */
  575. .anniversary-decoration {
  576. position: absolute;
  577. right: -150px;
  578. bottom: -90px;
  579. width: 30vw;
  580. /* 调整宽度 */
  581. height: 30vh;
  582. /* 调整高度 */
  583. background-image: url('@/assets/img/zhongchou/周年庆装饰.png');
  584. /* 图片名称中有空格 */
  585. background-size: contain;
  586. background-repeat: no-repeat;
  587. background-position: center;
  588. z-index: 100;
  589. /* 确保浮现于最上层 */
  590. animation: float 3s ease-in-out infinite;
  591. /* 添加浮动动画 */
  592. pointer-events: none;
  593. /* 确保不会影响鼠标事件 */
  594. }
  595. /* 港股卡片背景 */
  596. /* .hk-card {
  597. background-image: url('@/assets/img/zhongchou/港股.png') !important;
  598. } */
  599. .card-content {
  600. width: 100%;
  601. height: auto;
  602. display: flex;
  603. justify-content: flex-start;
  604. align-items: flex-start;
  605. gap: 20px;
  606. padding: 20px 20px 20px 20px;
  607. box-sizing: border-box;
  608. }
  609. /* 港股内容布局 - 进度条在右边 */
  610. /* .hk-content {
  611. flex-direction: row;
  612. } */
  613. /* 股票信息 */
  614. .stock-info {
  615. text-align: center;
  616. color: #fff;
  617. flex: 1;
  618. display: flex;
  619. flex-direction: column;
  620. }
  621. /* 剩余时间小于等于3分钟时的样式 */
  622. .time-almost-up h3 {
  623. color: #ff0000;
  624. }
  625. /* 股票信息标题样式 */
  626. .stock-info h3 {
  627. margin: 5px 0;
  628. font-size: 2rem;
  629. line-height: 1.2;
  630. word-wrap: break-word;
  631. /* 允许长单词换行 */
  632. overflow-wrap: break-word;
  633. /* 现代浏览器支持 */
  634. hyphens: auto;
  635. /* 自动断字 */
  636. }
  637. /* 通用进度条区域样式 */
  638. .progress-section {
  639. display: flex;
  640. align-items: center;
  641. justify-content: center;
  642. gap: 15px;
  643. }
  644. .us-content .progress-section {
  645. display: flex;
  646. align-items: center;
  647. justify-content: center;
  648. gap: 15px;
  649. flex-direction: row-reverse;
  650. /* 刻度在左,进度条在右 */
  651. }
  652. /* 港股内容布局 - 进度条在左边,刻度在右边 */
  653. /* .hk-content {
  654. flex-direction: row;
  655. }
  656. .hk-content .progress-section {
  657. display: flex;
  658. align-items: center;
  659. justify-content: center;
  660. gap: 15px;
  661. flex-direction: row;
  662. /* 进度条在左,刻度在右 */
  663. /* } */
  664. /* 默认进度条容器样式 */
  665. .progress-bar {
  666. width: 100%;
  667. height: auto;
  668. border-radius: 10px;
  669. position: relative;
  670. overflow: visible;
  671. min-width: 20px;
  672. /* 更改为响应式高度 */
  673. min-height: 50vh;
  674. }
  675. /* 美股进度条容器 - 蓝色主题背景 */
  676. .us-content .progress-bar {
  677. background: linear-gradient(to top,
  678. rgba(79, 195, 247, 0.2),
  679. rgba(41, 182, 246, 0.3),
  680. rgba(2, 136, 209, 0.4));
  681. border: 1px solid rgba(41, 182, 246, 0.5);
  682. box-shadow: 0 0 10px rgba(41, 182, 246, 0.3);
  683. }
  684. /* 港股进度条容器 - 红色主题背景 */
  685. /* .hk-content .progress-bar {
  686. background: linear-gradient(to top,
  687. rgba(255, 138, 128, 0.2),
  688. rgba(255, 87, 34, 0.3),
  689. rgba(211, 47, 47, 0.4));
  690. border: 1px solid rgba(255, 87, 34, 0.5);
  691. box-shadow: 0 0 10px rgba(255, 87, 34, 0.3);
  692. } */
  693. .time-markers {
  694. display: flex;
  695. flex-direction: column;
  696. height: auto;
  697. justify-content: space-between;
  698. align-items: center;
  699. /* 更改为响应式高度 */
  700. min-height: 50vh;
  701. }
  702. /* 股票内容容器 */
  703. .stock-content {
  704. display: flex;
  705. flex-direction: column;
  706. align-items: center;
  707. width: 100%;
  708. height: auto
  709. }
  710. /* 助力按钮区域样式 */
  711. .boost-section {
  712. display: flex;
  713. flex-direction: column;
  714. align-items: center;
  715. position: relative;
  716. width: 100%;
  717. }
  718. /* 助力按钮样式 */
  719. .boost-btn {
  720. border: none;
  721. cursor: pointer;
  722. transition: transform 0.3s ease;
  723. z-index: 2;
  724. background-size: contain;
  725. background-repeat: no-repeat;
  726. background-position: center;
  727. width: 240px;
  728. height: 80px;
  729. margin-top: -30px;
  730. }
  731. /* 美股助力按钮 */
  732. .us-boost-btn {
  733. background-image: url('@/assets/img/zhongchou/助力美股.png');
  734. }
  735. /* 美股已助力状态 */
  736. .us-boost-btn.boosted {
  737. background-image: url('@/assets/img/zhongchou/美股已助力.png');
  738. }
  739. /* 港股助力按钮 */
  740. /* .hk-boost-btn {
  741. background-image: url('@/assets/img/zhongchou/助力港股.png');
  742. }
  743. /* 港股已助力状态 */
  744. /* .hk-boost-btn.boosted {
  745. background-image: url('@/assets/img/zhongchou/港股已助力.png');
  746. } */
  747. /* 底座样式 */
  748. .base-image {
  749. margin-top: -65px;
  750. z-index: 1;
  751. }
  752. .base-image img {
  753. width: auto;
  754. height: 130px;
  755. display: block;
  756. }
  757. /* 默认进度条填充样式 */
  758. .progress-fill {
  759. position: absolute;
  760. bottom: 0;
  761. width: 100%;
  762. border-radius: 10px;
  763. transition: height 0.8s ease;
  764. }
  765. /* 美股进度条填充 - 蓝色系渐变 */
  766. .us-content .progress-fill {
  767. background: linear-gradient(to top, #4FC3F7, #29B6F6, #0288D1);
  768. }
  769. /* 港股进度条填充 - 红色系渐变 */
  770. /* .hk-content .progress-fill {
  771. background: linear-gradient(to top, #FF8A80, #FF5722, #D32F2F);
  772. } */
  773. /* 在进度条填充部分顶部添加火箭gif */
  774. .progress-fill::after {
  775. content: '';
  776. position: absolute;
  777. top: -25px;
  778. /* 火箭位置在填充部分顶部上方 */
  779. left: 50%;
  780. transform: translateX(-50%);
  781. width: 100px;
  782. height: 100px;
  783. background-image: url('@/assets/img/zhongchou/rocket.gif');
  784. background-size: contain;
  785. background-repeat: no-repeat;
  786. background-position: center;
  787. z-index: 10;
  788. }
  789. .marker {
  790. position: relative;
  791. color: #FFD700;
  792. /* 默认金色 */
  793. font-size: 1.4rem;
  794. font-weight: 700;
  795. font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  796. transition: all 0.5s ease;
  797. letter-spacing: 0.5px;
  798. text-rendering: optimizeLegibility;
  799. text-align: center;
  800. min-width: 30px;
  801. }
  802. /* 为刻度数字添加连接线 */
  803. .marker::before {
  804. content: '';
  805. position: absolute;
  806. top: 50%;
  807. width: 15px;
  808. height: 1px;
  809. background-color: currentColor;
  810. opacity: 0.6;
  811. transition: all 0.5s ease;
  812. }
  813. /* 美股刻度连接线 - 从右侧连接到进度条 */
  814. .us-content .marker::before {
  815. right: -13px;
  816. background-color: #00BFFF;
  817. /* 蓝色 */
  818. box-shadow: 0 0 4px rgba(0, 191, 255, 0.5);
  819. }
  820. /* 港股刻度连接线 - 从左侧连接到进度条 */
  821. /* .hk-content .marker::before {
  822. left: -20px;
  823. background-color: #FF4444;
  824. /* 红色 */
  825. /* box-shadow: 0 0 4px rgba(255, 68, 68, 0.5);
  826. } */
  827. /* 美股激活刻度 */
  828. .us-content .marker.reached {
  829. color: #00BFFF !important;
  830. }
  831. /* 港股激活刻度 */
  832. /* .hk-content .marker.reached {
  833. color: #FF4444 !important;
  834. text-shadow: 0 0 10px rgba(255, 68, 68, 0.8) !important;
  835. } */
  836. /* 刻度字体增强样式 */
  837. /* .marker-text {
  838. font-weight: bold;
  839. font-family: 'Arial Black', sans-serif;
  840. color: transparent;
  841. background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  842. -webkit-background-clip: text;
  843. background-clip: text;
  844. -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.6);
  845. text-stroke: 1.5px rgba(255, 255, 255, 0.6);
  846. text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(255, 255, 255, 0.2);
  847. filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
  848. isolation: isolate;
  849. z-index: 17;
  850. position: relative;
  851. } */
  852. .us-btn {
  853. background: linear-gradient(45deg, #0066cc, #0099ff);
  854. color: white;
  855. box-shadow: 0 5px 15px rgba(0, 100, 255, 0.4);
  856. }
  857. /* .hk-btn {
  858. background: linear-gradient(45deg, #cc3333, #ff6666);
  859. color: white;
  860. box-shadow: 0 5px 15px rgba(255, 50, 50, 0.4);
  861. } */
  862. .boost-btn:hover {
  863. background-size: 110%;
  864. }
  865. .rocket-container {
  866. position: relative;
  867. width: 100%;
  868. height: auto;
  869. display: flex;
  870. align-items: center;
  871. justify-content: center;
  872. }
  873. /* .rocket-glow {
  874. position: absolute;
  875. width: 300px;
  876. height: 300px;
  877. border-radius: 50%;
  878. background: radial-gradient(circle,
  879. rgba(0, 150, 255, 0.3) 0%,
  880. rgba(0, 100, 255, 0.2) 30%,
  881. transparent 70%);
  882. animation: pulse 2s ease-in-out infinite;
  883. } */
  884. .rocket-body {
  885. position: relative;
  886. z-index: 2;
  887. animation: float 3s ease-in-out infinite;
  888. }
  889. .rocket-body img {
  890. width: 15vw;
  891. height: auto;
  892. min-width: 100px;
  893. max-width: 250px;
  894. }
  895. /* 动画效果 */
  896. @keyframes pulse {
  897. 0%,
  898. 100% {
  899. transform: scale(1);
  900. opacity: 0.7;
  901. }
  902. 50% {
  903. transform: scale(1.1);
  904. opacity: 1;
  905. }
  906. }
  907. @keyframes float {
  908. 0%,
  909. 100% {
  910. transform: translateY(0px);
  911. }
  912. 50% {
  913. transform: translateY(-10px);
  914. }
  915. }
  916. /* 响应式设计 - 针对不同屏幕尺寸优化 */
  917. /* @media (max-width: 1200px) {
  918. .main-title img {
  919. max-height: 70px;
  920. }
  921. } */
  922. @media (max-width: 768px) {
  923. /* 平板端周年庆装饰元素 */
  924. .anniversary-decoration {
  925. width: 40vw;
  926. /* 调整手机版宽度 */
  927. height: 40vh;
  928. /* 调整手机版高度 */
  929. right: -20px;
  930. bottom: -100px;
  931. background-image: url('@/assets/img/zhongchou/手机周年庆装饰.png');
  932. /* 需要准备此图片资源 */
  933. }
  934. .main-title img {
  935. max-height: 60px;
  936. }
  937. .main-interactive-area {
  938. flex-direction: column;
  939. gap: 30px;
  940. }
  941. /* 股票信息标题样式 */
  942. .stock-info h3 {
  943. margin: 5px 0;
  944. font-size: 1.7rem;
  945. line-height: 1.2;
  946. word-wrap: break-word;
  947. /* 允许长单词换行 */
  948. overflow-wrap: break-word;
  949. /* 现代浏览器支持 */
  950. hyphens: auto;
  951. /* 自动断字 */
  952. }
  953. .stock-area {
  954. width: 50vw;
  955. /* 从58vw调整为50vw */
  956. height: 40vw;
  957. /* 从50vw调整为40vw */
  958. min-width: 350px;
  959. /* 从480px降低到350px */
  960. min-height: 300px;
  961. /* 从440px降低到300px */
  962. }
  963. .left-area {
  964. transform: translateX(0) rotateY(0deg);
  965. }
  966. /* 移动端火箭位置调整 - 确保不覆盖卡片 */
  967. .rocket-area {
  968. left: calc(50% + 30vw);
  969. top: 50%;
  970. transform: translate(0, -50%) translateZ(0);
  971. }
  972. /* 移动端规则按钮适配 */
  973. .rules-btn img {
  974. height: 35%;
  975. /* 移动端适当缩小图片尺寸 */
  976. }
  977. .rules-text {
  978. font-size: 0.9rem;
  979. /* 移动端适当缩小文字尺寸 */
  980. }
  981. /* 移动端活动时间容器适配 */
  982. .activity-period {
  983. font-size: 1.1rem;
  984. padding: 8px 15px;
  985. max-width: 90vw;
  986. /* 确保在小屏幕上不会超出视口 */
  987. }
  988. /* .right-area {
  989. transform: translateX(40vw) rotateY(-25deg) scale(1.3);
  990. } */
  991. }
  992. @media (max-width: 480px) {
  993. .rules-btn {
  994. display: flex;
  995. flex-direction: column;
  996. margin-right: 3%;
  997. cursor: pointer;
  998. /* 确保按钮在屏幕缩放时保持比例 */
  999. transform-origin: center;
  1000. transition: transform 0.2s ease;
  1001. margin-top: 35px;
  1002. }
  1003. /* 助力按钮区域样式 */
  1004. .boost-section {
  1005. display: flex;
  1006. flex-direction: column;
  1007. align-items: center;
  1008. position: relative;
  1009. width: 100%;
  1010. margin-top: 20px;
  1011. }
  1012. .interactive-container {
  1013. width: 100vw;
  1014. height: 100vh;
  1015. background: url('@/assets/img/zhongchou/手机bg.png') no-repeat center center;
  1016. background-size: 100% 100%;
  1017. position: fixed;
  1018. top: 0;
  1019. left: 0;
  1020. overflow: hidden;
  1021. display: flex;
  1022. flex-direction: column;
  1023. align-items: center;
  1024. justify-content: center;
  1025. }
  1026. .main-title {
  1027. margin-left: 12%;
  1028. text-align: center;
  1029. justify-content: center;
  1030. align-items: center;
  1031. margin-top: -10px;
  1032. padding-bottom: 30px;
  1033. }
  1034. .main-title img {
  1035. max-width: 100%;
  1036. height: auto;
  1037. width: auto;
  1038. max-height: 15vh;
  1039. object-fit: contain;
  1040. content: url('@/assets/img/zhongchou/手机助力美股享实时数据.png');
  1041. margin-top: 50px;
  1042. }
  1043. .rules-btn img {
  1044. height: 30px;
  1045. }
  1046. .rules-text {
  1047. font-size: 0.8rem;
  1048. }
  1049. /* 手机端股票卡片背景替换 */
  1050. .us-card {
  1051. background-image: url('@/assets/img/zhongchou/手机组2.png');
  1052. }
  1053. /* 手机端周年庆装饰元素 */
  1054. .anniversary-decoration {
  1055. width: 60vw;
  1056. /* 调整手机版宽度 */
  1057. height: 60vh;
  1058. /* 调整手机版高度 */
  1059. right: 5px;
  1060. bottom: -210px;
  1061. background-image: url('@/assets/img/zhongchou/手机周年庆装饰.png');
  1062. /* 需要准备此图片资源 */
  1063. }
  1064. /* 手机端隐藏火箭图片 */
  1065. .rocket-body img {
  1066. display: none;
  1067. }
  1068. /* 极小屏幕活动时间容器适配 */
  1069. .activity-period {
  1070. font-size: 0.9rem;
  1071. padding: 6px 12px;
  1072. max-width: 85vw;
  1073. /* 在极小屏幕上进一步缩小 */
  1074. }
  1075. }
  1076. /* 弹窗样式 */
  1077. .modal-overlay {
  1078. position: fixed;
  1079. top: 0;
  1080. left: 0;
  1081. width: 100vw;
  1082. height: 100vh;
  1083. background: rgba(0, 0, 0, 0.7);
  1084. display: flex;
  1085. justify-content: center;
  1086. align-items: center;
  1087. z-index: 1000;
  1088. }
  1089. .modal-content {
  1090. position: relative;
  1091. width: 620px;
  1092. height: 450px;
  1093. display: flex;
  1094. justify-content: center;
  1095. align-items: center;
  1096. }
  1097. .modal-background {
  1098. width: 100%;
  1099. height: auto;
  1100. background-image: url('@/assets/img/zhongchou/框.png');
  1101. background-size: 100% 100%;
  1102. background-repeat: no-repeat;
  1103. background-position: center;
  1104. display: flex;
  1105. flex-direction: column;
  1106. justify-content: space-between;
  1107. align-items: center;
  1108. padding: 50px 40px 40px 40px;
  1109. box-sizing: border-box;
  1110. }
  1111. .modal-text {
  1112. flex: 1;
  1113. display: flex;
  1114. flex-direction: column;
  1115. align-items: center;
  1116. color: #fff;
  1117. text-align: left;
  1118. width: 100%;
  1119. }
  1120. .rules-list {
  1121. width: 100%;
  1122. line-height: 1.6; /* 增加行高 */
  1123. margin-top: 10%;
  1124. margin-left: 10%; /* 减少左边距 */
  1125. padding-right: 5%; /* 添加右边距 */
  1126. }
  1127. .rules-list p {
  1128. margin: 10px 0;
  1129. font-size: 16px;
  1130. color: #fff;
  1131. font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif; /* 使用更清晰的中文字体 */
  1132. text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  1133. line-height: 1.7;
  1134. }
  1135. .close-btn {
  1136. background-image: url('@/assets/img/zhongchou/知道了.png');
  1137. background-size: 100%;
  1138. background-repeat: no-repeat;
  1139. background-position: center;
  1140. width: 160px;
  1141. height: 60px;
  1142. cursor: pointer;
  1143. transition: transform 0.2s ease;
  1144. }
  1145. .close-btn:hover {
  1146. transform: scale(1.05);
  1147. }
  1148. /* 助力成功提示样式 */
  1149. .boost-success-container {
  1150. position: fixed;
  1151. top: 50%;
  1152. left: 50%;
  1153. transform: translate(-50%, -50%);
  1154. z-index: 1000;
  1155. /* 确保显示在最上层 */
  1156. pointer-events: none;
  1157. /* 允许点击穿透 */
  1158. }
  1159. .boost-success-container img {
  1160. max-width: 300px;
  1161. height: auto;
  1162. filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
  1163. }
  1164. /* 增强的淡入淡出动画 */
  1165. .fade-enter-active {
  1166. animation: bounce-in 0.6s ease-out;
  1167. }
  1168. .fade-leave-active {
  1169. animation: bounce-out 0.5s ease-in;
  1170. }
  1171. @keyframes bounce-in {
  1172. 0% {
  1173. opacity: 0;
  1174. transform: translate(-50%, -50%) scale(0.5);
  1175. }
  1176. 50% {
  1177. opacity: 1;
  1178. transform: translate(-50%, -50%) scale(1.05);
  1179. }
  1180. 70% {
  1181. transform: translate(-50%, -50%) scale(0.95);
  1182. }
  1183. 100% {
  1184. transform: translate(-50%, -50%) scale(1);
  1185. }
  1186. }
  1187. @keyframes bounce-out {
  1188. 0% {
  1189. opacity: 1;
  1190. transform: translate(-50%, -50%) scale(1);
  1191. }
  1192. 20% {
  1193. opacity: 1;
  1194. transform: translate(-50%, -50%) scale(1.05);
  1195. }
  1196. 100% {
  1197. opacity: 0;
  1198. transform: translate(-50%, -50%) scale(0.5);
  1199. }
  1200. }
  1201. </style>