var content = { 'cn': { nav1: "关于CWG", nav2: "立即参赛", headers1: 'CWG交易之星', headers2: '(中国·新疆)特邀巅峰赛', headers3: '总奖池:', headers4: '美金', headers5: '报名截止:', headers6: '报名截止时间:', headers7: '比赛时间:', headers8: '*本次邀请赛的参赛者限定为中国新疆地区客户', headers9: '年', headers10: '月', headers11: '日', headers12: '时', headers13: '分', headers14: '秒', table1: '参加比赛并瓜分总奖金池', table2: '活跃参与者有机会参加每个交易日的每日幸运星抽奖活动', table3: '排名', table4: '账户昵称', table5: 'CWG账号', table6: '账户净值', table7: '最大回撤', table8: '盈利率', table9: '综合分', table10: '暂无数据', table11: '*排行版更新时间为每日平台时间(夏令时GMT+3,冬令时GMT+2)00:00', step1: '如何参赛', step2: '收到邀请的CWG真实客户登录CWG客户专区', step3: '在客户专区活动中心找到实盘特邀交易大赛活动入口', step4: '点击报名按钮选择参赛账户并填写完信息提交即为报名成功', footer1: '每日幸运星', footer2: 'CWG会在每个交易日从活跃参赛者中抽取一名幸运星,将得到CWG定制大赛礼盒一份。', footer3: '(*活跃参赛者即当日有任意交易或账户有持仓)', footer4: '*幸运星精品礼盒奖励将在10个工作日内按照您的报名地址寄出,如需更换地址,请在获奖后3个工作日内联系CWG官网在线客服进行处理。', }, 'en': { nav1: "About CWG", nav2: "Join Now", headers1: 'CWG Trading Star', headers2: '(China · Xinjiang) Invitational Championship', headers3: 'Total Prize Pool:', headers4: 'Dollars', headers5: 'Registration Deadline:', headers6: 'Countdown To The Competition:', headers7: 'Competition Time:', headers8: '*This event is an exclusive invitation for the CWG Xinjiang region in China. Participation is limited to CWG customers from the Xinjiang region in China.', headers9: 'Year', headers10: 'Month', headers11: 'Days', headers12: 'Hours', headers13: 'Minutes', headers14: 'Seconds', table1: 'Participate In The Competition & Divide The Total Bonus Pool', table2: 'Active participants have the opportunity to participate in the Daily Lucky Star Lucky Draw every trading day', table3: 'Rank', table4: 'Account Nickname', table5: 'CWG Account', table6: 'Account Equity', table7: 'Maximum Drawdown', table8: 'Profit Percentage', table9: 'Overall Score', table10: 'Not Data', table11: '*The update time of the ranking board is 00:00 daily platform time (daylight saving time GMT+3, winter time GMT+2)', step1: 'Three Simple Participation Techniques', step2: 'CWG real customers who have received an invitation should log in to the CWG Client Area.', step3: 'In the Client Area’s Activity Center, locate the entrance to the Real Account Invitational Trading Competition.', step4: 'Clicking the "Register" button confirms your successful registration.', footer1: 'Daily Lucky Stars', footer2: 'CWG will randomly select one lucky star from the pool of active participants on each trading day. The chosen lucky star will receive a specially curated CWG Championship Gift Box.', footer3: '(*Active participants are those who have engaged in any trading activity on that day or have open positions in their accounts.)', footer4: '(*Active participants are those who have engaged in any trading activity on that day or have open positions in their accounts.)', } } let vm = new Vue({ el: "#active1", data: { //多语言 langList: { en: "ENGLISH", cn: "中文简体" }, language: "en", lang: {}, flag: false, loading: false, mock_options: { time:'', list:[] }, // img_logo: logo, timer: 59, interval: null, getCodeString: "", notCountry:[ 'AF','AI','AG','BS','BY', 'BZ','BA','BI','CF','CD','CU', 'ET','FJ','PS','GN','GW','HT', 'IR','IQ','LB','LY','ML','MM', 'NI','KP','PW','RU','SO','SS', 'SD','SY','UA','US','VE','YE','ZW','MY' ], // 表单参数 params: { agentId: null, comPoint: null, sourceCode:null, subId: "", email: "", password: "", country: "", emailCode: "", phone: "", w: "", agree: false, }, clientWidth:'', pagerInfo: {row: 10, current: 1, pageTotal: 0, rowTotal: 0},//分页 pictLoading:false, // 验证规则 rules: { country: [ { validator: (rule, value, callback) => { if (value != "" && value != null) { callback(); } else { callback(new Error(content[sessionStorage.getItem('lang')].country)); } }, trigger: "blur", }, ], email: [ { validator: (rule, value, callback) => { if (/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(value)) { callback(); } else { callback(new Error(content[sessionStorage.getItem('lang')].email)); } }, trigger: "blur", }, ], emailCode: [ { validator: (rule, value, callback) => { if ( value != "" && value != null ) { callback(); } else { callback(new Error(content[sessionStorage.getItem('lang')].codeInput)); } }, trigger: "blur", }, ], password: [ { validator: (rule, value, callback) => { if (/^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?!.*([~!@&%$^\\(\\)#_]).*\\1.*\\1.*\\1)[A-Za-z0-9~!@&%$^\\(\\)#_]{8,16}$/.test(value)) { callback(); } else { callback(new Error(content[sessionStorage.getItem('lang')].password)); } }, trigger: "blur", }, ], agree: [ { validator: (rule, value, callback) => { if (value) { callback(); } else { callback(new Error(content[sessionStorage.getItem('lang')].agree)); } }, trigger: "change", }, ], phone: [ { validator: (rule, value, callback) => { if (/^[0-9]\d*$/.test(value)) { callback(); } else { callback(new Error(content[sessionStorage.getItem('lang')].phone)); } }, trigger: "blur", }, ], }, imgUrl: '', ho: '', isPc:null, centerDialogVisible:false, CompetitionData:{},//基础信息 rankingList:{},//排名列表 Countdown:{ d:'0', h:'0', m:'0', s:'0', }, CountdownFlag:true, infoCode: '', }, computed: { rule1: function () { if (!this.params.password) { return false; } return /^.{8,16}$/.test(this.params.password); }, rule2: function () { return /^(?=.*?[a-z])(?=.*?[A-Z]).*$/.test(this.params.password); }, rule3: function () { return /^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?!.*([~!@&%$^\\(\\)#_]).*\\1.*\\1)[A-Za-z0-9~!@&%$^\\(\\)#_]{8,16}$/.test( this.params.password ); }, }, methods: { // 语言切换函数 chooseLang(key) { this.lang = content[key]; this.language = key; sessionStorage.setItem("lang", this.language); location.reload(); }, //分页返回数据 handleSizeChange (val) { this.pagerInfo.row = val; this.searchFunc(); }, handleCurrentChange (val) { this.pagerInfo.current = val; this.searchFunc(); }, //获取当前国家编码 async getCountryMsg() { axios.get(this.imgUrl + '/country/get', { //参数 }).then(res => {//请求成功后的处理函数 if (res.data.code == 200) { if ((res.data.msg == "GB"||res.data.msg == "IE")&&res.data.data.indexOf('//195.224.141.218') == -1) { window.location.href = 'https://www.cwgmarkets.co.uk'; } else { document.getElementById("pre").style.display = 'none' } } else { document.getElementById("pre").style.display = 'none' this.$message.error(res.data.msg); } }).catch(err => {//请求失败后的处理函数 }) }, //获取列表数据 async searchFunc () { this.pictLoading = true; axios.post(this.imgUrl + '/follow/cpt/result/search/list', { "infoCode": this.infoCode, page: { current: this.pagerInfo.current, row: this.pagerInfo.row } //参数 }).then(res => {//请求成功后的处理函数 if (res.data.code == 200) { if (res.data.data && res.data.data.length) { this.mock_options.list = res.data.data; } if (res.data.page != null) { this.pagerInfo.rowTotal = res.data.page.rowTotal; this.pagerInfo.pageTotal = res.data.page.pageTotal; } else { this.pagerInfo.rowTotal = 0; } this.pictLoading = false; } else { this.$message.error(res.data.msg); this.pictLoading = false; } }).catch(err => {//请求失败后的处理函数 this.pictLoading = false; }) }, //获取基础数据 async searchCompetition () { this.pictLoading = true; axios.post(this.imgUrl + '/follow/cpt/info/front', { "infoCode": this.infoCode //参数 }).then(res => {//请求成功后的处理函数 if (res.data.code == 200) { this.CompetitionData = res.data.data; this.CompetitionData.startDate = res.data.data.startDate.split(' ')[0]; this.CompetitionData.endDate = res.data.data.endDate.split(' ')[0]; // this.CompetitionData.startDate = '2023-9-7' let that = this; let startTime = new Date(that.CompetitionData.signEndDate.replace(/-/g, '/')).getTime(); that.interval = setInterval(() => { let timezone = 3; //目标时区时间,东3区 东时区正数 西市区负数 let offset_GMT = new Date().getTimezoneOffset(); // 本地时间和格林威治的时间差,单位为分钟 let nowDate = new Date().getTime(); // 本地时间距 1970 年 1 月 1 日午夜(GMT 时间)之间的毫秒数 let nowTime = new Date(nowDate + offset_GMT * 60 * 1000 + timezone * 60 * 60 * 1000); let sec = 1000, min = 60 * sec, hour = min * 60, day = 24 * hour; let time = startTime - nowTime; if (time>0) { that.CountdownFlag = true; that.Countdown.d = that.getzero(Math.floor(time / day)); that.Countdown.h = that.getzero(Math.floor((time % day) / hour)); that.Countdown.m = that.getzero(Math.floor((time % hour) / min)); that.Countdown.s = that.getzero(Math.floor((time % min) / sec)); } else { that.CountdownFlag = false; this.CompetitionData.signStartDate = res.data.data.signStartDate.split(' ')[0]; this.CompetitionData.signEndDate = res.data.data.signEndDate.split(' ')[0]; } //时间归零,重新获取数据 if (nowTime >= startTime) { clearInterval(that.interval); } }, 1000); this.pictLoading = false; } else { this.$message.error(res.data.msg); this.pictLoading = false; } }).catch(err => {//请求失败后的处理函数 this.pictLoading = false; }) }, //时间补0 getzero(time){ return time > '9' ? time : '0' + time }, getQueryStringRegExp(name){ var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s|&|$)", "i"); if (reg.test(location.href)) return unescape(RegExp.$2.replace(/\+/g, " ")); return ""; }, }, watch:{ }, mounted() { this.ho = window.location.host.split('.')[1]; this.imgUrl = window.location.origin; this.infoCode = this.getQueryStringRegExp('code') // this.imgUrl = 'https://secure.cwgchinese.com/'; this.getCountryMsg() if (sessionStorage.getItem("lang")) { this.language = sessionStorage.getItem("lang"), this.lang = content[sessionStorage.getItem("lang")]; } else { var jsSrc =(navigator.language || navigator.browserLanguage).toLowerCase(); if(jsSrc.indexOf('zh') >= 0){ this.language = 'cn' this.lang = content['cn']; }else{ this.language = 'en' this.lang = content['en']; } sessionStorage.setItem("lang", this.language); } this.searchFunc();//获取列表数据 this.searchCompetition(); }, destroyed() { clearInterval(this.interval); }, });