暫無描述

queryHelp.js 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. goBack()
  25. cituInfoData()
  26. });
  27. //nav返回上一页
  28. function goBack () {
  29. $("nav i").click(function () {
  30. window.location.href = httpStr + "&name=" + city_name + "&code=" + code + "&token=" + token;
  31. })
  32. }
  33. //各城市对应注册地址
  34. function goZhuce () {
  35. tips.find(function(item,index) {
  36. if(item.region == city_name){
  37. if(item.URL.register){
  38. goUrl=item.URL.register;
  39. // window.location.href = goUrl;
  40. window.webkit.messageHandlers.OutPushMessageHandler.postMessage({'name':city_name,'url':goUrl});
  41. }else{
  42. goUrl=item.URL.web;
  43. // window.location.href = goUrl;
  44. window.webkit.messageHandlers.OutPushMessageHandler.postMessage({'name':city_name,'url':goUrl});
  45. }
  46. }
  47. })
  48. }
  49. //帮助文案
  50. function cituInfoData () {
  51. $.ajax({
  52. type:"POST",
  53. url: "/api/city/listinfo",
  54. data:{
  55. 'region': qs.name
  56. },
  57. dataType:'json',
  58. success: function (res) {
  59. console.log(res)
  60. if(res.errno == 0 && res.rst.city && res.rst.city.city){
  61. var data = res.rst.city.city;
  62. if(data.help_info && data.help_info != ""){
  63. $(".container").html(data.help_info);
  64. $(".container").find("p").css({
  65. "line-height":'0.2rem',
  66. "font-size":"0.14rem",
  67. "color":"#666666"
  68. }).find("span").css({
  69. "line-height":"0.26rem",
  70. "font-size":"0.14rem",
  71. "color":"#666666",
  72. "font-family": "微软雅黑"
  73. })
  74. $(".container strong").css({"color":"#333333","font-weight":"bold","font-size":"0.16rem"})
  75. $(".container strong span").css({"color":"#333333","font-weight":"bold","font-size":"0.16rem"})
  76. $(".container strong").find("span").css({"color":"#333333"})
  77. $(".goGjj").html(`<div class="ljqw">前往<em>${city_name}</em>公积金官网注册 <span onclick="goZhuce()">立即前往 >></span>
  78. </div>`)
  79. }else{
  80. $(".container").html(`<h3 class="title">如何获取查询密码/公积金帐号</h3>
  81. <p class="goOfficialNetwork">如果您还未在最新版,<i>${city_name}</i>公积金官网主注册并设置相关信息;<span onclick="goZhuce()">立即前往 >></span></p>
  82. <p class="goOfficialNetwork">注册完成后即可使用APP查询。</p>`)
  83. }
  84. }else{
  85. showMsg(res.err)
  86. }
  87. }
  88. });
  89. }
  90. /**
  91. * [showMsg 提示各种错误信息,3s后消失]
  92. */
  93. function showMsg(msg) {
  94. var msgBox = $('.alert-info');
  95. msgBox.children('p').text(msg);
  96. msgBox.show();
  97. setTimeout(function() {
  98. msgBox.hide();
  99. }, 3000);
  100. }