Açıklama Yok

queryHelp.js 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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/info",
  54. headers:{
  55. 'token': '5dac206be8b1f5736285fc03a08adb3c'
  56. },
  57. data:{
  58. 'region': qs.name
  59. },
  60. dataType:'json',
  61. success: function (res) {
  62. console.log(res)
  63. if(res.errno == 0 && res.rst.data && res.rst.data.city){
  64. var data = res.rst.data.city;
  65. if(data.help_info && data.help_info != ""){
  66. $(".container").html(data.help_info);
  67. $(".container").find("p").css({
  68. "line-height":'0.2rem',
  69. "font-size":"0.14rem",
  70. "color":"#666666"
  71. }).find("span").css({
  72. "line-height":"0.26rem",
  73. "font-size":"0.14rem",
  74. "color":"#666666"
  75. })
  76. $(".container strong").css({"color":"#333333","font-weight":"bold","font-size":"0.16rem"})
  77. $(".container strong").find("span").css({"color":"#333333"})
  78. $(".goGjj").html(`<div class="ljqw">前往<em>${city_name}</em>公积金官网注册 <span onclick="goZhuce()">立即前往 >></span>
  79. </div>`)
  80. }else{
  81. $(".container").html(`<h3 class="title">如何获取查询密码/公积金帐号</h3>
  82. <p class="goOfficialNetwork">如果您还未在最新版,<i>${city_name}</i>公积金官网主注册并设置相关信息;<span onclick="goZhuce()">立即前往 >></span></p>
  83. <p class="goOfficialNetwork">注册完成后即可使用APP查询。</p>`)
  84. }
  85. }else{
  86. showMsg(res.err)
  87. }
  88. }
  89. });
  90. }
  91. /**
  92. * [showMsg 提示各种错误信息,3s后消失]
  93. */
  94. function showMsg(msg) {
  95. var msgBox = $('.alert-info');
  96. msgBox.children('p').text(msg);
  97. msgBox.show();
  98. setTimeout(function() {
  99. msgBox.hide();
  100. }, 3000);
  101. }