网站
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

register.js 2.6 KiB

4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", 'swiper'], function ($, template, Tools, swiper) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. type:0
  9. },
  10. };
  11. var tools = new Tools();
  12. module.init = function (page) {
  13. //背景高度
  14. module.register();
  15. module.data.type = getQueryVariable("type")
  16. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  17. tools.getWebConfig();
  18. setTimeout(function(){
  19. //主题图片切换
  20. module.switchTheme();
  21. },500)
  22. };
  23. //主题图片切换
  24. module.switchTheme = function(){
  25. if(themeColor == 'red'){
  26. if (getQueryVariable('type')){
  27. document.getElementById('registerTit').src = '../../static/images/registerTit_red.png'
  28. }else{
  29. document.getElementById('icon1').src = '../../static/images/register_icon2_red.png'
  30. document.getElementById('icon2').src = '../../static/images/register_icon1_red.png'
  31. }
  32. }else if(themeColor == 'green'){
  33. if (getQueryVariable('type')){
  34. document.getElementById('registerTit').src = '../../static/images/registerTit.png'
  35. }else{
  36. document.getElementById('icon2').src = '../../static/images/register_icon1.png'
  37. document.getElementById('icon1').src = '../../static/images/register_icon2.png'
  38. }
  39. }
  40. }
  41. //底部友情链接
  42. module.bottomFriendsLinks = function (data) {
  43. if (data.code == 200) {
  44. var content = data.data;
  45. //console.log(content)
  46. module.data.friendsLinksList = content;
  47. var friendsLinksData = template('friendsLinksData', module.data);
  48. $("#friendsLinksContent").html(friendsLinksData);
  49. }
  50. }
  51. //获取地址栏参数
  52. function getQueryVariable(variable){
  53. var query = window.location.search.substring(1);
  54. var vars = query.split("&");
  55. for (var i=0;i<vars.length;i++) {
  56. var pair = vars[i].split("=");
  57. if(pair[0] == variable){return pair[1];}
  58. }
  59. return(false);
  60. }
  61. //背景高度
  62. module.register = function(){
  63. document.getElementById('registerBody').style.height = (document.body.offsetHeight - 112) +'px';
  64. }
  65. goAgree = function(){
  66. tools.skip('registerFrom.html?type='+module.data.type)
  67. }
  68. goRegister = function(){
  69. tools.skip('register.html')
  70. }
  71. return module;
  72. });