news.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?php
  2. $view
  3. ->set('name', 'news')
  4. ->set('title', '资讯')
  5. /*
  6. ->fetch(array('link@href', 2), Dever::assets("global.css"))
  7. ->fetch(array('link@href', 3), Dever::assets('<{(isset($name) ? $name : "news")}>.css', "css"))
  8. ->fetch(array('script@src', 2), Dever::assets('global.js'))
  9. ->fetch(array('script@src', 3), Dever::assets('<{(isset($name) ? $name : "news")}>.js', 'js'))
  10. */
  11. ->import('inc/head')
  12. # 焦点图
  13. ->loop
  14. (
  15. '.index-slide .swiper-slide',
  16. 'main/content.focus|key=news_focus&name=资讯焦点图',
  17. array
  18. (
  19. 'a' => array
  20. (
  21. 'href' => '$v.link',
  22. 'title' => '$v.name',
  23. ),
  24. 'img' => array
  25. (
  26. 'src' => '$v.pic',
  27. 'alt' => '$v.name',
  28. ),
  29. 'span' => array
  30. (
  31. 'html' => '$v.name ."<br/>". $v.desc',
  32. ),
  33. )
  34. )
  35. ->fetch('.index-slide@style', 'main/content.focus?key=news_focus&name=资讯焦点图', 'none')
  36. # 广告
  37. ->loop
  38. (
  39. '.ad-swiper .swiper-slide',
  40. 'main/content.ad|key=news_ad&name=资讯广告',
  41. array
  42. (
  43. 'a' => array
  44. (
  45. 'href' => '$v.link',
  46. 'title' => '$v.name',
  47. ),
  48. 'img' => array
  49. (
  50. 'src' => '$v.pic',
  51. 'alt' => '$v.name',
  52. ),
  53. )
  54. )
  55. ->fetch('.ad-swiper@style', 'main/content.ad?key=home_ad&name=首页广告', 'none')
  56. ->loop
  57. (
  58. '#mobile_tuijian dl',
  59. 'main/content.focus|key=news_focus&name=资讯焦点图&num=1',
  60. array
  61. (
  62. 'a|0' => array
  63. (
  64. 'href' => '$v.link',
  65. 'title' => '$v.name',
  66. 'img' => array
  67. (
  68. 'src' => '$v.pic',
  69. 'alt' => '$v.name',
  70. ),
  71. ),
  72. 'a|1' => array
  73. (
  74. 'href' => '$v.link',
  75. 'title' => '$v.name',
  76. 'html' => '$v.name ."<br/>". $v.desc',
  77. ),
  78. 'p' => array
  79. (
  80. 'html' => '$v.info',
  81. ),
  82. 'span' => array
  83. (
  84. 'html' => '$v.pdate_string',
  85. ),
  86. )
  87. )
  88. ->loop
  89. (
  90. '#news dl',
  91. 'main/content.news|type=1',
  92. array
  93. (
  94. 'a|0' => array
  95. (
  96. 'href' => '$v.link',
  97. 'title' => '$v.name',
  98. 'img' => array
  99. (
  100. 'src' => '$v.pic',
  101. 'alt' => '$v.name',
  102. ),
  103. ),
  104. 'a|1' => array
  105. (
  106. 'href' => '$v.link',
  107. 'title' => '$v.name',
  108. 'html' => '$v.name ."<br/>". $v.desc',
  109. ),
  110. 'p' => array
  111. (
  112. 'html' => '$v.info',
  113. ),
  114. 'span' => array
  115. (
  116. 'html' => '$v.pdate_string',
  117. ),
  118. )
  119. )
  120. ->fetch('.more@href', 'javascript:;')
  121. ->fetch('.more@dever-show', 'Dever::pageInfo()["link"] ? "1" : "2"')
  122. ->fetch('.more@style', 'Dever::pageInfo()["link"] ? "" : "display:none"')
  123. ->append('body', '<div id="page" dever-page-link="<{Dever::pageInfo()["link"]}>" dever-page-list=".dever-page"></div>')
  124. ->import('inc/foot')
  125. ->display();