active1.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  1. var content = {
  2. 'cn': {
  3. headers1: '登陆',
  4. headers2: '在线客服',
  5. headers3: '创建账户',
  6. box1item1: 'CWG为新用户打造专属好礼!入金可享20%最高2000美金赠金!首月交易每手可获得$3返现, 最高可申请1000美金返现。',
  7. box1item2: '',
  8. box1item3: '*活动受条款约束。请在我们的网站上查看优惠活动详情。',
  9. box1item3_1: '仅需入金100美金',
  10. box1item3_2: '对新客户适用',
  11. box1item3_3: '盈利随时可提取',
  12. box1item3_4: '支持EA交易',
  13. box1item4: '注册!',
  14. box1item5: '国家地区',
  15. box1item6: '联系电话',
  16. box1item7: '电子邮箱',
  17. box1item8: '邮箱验证码',
  18. box1item9: '设置密码',
  19. box1item10: '本人声明并确认本人并非美国公民或居民。',
  20. box1item11: '确认',
  21. box2_1: '赠金优势全新升级 ',
  22. box2_2: '单单返利',
  23. box2_3: '交易即得',
  24. box2item1: '20%赠金入金即享,高达$2000',
  25. box2item2: '超低门槛,入金仅需100美金',
  26. box2item3: '点首月最高$1000返现,每手均可获$3返现差低至',
  27. box2item4: '',
  28. box3: '如何领取您的赠金 ',
  29. box3item1: '新客户在页面上方注册客户专区并登录开立交易账户',
  30. box3item2: '最低入金100美金,并在入金时勾选20%赠金活动',
  31. box3item3: '首月交易完成后提取现金或交易全部完成后申请全额赠金',
  32. box3item4_1: '活动详细条款请登录',
  33. box3item4_2: 'CWG官网',
  34. box3item4_3: '查看',
  35. box4: '福利三部曲,奖励金拿到手软,交易保障亏损无忧',
  36. box4item1_1: '谁可以申请20%赠金?如何申请?',
  37. box4item1_2: 'CWG未激活过的ID(此前未入过金),在账户首次入金时可申请该赠金活动。申请赠金用户需在CWG用户中心入金不低于$100美金,并在入金时勾选 20%赠金申请,申请后20%赠金会在一个工作日内注入账户信用额。',
  38. box4item1_3: '',
  39. box4item2_1: '入金有要求么,首月交易返现最高能拿多少?',
  40. box4item2_2: '最低仅需入金$100美金,赠金到账起30天内每交易1标准手可获得3美金返现,交易越多获得返现越多,最高不超过$1000。',
  41. box4item2_3: '(例: A客户仅需入金100美金,30天内完成100标准手可直接先申请 300美金返现。如A客户完成334手可获得全部1000美金返现。)',
  42. box4item3_1: '首月获取的返现多久能到账,可以提取或转账么?',
  43. box4item3_2: '30天交易完成后,在活动中心找到该活动点击首月返现按钮,CWG将会协助在5个工作日内对交易账户进行审核并将首月完成返现注入账户余额。返现金额随时可提取或转账,也可用于继续交易。',
  44. box4item3_3: '',
  45. box4item4_1: '',
  46. box4item4_2: '',
  47. box4item4_3: '',
  48. box5_1: '在CWG一键链接',
  49. box5_2: '全球500',
  50. box5_3: '多个交易品种',
  51. box5item11: '外汇',
  52. box5item12: '全球最热门交易产品',
  53. box5item13: 'EURUSD',
  54. box5item14: 'GBPUSD',
  55. box5item15: 'USDJPY',
  56. box5item16: 'USDCNH',
  57. box5item21: '贵金属',
  58. box5item22: '黄金白银等',
  59. box5item23: 'XAUUSD',
  60. box5item24: 'XAGUSD',
  61. box5item25: 'XPTUSD',
  62. box5item26: 'XAUEUR',
  63. box5item31: '股票&股指',
  64. box5item32: '股票&指数产品',
  65. box5item33: 'Apple Inc',
  66. box5item34: 'Tesla Inc',
  67. box5item35: 'US30',
  68. box5item36: 'JP225',
  69. box5item41: '商品期&现货',
  70. box5item42: '直通国际各大期货交易所',
  71. box5item43: 'COTTON',
  72. box5item44: 'USCOCOA',
  73. box5item45: 'COFFEE',
  74. box5item46: 'USOILROLL',
  75. box6_1: '选择享誉全球的CWG Markets ',
  76. box6_2: '与超',
  77. box6_3: '150个国家',
  78. box6_4: '的用户一起开启全新交易体验',
  79. box6item3: '立即领取',
  80. box8: '丰富的出入金通道',
  81. box9: 'CWG载誉而行',
  82. box9item11: '年度最佳MT4 & MT5经纪商',
  83. box9item12: '2022',
  84. box9item13: 'fxdailyinfo.com',
  85. box9item21: '年度最佳交易环境经纪商',
  86. box9item22: '2022',
  87. box9item23: 'fxdailyinfo.com',
  88. box9item31: '最值得信赖经纪商',
  89. box9item32: '2022',
  90. box9item33: 'fxdailyinfo.com',
  91. box9item41: '英国最佳交易平台',
  92. box9item42: '2022',
  93. box9item43: 'Global Banking & Finance Review Award',
  94. box9item51: '英国最佳大宗商品经纪商',
  95. box9item52: '2022',
  96. box9item53: 'Global Banking & Finance Review Award',
  97. box9item61: '英国最佳多资产交易平台',
  98. box9item62: '2021',
  99. box9item63: 'Global Banking & Finance Review Award',
  100. box9item71: '英国最佳交易平台',
  101. box9item72: '2021',
  102. box9item73: 'Global Banking & Finance Review Award',
  103. box9item81: '培训卓越服务奖',
  104. box9item82: '2021',
  105. box9item83: '第七届金融分析大会',
  106. box9item91: '年度交易商人气平台',
  107. box9item92: '2021',
  108. box9item93: '汇友网',
  109. box9item101: '年度最具影响力经纪商',
  110. box9item102: '2020',
  111. box9item103: '第二届金融科技大会',
  112. box9item111: '最具创新MT5经纪商',
  113. box9item112: '2019',
  114. box9item113: '西贡交易博览',
  115. box9item121: '最佳交易环境经纪商',
  116. box9item122: '2019',
  117. box9item123: '汇通财经',
  118. box7item1: 'CWG Markets是CWG集团的商标。',
  119. box7item2: 'Cwgvu.com由CWG集团所有并运营。CWG集团包括:',
  120. box7item3: 'CWG Markets Ltd(UK),在英格兰和威尔士注册,公司编号为08888720。该公司是一家730K投资公司,由英国金融行为监管局(FCA)完全授权和监管,公司监管编号 FRN 785129 。',
  121. box7item4: 'CWG Markets Ltd(VU),是一家证券及金融衍生品交易商,接受瓦努阿图金融服务委员会(VFSC)监管,监管编号为41694,获得授权从事证券交易业务。',
  122. box7item5: '客户必须年满18周岁才能使用CWG Markets的服务。',
  123. box7item6: '外汇和杠杆化金融产品是复杂的工具,并且由于杠杆而有快速亏损的风险。您应该考虑是否了解差价合约是如何运作的,以及您是否有能力承担损失资金的风险。您应该了解与差价合约(CFD)相关的所有风险,如果您有任何疑问,请寻求独立顾问的建议。请仔细阅读我们的',
  124. box7item7: '风险披露',
  125. box7item8: '。',
  126. box7item9: '受限地区: CWG Markets Ltd无法为特定国家/地区提供服务,例如:美国,以色列和伊朗。如果此类分发或使用违反当地法律或法规,则本网站上的信息不是分发或用于此类国家或地区的任何人。',
  127. box7item10: '本网站使用cookies为您提供最佳体验并更好地了解您。通过访问我们的网站并将您的浏览器设置为允许cookie,即表示您同意我们使用我们的隐私政策中所述的cookie。',
  128. box7item11: '© 2020 CWG MARKETS',
  129. box7item12: 'cookies政策',
  130. box7item13: '和',
  131. box7item14: ' 隐私政策',
  132. box7item15: '.',
  133. code: '获取验证码',
  134. country: "请选择您所在国家",
  135. email: "邮箱格式错误",
  136. phone: "电话格式错误",
  137. password: "使用8到15个字符,同时使用大写和小写字母,使用数字和英文字母的组合",
  138. codeInput: "请输入验证码",
  139. agree: "请同意声明",
  140. CodeSuccess: "验证码获取成功",
  141. emailempty: "邮箱不能为空",
  142. waitCode1: "等待 ",
  143. waitCode2: "s ",
  144. registerSuc: "注册成功,正在登录...",
  145. SystemError: "系统错误,请稍后再试。",
  146. LoginSuccess: "登录成功,马上进入系统。",
  147. st1: "使用8到15个字符",
  148. nd2: "同时使用大写和小写字母",
  149. rd3: "使用数字和英文字母的组合"
  150. },
  151. 'en': {
  152. headers1: 'Login',
  153. headers2: 'Live Chat',
  154. headers3: 'Create Account',
  155. box1item1: 'CWG Markets is offering an exciting new promotion for brand new clients! Any new traders that join us this year will receive a 20% bonus on their first deposit! Additionally, traders will receive $3 cash per trade! Claim up to $1,000.',
  156. box1item2: '*per lot on FX, Gold and Silver',
  157. box1item3: '*T&Cs apply. Full details of our promotions are on our website.',
  158. box1item3_1: 'Deposit $100 or more to receive this instant bonus',
  159. box1item3_2: 'For traders using CWG Markets for the first time',
  160. box1item3_3: 'Profit can be withdrawn at any time',
  161. box1item3_4: 'EA and Algo traders welcome',
  162. box1item4: 'Signup!',
  163. box1item5: 'Country',
  164. box1item6: 'Phone',
  165. box1item7: 'Email',
  166. box1item8: 'Email Varification Code',
  167. box1item9: 'Password',
  168. box1item10: 'I declared and confirmed that I am not a citizen or resident of the United States.',
  169. box1item11: 'Submit',
  170. box2_1: 'Bonus for new traders! ',
  171. box2_2: '',
  172. box2_3: '',
  173. box2item1: 'Claim your 20% bonus on your first deposit, up to $2,000',
  174. box2item2: 'Simply deposit $100 or more to receive this instant bonus',
  175. box2item3: 'Receive $3 cash per trade! Claim up to $1,000.',
  176. box2item4: '*per lot on FX, Gold and Silver',
  177. box3: 'Ho do I claim this bonus?',
  178. box3item1: 'Register for a ‘Live Account’. Once it has been fully verified, you will be able to create an MT4/MT5 account (either Instant, Classic or Advanced)',
  179. box3item2: 'Deposit $100 or more, then click the ‘20% Bonus’ icon that will appear under the ‘Promotions’ tab.',
  180. box3item3: 'After the first 30 days of the bonus being applied, you will be eligible to withdraw the cash generated for the trading volume. If the full trading volume requirements are met, traders will also be able to withdraw the full bonus amount',
  181. box3item4_1: '*Please visit ',
  182. box3item4_2: 'CWG official website',
  183. box3item4_3: ' to view the full Terms and Conditions for this promotion',
  184. box4: 'The trilogy of benefits: high rewards with trading protection and transactions are guaranteed loss-free',
  185. box4item1_1: 'Who is eligible for this promotion? ',
  186. box4item1_2: '-Traders who have applied for an account with CWG Markets and have not previously used our services. This includes having a funded account. ',
  187. box4item1_3: '-Traders who apply for an Instant, Classic or Advanced account and make an initial deposit of $100 or more.',
  188. box4item2_1: 'How do I claim this bonus? ',
  189. box4item2_2: 'Register for a ‘Live Account’. Once it has been fully verified, you will be able to create an MT4/MT5 account (either Instant, Classic or Advanced) and make your initial deposit. After this has been complete, click the ‘20% Bonus’ icon that will appear under the ‘Promotions’ tab in your back office and the credit will be applied within 24 hours. ',
  190. box4item2_3: '',
  191. box4item3_1: 'How do I withdraw my bonus?',
  192. box4item3_2: 'In order to withdraw the bonus, the client must trade more than 35% of the initial applied bonus. For example, if the initial applied bonus is $200, the client must trade over 70 lots (35%) of FX, Gold or Silver in order to withdraw the bonus as cash. Once the request has been made, it will be processed within 3-5 working days (if the requirements are met).',
  193. box4item3_3: 'In order to apply for a withdrawal of the bonus, please send an email to activity@cwgmarkets.com with the subject line “20% Bonus Promotion Completed” after the requirements are met. Within the email, please confirm the name of the account holder and your trading account number. Once received, CWG Markets will review your request and it will within 3-5 working days (if the requirements are met).',
  194. box4item4_1: '',
  195. box4item4_2: '',
  196. box4item4_3: '',
  197. box4item6: 'Compensation for losses of up to $900 per month to protect your trading transactions',
  198. box5_1: 'Easy access to ',
  199. box5_2: 'more 500',
  200. box5_3: ' global markets instruments and prime liquidity',
  201. box5item11: 'Foreign Exchange',
  202. box5item12: 'All major and minor forex pairs',
  203. box5item13: 'EURUSD',
  204. box5item14: 'GBPUSD',
  205. box5item15: 'USDJPY',
  206. box5item16: 'USDCNH',
  207. box5item21: 'Precious Metals',
  208. box5item22: 'Gold, Silver and Copper',
  209. box5item23: 'XAUUSD',
  210. box5item24: 'XAGUSD',
  211. box5item25: 'XPTUSD',
  212. box5item26: 'XAUEUR',
  213. box5item31: 'Index & Stock CFD',
  214. box5item32: 'Trade over 100 major US stocks and Indices',
  215. box5item33: 'Apple Inc',
  216. box5item34: 'Tesla Inc',
  217. box5item35: 'US30',
  218. box5item36: 'JP225',
  219. box5item41: 'Commodity Future Prices',
  220. box5item42: 'Trade major commodities such as Crude Oil and Natural Gas with liquidity from major futures exchanges',
  221. box5item43: 'COTTON',
  222. box5item44: 'USCOCOA',
  223. box5item45: 'COFFEE',
  224. box5item46: 'USOILROLL',
  225. box6_1: 'CWG Markets ',
  226. box6_2: 'Traders in over',
  227. box6_3: '150 countries',
  228. box6_4: '',
  229. box6item3: 'Claim Bonus',
  230. box8: 'Deposit and Withdrawal Options',
  231. box9: 'CWG Markets Honors and Awards',
  232. box9item11: 'Best MT4&MT5 Broker of the Year',
  233. box9item12: '2022',
  234. box9item13: 'fxdailyinfo.com',
  235. box9item21: 'Best Trading Environment of the Year ',
  236. box9item22: '2022',
  237. box9item23: 'fxdailyinfo.com',
  238. box9item31: 'The Most Trusted Broker ',
  239. box9item32: '2022',
  240. box9item33: 'fxdailyinfo.com',
  241. box9item41: 'Best Trading Platform UK ',
  242. box9item42: '2022',
  243. box9item43: 'Global Banking & Finance Review Award',
  244. box9item51: 'Best Commodity Broker of the Year UK ',
  245. box9item52: '2022',
  246. box9item53: 'Global Banking & Finance Review Award',
  247. box9item61: 'Best Multi-Asset Trading Platform UK ',
  248. box9item62: '2021',
  249. box9item63: 'Global Banking & Finance Review Award',
  250. box9item71: 'Best Trading Platform UK ',
  251. box9item72: '2021',
  252. box9item73: 'Global Banking & Finance Review Award',
  253. box9item81: 'Excellent Education Service Award ',
  254. box9item82: '2021',
  255. box9item83: 'The 7th Financial Analysis Conference',
  256. box9item91: 'Broker Popularity Platform of the Year ',
  257. box9item92: '2021',
  258. box9item93: 'Huiyou.com',
  259. box9item101: 'Most Influential Broker of the Year ',
  260. box9item102: '2020',
  261. box9item103: 'The 2nd Financial Technology Conference',
  262. box9item111: 'Most Innovative MT5 Broker ',
  263. box9item112: '2019',
  264. box9item113: 'Saigon Trade Expo',
  265. box9item121: 'Best Trading Environment Broker ',
  266. box9item122: '2019',
  267. box9item123: 'Fx678.com',
  268. box7item1: 'CWG Markets is the trading name of CWG Group of companies.',
  269. box7item2: 'Cwgvu.com is owned and operated within the CWG Group of companies. CWG Group consists of:',
  270. 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.',
  271. 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.',
  272. box7item5: 'Clients must be at least 18 years old to use the services of CWG Markets.',
  273. 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',
  274. box7item7: ' Risk Disclosure ',
  275. box7item8: 'carefully.',
  276. 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.',
  277. 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 .',
  278. box7item11: '© 2020 CWG MARKETS',
  279. box7item12: 'Privacy Policy',
  280. box7item13: '.',
  281. box7item14: ' Terms & Conditions',
  282. box7item15: '.',
  283. code: 'Get Code',
  284. country: "Please select your country",
  285. email: "Email Address Format Error",
  286. phone: "Phone Format Error",
  287. password: "Must be between 8 to 15 characters,Contain both uppercase and lowercase letter,Use a combination of numbers and letters",
  288. codeInput: "Please enter the Email verification code",
  289. agree: "Please agree to the declaration",
  290. CodeSuccess: "Verification code has been successfully obtained ",
  291. emailempty: "Email Address cannot be empty",
  292. waitCode1: "Please wait ",
  293. waitCode2: "s ",
  294. registerSuc: "Registration successful, log in now...",
  295. SystemError: "System Error, please try again.",
  296. LoginSuccess: "Login Successful",
  297. st1: "Must be between 8 to 15 characters",
  298. nd2: "Contain both uppercase and lowercase letter",
  299. rd3: "Use a combination of numbers and letters"
  300. }
  301. }
  302. let vm = new Vue({
  303. el: "#active1",
  304. data: {
  305. //多语言
  306. langList: {
  307. en: "ENGLISH",
  308. cn: "中文简体"
  309. },
  310. language: "en",
  311. lang: {},
  312. flag: false,
  313. loading: false,
  314. mock_options: [],
  315. // img_logo: logo,
  316. timer: 59,
  317. interval: null,
  318. getCodeString: "",
  319. notCountry:[
  320. 'AF','AI','AG','BS','BY',
  321. 'BZ','BA','BI','CF','CD','CU',
  322. 'ET','FJ','PS','GN','GW','HT',
  323. 'IR','IQ','LB','LY','ML','MM',
  324. 'NI','KP','PW','RU','SO','SS',
  325. 'SD','SY','UA','US','VE','YE','ZW','MY'
  326. ],
  327. // 表单参数
  328. params: {
  329. agentId: null,
  330. comPoint: null,
  331. sourceCode:null,
  332. subId: "",
  333. email: "",
  334. password: "",
  335. country: "",
  336. emailCode: "",
  337. agree: false,
  338. linkValue: null,
  339. },
  340. clientWidth:'',
  341. // 验证规则
  342. rules: {
  343. country: [
  344. {
  345. validator: (rule, value, callback) => {
  346. if (value != "" && value != null) {
  347. callback();
  348. } else {
  349. callback(new Error(content[sessionStorage.getItem('lang')].country));
  350. }
  351. },
  352. trigger: "blur",
  353. },
  354. ],
  355. email: [
  356. {
  357. validator: (rule, value, callback) => {
  358. if (/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(value)) {
  359. callback();
  360. } else {
  361. callback(new Error(content[sessionStorage.getItem('lang')].email));
  362. }
  363. },
  364. trigger: "blur",
  365. },
  366. ],
  367. emailCode: [
  368. {
  369. validator: (rule, value, callback) => {
  370. if (
  371. value != "" &&
  372. value != null
  373. ) {
  374. callback();
  375. } else {
  376. callback(new Error(content[sessionStorage.getItem('lang')].codeInput));
  377. }
  378. },
  379. trigger: "blur",
  380. },
  381. ],
  382. password: [
  383. {
  384. validator: (rule, value, callback) => {
  385. if (/^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?!.*([~!@&%$^\\(\\)#_]).*\\1.*\\1.*\\1)[A-Za-z0-9~!@&%$^\\(\\)#_]{8,16}$/.test(value)) {
  386. callback();
  387. } else {
  388. callback(new Error(content[sessionStorage.getItem('lang')].password));
  389. }
  390. },
  391. trigger: "blur",
  392. },
  393. ],
  394. agree: [
  395. {
  396. validator: (rule, value, callback) => {
  397. if (value) {
  398. callback();
  399. } else {
  400. callback(new Error(content[sessionStorage.getItem('lang')].agree));
  401. }
  402. },
  403. trigger: "change",
  404. },
  405. ],
  406. phone: [
  407. {
  408. validator: (rule, value, callback) => {
  409. if (/^[0-9]\d*$/.test(value)) {
  410. callback();
  411. } else {
  412. callback(new Error(content[sessionStorage.getItem('lang')].phone));
  413. }
  414. },
  415. trigger: "blur",
  416. },
  417. ],
  418. },
  419. notRegisterMsg:"",
  420. notRegisterMsgOpen:false,
  421. imgUrl: '',
  422. ho: ''
  423. },
  424. computed: {
  425. rule1: function () {
  426. if (!this.params.password) {
  427. return false;
  428. }
  429. return /^.{8,16}$/.test(this.params.password);
  430. },
  431. rule2: function () {
  432. return /^(?=.*?[a-z])(?=.*?[A-Z]).*$/.test(this.params.password);
  433. },
  434. rule3: function () {
  435. return /^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?!.*([~!@&%$^\\(\\)#_]).*\\1.*\\1)[A-Za-z0-9~!@&%$^\\(\\)#_]{8,16}$/.test(
  436. this.params.password
  437. );
  438. },
  439. },
  440. methods: {
  441. // 语言切换函数
  442. chooseLang(key) {
  443. this.lang = content[key];
  444. this.language = key;
  445. sessionStorage.setItem("lang", this.language);
  446. location.reload();
  447. this.initTimer();
  448. },
  449. //获取国家列表
  450. async getCountry() {
  451. axios.post(this.imgUrl + '/country/get', {
  452. ...this.params
  453. //参数
  454. }).then(res => {//请求成功后的处理函数
  455. if (res.data.code == 200) {
  456. this.mock_options = res.data.data;
  457. } else {
  458. this.$message.error(res.data.msg);
  459. }
  460. }).catch(err => {//请求失败后的处理函数
  461. })
  462. },
  463. //获取当前国家编码
  464. async getCountryMsg() {
  465. axios.get(this.imgUrl + '/country/get', {
  466. //参数
  467. }).then(res => {//请求成功后的处理函数
  468. if (res.data.code == 200) {
  469. this.notRegisterMsg = res.data.msg
  470. if ((res.data.msg == "GB"||res.data.msg == "IE")&&res.data.data.indexOf('//195.224.141.218') == -1) {
  471. window.location.href = 'https://www.cwgmarkets.co.uk';
  472. } else {
  473. document.getElementById("pre").style.display = 'none'
  474. }
  475. } else {
  476. document.getElementById("pre").style.display = 'none'
  477. this.$message.error(res.data.msg);
  478. }
  479. }).catch(err => {//请求失败后的处理函数
  480. })
  481. },
  482. //获取当前国家编码
  483. async getCountryCode() {
  484. axios.post(this.imgUrl + '/country/getCodeByIp', {
  485. //参数
  486. }).then(res => {//请求成功后的处理函数
  487. if (res.data.code == 200) {
  488. if (this.notCountry.indexOf(res.data.msg)==-1) {
  489. this.params.country = res.data.msg;
  490. }
  491. if (!sessionStorage.getItem("timer")) {
  492. let lang = sessionStorage.getItem("lang")
  493. ? sessionStorage.getItem("lang")
  494. : this.params.country == "CN"
  495. ? "cn"
  496. : "en";
  497. sessionStorage.clear();
  498. sessionStorage.setItem("lang", lang);
  499. } else {
  500. let timer = sessionStorage.getItem("timer");
  501. let lang = sessionStorage.getItem("lang")
  502. ? sessionStorage.getItem("lang")
  503. : this.params.country == "CN"
  504. ? "cn"
  505. : "en";
  506. sessionStorage.clear();
  507. sessionStorage.setItem("lang", lang);
  508. sessionStorage.setItem("timer", timer);
  509. }
  510. this.language = sessionStorage.getItem("lang");
  511. this.lang = content[this.language];
  512. this.initTimer();
  513. } else {
  514. this.$message.error(res.data.msg);
  515. }
  516. }).catch(err => {//请求失败后的处理函数
  517. })
  518. },
  519. // 注册
  520. register: async function () {
  521. if (this.notRegisterMsg == 'MY') {
  522. this.notRegisterMsgOpen = true;
  523. return
  524. }
  525. this.$refs["params"].validate(async (valid) => {
  526. if (valid) {
  527. if (this.flag) {
  528. return;
  529. } else {
  530. this.flag = true;
  531. }
  532. axios.post(this.imgUrl + '/custom/register', {
  533. ...this.params
  534. //参数
  535. }).then(res => {//请求成功后的处理函数
  536. if (res.data.code == 200) {
  537. this.loading = true;
  538. this.$message({
  539. message: this.lang.registerSuc,
  540. type: 'success'
  541. });
  542. this.login();
  543. this.flag = false;
  544. } else {
  545. this.$message.error(res.data.msg);
  546. this.flag = false;
  547. }
  548. }).catch(err => {//请求失败后的处理函数
  549. })
  550. } else {
  551. return false;
  552. }
  553. });
  554. },
  555. // 登陆
  556. login: async function () {
  557. axios.post(this.imgUrl + '/custom/login', {
  558. loginName: this.params.email,
  559. password: this.params.password,
  560. //参数
  561. }).then(res => {//请求成功后的处理函数
  562. if (res.data.code == 200) {
  563. sessionStorage.setItem("access_token", res.data.data);
  564. axios.defaults.headers.common["Access-Token"] = res.data.data;
  565. this.getLoginInfo();
  566. } else {
  567. this.$message.error(res.data.msg);
  568. }
  569. }).catch(err => {//请求失败后的处理函数
  570. })
  571. },
  572. //获取登录信息
  573. async getLoginInfo() {
  574. axios.post(this.imgUrl + '/custom/info', {
  575. //参数
  576. }).then(res => {//请求成功后的处理函数
  577. if (res.data.code == 200) {
  578. this.loading = true;
  579. // this.$store.commit("InitInfo", res.data.data);
  580. this.$message({
  581. message: this.lang.LoginSuccess,
  582. type: 'success'
  583. });
  584. setTimeout(() => {
  585. this.loading = false;
  586. Session.Set("user", JSON.stringify(res.data.data), true)
  587. window.location.href = this.imgUrl + '/#/customer/index';
  588. }, 1000);
  589. } else {
  590. this.$message.error(this.lang.SystemError);
  591. }
  592. }).catch(err => {//请求失败后的处理函数
  593. })
  594. },
  595. // 获取验证码
  596. getCode: async function (val) {
  597. if (val) {
  598. if (!this.params.country) {
  599. this.$message.error(content[sessionStorage.getItem("lang")].country);
  600. return;
  601. }
  602. if (!this.params.email) {
  603. this.$message.error(content[sessionStorage.getItem("lang")].emailempty);
  604. return;
  605. }
  606. if (!/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(this.params.email)) {
  607. this.$message.error(content[sessionStorage.getItem("lang")].email);
  608. return;
  609. }
  610. }
  611. this.getCodeString =
  612. content[sessionStorage.getItem("lang")].waitCode1 +
  613. this.timer +
  614. content[sessionStorage.getItem("lang")].waitCode2;
  615. let that = this;
  616. if (!this.interval) {
  617. this.getCode1(val);
  618. this.interval = setInterval(() => {
  619. that.timer--;
  620. sessionStorage.setItem("timer", that.timer);
  621. that.getCodeString =
  622. content[sessionStorage.getItem("lang")].waitCode1 +
  623. that.timer +
  624. content[sessionStorage.getItem("lang")].waitCode2;
  625. if (that.timer == 0) {
  626. this.getCodeString = content[sessionStorage.getItem("lang")].code;
  627. clearInterval(that.interval);
  628. that.interval = null;
  629. that.timer = 59;
  630. sessionStorage.setItem("timer", that.timer);
  631. }
  632. }, 1000);
  633. }
  634. },
  635. //验证码
  636. async getCode1(val) {
  637. if (val) {
  638. axios.post(this.imgUrl + '/custom/register/send/code', {
  639. ...this.params
  640. //参数
  641. }).then(res => {//请求成功后的处理函数
  642. if (res.data.code == 200) {
  643. this.$message({
  644. message: this.lang.CodeSuccess,
  645. type: 'success'
  646. });
  647. } else {
  648. this.$message.error(res.data.msg);
  649. }
  650. }).catch(err => {//请求失败后的处理函数
  651. })
  652. }
  653. },
  654. // 初始化定时器
  655. initTimer: function () {
  656. let t = sessionStorage.getItem("timer") || this.timer;
  657. if (t == 59) {
  658. this.getCodeString = content[sessionStorage.getItem("lang")].code;
  659. } else {
  660. this.timer = sessionStorage.getItem("timer");
  661. this.getCode(0);
  662. }
  663. },
  664. getQueryStringRegExp(name){
  665. var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s|&|$)", "i");
  666. if (reg.test(location.href)) return unescape(RegExp.$2.replace(/\+/g, " ")); return "";
  667. },
  668. getCodeQuery(){
  669. this.params.sourceCode = this.getQueryStringRegExp('ex')
  670. this.params.w = this.getQueryStringRegExp('w')
  671. this.params.subId = this.getQueryStringRegExp('SUBID')
  672. this.params.agentId = Number(this.getQueryStringRegExp('mmdi')) || null;
  673. this.params.linkValue = this.getQueryStringRegExp('mmF')
  674. switch (this.getQueryStringRegExp('mmF')) {
  675. case "F0":
  676. this.params.comPoint = 0;
  677. break;
  678. case "F1":
  679. this.params.comPoint = 10;
  680. break;
  681. case "F2":
  682. this.params.comPoint = 20;
  683. break;
  684. case "F3":
  685. this.params.comPoint = 30;
  686. break;
  687. }
  688. switch (this.getQueryStringRegExp('mmB')) {
  689. case "B0":
  690. this.params.ibInvalid = 0;
  691. break;
  692. case "B1":
  693. this.params.ibInvalid = 1;
  694. break;
  695. }
  696. }
  697. },
  698. mounted() {
  699. // console.log(document.body.clientWidth);
  700. // this.clientWidth = document.body.clientWidth;
  701. // if (window.location.search.indexOf('&ex=') != '-1') {
  702. // this.params.sourceCode = window.location.search.split('&ex=')[1] || null;
  703. // } else if (window.location.search.indexOf('?ex=') != '-1') {
  704. // this.params.sourceCode = window.location.search.split('?ex=')[1] || null;
  705. // }
  706. this.getCodeQuery();
  707. this.ho = window.location.host.split('.')[1];
  708. this.imgUrl = window.location.origin;
  709. // this.imgUrl = 'https://secure.cwgcn.com';
  710. this.getCountryMsg()
  711. if (sessionStorage.getItem("lang")) {
  712. this.language = sessionStorage.getItem("lang"),
  713. this.lang = content[sessionStorage.getItem("lang")];
  714. } else {
  715. this.language = 'en',
  716. this.lang = content['en'];
  717. }
  718. //获取国家
  719. this.getCountryCode();
  720. this.getCountry();
  721. // this.initTimer();
  722. },
  723. destroyed() {
  724. clearInterval(this.interval);
  725. },
  726. });