zhb 2 ヶ月 前
コミット
257e211317

+ 7 - 7
components/cwg-custom-footer.vue

@@ -7,10 +7,10 @@
                 <view class="desc-text" v-t="'newSignin.item11'" />
                 <view class="desc-text">
                     <text v-t="'newSignin.item13'" />
-                    <a :href="'https://www.' +
+                    <cwg-link type="pdf1" :title="'newSignin.item13_1'" :url="'https://www.' +
                         ho +
                         '.com/doc/Risk-Disclosures-and-Acknowledgements-2020-08.pdf'
-                        " target="_blank" v-t="'newSignin.item13_1'" class="desc-link" />
+                        " target="_blank" class="desc-link" />
                     <text class="desc-text" v-t="'newSignin.item13_2'" />
                 </view>
                 <text class="desc-text" v-t="'newSignin.item13_3'" />
@@ -19,8 +19,8 @@
         </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)"
-                v-t="item.text" />
+            <cwg-link type="pdf" :title="item.text" :url="item.url" target="_blank" v-for="(item, index) in linkList"
+                :key="index" class="link-item" />
             <!-- <view class="copyright">© 2008 - 2026. Exness</view> -->
         </view>
     </view>
@@ -34,9 +34,9 @@ const linkList = [
     { text: 'signup.agreemnet6', url: 'pdf/Privacy_Policy.pdf' },
     { text: 'news_add_field.OpenAccount.Des2', url: 'pdf/PrivacyPolicy2019_01.pdf' }
 ]
-const openLink = ({url, text}) => {
-    openLocalPdf(url, text)
-}
+// const openLink = ({ url, text }) => {
+//     openLocalPdf(url, text)
+// }
 </script>
 
 <style lang="scss" scoped>

+ 41 - 0
components/cwg-link.vue

@@ -0,0 +1,41 @@
+<template>
+    <view class="pdf-link" @click="handleClick">
+        <slot v-if="slots['default']"></slot>
+        <view v-else >{{ t(title) || title }}</view>
+    </view>
+</template>
+
+<script setup>
+import { useSlots } from 'vue'
+import { openLocalPdf } from '@/utils/pdf'
+import { openExternalUrl } from '@/utils/openExternalUrl'
+import { useI18n } from 'vue-i18n'
+const { t } = useI18n()
+
+const props = defineProps({
+    url: String,
+    type: {
+        type: String,
+        default: 'pdf'
+    },
+    title: String,
+    target: String
+})
+const slots = useSlots()
+
+const handleClick = () => {
+    if (!props.url) return
+    if (props.type == 'pdf' || props.type == 'pdf1') {
+        openLocalPdf(props.url, props.title, props.type)
+    } else if (props.type === 'html') {
+        openExternalUrl(props.url)
+    }
+}
+</script>
+
+<style scoped>
+.pdf-link {
+    display: inline-block;
+    cursor: pointer;
+}
+</style>

+ 9 - 9
pages/activities/content.vue

@@ -327,12 +327,12 @@
                       color: #3490CE;
                       text-align: center;
                       margin: 20px 0;">
-                                <a class="crm-cursor" style="font-size: 16px;
+                                <cwg-link type="html" title="news_add_field1.activitiesJX.item22" class="crm-cursor"
+                                    style="font-size: 16px;
                       font-weight: bold;
                       color: #3490CE;
                       text-align: center;
-                      margin: 20px 0;" :href="imgUrl + '/activity/jiangx/index.html'" target="_blank"
-                                    v-t="'news_add_field1.activitiesJX.item22'"></a>
+                      margin: 20px 0;" :url="imgUrl + '/activity/jiangx/index.html'" target="_blank" />
                             </view>
                             <view style="font-size: 14px;" v-t="'news_add_field1.activitiesJX.item23'" />
                         </view>
@@ -369,12 +369,12 @@
                       color: #3490CE;
                       text-align: center;
                       margin: 20px 0;">
-                                <a class="crm-cursor" style="font-size: 16px;
+                                <cwg-link type="html" title="news_add_field1.activitiesJX.item22" class="crm-cursor"
+                                    style="font-size: 16px;
                       font-weight: bold;
                       color: #3490CE;
                       text-align: center;
-                      margin: 20px 0;" :href="imgUrl + '/activity/jiangx/indexVip.html'" target="_blank"
-                                    v-t="'news_add_field1.activitiesJX.item22'"></a>
+                      margin: 20px 0;" :url="imgUrl + '/activity/jiangx/indexVip.html'" target="_blank" />
                             </view>
                             <view style="font-size: 14px;" v-t="'news_add_field1.activitiesJX.item23'" />
                         </view>
