暂无描述

queryHelp.js 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. });
  29. //nav返回上一页
  30. function goBack () {
  31. $("nav i").click(function () {
  32. window.location.href = httpStr + "&name=" + city_name + "&code=" + code + "&token=" + token;
  33. })
  34. }
  35. //各城市对应注册地址
  36. function goZhuce () {
  37. tips.find(function(item,index) {
  38. if(item.region == city_name){
  39. if(item.URL.register){
  40. goUrl=item.URL.register;
  41. goCopy(goUrl)
  42. // window.location.href = "iframeUrl.html?url=" + goUrl;
  43. // window.webkit.messageHandlers.OutPushMessageHandler.postMessage({'name':city_name,'url':goUrl});
  44. }else if(item.URL.web){
  45. goUrl=item.URL.web;
  46. goCopy(goUrl)
  47. // window.location.href = "iframeUrl.html?url=" + goUrl;
  48. // window.webkit.messageHandlers.OutPushMessageHandler.postMessage({'name':city_name,'url':goUrl});
  49. }else{
  50. $(".tips .ljqw").html("")
  51. }
  52. }
  53. })
  54. }
  55. //帮助文案
  56. function cituInfoData () {
  57. $.ajax({
  58. type:"POST",
  59. url: "/api/city/info",
  60. headers:{
  61. 'token': '5dac206be8b1f5736285fc03a08adb3c'
  62. },
  63. data:{
  64. 'region': qs.name
  65. },
  66. dataType:'json',
  67. success: function (res) {
  68. console.log(res)
  69. if(res.errno == 0 && res.rst.data && res.rst.data.city){
  70. var data = res.rst.data.city;
  71. if(data.help_info && data.help_info != ""){
  72. $(".container").html(data.help_info);
  73. $(".container").find("p").css({
  74. "line-height":'0.2rem',
  75. "font-size":"0.14rem",
  76. "color":"#666666"
  77. }).find("span").css({
  78. "line-height":"0.26rem",
  79. "font-size":"0.14rem",
  80. "color":"#666666"
  81. })
  82. $(".container strong").css({"color":"#333333","font-weight":"bold","font-size":"0.16rem"})
  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. }