question.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. {extend name="layout/base" /}
  2. {block name="title"}
  3. <title>常见问题_麻花网络客服中心</title>
  4. {/block}
  5. {block name="header"}
  6. <link rel="stylesheet" href="__STATIC__/css/mobile/style.css">
  7. {/block}
  8. {block name="content"}
  9. <!-- header start -->
  10. <header class="top">
  11. <div class="header question">
  12. <a href="{:getMobileCscUrl(4)}"><img src="__STATIC__/images/mobile/icon/left.png" class="back"></a>
  13. <h1>常见问题</h1>
  14. </div>
  15. <ul class="game_rec">
  16. {foreach name="typeList" item="vo" key="k" }
  17. <li><a href="javascript:;" onclick="window.location.replace('{:getMobileServiceUrl(1)}{$k}')" class=" {if condition='$type == $k'} active {/if} ">{$vo}</a></li>
  18. {/foreach}
  19. </ul>
  20. </header>
  21. <!-- header end -->
  22. {empty name="list"}
  23. <div class="no_content" style="margin-top: 1.8rem;">
  24. <div>
  25. <img src="/static/images/mobile/icon/no-gift.png">
  26. <p>暂无相关常见问题</p>
  27. </div>
  28. </div>
  29. {else/}
  30. <ul class="question-list">
  31. {volist name="list" id="item" id='item' key="k"}
  32. <li>
  33. <h4>{$current_num + $k}、{$item.title}</h4>
  34. <p>{$item.answer}</p>
  35. </li>
  36. {/volist}
  37. </ul>
  38. {/empty}
  39. <div class="weui-loadmore">
  40. <i class="weui-loading"></i>
  41. <span class="weui-loadmore__tips">数据加载中,请稍等</span>
  42. </div>
  43. <div class="no-more-data"><span></span>我也是有底线的<span></span></div>
  44. {include file="layout/footer" /}
  45. {/block}
  46. {block name="detail_js"}
  47. <script>
  48. if($(".game_rec li").length <1){
  49. $(".game_rec").hide()
  50. }
  51. var currentPage = parseInt("{$list->currentPage()}");
  52. var lastPage = parseInt("{$list->lastPage()}");
  53. var total = parseInt("{$list->total()}");
  54. var url = window.location.href;
  55. $(".no-more-data").hide();
  56. var loading = false; //状态标记
  57. $(document.body).infinite(90).on("infinite", function() {
  58. if (loading) return;
  59. loading = true;
  60. if (currentPage + 1 > lastPage) {
  61. $(".weui-loadmore").hide();
  62. if (currentPage > 1) {
  63. $(".no-more-data").show();
  64. }
  65. loading = false;
  66. return false;
  67. }
  68. loading = true;
  69. $(".weui-loadmore").show();
  70. setTimeout(function() {
  71. currentPage += 1;
  72. $.ajax({
  73. type: "POST",
  74. timeOut: 10000,
  75. url: url,
  76. data: {
  77. "page": currentPage
  78. },
  79. async: false,
  80. success: function(res) {
  81. var num = (res.data.current_page -1) * 10;
  82. var arr = res.data.data;
  83. arr.forEach(function(val, index) {
  84. var nownum = num+index+1;
  85. $(".question-list").append(
  86. "<li>"+
  87. "<h4>"+nownum+"、"+val.title+"</h4>"+
  88. "<p>"+val.answer+"</p>"+
  89. "</li>"
  90. );
  91. });
  92. },
  93. error: function() {
  94. $.alert("网络错误,请刷新页面重试");
  95. }
  96. });
  97. $(".weui-loadmore").hide();
  98. loading = false;
  99. }, 600); //模拟延迟
  100. });
  101. </script>
  102. {/block}