active1.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. var content = {
  2. 'cn': {
  3. nav1: "关于CWG",
  4. nav2: "立即参赛",
  5. headers1: 'CWG交易之星',
  6. headers2: '(中国·新疆)特邀巅峰赛',
  7. headers3: '总奖池:',
  8. headers4: '美金',
  9. headers5: '报名截止:',
  10. headers6: '报名截止时间:',
  11. headers7: '比赛时间:',
  12. headers8: '*本次邀请赛的参赛者限定为中国新疆地区客户',
  13. headers9: '年',
  14. headers10: '月',
  15. headers11: '日',
  16. headers12: '时',
  17. headers13: '分',
  18. headers14: '秒',
  19. table1: '参加比赛并瓜分总奖金池',
  20. table2: '活跃参与者有机会参加每个交易日的每日幸运星抽奖活动',
  21. table3: '排名',
  22. table4: '账户昵称',
  23. table5: 'CWG账号',
  24. table6: '账户净值',
  25. table7: '最大回撤',
  26. table8: '盈利率',
  27. table9: '综合分',
  28. table10: '暂无数据',
  29. table11: '*排行版更新时间为每日平台时间(夏令时GMT+3,冬令时GMT+2)00:00',
  30. step1: '如何参赛',
  31. step2: '收到邀请的CWG真实客户登录CWG客户专区',
  32. step3: '在客户专区活动中心找到实盘特邀交易大赛活动入口',
  33. step4: '点击报名按钮选择参赛账户并填写完信息提交即为报名成功',
  34. footer1: '每日幸运星',
  35. footer2: 'CWG会在每个交易日从活跃参赛者中抽取一名幸运星,将得到CWG定制大赛礼盒一份。',
  36. footer3: '(*活跃参赛者即当日有任意交易或账户有持仓)',
  37. footer4: '*幸运星精品礼盒奖励将在10个工作日内按照您的报名地址寄出,如需更换地址,请在获奖后3个工作日内联系CWG官网在线客服进行处理。',
  38. },
  39. 'en': {
  40. nav1: "About CWG",
  41. nav2: "Join Now",
  42. headers1: "CWG Africa's Top Trader Challenge",
  43. headers2: 'For each new trader, we will add $10 into the prize pool, no limits!',
  44. headers3: 'Total Prize Pool:',
  45. headers4: 'USD',
  46. headers5: 'Registration Deadline:',
  47. headers6: 'Registration Deadline:',
  48. headers7: 'Competition Period:',
  49. headers8: '*Participants in this competition include all customers from the African region.',
  50. headers9: 'Year',
  51. headers10: 'Month',
  52. headers11: 'Day',
  53. headers12: 'Hour',
  54. headers13: 'Minute',
  55. headers14: 'Second',
  56. table1: 'Join now and win from our traders prize pool',
  57. table2: 'Active participants have the chance to win the daily trader prize every trading day',
  58. table3: 'Rank',
  59. table4: 'Nickname',
  60. table5: 'CWG Account',
  61. table6: 'Account Net Value',
  62. table7: 'Maximum Drawdown',
  63. table8: 'Profitability',
  64. table9: 'Overall Score',
  65. table10: 'No data available',
  66. table11: '*Rankings are updated daily at 00:00 platform time (GMT+3 during daylight saving time, GMT+2 during standard time)',
  67. step1: 'How to Participate',
  68. step2: 'Click "Join Now," fill in the registration information, and successfully create an instant account (if you already have a CWG account, please contact our customer service for registration)',
  69. step3: 'After successfully submitting, wait for dedicated customer service to contact you and open the competition channel for your account.',
  70. step4: "click on 'Sign Up for the Competition' in the client zone's activity center to successfully register and wait for the competition to start.",
  71. footer1: 'Daily Trader Prize',
  72. footer2: 'For each trading day of the challenge, CWG will randomly select one lucky trader from the pool of active participants who will receive a reward of $5 CASH!',
  73. footer3: '(Active participants refer to those who have made any trades or have open positions on that day)',
  74. footer4: "*Rewards will be credited to your customer's wallet immediately",
  75. box1item4: 'Welcome To CWG Markets',
  76. box1item4_1: 'Please fill out this field',
  77. box1item5: 'Country / Region',
  78. box1item6: 'Phone Number',
  79. box1item7: 'Email Address',
  80. box1item8: 'Email Varification Code',
  81. box1item9: 'Set Password',
  82. box1item10: 'I declared and confirmed that I am not a citizen or resident of the United States.',
  83. box1item11: 'Register',
  84. box1item12: 'Already have an account',
  85. code: 'Generate',
  86. country: "Please select your country",
  87. email: "Email Address Format Error",
  88. phone: "Phone Format Error",
  89. password: "Must be between 8 to 15 characters,Contain both uppercase and lowercase letter,Use a combination of numbers and letters",
  90. codeInput: "Please enter the Email verification code",
  91. agree: "Please agree to the declaration",
  92. CodeSuccess: "Verification code has been successfully obtained ",
  93. emailempty: "Email Address cannot be empty",
  94. waitCode1: "Please wait ",
  95. waitCode2: "s ",
  96. registerSuc: "Registration successful, log in now...",
  97. SystemError: "System Error, please try again.",
  98. LoginSuccess: "Login Successful",
  99. st1: "Must be between 8 to 15 characters",
  100. nd2: "Contain both uppercase and lowercase letter",
  101. rd3: "Use a combination of numbers and letters",
  102. },
  103. }
  104. let vm = new Vue({
  105. el: "#active1",
  106. data: {
  107. //多语言
  108. langList: {
  109. en: "ENGLISH",
  110. cn: "中文简体"
  111. },
  112. language: "en",
  113. lang: {},
  114. flag: false,
  115. loading: false,
  116. mock_options: {
  117. time:'',
  118. list:[]
  119. },
  120. mock_optionsC: [],
  121. // img_logo: logo,
  122. timer: 59,
  123. intervalCode:null,
  124. interval: null,
  125. getCodeString: "",
  126. notCountry:[
  127. 'AF','AI','AG','BS','BY',
  128. 'BZ','BA','BI','CF','CD','CU',
  129. 'ET','FJ','PS','GN','GW','HT',
  130. 'IR','IQ','LB','LY','ML','MM',
  131. 'NI','KP','PW','RU','SO','SS',
  132. 'SD','SY','UA','US','VE','YE','ZW','MY'
  133. ],
  134. // 表单参数
  135. params: {
  136. agentId: null,
  137. comPoint: null,
  138. sourceCode:null,
  139. subId: "",
  140. email: "",
  141. password: "",
  142. country: "",
  143. emailCode: "",
  144. phone: "",
  145. w: "",
  146. agree: false,
  147. linkValue: null,
  148. },
  149. dialogFormVisible:false,
  150. clientWidth:'',
  151. pagerInfo: {row: 10, current: 1, pageTotal: 0, rowTotal: 0},//分页
  152. pictLoading:false,
  153. // 验证规则
  154. rules: {
  155. country: [
  156. {
  157. validator: (rule, value, callback) => {
  158. if (value != "" && value != null) {
  159. callback();
  160. } else {
  161. callback(new Error(content[sessionStorage.getItem('lang')].country));
  162. }
  163. },
  164. trigger: "blur",
  165. },
  166. ],
  167. email: [
  168. {
  169. validator: (rule, value, callback) => {
  170. if (/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(value)) {
  171. callback();
  172. } else {
  173. callback(new Error(content[sessionStorage.getItem('lang')].email));
  174. }
  175. },
  176. trigger: "blur",
  177. },
  178. ],
  179. emailCode: [
  180. {
  181. validator: (rule, value, callback) => {
  182. if (
  183. value != "" &&
  184. value != null
  185. ) {
  186. callback();
  187. } else {
  188. callback(new Error(content[sessionStorage.getItem('lang')].codeInput));
  189. }
  190. },
  191. trigger: "blur",
  192. },
  193. ],
  194. password: [
  195. {
  196. validator: (rule, value, callback) => {
  197. if (/^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?!.*([~!@&%$^\\(\\)#_]).*\\1.*\\1.*\\1)[A-Za-z0-9~!@&%$^\\(\\)#_]{8,16}$/.test(value)) {
  198. callback();
  199. } else {
  200. callback(new Error(content[sessionStorage.getItem('lang')].password));
  201. }
  202. },
  203. trigger: "blur",
  204. },
  205. ],
  206. agree: [
  207. {
  208. validator: (rule, value, callback) => {
  209. if (value) {
  210. callback();
  211. } else {
  212. callback(new Error(content[sessionStorage.getItem('lang')].agree));
  213. }
  214. },
  215. trigger: "change",
  216. },
  217. ],
  218. phone: [
  219. {
  220. validator: (rule, value, callback) => {
  221. if (/^[0-9]\d*$/.test(value)) {
  222. callback();
  223. } else {
  224. callback(new Error(content[sessionStorage.getItem('lang')].phone));
  225. }
  226. },
  227. trigger: "blur",
  228. },
  229. ],
  230. },
  231. notRegisterMsg:"",
  232. notRegisterMsgOpen:false,
  233. imgUrl: '',
  234. ho: '',
  235. isPc:null,
  236. centerDialogVisible:false,
  237. CompetitionData:{},//基础信息
  238. rankingList:{},//排名列表
  239. Countdown:{
  240. d:'0',
  241. h:'0',
  242. m:'0',
  243. s:'0',
  244. },
  245. CountdownFlag:true,
  246. infoCode:'',
  247. },
  248. computed: {
  249. rule1: function () {
  250. if (!this.params.password) {
  251. return false;
  252. }
  253. return /^.{8,16}$/.test(this.params.password);
  254. },
  255. rule2: function () {
  256. return /^(?=.*?[a-z])(?=.*?[A-Z]).*$/.test(this.params.password);
  257. },
  258. rule3: function () {
  259. return /^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?!.*([~!@&%$^\\(\\)#_]).*\\1.*\\1)[A-Za-z0-9~!@&%$^\\(\\)#_]{8,16}$/.test(
  260. this.params.password
  261. );
  262. },
  263. },
  264. methods: {
  265. // 语言切换函数
  266. chooseLang(key) {
  267. this.lang = content[key];
  268. this.language = key;
  269. sessionStorage.setItem("lang", this.language);
  270. location.reload();
  271. },
  272. //分页返回数据
  273. handleSizeChange (val) {
  274. this.pagerInfo.row = val;
  275. this.searchFunc();
  276. },
  277. handleCurrentChange (val) {
  278. this.pagerInfo.current = val;
  279. this.searchFunc();
  280. },
  281. //获取列表数据
  282. async searchFunc () {
  283. this.pictLoading = true;
  284. axios.post(this.imgUrl + '/follow/cpt/result/search/list', {
  285. "infoCode": this.infoCode,
  286. page: {
  287. current: this.pagerInfo.current,
  288. row: this.pagerInfo.row
  289. }
  290. //参数
  291. }).then(res => {//请求成功后的处理函数
  292. if (res.data.code == 200) {
  293. if (res.data.data && res.data.data.length) {
  294. this.mock_options.list = res.data.data;
  295. }
  296. if (res.data.page != null) {
  297. this.pagerInfo.rowTotal = res.data.page.rowTotal;
  298. this.pagerInfo.pageTotal = res.data.page.pageTotal;
  299. } else {
  300. this.pagerInfo.rowTotal = 0;
  301. }
  302. this.pictLoading = false;
  303. } else {
  304. this.$message.error(res.data.msg);
  305. this.pictLoading = false;
  306. }
  307. }).catch(err => {//请求失败后的处理函数
  308. this.pictLoading = false;
  309. })
  310. },
  311. //获取基础数据
  312. async searchCompetition () {
  313. this.pictLoading = true;
  314. axios.post(this.imgUrl + '/follow/cpt/info/front', {
  315. "infoCode": this.infoCode
  316. //参数
  317. }).then(res => {//请求成功后的处理函数
  318. if (res.data.code == 200) {
  319. this.CompetitionData = res.data.data;
  320. this.CompetitionData.luckyLogins = this.CompetitionData.luckyLogins||[];
  321. this.CompetitionData.startDate = res.data.data.startDate.split(' ')[0];
  322. this.CompetitionData.endDate = res.data.data.endDate.split(' ')[0];
  323. // this.CompetitionData.startDate = '2023-9-7'
  324. // let that = this;
  325. // let startTime = new Date(that.CompetitionData.signEndDate.replace(/-/g, '/')).getTime();
  326. // that.interval = setInterval(() => {
  327. // let timezone = 3; //目标时区时间,东3区 东时区正数 西市区负数
  328. // let offset_GMT = new Date().getTimezoneOffset(); // 本地时间和格林威治的时间差,单位为分钟
  329. // let nowDate = new Date().getTime(); // 本地时间距 1970 年 1 月 1 日午夜(GMT 时间)之间的毫秒数
  330. // let nowTime = new Date(nowDate + offset_GMT * 60 * 1000 + timezone * 60 * 60 * 1000);
  331. // let sec = 1000, min = 60 * sec, hour = min * 60, day = 24 * hour;
  332. // let time = startTime - nowTime;
  333. // if (time>0) {
  334. // that.CountdownFlag = true;
  335. // that.Countdown.d = that.getzero(Math.floor(time / day));
  336. // that.Countdown.h = that.getzero(Math.floor((time % day) / hour));
  337. // that.Countdown.m = that.getzero(Math.floor((time % hour) / min));
  338. // that.Countdown.s = that.getzero(Math.floor((time % min) / sec));
  339. // } else {
  340. // that.CountdownFlag = false;
  341. // this.CompetitionData.signStartDate = res.data.data.signStartDate.split(' ')[0];
  342. // this.CompetitionData.signEndDate = res.data.data.signEndDate.split(' ')[0];
  343. // }
  344. // //时间归零,重新获取数据
  345. // if (nowTime >= startTime) {
  346. // clearInterval(that.interval);
  347. // }
  348. // }, 1000);
  349. this.pictLoading = false;
  350. } else {
  351. this.$message.error(res.data.msg);
  352. this.pictLoading = false;
  353. }
  354. }).catch(err => {//请求失败后的处理函数
  355. this.pictLoading = false;
  356. })
  357. },
  358. //时间补0
  359. getzero(time){
  360. return time > '9' ? time : '0' + time
  361. },
  362. //获取国家列表
  363. async getCountry() {
  364. axios.post(this.imgUrl + '/country/get', {
  365. ...this.params
  366. //参数
  367. }).then(res => {//请求成功后的处理函数
  368. if (res.data.code == 200) {
  369. this.mock_optionsC = res.data.data;
  370. } else {
  371. this.$message.error(res.data.msg);
  372. }
  373. }).catch(err => {//请求失败后的处理函数
  374. })
  375. },
  376. //获取当前国家编码
  377. async getCountryMsg() {
  378. axios.get(this.imgUrl + '/country/get', {
  379. //参数
  380. }).then(res => {//请求成功后的处理函数
  381. if (res.data.code == 200) {
  382. this.notRegisterMsg = res.data.msg
  383. if ((res.data.msg == "GB"||res.data.msg == "IE")&&res.data.data.indexOf('//195.224.141.218') == -1) {
  384. window.location.href = 'https://www.cwgmarkets.co.uk';
  385. } else {
  386. document.getElementById("pre").style.display = 'none'
  387. }
  388. } else {
  389. document.getElementById("pre").style.display = 'none'
  390. this.$message.error(res.data.msg);
  391. }
  392. }).catch(err => {//请求失败后的处理函数
  393. })
  394. },
  395. //获取当前国家编码
  396. async getCountryCode() {
  397. axios.post(this.imgUrl + '/country/getCodeByIp', {
  398. //参数
  399. }).then(res => {//请求成功后的处理函数
  400. if (res.data.code == 200) {
  401. if (this.notCountry.indexOf(res.data.msg)==-1) {
  402. this.params.country = res.data.msg;
  403. }
  404. if (!sessionStorage.getItem("timer")) {
  405. let lang = sessionStorage.getItem("lang")
  406. ? sessionStorage.getItem("lang")
  407. : this.params.country == "CN"
  408. ? "cn"
  409. : "en";
  410. sessionStorage.clear();
  411. sessionStorage.setItem("lang", lang);
  412. } else {
  413. let timer = sessionStorage.getItem("timer");
  414. let lang = sessionStorage.getItem("lang")
  415. ? sessionStorage.getItem("lang")
  416. : this.params.country == "CN"
  417. ? "cn"
  418. : "en";
  419. sessionStorage.clear();
  420. sessionStorage.setItem("lang", lang);
  421. sessionStorage.setItem("timer", timer);
  422. }
  423. this.language = sessionStorage.getItem("lang");
  424. this.lang = content[this.language];
  425. this.initTimer();
  426. } else {
  427. this.$message.error(res.data.msg);
  428. }
  429. }).catch(err => {//请求失败后的处理函数
  430. })
  431. },
  432. // 注册
  433. register: async function () {
  434. if (this.notRegisterMsg == 'MY') {
  435. this.notRegisterMsgOpen = true;
  436. return
  437. }
  438. this.$refs["params"].validate(async (valid) => {
  439. if (valid) {
  440. if (this.flag) {
  441. return;
  442. } else {
  443. this.flag = true;
  444. }
  445. axios.post(this.imgUrl + '/custom/register', {
  446. ...this.params
  447. //参数
  448. }).then(res => {//请求成功后的处理函数
  449. if (res.data.code == 200) {
  450. this.loading = true;
  451. this.$message({
  452. message: this.lang.registerSuc,
  453. type: 'success'
  454. });
  455. this.login();
  456. this.flag = false;
  457. } else {
  458. this.$message.error(res.data.msg);
  459. this.flag = false;
  460. }
  461. }).catch(err => {//请求失败后的处理函数
  462. })
  463. } else {
  464. return false;
  465. }
  466. });
  467. },
  468. // 登陆
  469. login: async function () {
  470. axios.post(this.imgUrl + '/custom/login', {
  471. loginName: this.params.email,
  472. password: this.params.password,
  473. //参数
  474. }).then(res => {//请求成功后的处理函数
  475. if (res.data.code == 200) {
  476. sessionStorage.setItem("access_token", res.data.data);
  477. axios.defaults.headers.common["Access-Token"] = res.data.data;
  478. this.getLoginInfo();
  479. } else {
  480. this.$message.error(res.data.msg);
  481. }
  482. }).catch(err => {//请求失败后的处理函数
  483. })
  484. },
  485. //获取登录信息
  486. async getLoginInfo() {
  487. axios.post(this.imgUrl + '/custom/info', {
  488. //参数
  489. }).then(res => {//请求成功后的处理函数
  490. if (res.data.code == 200) {
  491. this.loading = true;
  492. // this.$store.commit("InitInfo", res.data.data);
  493. this.$message({
  494. message: this.lang.LoginSuccess,
  495. type: 'success'
  496. });
  497. setTimeout(() => {
  498. this.loading = false;
  499. Session.Set("user", JSON.stringify(res.data.data), true)
  500. window.location.href = this.imgUrl + '/#/customer/index';
  501. }, 1000);
  502. } else {
  503. this.$message.error(this.lang.SystemError);
  504. }
  505. }).catch(err => {//请求失败后的处理函数
  506. })
  507. },
  508. // 获取验证码
  509. getCode: async function (val) {
  510. if (val) {
  511. if (!this.params.country) {
  512. this.$message.error(content[sessionStorage.getItem("lang")].country);
  513. return;
  514. }
  515. if (!this.params.email) {
  516. this.$message.error(content[sessionStorage.getItem("lang")].emailempty);
  517. return;
  518. }
  519. if (!/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(this.params.email)) {
  520. this.$message.error(content[sessionStorage.getItem("lang")].email);
  521. return;
  522. }
  523. }
  524. this.getCodeString =
  525. content[sessionStorage.getItem("lang")].waitCode1 +
  526. this.timer +
  527. content[sessionStorage.getItem("lang")].waitCode2;
  528. let that = this;
  529. if (!this.intervalCode) {
  530. this.getCode1(val);
  531. this.intervalCode = setInterval(() => {
  532. that.timer--;
  533. sessionStorage.setItem("timer", that.timer);
  534. that.getCodeString =
  535. content[sessionStorage.getItem("lang")].waitCode1 +
  536. that.timer +
  537. content[sessionStorage.getItem("lang")].waitCode2;
  538. if (that.timer == 0) {
  539. this.getCodeString = content[sessionStorage.getItem("lang")].code;
  540. clearInterval(that.intervalCode);
  541. that.intervalCode = null;
  542. that.timer = 59;
  543. sessionStorage.setItem("timer", that.timer);
  544. }
  545. }, 1000);
  546. }
  547. },
  548. //验证码
  549. async getCode1(val) {
  550. if (val) {
  551. axios.post(this.imgUrl + '/custom/register/send/code', {
  552. ...this.params
  553. //参数
  554. }).then(res => {//请求成功后的处理函数
  555. if (res.data.code == 200) {
  556. this.$message({
  557. message: this.lang.CodeSuccess,
  558. type: 'success'
  559. });
  560. } else {
  561. this.$message.error(res.data.msg);
  562. }
  563. }).catch(err => {//请求失败后的处理函数
  564. })
  565. }
  566. },
  567. // 初始化定时器
  568. initTimer: function () {
  569. let t = sessionStorage.getItem("timer") || this.timer;
  570. if (t == 59) {
  571. this.getCodeString = content[sessionStorage.getItem("lang")].code;
  572. } else {
  573. this.timer = sessionStorage.getItem("timer");
  574. this.getCode(0);
  575. }
  576. },
  577. getQueryStringRegExp(name){
  578. var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s|&|$)", "i");
  579. if (reg.test(location.href)) return unescape(RegExp.$2.replace(/\+/g, " ")); return "";
  580. },
  581. getCodeQuery(){
  582. // this.token = decodeURIComponent(this.getQueryStringRegExp('token'));
  583. this.params.sourceCode = this.getQueryStringRegExp('ex')
  584. this.params.w = this.getQueryStringRegExp('w')
  585. this.params.subId = this.getQueryStringRegExp('SUBID')
  586. this.infoCode = this.getQueryStringRegExp('code')||'AFRICAN_FOREX_TRADING_CHALLENGE_2025';
  587. this.params.agentId = Number(this.getQueryStringRegExp('mmdi')) || null;
  588. this.params.linkValue = this.getQueryStringRegExp('mmF')
  589. switch (this.getQueryStringRegExp('mmF')) {
  590. case "F0":
  591. this.params.comPoint = 0;
  592. break;
  593. case "F1":
  594. this.params.comPoint = 10;
  595. break;
  596. case "F2":
  597. this.params.comPoint = 20;
  598. break;
  599. case "F3":
  600. this.params.comPoint = 30;
  601. break;
  602. }
  603. switch (this.getQueryStringRegExp('mmB')) {
  604. case "B0":
  605. this.params.ibInvalid = 0;
  606. break;
  607. case "B1":
  608. this.params.ibInvalid = 1;
  609. break;
  610. }
  611. },
  612. },
  613. watch:{ },
  614. mounted() {
  615. this.ho = window.location.host.split('.')[1];
  616. this.imgUrl = window.location.origin;
  617. this.getCodeQuery();
  618. // this.imgUrl = 'https://secure.cwgmarkets.com/';
  619. // this.imgUrl = 'http://193.134.208.230:8000'
  620. this.getCountryMsg()
  621. if (sessionStorage.getItem("lang")) {
  622. this.language = sessionStorage.getItem("lang"),
  623. this.lang = content[sessionStorage.getItem("lang")];
  624. } else {
  625. // var jsSrc =(navigator.language || navigator.browserLanguage).toLowerCase();
  626. // if(jsSrc.indexOf('zh') >= 0){
  627. // this.language = 'cn'
  628. // this.lang = content['cn'];
  629. // }else{
  630. // this.language = 'en'
  631. // this.lang = content['en'];
  632. // }
  633. this.language = 'en'
  634. this.lang = content['en'];
  635. sessionStorage.setItem("lang", this.language);
  636. }
  637. this.searchFunc();//获取列表数据
  638. this.searchCompetition();
  639. this.getCountryCode();
  640. this.getCountry();
  641. },
  642. destroyed() {
  643. clearInterval(this.interval);
  644. clearInterval(this.intervalCode)
  645. },
  646. });