@@ -416,12 +416,12 @@
                       color: #3490CE;
                       text-align: center;
                       margin: 20px 0;">
-                                <a class="crm-cursor" style="font-size: 16px;
+                                <cwg-link type="html" title="news_add_field1.activitiesJYB.item22" class="crm-cursor"
+                                    style="font-size: 16px;
                       font-weight: bold;
                       color: #3490CE;
                       text-align: center;
-                      margin: 20px 0;" :href="imgUrl + '/activity/jiangx/indexJYB.html'" target="_blank"
-                                    v-t="'news_add_field1.activitiesJYB.item22'"></a>
+                      margin: 20px 0;" :url="imgUrl + '/activity/jiangx/indexJYB.html'" target="_blank" />
                             </view>
                             <view style="font-size: 14px;" v-t="'news_add_field1.activitiesJYB.item23'" />
                         </view>

+ 6 - 9
pages/activities/detail.vue

@@ -328,12 +328,11 @@
                       color: #3490CE;
                       text-align: center;
                       margin: 20px 0;">
-                                <a class="crm-cursor" style="font-size: 16px;
+                                <cwg-link type="html" title="news_add_field1.activitiesJX.item22" class="crm-cursor" style="font-size: 16px;
                       font-weight: bold;
                       color: #3490CE;
                       text-align: center;
-                      margin: 20px 0;" :href="imgUrl + '/activity/jiangx/index.html'" target="_blank"
-                                    v-t="'news_add_field1.activitiesJX.item22'"></a>
+                      margin: 20px 0;" :url="imgUrl + '/activity/jiangx/index.html'" target="_blank" />
                             </view>
                             <view style="font-size: 14px;" v-t="'news_add_field1.activitiesJX.item23'" />
                         </view>
@@ -370,12 +369,11 @@
                       color: #3490CE;
                       text-align: center;
                       margin: 20px 0;">
-                                <a class="crm-cursor" style="font-size: 16px;
+                                <cwg-link type="html" title="news_add_field1.activitiesJX.item22" class="crm-cursor" style="font-size: 16px;
                       font-weight: bold;
                       color: #3490CE;
                       text-align: center;
-                      margin: 20px 0;" :href="imgUrl + '/activity/jiangx/indexVip.html'" target="_blank"
-                                    v-t="'news_add_field1.activitiesJX.item22'"></a>
+                      margin: 20px 0;" :url="imgUrl + '/activity/jiangx/indexVip.html'" target="_blank" />
                             </view>
                             <view style="font-size: 14px;" v-t="'news_add_field1.activitiesJX.item23'" />
                         </view>
@@ -417,12 +415,11 @@
                       color: #3490CE;
                       text-align: center;
                       margin: 20px 0;">
-                                <a class="crm-cursor" style="font-size: 16px;
+                                <cwg-link type="html" title="news_add_field1.activitiesJYB.item22" class="crm-cursor" style="font-size: 16px;
                       font-weight: bold;
                       color: #3490CE;
                       text-align: center;
-                      margin: 20px 0;" :href="imgUrl + '/activity/jiangx/indexJYB.html'" target="_blank"
-                                    v-t="'news_add_field1.activitiesJYB.item22'"></a>
+                      margin: 20px 0;" :url="imgUrl + '/activity/jiangx/indexJYB.html'" target="_blank" />
                             </view>
                             <view style="font-size: 14px;" v-t="'news_add_field1.activitiesJYB.item23'" />
                         </view>

+ 1 - 1
pages/analytics/detail.vue

@@ -58,7 +58,7 @@
                             <rich-text :nodes="info.content" />
                         </view>
                         <view class="news-status">
-                            <a :href="imgUrl + info.bookUrl" target="_blank" v-t="'blockchain.item12'"></a>
+                            <cwg-link type="html" title="blockchain.item12" :url="imgUrl + info.bookUrl" target="_blank" />
                         </view>
                     </view>
                 </view>

+ 30 - 26
pages/common/download.vue

@@ -11,7 +11,7 @@
                             <view class="section-subtitle" v-t="'Downloadpage.item3'" />
                         </view>
                         <view class="download-cards">
