No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

style_1-原手动计算分页.htm 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <?php
  2. $name = "list-s-1";
  3. ?>
  4. <link rel="stylesheet" href="/template/pc/components/list/style_1.css" media="all">
  5. <!--定义div盒子-->
  6. <div class="<?php echo $name; ?>-content">
  7. <div class="box">
  8. <!--定义内容布局--->
  9. <div class="row">
  10. <!--定义内部栅格 上下中左右 使用浮动-->
  11. <div class="top">
  12. <!--定义内容标签 p span a li img--->
  13. <!--<span></span>-->
  14. {eyou:type typeid='$route_param.tid' empty='暂时没有数据'}
  15. <a target="_blank" href="{:get_tid_url_2($field['typeurl'])}">
  16. {eyou:if condition='($route_param.tid != 38)'}
  17. {$field.typename}
  18. {eyou:else /}
  19. 职称工种
  20. {/eyou:if}
  21. </a>
  22. {/eyou:type}
  23. </div>
  24. <div class="center">
  25. <!--定义内容标签 p span a li img--->
  26. <!-- <?php for($i=1;$i<=15;$i++){ ?>
  27. <li>
  28. <img src="https://www.wetools.com/imgplaceholder/160x140" />
  29. <a target="_blank" href="">建筑工职称</a>
  30. </li>
  31. <?php } ?> -->
  32. <!--list 标签只能使用一次 会导致程序变量错乱-->
  33. {eyou:if condition='($route_param.tid == 38)'}
  34. <!--调用全部职称产品并分页-->
  35. {eyou:php}
  36. //计算limit属性
  37. $pagesize = 12;
  38. if(!empty($route_param['pa'])){
  39. $curpage = $route_param['pa'];
  40. $start_li = $pagesize*($curpage-1); //开始位置
  41. $end_li = $pagesize*$curpage;
  42. $limit_cat_value = $start_li.','.$pagesize;
  43. }else{
  44. $curpage = 1;
  45. $limit_cat_value = '0,'.$pagesize;
  46. }
  47. {/eyou:php}
  48. {eyou:assign name='$limit_cat' value="$limit_cat_value" /}
  49. <!--直接用sql-->
  50. {eyou:sql sql="SELECT id FROM __PREFIX__arctype WHERE topid=38 and status=1 and type='产品' limit $limit_cat" cachetime='3600' id='res'}
  51. {eyou:foreach name='$res' item='cat'}
  52. {eyou:type typeid='$cat' empty='暂时没有数据' id='item'}
  53. <li style="position:relative;">
  54. <img src="/template/pc/images/bg_1.png" width='160' height='140'/>
  55. <a target="_blank" href="{:get_tid_url_2($item['typeurl'],0,0,0,'产品',$item['topid'])}">{$item.typename}</a>
  56. <span style="display:block;position: absolute;top:35%;width:100%;text-align:center;font-size: 20px;font-weight: bold;">
  57. {$item.typename}
  58. </span>
  59. </li>
  60. {/eyou:type}
  61. {/eyou:foreach}
  62. {/eyou:sql}
  63. {eyou:else /}
  64. <!--具体职称分类-->
  65. {eyou:php}
  66. //计算limit属性
  67. $pagesize = 12;
  68. if(!empty($route_param['pa'])){
  69. $curpage = $route_param['pa'];
  70. $start_li = $pagesize*($curpage-1); //开始位置
  71. $end_li = $pagesize*$curpage;
  72. $limit_cat_value = $start_li.','.$pagesize;
  73. }else{
  74. $curpage = 1;
  75. $limit_cat_value = '0,'.$pagesize;
  76. }
  77. {/eyou:php}
  78. <!--一开始用sql 用limit浪费时间-->
  79. {eyou:assign name='$limit_cat' value="$limit_cat_value" /}
  80. {eyou:channel typeid='$route_param.tid' limit="$limit_cat" currentclass='active'}
  81. <li style="position:relative;">
  82. <img src="/template/pc/images/bg_1.png" width='160' height='140'/>
  83. <a target="_blank" href="{:get_tid_url_2($field['typeurl'],0,0,0,'产品',$field['topid'])}">{$field.typename}</a>
  84. <span style="display:block;position: absolute;top:35%;width:100%;text-align:center;font-size: 20px;font-weight: bold;">
  85. {$field.typename}
  86. </span>
  87. </li>
  88. {/eyou:channel}
  89. {/eyou:if}
  90. </div>
  91. <div class="bottom">
  92. <div class="bottom-row">
  93. <!--定义内容标签 p span a li img--->
  94. {eyou:assign name='pid' value="$route_param.tid" /}
  95. {eyou:sql sql="select COUNT(*) as total FROM __PREFIX__arctype where parent_id=$pid" cachetime='3600' empty='没有数据' id="list"}
  96. {eyou:php}
  97. $total_page = ceil($list['total']/$pagesize);
  98. $total_page_for = $total_page + 1;
  99. $pro_page = $curpage - 1;
  100. $pev_page = $curpage + 1;
  101. {/eyou:php}
  102. <div class="bottom bottom-row">
  103. {eyou:if condition='($route_param.tid == 38)'}
  104. {eyou:if condition='((int)$total_page > 1)'}
  105. {eyou:if condition='((int)$curpage === 1)'}
  106. <li><a>首页</a></li>
  107. <li><a>上一页</a></li>
  108. {eyou:else /}
  109. <li><a target="_blank" href="/zczl">首页</a></li>
  110. {eyou:if condition='((int)$curpage === 2)'}
  111. <li><a target="_blank" href="/zczl">上一页</a></li>
  112. {eyou:else /}
  113. <li><a target="_blank" href="/zczl-{$pro_page}">上一页</a></li>
  114. {/eyou:if}
  115. {/eyou:if}
  116. {eyou:for start='1' end="$total_page_for"}
  117. {eyou:if condition='((int)$i === 1)'}
  118. {eyou:if condition='((int)$curpage === $i)'}
  119. <li class="active-1"><a>{$i}</a></li>
  120. {eyou:else /}
  121. <li><a target="_blank" href="/zczl" data-ey_fc35fdc="html" data-tmp="1" >{$i}</a></li>
  122. {/eyou:if}
  123. {eyou:else /}
  124. {eyou:if condition='((int)$curpage === $i)'}
  125. <li class="active-1"><a>{$i}</a></li>
  126. {eyou:else /}
  127. <li><a target="_blank" href="/zczl-{$i}" data-ey_fc35fdc="html" data-tmp="1">{$i}</a></li>
  128. {/eyou:if}
  129. {/eyou:if}
  130. {/eyou:for}
  131. {eyou:if condition='((int)$curpage === (int)$total_page)'}
  132. <li><a>下一页</a></li>
  133. <li><a>末页</a></li>
  134. {eyou:else /}
  135. <li><a target="_blank" href="/zczl-{$pev_page}" data-ey_fc35fdc="html" data-tmp="1">下一页</a></li>
  136. <li><a target="_blank" href="/zczl-{$total_page}" data-ey_fc35fdc="html" data-tmp="1">末页</a></li>
  137. {/eyou:if}
  138. {/eyou:if}
  139. 共<strong>
  140. {eyou:php}
  141. echo $total_page;
  142. {/eyou:php}
  143. </strong>页 <strong>{$list.total}</strong>条
  144. {eyou:else /}
  145. {eyou:if condition='((int)$total_page > 1)'}
  146. {eyou:if condition='((int)$curpage === 1)'}
  147. <li><a>首页</a></li>
  148. <li><a>上一页</a></li>
  149. {eyou:else /}
  150. <li><a target="_blank" href="/zczl/jzzc{$route_param.tid}">首页</a></li>
  151. {eyou:if condition='((int)$curpage === 2)'}
  152. <li><a target="_blank" href="/zczl/jzzc{$route_param.tid}">上一页</a></li>
  153. {eyou:else /}
  154. <li><a target="_blank" href="/zczl/jzzc{$route_param.tid}-{$pro_page}">上一页</a></li>
  155. {/eyou:if}
  156. {/eyou:if}
  157. {eyou:for start='1' end="$total_page_for"}
  158. {eyou:if condition='((int)$i === 1)'}
  159. {eyou:if condition='((int)$curpage === $i)'}
  160. <li class="active-1"><a target="_blank" >{$i}</a></li>
  161. {eyou:else /}
  162. <li><a target="_blank" href="/zczl/jzzc{$route_param.tid}" data-ey_fc35fdc="html" data-tmp="1">{$i}</a></li>
  163. {/eyou:if}
  164. {eyou:else /}
  165. {eyou:if condition='((int)$curpage === $i)'}
  166. <li class="active-1"><a>{$i}</a></li>
  167. {eyou:else /}
  168. <li><a target="_blank" href="/zczl/jzzc{$route_param.tid}-{$i}" data-ey_fc35fdc="html" data-tmp="1">{$i}</a></li>
  169. {/eyou:if}
  170. {/eyou:if}
  171. {/eyou:for}
  172. {eyou:if condition='((int)$curpage === (int)$total_page)'}
  173. <li><a>下一页</a></li>
  174. <li><a>末页</a></li>
  175. {eyou:else /}
  176. <li><a target="_blank" href="/zczl/jzzc{$route_param.tid}-{$pev_page}" data-ey_fc35fdc="html" data-tmp="1">下一页</a></li>
  177. <li><a target="_blank" href="/zczl/jzzc{$route_param.tid}-{$total_page}" data-ey_fc35fdc="html" data-tmp="1">末页</a></li>
  178. {/eyou:if}
  179. {/eyou:if}
  180. 共<strong>
  181. {eyou:php}
  182. echo $total_page;
  183. {/eyou:php}
  184. </strong>页 <strong>{$list.total}</strong>条
  185. {/eyou:if}
  186. </div>
  187. {/eyou:sql}
  188. <!-- <a target="_blank" href=""><img src="/template/pc/images/011.svg" /></a>
  189. <?php for($i=1;$i<=5;$i++){ ?>
  190. <a target="_blank" href="" class="active-<?php echo $i; ?>"><?php echo $i; ?></a>
  191. <?php } ?>
  192. <a target="_blank" href="">.....</a>
  193. <a target="_blank" href="">18</a>
  194. <a target="_blank" href="">19</a>
  195. <a target="_blank" href="">20</a>
  196. <a target="_blank" href=""><img src="/template/pc/images/012.svg" /></a>
  197. <span>跳至<input type="text" />页</span>-->
  198. </div>
  199. </div>
  200. </div>
  201. <div class="clear"></div>
  202. </div>
  203. </div>