Nav apraksta

queryHelp.js 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. var token = '';
  2. var city_name = '';
  3. var returnUrl = '';
  4. var code = '';
  5. var goUrl = "";
  6. var httpStr = "";
  7. var qs = parseQueryString(window.location.href);
  8. $().ready(function() {
  9. if (qs.returnUrl) {
  10. returnUrl = qs.returnUrl;
  11. }
  12. if (qs.httpStr) {
  13. httpStr = qs.httpStr;
  14. }
  15. if (qs.name) {
  16. city_name = qs.name;
  17. }
  18. if (qs.code) {
  19. code = qs.code;
  20. }
  21. if (qs.token) {
  22. token = qs.token;
  23. }
  24. $(".ljqw em").html(city_name)
  25. $(".goOfficialNetwork i").html(city_name)
  26. goBack()
  27. cituInfoData()
  28. loanClick();
  29. });
  30. //nav返回上一页
  31. function goBack () {
  32. $("nav i").click(function () {
  33. window.location.href = httpStr + "&name=" + city_name + "&code=" + code + "&token=" + token;
  34. })
  35. }
  36. //各城市对应注册地址
  37. function goZhuce () {
  38. tips.find(function(item,index) {
  39. if(item.region == city_name){
  40. if(item.URL.register){
  41. goUrl=item.URL.register;
  42. goCopy(goUrl)
  43. // window.location.href = "iframeUrl.html?url=" + goUrl;
  44. // window.webkit.messageHandlers.OutPushMessageHandler.postMessage({'name':city_name,'url':goUrl});
  45. }else if(item.URL.web){
  46. goUrl=item.URL.web;
  47. goCopy(goUrl)
  48. // window.location.href = "iframeUrl.html?url=" + goUrl;
  49. // window.webkit.messageHandlers.OutPushMessageHandler.postMessage({'name':city_name,'url':goUrl});
  50. }else{
  51. $(".tips .ljqw").html("")
  52. }
  53. }
  54. })
  55. }
  56. //帮助文案
  57. function cituInfoData () {
  58. $.ajax({
  59. type:"POST",
  60. url: "/api/city/listinfo",
  61. data:{
  62. 'region': qs.name
  63. },
  64. dataType:'json',
  65. success: function (res) {
  66. console.log(res)
  67. if(res.errno == 0 && res.rst.city && res.rst.city.city){
  68. var data = res.rst.city.city;
  69. if(data.help_info && data.help_info != ""){
  70. $(".container").html(data.help_info);
  71. $(".container").find("p").css({
  72. "line-height":'0.2rem',
  73. "font-size":"0.14rem",
  74. "color":"#666666"
  75. }).find("span").css({
  76. "line-height":"0.26rem",
  77. "font-size":"0.14rem",
  78. "color":"#666666",
  79. "font-family": "微软雅黑"
  80. })
  81. $(".container strong").css({"color":"#333333","font-weight":"bold","font-size":"0.16rem"})
  82. $(".container strong span").css({"color":"#333333","font-weight":"bold","font-size":"0.1rem"})
  83. $(".container strong").find("span").css({"color":"#333333"})
  84. $(".goGjj").html(`<div class="ljqw">前往<em>${city_name}</em>公积金官网注册 <span onclick="goZhuce()">复制链接 </span>
  85. </div>`)
  86. }else{
  87. $(".container").html(`<h3 class="title">如何获取查询密码/公积金帐号</h3>
  88. <p class="goOfficialNetwork">如果您还未在最新版,<i>${city_name}</i>公积金官网主注册并设置相关信息;<span onclick="goZhuce()">复制链接</span></p>
  89. <p class="goOfficialNetwork">注册完成后即可使用APP查询。</p>`)
  90. }
  91. }else{
  92. showMsg(res.err)
  93. }
  94. }
  95. });
  96. }
  97. //推广统计的接口
  98. function extension_statistics (id,name) {
  99. $.ajax({
  100. type:"POST",
  101. url: "/api/hot/getactivitylink",
  102. data:{
  103. 'id': id
  104. },
  105. dataType:'json',
  106. success: function (res) {
  107. if(res.errno == 0 && res.rst){
  108. var url = res.rst.link;
  109. window.location.href = url;
  110. // url = encodeURIComponent(url);
  111. // window.location.href='loan.html?url=' + url
  112. }else{
  113. showMsg(res.err)
  114. }
  115. }
  116. });
  117. }
  118. function loanClick () {
  119. $(".mySwiper").click(function () {
  120. extension_statistics(129,"贷款")
  121. })
  122. }