-                            <a class="download-card" :href="myLink + '/mt/cwgmarketssvgltd4setup.exe'"
+                            <cwg-link type="html" class="download-card" :url="myLink + '/mt/cwgmarketssvgltd4setup.exe'"
                                 download="cwgmarketssvgltd4setup.exe">
                                 <image class="card-icon" src="/static/images/windows-os-1-48.png" alt=""
                                     mode="widthFix" />
@@ -20,8 +20,9 @@
                                     <view class="card-desc" v-t="'Downloadpage.item5'" />
                                 </view>
                                 <view class="download-badge">Windows</view>
-                            </a>
-                            <a class="download-card" :href="myLink + '/mt/mt4.zip'" download="mt4.zip">
+                            </cwg-link>
+                            <cwg-link type="html" class="download-card" :url="myLink + '/mt/mt4.zip'"
+                                download="mt4.zip">
                                 <image class="card-icon" src="/static/images/windows-os-1-48.png" alt=""
                                     mode="widthFix" />
                                 <view class="card-info">
@@ -29,8 +30,9 @@
                                     <view class="card-desc" v-t="'Downloadpage.item5'" />
                                 </view>
                                 <view class="download-badge">ZIP</view>
-                            </a>
-                            <a class="download-card" :href="myLink + '/mt/MetaTrader4.pkg'" download="MetaTrader4.pkg">
+                            </cwg-link>
+                            <cwg-link type="html" class="download-card" :url="myLink + '/mt/MetaTrader4.pkg'"
+                                download="MetaTrader4.pkg">
                                 <image class="card-icon" src="/static/images/apple-os-1-48.png" alt=""
                                     mode="widthFix" />
                                 <view class="card-info">
@@ -38,7 +40,7 @@
                                     <view class="card-desc" v-t="'Downloadpage.item5'" />
                                 </view>
                                 <view class="download-badge download-badge-apple">macOS</view>
-                            </a>
+                            </cwg-link>
                         </view>
                     </view>
                     <view class="download-section web-section">
@@ -46,13 +48,13 @@
                             <view class="section-title" v-t="'Downloadpage.item38'" />
                         </view>
                         <view class="download-cards">
-                            <a class="download-card download-card-web" target="_blank"
-                                :href="'https://www.' + link + '.com/' + getLang(lang) + '/mt4/web'">
+                            <cwg-link type="html" class="download-card download-card-web" target="_blank"
+                                :url="'https://www.' + link + '.com/' + getLang(lang) + '/mt4/web'">
                                 <view class="card-info">
                                     <view class="card-title" v-t="'Downloadpage.item40'" />
                                 </view>
                                 <text class="icon-arrow">→</text>
-                            </a>
+                            </cwg-link>
                         </view>
                     </view>
                     <view class="download-section mobile-section">
@@ -107,7 +109,7 @@
                             <view class="section-subtitle" v-t="'Downloadpage.item12'" />
                         </view>
                         <view class="download-cards">
-                            <a class="download-card" :href="myLink + '/mt/cwgmarketssvg5setup.exe'"
+                            <cwg-link type="html" class="download-card" :url="myLink + '/mt/cwgmarketssvg5setup.exe'"
                                 download="cwgmarketssvg5setup.exe">
                                 <image class="card-icon" src="/static/images/windows-os-1-48.png" alt=""
                                     mode="widthFix" />
@@ -116,8 +118,9 @@
                                     <view class="card-desc" v-t="'Downloadpage.item5'" />
                                 </view>
                                 <view class="download-badge">Windows</view>
-                            </a>
-                            <a class="download-card" :href="myLink + '/mt/mt5.zip'" download="mt5.zip">
+                            </cwg-link>
+                            <cwg-link type="html" class="download-card" :url="myLink + '/mt/mt5.zip'"
+                                download="mt5.zip">
                                 <image class="card-icon" src="/static/images/windows-os-1-48.png" alt=""
                                     mode="widthFix" />
                                 <view class="card-info">
@@ -125,8 +128,9 @@
                                     <view class="card-desc" v-t="'Downloadpage.item5'" />
                                 </view>
                                 <view class="download-badge">ZIP</view>
-                            </a>
-                            <a class="download-card" :href="myLink + '/mt/MetaTrader5.pkg'" download="MetaTrader5.dmg">
+                            </cwg-link>
+                            <cwg-link type="html" class="download-card" :url="myLink + '/mt/MetaTrader5.pkg'"
+                                download="MetaTrader5.dmg">
                                 <image class="card-icon" src="/static/images/apple-os-1-48.png" alt=""
                                     mode="widthFix" />
                                 <view class="card-info">
