Bläddra i källkod

feat: 活动,存款活动

ljc 9 timmar sedan
förälder
incheckning
63182e7632

+ 3 - 1
components/cwg-link.vue

@@ -42,6 +42,8 @@ const props = defineProps({
   },
   title: String,
   target: String,
+  // title是否直接展示不用多语言方法转义
+  isText: Boolean,
   // 下载文件名(下载时必填)
   downloadName: String
 })
@@ -50,7 +52,7 @@ const isDownload = props.type === 'download'
 const isHtml = props.type === 'html'
 const resolvedTitle = computed(() => {
   if (!props.title) return undefined
-  return t(props.title)
+  return props.isText?props.title : t(props.title)
 })
 
 const handleClick = () => {

+ 40 - 41
pages/activities/index.vue

@@ -47,22 +47,22 @@
                                             <view
                                                 :class="['btn btn-dark waves-effect waves-light', monthlyGiveParticipateEnabled ? 'btn-danger' : 'disabled']"
                                                 @click="openSurplusActivityDialog1()">
-                                                <text v-t="'DollarActivity.participate'"></text>
+                                                <text v-t="'news_add_field1.activities10_trading_aoyun.item3'"></text>
                                             </view>
-<!--                                            <cwg-link type="pdf" class="btn btn-outline-dark1 waves-effect waves-light"-->
-<!--                                                target="_blank" title="wallet.item15"-->
-<!--                                                :url="`pdf/pdf13/CWG Prime Bonus-cn.pdf`" />-->
-<!--                                            <cwg-link type="pdf" class="btn btn-outline-dark1 waves-effect waves-light"-->
-<!--                                                target="_blank" title="Transfer.item7"-->
-<!--                                                :url="`pdf/pdf13/CWG Markets Prime Bonus Application Process-cn.pdf`" />-->
+                                            <cwg-link type="pdf" class="btn btn-outline-dark1 waves-effect waves-light"
+                                                target="_blank" title="wallet.item15"
+                                                :url="`pdf/pdf13/CWG Prime Bonus-cn.pdf`" />
+                                            <cwg-link type="pdf" class="btn btn-outline-dark1 waves-effect waves-light"
+                                                target="_blank" title="Transfer.item7"
+                                                :url="`pdf/pdf13/CWG Markets Prime Bonus Application Process-cn.pdf`" />
                                             <view class="btn btn-outline-dark1 waves-effect waves-light"
                                                 @click="goMonthlyTaskList()">
                                                 <text v-t="'wallet.item14'"></text>
                                             </view>
-                                            <view class="btn btn-outline-dark1 waves-effect waves-light"
-                                                @click="goMonthlyGiveActivityDetail()">
-                                                <text v-t="'Custom.Activity.Single'"></text>
-                                            </view>
+<!--                                            <view class="btn btn-outline-dark1 waves-effect waves-light"-->
+<!--                                                @click="goMonthlyGiveActivityDetail()">-->
+<!--                                                <text v-t="'Custom.Activity.Single'"></text>-->
+<!--                                            </view>-->
                                         </view>
                                     </view>
                                 </view>
@@ -94,7 +94,8 @@
                                         <view class="time" v-if="surplusGiveActivityDate">{{surplusGiveActivityDate}}</view>
                                       </view>
                                       <p class="crm-one-font lh-sm " v-if="surplusGiveActivity.subTitle">
-                                        {{ surplusGiveActivity.subTitle }}</p>
+                                        {{ surplusGiveActivity.subTitle }}
+                                      </p>
                                       <view class="crm-one-font lh-sm dollar-activity-html" v-else-if="surplusGiveActivity.content" v-html="surplusGiveActivity.content">
                                       </view>
                                         <view class="d-flex flex-wrap gap-2">
@@ -103,7 +104,7 @@
                                                 @click="openSurplusActivityDialog()">
                                                 <text v-t="'news_add_field1.activities10_trading_aoyun.item3'"></text>
                                             </view>
-<!--                                            <cwg-link type="pdf" class="btn btn-outline-dark1 waves-effect waves-light"
+                                            <cwg-link type="pdf" class="btn btn-outline-dark1 waves-effect waves-light"
                                                 target="_blank" title="wallet.item15"
                                                 :url="`pdf/pdf12/CWG Prime Bonus-${locale}.pdf`" />
                                             <cwg-link type="pdf"
@@ -114,15 +115,15 @@
                                             <cwg-link type="pdf" v-else
                                                 class="btn btn-outline-dark1 waves-effect waves-light" target="_blank"
                                                 title="Transfer.item7"
-                                                :url="`pdf/pdf12/CWG Markets Prime Bonus Application Process-en.pdf`" />-->
+                                                :url="`pdf/pdf12/CWG Markets Prime Bonus Application Process-en.pdf`" />
                                             <view class="btn btn-outline-dark1 waves-effect waves-light"
                                                 @click="goSurplusTaskList()">
                                                 <text v-t="'wallet.item14'"></text>
                                             </view>
-                                          <view class="btn btn-outline-dark1 waves-effect waves-light"
-                                                @click="goSurplusGiveActivityDetail">
-                                            <text v-t="'Custom.Activity.Single'"></text>
-                                          </view>
+<!--                                          <view class="btn btn-outline-dark1 waves-effect waves-light"-->
+<!--                                                @click="goSurplusGiveActivityDetail">-->
+<!--                                            <text v-t="'Custom.Activity.Single'"></text>-->
+<!--                                          </view>-->
                                         </view>
                                     </view>
                                 </view>
@@ -130,8 +131,6 @@
                         </view>
                     </view>
 
-
-
                     <!-- 美金活动(/custom/activity/shows/info dollar) -->
                     <view class="col-12 m-b30" v-if="dollarActivity">
                         <view class="card card-action action-elevate action-border-primary">
@@ -1087,10 +1086,8 @@ const isEmpty = computed(()=>{
         !surplusGiveActivity.value &&
         !dollarActivity.value &&
         !tableDataNoWorriesFlag.value &&
-        !tableDataGive.value &&
-        !tableDataGive.value.length &&
-        !tableData.value &&
-        !tableData.value.length
+        !tableDataGive.value?.length &&
+        !tableData.value?.length
 })
 // ==================== 工具方法 ====================
 // 根据key获取活动数据
@@ -1274,7 +1271,7 @@ const searchFunc = async () => {
     } else {
         flag.value = true
     }
-    pictLoading.value = true
+    // pictLoading.value = true
     let res = await activityApi.ActivityExtensionIist({
         hot: hot.value,
         tag: 1,
@@ -1293,12 +1290,12 @@ const searchFunc = async () => {
         uni.showToast({ title: res.msg, icon: "none" })
         flag.value = false
     }
-    pictLoading.value = false
+    // pictLoading.value = false
 }
 
 //获取list-赠金活动列表
 const searchFunc1 = async () => {
-    pictLoading.value = true
+    // pictLoading.value = true
     let res = await activityApi.ActivityExtensionGiveList({
         page: {
             current: pagerInfo.current,
@@ -1312,7 +1309,7 @@ const searchFunc1 = async () => {
     } else {
         uni.showToast({ title: res.msg, icon: "none" })
     }
-    pictLoading.value = false
+    // pictLoading.value = false
 }
 
 //详情
@@ -2623,7 +2620,8 @@ watch(dialogSurplusActivity1, (newVal) => {
 })
 
 // ==================== 生命周期 ====================
-onMounted(() => {
+onMounted(async () => {
+    pictLoading.value = true
     getDateList()
     // 2025-07-31 00:00:00 之后关闭 standard
     const endTime = new Date("2025/07/31 00:00:00").getTime()
@@ -2635,21 +2633,22 @@ onMounted(() => {
         standard.value = false
     }
     is20Open()
-    searchFunc()
-    searchFunc1()
-    getActivityPercentageGiveInfo()
-    Activity23HundredInfo()
+    await searchFunc()
+    await searchFunc1()
+    await getActivityPercentageGiveInfo()
+    await Activity23HundredInfo()
     // Activity23JiangxinInfo()
-    Activity23JiangxinInfoVip()
-    Activity24nianzhongInfo()
-    Activity24nianzhongTwoInfo()
-    GetActivityCptCode()
-    Activity24JYBInfoVip()
-    ActivityNoWorriesInfo()
+    await Activity23JiangxinInfoVip()
+    await Activity24nianzhongInfo()
+    await Activity24nianzhongTwoInfo()
+    await GetActivityCptCode()
+    await Activity24JYBInfoVip()
+    await ActivityNoWorriesInfo()
     isRaffleOpen()
     isNewYear24Open()
-    ActivityRequiteInfo()
-    getActivityShowsInfo()
+    await ActivityRequiteInfo()
+    await getActivityShowsInfo()
+    pictLoading.value = false
 })
 
 onUnmounted(() => {

+ 64 - 11
pages/customer/deposit-select.vue

@@ -397,26 +397,31 @@
 
                                             <!-- 普通10%赠金(非年中、非特定账户) -->
                                             <uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24"
-                                                v-if="!tableData4Flag && !tableData4TwoFlag && !tableDataNewListFlag && (country != 'CN' || (country == 'CN' && (ACCType == 1 || ACCType == 2 || ACCType == 7 || ACCType == 5 || ACCType == 6 || ACCType == 8))) && ACCType != 3">
-                                                <template v-if="isSupportedCountry && (ACCType == 2 || ACCType == 7)">
+                                                v-if="depositGiveInfo.show == 1 && !tableData4Flag && !tableData4TwoFlag && !tableDataNewListFlag ">
                                                     <uni-forms-item class="agree" name="agree2">
                                                         <label>
                                                             <checkbox :checked="params.agree2"
                                                                 @click="params.agree2 = !params.agree2" />
-                                                            <text>{{ t('news_add_field1.deposit.item2_1') }}</text>
+                                                            <text>{{ depositGiveInfo.title }}</text>
                                                         </label>
                                                         <view style="line-height: 1.5; font-size: 14px">
-                                                            <text>{{ t('Custom.Deposit.agree21') }}</text>
-                                                            <cwg-link type="pdf" title="Custom.Deposit.agree22_2"
-                                                                :url="`pdf/pdf4/100Bonus-en.pdf`"
+                                                            <text style="margin-bottom: 15px;">{{ depositGiveInfo.subTitle }}</text>
+                                                          <cwg-link v-if="depositGiveInfo.filePath" type="pdf" isText :title="depositGiveInfo.filePath"
+                                                                    :url="depositGiveFilePath"
+                                                                    style="color: black" />
+                                                          <template v-if="isSupportedCountry && (ACCType == 2 || ACCType == 7)">
+                                                            <text>{{ bonusDepositT("Custom.Deposit.agree21") }}</text>
+                                                            <cwg-link type="pdf" isText :title="bonusDepositT('Custom.Deposit.agree22_2')"
+                                                                :url="`pdf/pdf4/100Bonus-${bonusActivityLang}.pdf`"
                                                                 style="color: black" />
-                                                            <text>{{ t('Custom.Deposit.agree23_2') }}</text>
+                                                            <text>{{ bonusDepositT("Custom.Deposit.agree23_2") }}</text>
+                                                          </template>
                                                         </view>
                                                     </uni-forms-item>
 
-                                                </template>
+
                                                 <template
-                                                    v-else-if="!isSupportedCountry && ACCType != 8 && !isAfterSeptember30()">
+                                                    v-if="!isSupportedCountry && ACCType != 8 && !isAfterSeptember30()">
                                                     <uni-forms-item class="agree" name="agree2">
                                                         <label>
                                                             <checkbox :checked="params.agree2"
@@ -494,7 +499,7 @@
 <script setup>
 import { ref, reactive, computed, watch, onMounted, nextTick } from 'vue'
 import { useI18n } from 'vue-i18n'
-const { t, locale } = useI18n()
+const { t, locale , message } = useI18n()
 import useUserStore from '@/stores/use-user-store'
 import { customApi } from '@/service/custom'
 import { financialApi } from '@/service/financial'
@@ -516,6 +521,10 @@ import CheckPopup from './components/CheckPopup.vue'
 import CwgCheckConfirmPopup from './components/DepositCheckConfirmPopup.vue'
 import VietnamNoticePopup from './components/VietnamNoticePopup.vue'
 import NewYear24Popup from './components/NewYear24Popup.vue'
+import {
+  getBonusActivityLang,
+  getCountryLocalizedMessage,
+} from "@/utils/bonusActivityLang";
 import useRouter from '@/hooks/useRouter'
 const router = useRouter()
 // 假设原有导入路径保持不变
@@ -597,6 +606,9 @@ const step3 = ref(false)
 const value = ref("")
 const giveLoginJoin = ref("")
 
+//入金10%/100%赠金活动
+const depositGiveInfo = ref({})
+
 const openType = ref("")
 const dialogInfoTradingAdd = ref(false)
 const ruleForm = reactive({
@@ -632,6 +644,7 @@ const tableData1 = reactive({
     Ucard_Wallet: []
 })
 //通道table-选择前后
+
 const activeTab = ref(1)
 // 🔥 自动过滤掉空数据的 tab
 const tabsConfig = computed(() => {
@@ -651,11 +664,33 @@ const tabsConfig = computed(() => {
 // 当前选中的 tab 项
 const currentTab = computed(() => tabsConfig.value.find(t => t.value === activeTab.value))
 
+const bonusActivityLang = computed(() => {
+  return getBonusActivityLang(country.value);
+})
+
 // 当前要渲染的表格数据
 const currentTableData = computed(() => {
     const type = currentTab.value?.type
     return type ? tableData[type] || [] : []
 })
+
+const depositGiveFilePath = computed(() => {
+  const filePath = depositGiveInfo.value && depositGiveInfo.value.filePath;
+  if (!filePath) {
+    return "";
+  }
+  const path = String(filePath);
+  if (/^https?:\/\//i.test(path)) {
+    return path;
+  }
+  return Host05.value + path;
+})
+
+const bonusDepositT = (path)=>{
+  return getCountryLocalizedMessage({
+    t,message:message.value
+  }, country.value, path);
+}
 // ✅ 监听 tab 变化,自动选中第一个有数据的 tab
 watch(
     tabsConfig,
@@ -1260,7 +1295,7 @@ const submitConfirm = async () => {
 }
 // 打开不参加活动弹窗
 const openDontActive = () => {
-    if (!tableData4Flag.value && !tableData4TwoFlag.value && !tableDataNewListFlag.value && (country.value != "CN" || (country.value == "CN" && (ACCType.value == 1 || ACCType.value == 2 || ACCType.value == 7))) && ACCType.value != 3 && params.agree2) {
+    if (depositGiveInfo.value.show == 1 && !tableData4Flag.value && !tableData4TwoFlag.value && !tableDataNewListFlag.value && params.agree2) {
         tosubmitConfirm()
         return
     }
@@ -1448,6 +1483,23 @@ const setCardUrl = (serial) => {
     let params = `${AccessToken.value["Access-Token"]}/${locale.value}/${serial}/1/pay`
     return initLink({ link: imgUrl.value + '/pay/paycard.html', params })
 }
+
+const getDepositGiveInfo = async (login) => {
+  params.agree2 = false;
+  try{
+    let res = await activityApi.ActivityDepositGiveInfo({
+      login,
+    });
+    if (res.code == Code.StatusOK) {
+      depositGiveInfo.value = res.data || {};
+    } else {
+      uni.showToast({ title:res.msg,icon:'none' });
+      depositGiveInfo.value = {};
+    }
+  }catch(error) {
+    uni.showToast({ title:error.msg,icon:'none' });
+  }
+}
 //处理申请返回result
 const dealResult = (data) => {
     DealResultType.value = data.type
@@ -1946,6 +1998,7 @@ watch(loginValue, (login) => {
     if (login) {
         step2.value = true
         getDepositList()
+        getDepositGiveInfo(login)
         loginOptions.value.forEach(item => {
             if (item.login == login) ACCType.value = item.type
         })

+ 2 - 0
service/activity.ts

@@ -19,6 +19,8 @@ export const activityApi = {
   ActivityComplete: (params = {}) => post('/custom/activity/apply/complete', params, 'Host80'),
   /** 20赠金活动 */
   ActivityPercentageGiveInfo: (params = {}) => post('/custom/activity/percentage/give/info', params, 'Host80'),
+  /** 入金10%/100%赠金活动信息 */
+  ActivityDepositGiveInfo: (params = {}) => post('/custom/activity/deposit/give/info', params, 'Host80'),
   /** 20赠金活动返现 */
   ActivityPercentageGiveApply: (params = {}) => post('/custom/activity/percentage/give/apply', params, 'Host80'),
   /** 2023迎新活动数据 */

+ 81 - 0
utils/bonusActivityLang.js

@@ -0,0 +1,81 @@
+const SPANISH_COUNTRIES = new Set([
+  "ES",
+  "AR",
+  "BO",
+  "CL",
+  "CO",
+  "CR",
+  "EC",
+  "SV",
+  "GT",
+  "HN",
+  "NI",
+  "PA",
+  "PY",
+  "PE",
+  "UY",
+  "VE",
+  "BZ",
+]);
+
+const ARABIC_COUNTRIES = new Set([
+  "DZ",
+  "BH",
+  "EG",
+  "IQ",
+  "JO",
+  "KW",
+  "LB",
+  "MR",
+  "MA",
+  "OM",
+  "PS",
+  "QA",
+  "SA",
+  "SD",
+  "SY",
+  "TN",
+  "AE",
+  "YE",
+  "DJ",
+  "SO",
+]);
+
+const CHINESE_COUNTRIES = new Set(["CN", "CNX", "CNA", "CNT"]);
+
+export function getBonusActivityLang(country) {
+  if (!country) {
+    return "en";
+  }
+  if (CHINESE_COUNTRIES.has(country)) {
+    return "cn";
+  }
+  if (SPANISH_COUNTRIES.has(country)) {
+    return "es";
+  }
+  if (ARABIC_COUNTRIES.has(country)) {
+    return "ar";
+  }
+  return "en";
+}
+
+function getI18nMessageByPath(messages, path) {
+  if (!messages || !path) {
+    return null;
+  }
+  return path.split(".").reduce((obj, key) => {
+    if (obj == null) {
+      return undefined;
+    }
+    return obj[key];
+  }, messages);
+}
+// i18n = {t,message} 合并传入 message要是useI18n的message.value
+export function getCountryLocalizedMessage(i18n, country, path) {
+  const locale = getBonusActivityLang(country);
+  const messages = i18n.messages;
+  const localized = getI18nMessageByPath(messages[locale], path);
+  console.log(localized, 'localized')
+  const t = i18n.t;
+  return localized || t(path);
+}

+ 1 - 1
utils/request.js

@@ -139,7 +139,7 @@ export const request = async (options) => {
 
   return new Promise((resolve, reject) => {
     const needLoading = urlLoading.some(item => config.url.includes(item));
-    console.log(needLoading,config.url)
+    // console.log(needLoading,config.url)
     if (!needLoading) {
       // uni.showLoading({
       //   mask:true