var content = {
'cn': {
headers1: '登陆',
headers2: '在线客服',
headers3: '创建账户',
box1item1: '无需入金直接领取您的$100美金迎新礼,活动期内优质信号源跟单费用全免,盈利可提取,即刻开启CWG交易之旅。',
box1item2: '',
box1item3: '*活动受条款约束。请在我们的网站上查看优惠活动详情。',
box1item3_1: '丰富交易品种可选',
box1item3_2: '1000:1超高杠杆',
box1item3_3: '真仓账户交易体验',
box1item3_4: '免费使用跟单社区',
box1item3_5: '盈利可提取',
box1item3_6: '仅对新客户适用',
box1item4: '注册!',
box1item5: '国家地区',
box1item6: '联系电话',
box1item7: '电子邮箱',
box1item8: '邮箱验证码',
box1item9: '设置密码',
box1item10: '本人声明并确认本人并非美国公民或居民。',
box1item11: '立即领取',
box2_1: '如何领取迎新赠金',
box2item1: '页面上方输入信息立即开立“活动账户”领取迎新礼金',
box2item2: '无需入金,直接使用$100迎新礼金开始交易',
box2item3: '回客户专区结束活动提现盈利',
box2item4: '*具体流程条款请至登录客户-活动中心专区查看',
box3: 'CWG迎新礼金 VS 其他平台礼金活动 ',
box3item1: '各种优质信号源免费跟随,盈利有保障',
box3item2: '仅可自主交易',
box3item3: '$100美金真实交易资金',
box3item4: '$30-$50美金 交易体验不足',
box3item5: '1000:1超高交易杠杆',
box3item6: '交易杠杆低,手数难以完成',
box3item7: '盈利可提取',
box3item8: '盈利不可提取',
box4: '',
box4item1_1: '谁可以申请$100美金迎新礼金账户,如何申请?',
box4item1_2: '该活动仅限新用户(未在CWG注册过任何交易账户的客户)参加,在“客户专区”开立极速账户(MT4)并订阅CWG跟单社区后进入“客户专区 – 活动中心”点击“申请”,即可获取您的$100迎新礼金,每位新用户仅限参加一次,请勿重复申请其它CWG账户,否则将影响赠金申领。',
box4item2_1: '迎新礼金活动交易期为多久,可以调节杠杆么?',
box4item2_2: '迎新礼金活动交易期为$100迎新礼金到账后7天内。',
box4item2_3: '活动交易期间外汇杠杆为1:1000,黄金杠杆为 1:400,白银杠杆为 1:200;杠杆不可调节。',
box4item3_1: '如何进入CWG跟单社区订阅信号源?如果订阅后我想自主交易可以取消么?',
box4item3_2: '跟单社区的订阅方法可参看 <如何使用CWG跟单社区> ,订阅成功后',
box4item3_3: '账户即进入自动跟单模式。礼金下发成功后,如您还需要自动交易,可参考上记教程取消订阅。',
box4item4_1: '活动期内完成两标准手之后如何提现?',
box4item4_2: '交易期内完成2标准手(手数计算仅限外汇、黄金和白银)即可在“客户专区 – 活动中心”选择“盈利转化”申请获取盈利(最高100美金),审核将在1个工作日内完成,审核通过后开通入金通道入金通道开启后,需在30天内向该账户存入任意资金并完成最少0.1标准手(手数计算仅限外汇、黄金和白银)交易后在活动中心点击”盈利变现”,即可将活动期内获取的盈利(信用额)转至余额,可用于继续交易或提现。',
box5_1: '选择享誉全球的CWG Markets ',
box5_2: '与超',
box5_3: '135个国家',
box5_4: '的用户一起开启全新交易体验',
box5item11: '双重严格资金监管',
box5item12: '国际权威资金监管,客户资金隔离存放',
box5item13: '极致交易体验',
box5item14: '500+交易产品,1000:1最高杠杆,领先的交易平台',
box5item15: '价格和执行优势',
box5item16: '提供极具竞争力且稳定、透明的低点差、隔夜利息和出色的交易执行力',
box5item17: '专业的教育和分析',
box5item18: '专业的每日分析,智能的AI交易策略,财经日历一手信息',
box5item19: '优质的客户服务',
box5item20: '24/5专业客服人员,一对一市场策略师',
box6_1: '选择享誉全球的CWG Markets ',
box6_2: '与超',
box6_3: '150个国家',
box6_4: '的用户一起开启全新交易体验',
box6item3: '立即领取',
box8: '丰富的出入金通道',
box9: 'CWG载誉而行',
box9item11: '年度最佳MT4 & MT5经纪商',
box9item12: '2022',
box9item13: 'fxdailyinfo.com',
box9item21: '年度最佳交易环境经纪商',
box9item22: '2022',
box9item23: 'fxdailyinfo.com',
box9item31: '最值得信赖经纪商',
box9item32: '2022',
box9item33: 'fxdailyinfo.com',
box9item41: '英国最佳交易平台',
box9item42: '2022',
box9item43: 'Global Banking & Finance Review Award',
box9item51: '英国最佳大宗商品经纪商',
box9item52: '2022',
box9item53: 'Global Banking & Finance Review Award',
box9item61: '英国最佳多资产交易平台',
box9item62: '2021',
box9item63: 'Global Banking & Finance Review Award',
box9item71: '英国最佳交易平台',
box9item72: '2021',
box9item73: 'Global Banking & Finance Review Award',
box9item81: '培训卓越服务奖',
box9item82: '2021',
box9item83: '第七届金融分析大会',
box9item91: '年度交易商人气平台',
box9item92: '2021',
box9item93: '汇友网',
box9item101: '年度最具影响力经纪商',
box9item102: '2020',
box9item103: '第二届金融科技大会',
box9item111: '最具创新MT5经纪商',
box9item112: '2019',
box9item113: '西贡交易博览',
box9item121: '最佳交易环境经纪商',
box9item122: '2019',
box9item123: '汇通财经',
box7item1: 'CWG Markets是CWG集团的商标。',
box7item2: 'Cwgvu.com由CWG集团所有并运营。CWG集团包括:',
box7item3: 'CWG Markets Ltd(UK),在英格兰和威尔士注册,公司编号为08888720。该公司是一家730K投资公司,由英国金融行为监管局(FCA)完全授权和监管,公司监管编号 FRN 785129 。',
box7item4: 'CWG Markets Ltd(VU),是一家证券及金融衍生品交易商,接受瓦努阿图金融服务委员会(VFSC)监管,监管编号为41694,获得授权从事证券交易业务。',
box7item5: '客户必须年满18周岁才能使用CWG Markets的服务。',
box7item6: '外汇和杠杆化金融产品是复杂的工具,并且由于杠杆而有快速亏损的风险。您应该考虑是否了解差价合约是如何运作的,以及您是否有能力承担损失资金的风险。您应该了解与差价合约(CFD)相关的所有风险,如果您有任何疑问,请寻求独立顾问的建议。请仔细阅读我们的',
box7item7: '风险披露',
box7item8: '。',
box7item9: '受限地区: CWG Markets Ltd无法为特定国家/地区提供服务,例如:美国,以色列和伊朗。如果此类分发或使用违反当地法律或法规,则本网站上的信息不是分发或用于此类国家或地区的任何人。',
box7item10: '本网站使用cookies为您提供最佳体验并更好地了解您。通过访问我们的网站并将您的浏览器设置为允许cookie,即表示您同意我们使用我们的隐私政策中所述的cookie。',
box7item11: '© 2020 CWG MARKETS',
box7item12: 'cookies政策',
box7item13: '和',
box7item14: ' 隐私政策',
box7item15: '.',
code: '获取验证码',
country: "请选择您所在国家",
email: "邮箱格式错误",
phone: "电话格式错误",
password: "使用8到15个字符,同时使用大写和小写字母,使用数字和英文字母的组合",
codeInput: "请输入验证码",
agree: "请同意声明",
CodeSuccess: "验证码获取成功",
emailempty: "邮箱不能为空",
waitCode1: "等待 ",
waitCode2: "s ",
registerSuc: "注册成功,正在登录...",
SystemError: "系统错误,请稍后再试。",
LoginSuccess: "登录成功,马上进入系统。",
st1: "使用8到15个字符",
nd2: "同时使用大写和小写字母",
rd3: "使用数字和英文字母的组合"
},
'en': {
headers1: 'Login',
headers2: 'Live Chat',
headers3: 'Create Account',
box1item1: 'Receive your free $100 Welcome bonus. During the promotion period; you can access our free copy trade system where you can receive free high quality trading signals. Start your CWG trading journey now',
box1item2: '',
box1item3: '*活动受条款约束。请在我们的网站上查看优惠活动详情。',
box1item3_1: 'Various trading instruments available',
box1item3_2: '1000:1 ultra high leverage',
box1item3_3: 'Live open position account trading',
box1item3_4: 'Free use of the Copy Trade Community',
box1item3_5: 'Profits can be withdrawn',
box1item3_6: 'Only available to new clients',
box1item4: 'Signup!',
box1item5: 'Country',
box1item6: 'Phone',
box1item7: 'Email',
box1item8: 'Email Varification Code',
box1item9: 'Password',
box1item10: 'I declared and confirmed that I am not a citizen or resident of the United States.',
box1item11: 'Submit',
box2_1: 'How to get $100 welcome bonus?',
box2item1: 'Fill in the information at the top of the page and then select open a “Welcome Account” to get the welcome bonus',
box2item2: 'Use the $100 welcome bonus to start trading directly.',
box2item3: 'Return back to the Clients Zone to end the promotion',
box2item4: '*Please log into the Client Zone- Promotion Center for specific step terms',
box3: 'CWG Welcome Bonus VS. Other platform Bonus Promotion ',
box3item1: 'A Variety of high-quality signal sources copy trade helps you to win profits easily all for free',
box3item2: 'Only self-trading',
box3item3: '$100 real trading funds',
box3item4: '$30- $50, insufficient trading experience',
box3item5: '1000:1 ultra high leverage',
box3item6: 'Low trading leverage and difficult to complete pre set trading lots',
box3item7: 'Profits can be withdrawn',
box3item8: 'Profits cannot be withdrawn',
box4: '',
box4item1_1: 'Who can apply for the $100 Welcome Account and how to apply?',
box4item1_2: 'This promotion is only available to new clients (clients who have not registered any trading accounts with CWG), individuals who open an Instant Account (MT4) in the "Client Zone" and subscribe to a signal in the CWG Copy Trade community. Each client can participate only once. Please do not reapply for other CWG accounts, otherwise it will affect the Welcome Bonus Account application.',
box4item2_1: 'How long is the trading period for the Welcome Bonus Promotion and can I adjust the leverage?',
box4item2_2: 'The trading period of the Welcome Account Bonus Promotion is 7 days after the arrival of the $100 bonus.',
box4item2_3: 'During the promotional trading period, the foreign exchange leverage is 1:1000, the gold leverage is 1:400, and the silver leverage is 1:200. The leverage is not adjustable.',
box4item3_1: 'How to log into the CWG Copy Trade Community and subscribe to a signal source? Can I cancel if I want to do self-trading after subscribing?',
box4item3_2: 'The subscription method for the Copy Trade Community process can be seen in reference to < HOW TO USE CWG COPY TRADING > . After successfully subscribing, the account will start the copy trade mode automatically. If you need to trade independently after the bonus successfully arrives into your account, you can refer to the above tutorial to unsubscribe.',
box4item3_3: '',
box4item4_1: 'How to withdraw profits after completing two standard lots during the promotion period?',
box4item4_2: 'After completing the 2 standard lots (the number of lots is only limited to trade foreign exchange, gold and silver) during the trading period, you can choose "Profit Conversion" to apply for profits (up to $100) in the "Client Zone, Promotion Center". The verification will be completed within 1 working day. After the verification is approved, the deposit channel will be opened. Once the deposit channel is available to your account, you should deposit to the account within 30 days and complete at least 0.1 standard lot (the number of lots is calculated only for foreign exchange, gold and silver) trading.After trading, click "Profit Realization" in the Promotion Center to transfer the obtained profits (credits) into account balance, which can be used to trade or withdrawal in the future.',
box5_1: 'Choose CWG Markets ',
box5_2: ' to embark on a new trading experience with clients from over ',
box5_3: '135 countries',
box5_4: '',
box5item11: 'Top tier fund protection',
box5item12: 'International authoritative fund protection, segregation of client funds',
box5item13: 'Ultimate Trading Experience',
box5item14: '500+trading instruments, 1000:1 highest leverage, leading trading platform',
box5item15: 'Pricing and execution advantages',
box5item16: 'Provide highly competitive, stable, and transparent low spreads, overnight interest rates, and excellent trading execution capabilities',
box5item17: 'Professional education and technical analysis',
box5item18: 'Professional daily technical analysis, intelligent AI trading strategies, first-hand financial calendar information',
box5item19: 'High quality customer service',
box5item20: '24/5 professional customer service personnel, one-for-one market strategist',
box6_1: 'CWG Markets ',
box6_2: 'Traders in over',
box6_3: '150 countries',
box6_4: '',
box6item3: 'Claim Bonus',
box8: 'Various deposit and withdrawal channels',
box9: 'CWG Run with Praise',
box9item11: 'Best MT4&MT5 Broker of the Year',
box9item12: '2022',
box9item13: 'fxdailyinfo.com',
box9item21: 'Best Trading Environment of the Year ',
box9item22: '2022',
box9item23: 'fxdailyinfo.com',
box9item31: 'The Most Trusted Broker ',
box9item32: '2022',
box9item33: 'fxdailyinfo.com',
box9item41: 'Best Trading Platform UK ',
box9item42: '2022',
box9item43: 'Global Banking & Finance Review Award',
box9item51: 'Best Commodity Broker of the Year UK ',
box9item52: '2022',
box9item53: 'Global Banking & Finance Review Award',
box9item61: 'Best Multi-Asset Trading Platform UK ',
box9item62: '2021',
box9item63: 'Global Banking & Finance Review Award',
box9item71: 'Best Trading Platform UK ',
box9item72: '2021',
box9item73: 'Global Banking & Finance Review Award',
box9item81: 'Excellent Education Service Award ',
box9item82: '2021',
box9item83: 'The 7th Financial Analysis Conference',
box9item91: 'Broker Popularity Platform of the Year ',
box9item92: '2021',
box9item93: 'Huiyou.com',
box9item101: 'Most Influential Broker of the Year ',
box9item102: '2020',
box9item103: 'The 2nd Financial Technology Conference',
box9item111: 'Most Innovative MT5 Broker ',
box9item112: '2019',
box9item113: 'Saigon Trade Expo',
box9item121: 'Best Trading Environment Broker ',
box9item122: '2019',
box9item123: 'Fx678.com',
box7item1: 'CWG Markets is the trading name of CWG Group of companies.',
box7item2: 'Cwgvu.com is owned and operated within the CWG Group of companies. CWG Group consists of:',
box7item3: 'CWG Markets Ltd(UK), which is registered in England and Wales with company number 08888720. It is an investment firm fully authorised and regulated by the Financial Conduct Authority (FCA), under the firm reference number FRN 785129.',
box7item4: 'CWG Markets Ltd(VU), authorized and regulated by the Vanuatu Financial Services Commission (VFSC), with registration no. 41694. and the address is 1276, Govant Building, Kumul Highway, PORT VILA, VANUATU.It is a licensed financial dealer authorized to carry on the business of dealing in securities.',
box7item5: 'Clients must be at least 18 years old to use the services of CWG Markets.',
box7item6: 'Forex and Leveraged Financial Instruments are complex instruments and come with a high risk of losing money rapidly due to leverage. Please ensure you fully understand the risks and take appropriate care to manage your own risk. Please read our',
box7item7: ' Risk Disclosure ',
box7item8: 'carefully.',
box7item9: 'Restricted Regions: CWG Markets Ltd does not provide services for the residents of certain countries, such as the United States of America, Israel and the Islamic Republic of Iran. If such distribution or use violates local laws or regulations, the information on this website is not intended to be distributed or used to anyone in such countries or regions.',
box7item10: 'This website uses cookies to provide you with the very best experience and to know you better. By visiting our website with your browser set to allow cookies, you consent to our cookies policy and Privacy Policy .',
box7item11: '© 2020 CWG MARKETS',
box7item12: 'Privacy Policy',
box7item13: '.',
box7item14: ' Terms & Conditions',
box7item15: '.',
code: 'Get Code',
country: "Please select your country",
email: "Email Address Format Error",
phone: "Phone Format Error",
password: "Must be between 8 to 15 characters,Contain both uppercase and lowercase letter,Use a combination of numbers and letters",
codeInput: "Please enter the Email verification code",
agree: "Please agree to the declaration",
CodeSuccess: "Verification code has been successfully obtained ",
emailempty: "Email Address cannot be empty",
waitCode1: "Please wait ",
waitCode2: "s ",
registerSuc: "Registration successful, log in now...",
SystemError: "System Error, please try again.",
LoginSuccess: "Login Successful",
st1: "Must be between 8 to 15 characters",
nd2: "Contain both uppercase and lowercase letter",
rd3: "Use a combination of numbers and letters"
}
}
let vm = new Vue({
el: "#active1",
data: {
//多语言
langList: {
en: "ENGLISH",
cn: "中文简体"
},
language: "en",
lang: {},
flag: false,
loading: false,
mock_options: [],
// 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,
linkValue: null,
},
clientWidth:'',
// 验证规则
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",
},
],
},
notRegisterMsg:"",
notRegisterMsgOpen:false,
imgUrl: '',
ho: '',
isPc:null,
centerDialogVisible:false,
},
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();
this.initTimer();
},
//获取国家列表
async getCountry() {
axios.post(this.imgUrl + '/country/get', {
...this.params
//参数
}).then(res => {//请求成功后的处理函数
if (res.data.code == 200) {
this.mock_options = res.data.data;
} else {
this.$message.error(res.data.msg);
}
}).catch(err => {//请求失败后的处理函数
})
},
//获取当前国家编码
async getCountryMsg() {
axios.get(this.imgUrl + '/country/get', {
//参数
}).then(res => {//请求成功后的处理函数
if (res.data.code == 200) {
this.notRegisterMsg = res.data.msg
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 getCountryCode() {
axios.post(this.imgUrl + '/country/getCodeByIp', {
//参数
}).then(res => {//请求成功后的处理函数
if (res.data.code == 200) {
if (this.notCountry.indexOf(res.data.msg)==-1) {
this.params.country = res.data.msg;
}
if (!sessionStorage.getItem("timer")) {
let lang = sessionStorage.getItem("lang")
? sessionStorage.getItem("lang")
: this.params.country == "CN"
? "cn"
: "en";
sessionStorage.clear();
sessionStorage.setItem("lang", lang);
} else {
let timer = sessionStorage.getItem("timer");
let lang = sessionStorage.getItem("lang")
? sessionStorage.getItem("lang")
: this.params.country == "CN"
? "cn"
: "en";
sessionStorage.clear();
sessionStorage.setItem("lang", lang);
sessionStorage.setItem("timer", timer);
}
this.language = sessionStorage.getItem("lang");
this.lang = content[this.language];
this.initTimer();
} else {
this.$message.error(res.data.msg);
}
}).catch(err => {//请求失败后的处理函数
})
},
// 注册
register: async function () {
if (this.notRegisterMsg == 'MY') {
this.notRegisterMsgOpen = true;
return
}
this.$refs["params"].validate(async (valid) => {
if (valid) {
if (this.flag) {
return;
} else {
this.flag = true;
}
axios.post(this.imgUrl + '/custom/register', {
...this.params
//参数
}).then(res => {//请求成功后的处理函数
if (res.data.code == 200) {
this.loading = true;
this.$message({
message: this.lang.registerSuc,
type: 'success'
});
this.login();
this.flag = false;
} else {
this.$message.error(res.data.msg);
this.flag = false;
}
}).catch(err => {//请求失败后的处理函数
})
} else {
return false;
}
});
},
// 登陆
login: async function () {
axios.post(this.imgUrl + '/custom/login', {
loginName: this.params.email,
password: this.params.password,
//参数
}).then(res => {//请求成功后的处理函数
if (res.data.code == 200) {
sessionStorage.setItem("access_token", res.data.data);
axios.defaults.headers.common["Access-Token"] = res.data.data;
this.getLoginInfo();
} else {
this.$message.error(res.data.msg);
}
}).catch(err => {//请求失败后的处理函数
})
},
//获取登录信息
async getLoginInfo() {
axios.post(this.imgUrl + '/custom/info', {
//参数
}).then(res => {//请求成功后的处理函数
if (res.data.code == 200) {
this.loading = true;
// this.$store.commit("InitInfo", res.data.data);
this.$message({
message: this.lang.LoginSuccess,
type: 'success'
});
setTimeout(() => {
this.loading = false;
Session.Set("user", JSON.stringify(res.data.data), true)
window.location.href = this.imgUrl + '/#/customer/index';
}, 1000);
} else {
this.$message.error(this.lang.SystemError);
}
}).catch(err => {//请求失败后的处理函数
})
},
// 获取验证码
getCode: async function (val) {
if (val) {
if (!this.params.country) {
this.$message.error(content[sessionStorage.getItem("lang")].country);
return;
}
if (!this.params.email) {
this.$message.error(content[sessionStorage.getItem("lang")].emailempty);
return;
}
if (!/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(this.params.email)) {
this.$message.error(content[sessionStorage.getItem("lang")].email);
return;
}
}
this.getCodeString =
content[sessionStorage.getItem("lang")].waitCode1 +
this.timer +
content[sessionStorage.getItem("lang")].waitCode2;
let that = this;
if (!this.interval) {
this.getCode1(val);
this.interval = setInterval(() => {
that.timer--;
sessionStorage.setItem("timer", that.timer);
that.getCodeString =
content[sessionStorage.getItem("lang")].waitCode1 +
that.timer +
content[sessionStorage.getItem("lang")].waitCode2;
if (that.timer == 0) {
this.getCodeString = content[sessionStorage.getItem("lang")].code;
clearInterval(that.interval);
that.interval = null;
that.timer = 59;
sessionStorage.setItem("timer", that.timer);
}
}, 1000);
}
},
//验证码
async getCode1(val) {
if (val) {
axios.post(this.imgUrl + '/custom/register/send/code', {
...this.params
//参数
}).then(res => {//请求成功后的处理函数
if (res.data.code == 200) {
this.$message({
message: this.lang.CodeSuccess,
type: 'success'
});
} else {
this.$message.error(res.data.msg);
}
}).catch(err => {//请求失败后的处理函数
})
}
},
// 初始化定时器
initTimer: function () {
let t = sessionStorage.getItem("timer") || this.timer;
if (t == 59) {
this.getCodeString = content[sessionStorage.getItem("lang")].code;
} else {
this.timer = sessionStorage.getItem("timer");
this.getCode(0);
}
},
getQueryStringRegExp(name){
var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s|&|$)", "i");
if (reg.test(location.href)) return unescape(RegExp.$2.replace(/\+/g, " ")); return "";
},
getCodeQuery(){
this.params.sourceCode = this.getQueryStringRegExp('ex')
this.params.w = this.getQueryStringRegExp('w')
this.params.subId = this.getQueryStringRegExp('SUBID')
this.params.agentId = Number(this.getQueryStringRegExp('mmdi')) || null;
this.params.linkValue = this.getQueryStringRegExp('mmF')
switch (this.getQueryStringRegExp('mmF')) {
case "F0":
this.params.comPoint = 0;
break;
case "F1":
this.params.comPoint = 10;
break;
case "F2":
this.params.comPoint = 20;
break;
case "F3":
this.params.comPoint = 30;
break;
}
switch (this.getQueryStringRegExp('mmB')) {
case "B0":
this.params.ibInvalid = 0;
break;
case "B1":
this.params.ibInvalid = 1;
break;
}
},
//判断pc、移动
IsPC() {
var userAgentInfo = navigator.userAgent;
var Agents = ['Android', 'iPhone',
'SymbianOS', 'Windows Phone',
'iPad', 'iPod'
];
var flag = true;
for (var i = 0; i < Agents.length; i++) {
if (userAgentInfo.indexOf(Agents[i]) != -1) {
flag = false;
break;
}
}
return flag;
},
openMP4(){
this.centerDialogVisible = true;
},
},
watch:{
'centerDialogVisible'(val){
if (!val) {
document.getElementById("videoplayer").pause();
}
}
},
mounted() {
// console.log(document.body.clientWidth);
// this.clientWidth = document.body.clientWidth;
// if (window.location.search.indexOf('&ex=') != '-1') {
// this.params.sourceCode = window.location.search.split('&ex=')[1] || null;
// } else if (window.location.search.indexOf('?ex=') != '-1') {
// this.params.sourceCode = window.location.search.split('?ex=')[1] || null;
// }
this.getCodeQuery();
this.ho = window.location.host.split('.')[1];
this.imgUrl = window.location.origin;
// this.imgUrl = 'http://8.210.194.53:8000';
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 = 'en'
this.lang = content['en'];
}else{
this.language = 'en'
this.lang = content['en'];
}
}
//获取国家
this.getCountryCode();
this.getCountry();
// this.initTimer();
//是否pc
if (this.IsPC()) {
this.isPc = true;
} else {
this.isPc = false;
}
},
destroyed() {
clearInterval(this.interval);
},
});