@@ -134,7 +138,7 @@
                                     <view class="card-desc" v-t="'Downloadpage.item5'" />
                                 </view>
                                 <view class="download-badge download-badge-apple">macOS</view>
-                            </a>
+                            </cwg-link>
                         </view>
                     </view>
                     <view class="download-section web-section">
@@ -142,13 +146,13 @@
                             <view class="section-title" v-t="'Downloadpage.item39'" />
                         </view>
                         <view class="download-cards">
-                            <a class="download-card download-card-web" target="_blank"
-                                :href="'https://www.' + link + '.com/' + getLang(lang) + '/mt5/web'">
+                            <cwg-link type="html" class="download-card download-card-web" target="_blank"
+                                :url="'https://www.' + link + '.com/' + getLang(lang) + '/mt5/web'">
                                 <view class="card-info">
                                     <view class="card-title" v-t="'Downloadpage.item40'" />
                                 </view>
                                 <text class="icon-arrow">→</text>
-                            </a>
+                            </cwg-link>
                         </view>
                     </view>
                     <view class="download-section mobile-section">
@@ -202,22 +206,22 @@
                             <view class="banner-subtitle" v-t="'Downloadpage.item19'" />
                         </view>
                         <view class="banner-buttons">
-                            <a class="banner-btn" style="padding: 10px 25px;min-width: 220px;"
-                                href="https://mt.tradingcentral.cn/download"
+                            <cwg-link type="html" class="banner-btn" style="padding: 10px 25px;min-width: 220px;"
+                                url="https://mt.tradingcentral.cn/download"
                                 v-if="['cn', 'zhHant'].indexOf(Session.Get('lang')) != -1">
                                 <view v-t="'Downloadpage.item20'" />
                                 <view class="btn-tag">中国大陆用户</view>
-                            </a>
-                            <a class="banner-btn" style="padding: 10px 25px;min-width: 220px;"
-                                href="https://mt.tradingcentral.com/download"
+                            </cwg-link>
+                            <cwg-link type="html" class="banner-btn" style="padding: 10px 25px;min-width: 220px;"
+                                url="https://mt.tradingcentral.com/download"
                                 v-if="['cn', 'zhHant'].indexOf(Session.Get('lang')) != -1">
                                 <view v-t="'Downloadpage.item20'" />
                                 <view class="btn-tag">港澳台地区及海外用户</view>
-                            </a>
-                            <a class="banner-btn" href="https://mt.tradingcentral.com/download"
+                            </cwg-link>
+                            <cwg-link type="html" class="banner-btn" url="https://mt.tradingcentral.com/download"
                                 v-if="['cn', 'zhHant'].indexOf(Session.Get('lang')) == -1">
                                 <span v-t="'Downloadpage.item20'"></span>
-                            </a>
+                            </cwg-link>
                         </view>
                     </view>
                     <view class="features-grid">

+ 2 - 2
pages/customer/account-select.vue

@@ -77,8 +77,8 @@
         <view class="terms-section">
             <text v-t="'news_add_field.OpenAccount.Des1'"></text>
             <text class="pdfLink">
-                <a href="/static/pdf/PrivacyPolicy2019_01.pdf" target="_blank"
-                    v-t="'news_add_field.OpenAccount.Des2'"></a>
+                <cwg-link type="pdf" title="news_add_field.OpenAccount.Des2" url="pdf/PrivacyPolicy2019_01.pdf"
+                    target="_blank" />
             </text>
         </view>
 

+ 2 - 2
pages/customer/create-account.vue

@@ -85,8 +85,8 @@
                     <view class="info-value">{{ currentAccount?.maxLeverage || '--' }}</view>
                 </view>
                 <view class="info-row">
-                    <view class="info-value"><a href="/static/pdf/PrivacyPolicy2019_01.pdf" target="_blank"
-                            v-t="'news_add_field.OpenAccount.Des2'"></a></view>
+                    <view class="info-value"><cwg-link type="pdf" title="news_add_field.OpenAccount.Des2"
+                            url="pdf/PrivacyPolicy2019_01.pdf" target="_blank" /></view>
                 </view>
             </view>
         </view>

+ 4 - 7
pages/customer/deposit.vue

@@ -339,9 +339,8 @@
                                                     </label>
                                                     <view style="line-height: 1.5; font-size: 14px">
                                                         <text>{{ t('Custom.Deposit.agree21') }}</text>
