zhb 2 месяцев назад
Родитель
Сommit
e86af69bf2
4 измененных файлов с 167 добавлено и 0 удалено
  1. 120 0
      components/cwg-custom-footer.vue
  2. 1 0
      components/cwg-page-wrapper.vue
  3. 20 0
      utils/dateUtils.js
  4. 26 0
      utils/pdf.js

+ 120 - 0
components/cwg-custom-footer.vue

@@ -0,0 +1,120 @@
+<template>
+    <view class="custom-footer">
+        <view class="footer-description">
+            <view class="desc-block">
+                <view class="desc-text" v-t="'newSignin.item12'" />
+                <view class="desc-text" v-t="'newSignin.item10'" />
+                <view class="desc-text" v-t="'newSignin.item11'" />
+                <view class="desc-text">
+                    <text v-t="'newSignin.item13'" />
+                    <a :href="'https://www.' +
+                        ho +
+                        '.com/doc/Risk-Disclosures-and-Acknowledgements-2020-08.pdf'
+                        " target="_blank" v-t="'newSignin.item13_1'" class="desc-link" />
+                    <text class="desc-text" v-t="'newSignin.item13_2'" />
+                </view>
+                <text class="desc-text" v-t="'newSignin.item13_3'" />
+                <text class="desc-text" v-t="'newSignin.item13_4'" />
+            </view>
+        </view>
+        <view class="footer-placeholder"></view>
+        <view class="footer-links">
+            <view v-for="(item, index) in linkList" :key="index" class="link-item" @click="openLink(item.url)"
+                v-t="item.text" />
+            <!-- <view class="copyright">© 2008 - 2026. Exness</view> -->
+        </view>
+    </view>
+</template>
+
+<script setup>
+import { openLocalPdf } from '@/utils/pdf.js'
+const linkList = [
+    { text: 'signup.agreemnet2', url: 'pdf/Client_Agreement.pdf' },
+    { text: 'signup.agreemnet4', url: 'pdf/Terms&Conditions.pdf' },
+    { text: 'signup.agreemnet6', url: 'pdf/Privacy_Policy.pdf' },
+]
+const openLink = (url) => {
+    openLocalPdf(url)
+}
+</script>
+
+<style lang="scss" scoped>
+@import "@/uni.scss";
+
+.custom-footer {
+    font-family: var(--f-country-simple-family);
+    font-weight: 400;
+    line-height: px2rpx(16);
+    font-size: px2rpx(12);
+    letter-spacing: px2rpx(0.5);
+    display: grid;
+    grid-template-columns: 1fr;
+    gap: px2rpx(32);
+    margin: px2rpx(16) px2rpx(24);
+    margin: px2rpx(64) 0px;
+
+    .footer-description {
+        .desc-block {
+            margin-bottom: px2rpx(32);
+
+            .desc-text {
+                display: inline-block;
+                margin-bottom: px2rpx(8);
+            }
+
+            .desc-link {
+                display: inline-block;
+                color: #0066cc;
+                text-decoration: underline;
+                margin-top: px2rpx(4);
+            }
+        }
+    }
+
+    .footer-placeholder {
+        display: block;
+    }
+
+    .footer-links {
+        display: flex;
+        flex-direction: column;
+        align-items: flex-start;
+
+        .link-item {
+            line-height: px2rpx(20);
+            font-size: px2rpx(12);
+            letter-spacing: px2rpx(0.5);
+            color: #0066cc;
+            cursor: pointer;
+
+            &:active {
+                opacity: 0.7;
+            }
+        }
+
+        .copyright {
+            width: 100%;
+            color: #999;
+            margin-top: px2rpx(12);
+        }
+    }
+}
+
+@media screen and (min-width: 768px) {
+    .custom-footer {
+        grid-template-columns: 4fr 2fr;
+    }
+}
+
+@media screen and (min-width: 992px) {
+    .custom-footer {
+        grid-template-columns: 8fr 4fr;
+    }
+}
+
+@media screen and (min-width: 1200px) {
+    .custom-footer {
+        grid-template-columns: 7fr 1fr 3fr;
+    }
+}
+</style>

+ 1 - 0
components/cwg-page-wrapper.vue

@@ -27,6 +27,7 @@
         <view class="content-wrapper" :class="{ 'content-wrapper-padding': isContentPadding }">
           <!-- <cwg-header /> -->
           <slot />
+          <cwg-custom-footer />
         </view>
       </view>
       <view :style="{ height: isTabBarPage ? '60px' : '0px' }" />

+ 20 - 0
utils/dateUtils.js

@@ -0,0 +1,20 @@
+/**
+ * 检查当前时间是否在7月28号零点之后
+ * @returns {boolean} 如果在7月28号零点之后返回true,否则返回false
+ */
+export function isAfterJuly28() {
+  const now = new Date();
+  const july28 = new Date(2025, 6, 28, 0, 0, 0); // 月份从0开始,所以7月是6
+  
+  return now >= july28;
+}
+
+/**
+ * 检查当前时间是否在指定日期之后
+ * @param {Date} targetDate 目标日期
+ * @returns {boolean} 如果在目标日期之后返回true,否则返回false
+ */
+export function isAfterDate(targetDate) {
+  const now = new Date();
+  return now >= targetDate;
+} 

+ 26 - 0
utils/pdf.js

@@ -0,0 +1,26 @@
+// utils/pdf.js 或直接在组件 methods 中定义
+export function openLocalPdf(fileName) {
+  // #ifdef H5
+  // H5 端直接打开相对路径,会被浏览器渲染或下载(取决于浏览器配置)
+  window.open(`/static/${fileName}`);
+  // #endif
+
+  // #ifdef APP-PLUS
+  // App 端:将静态资源路径转为系统绝对路径,再用 uni.openDocument 调用系统阅读器打开
+  const localPath = `_www/static/${fileName}`;
+  const absolutePath = plus.io.convertLocalFileSystemURL(localPath);
+  uni.openDocument({
+    filePath: absolutePath,
+    success: () => {
+      console.log('PDF 打开成功');
+    },
+    fail: err => {
+      console.error('打开失败', err);
+      uni.showToast({
+        title: '无法打开文件,请检查文件是否存在',
+        icon: 'none'
+      });
+    }
+  });
+  // #endif
+}