Keine Beschreibung

queryHelp.js 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. renderTips(city_name);
  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. * [renderTips 渲染常见问题]
  57. * @param {[type]} region [description]
  58. */
  59. function renderTips(region) {
  60. var tipStr = "";
  61. var defaultTip = null;
  62. var defaultRegion = '北京';
  63. var tipContent = tips.find(function(item, index) {
  64. if (item.region === defaultRegion) {
  65. defaultTip = item;
  66. }
  67. return item.region === region;
  68. });
  69. if (!tipContent) {
  70. tipContent = defaultTip; // 默认北京
  71. }
  72. tipContent = tipContent.tip;
  73. console.log()
  74. if(Boolean(tipContent[0].title)){
  75. for (var list of tipContent) {
  76. tipStr += "<p class=title>" + list.title + "</p>";
  77. if (list.content) {
  78. for (var tip of list.content) {
  79. tipStr += "<p style=text-indent:2em>" + tip + "</p>"
  80. }
  81. }
  82. }
  83. }else{
  84. tipStr = `<p style="padding-top:0.2rem">如果您还未在最新版,${city_name}公积金官网主注册并设置相关信息;注册完成后即可使用APP查询。</p>`
  85. }
  86. $('.tips .con').html(tipStr);
  87. }