-                                                        <a :href="`/static/pdf/pdf4/100Bonus-en.pdf`"
-                                                            style="color: black">{{
-                                                                t('Custom.Deposit.agree22_2') }}</a>
+                                                        <cwg-link type="pdf" title="Custom.Deposit.agree22_2"
+                                                            :url="`pdf/pdf4/100Bonus-en.pdf`" style="color: black" />
                                                         <text>{{ t('Custom.Deposit.agree23_2') }}</text>
                                                     </view>
                                                 </uni-forms-item>
@@ -357,10 +356,8 @@
                                                     </label>
                                                     <view style="line-height: 1.5; font-size: 14px">
                                                         <text>{{ t('Custom.Deposit.agree21') }}</text>
-                                                        <a :href="`/static/pdf/pdf4/${langCN}.pdf`"
-                                                            style="color: black">{{
-                                                                t('Custom.Deposit.agree22')
-                                                            }}</a>
+                                                        <cwg-link type="pdf" title="Custom.Deposit.agree22"
+                                                            :url="`pdf/pdf4/${langCN}.pdf`" style="color: black" />
                                                         <text>{{ t('Custom.Deposit.agree23_1') }}</text>
                                                     </view>
                                                 </uni-forms-item>

+ 2 - 1
pages/customer/withdrawal.vue

@@ -112,7 +112,8 @@
                     <uni-forms-item :label="t('blockchain.item5')">
                       <view class="proof">
                         <template v-if="form.addressProve && (form.addressProve.slice(-3).toLowerCase() === 'pdf')">
-                          <a :href="imgUrl + form.addressProve" target="_blank" class="state crm_state_blue">PDF</a>
+                          <cwg-link type="pdf1"
+                            :url="imgUrl + form.addressProve" target="_blank" class="state crm_state_blue">PDF</cwg-link>
                         </template>
                         <image v-else :src="imgUrl + form.addressProve" mode="aspectFit"
                           style="width: 100rpx; height: 100rpx;" @click="previewImage(imgUrl + form.addressProve)" />

+ 5 - 10
pages/ib/components/documentaryDialog.vue

@@ -23,16 +23,11 @@
             <label class="checkbox">
               <checkbox value="1" />
               <view style="display: inline">
-                <text class="crm-cursor" >{{t('Documentary.AgentBackground.item3') }}</text>
-                <a v-if="['cn', 'zhHant'].indexOf(lang) != -1" style="color: #4497ff" href="pdf/CopyTradeUserAgreementcn.pdf" target="_blank" >{{t('Documentary.AgentBackground.item4')}}</a>
-                <a
-                  style="color: #4497ff"
-                  href="pdf/CopyTradeUserAgreement.pdf"
-                  target="_blank"
-                  v-else
-                >
-                  {{t('Documentary.AgentBackground.item4')}}
-                </a>
+                <text class="crm-cursor">{{ t('Documentary.AgentBackground.item3') }}</text>
+                <cwg-link type="pdf" title="Documentary.AgentBackground.item4" v-if="['cn', 'zhHant'].indexOf(lang) != -1"
+                  style="color: #4497ff" url="pdf/CopyTradeUserAgreementcn.paf"
+                  target="_blank" />
+                <cwg-link style="color: #4497ff" title="Documentary.AgentBackground.item4" url="pdf/CopyTradeUserAgreement.pdf" target="_blank" v-else />
               </view>
             </label>
           </checkbox-group>

+ 4 - 3
pages/ib/withdraw.vue

@@ -114,12 +114,13 @@
                                     v-if="channelData.type == 'DIGITAL_CURRENCY' && isStep3 && form.addressProve">
                                     <uni-forms-item :label="t('blockchain.item5')">
                                         <div style="height: 100%; width: 100%" v-if="form.addressProve">
-                                            <a v-if="form.addressProve && (form.addressProve.slice(-3).toLowerCase() === 'pdf')"
-                                                :href="imgUrl + form.addressProve" target="_blank"
+                                            <cwg-link type="pdf1" 
+                                                v-if="form.addressProve && (form.addressProve.slice(-3).toLowerCase() === 'pdf')"
+                                                :url="imgUrl + form.addressProve" target="_blank"
                                                 style="text-decoration: none; min-width: auto; width: auto; color: #ffffff; padding: 5px 10px;"
                                                 class="state crm_state_blue">
                                                 PDF
-                                            </a>
+                                            </cwg-link>
                                             <image v-else style="width: 50px; height: 50px"
                                                 :src="imgUrl + form.addressProve" mode="aspectFill"
                                                 @click="previewImage(imgUrl + form.addressProve)" />