移动端
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

174 řádky
4.9 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-row>
  4. <van-col span="2">
  5. <van-image src="../../static/images/index/logo.png" />
  6. </van-col>
  7. <van-col span="22" style="line-height: 29px;font-size: 20px;">农村产权交易平台</van-col>
  8. </van-row>
  9. <van-swipe class="my-swipe" :autoplay="3000" height="180" indicator-color="white">
  10. <van-swipe-item v-for="(item,index) in bannerList" :key="index">
  11. <van-image :src="item.img" height="180" />
  12. <p class="bannerTit">{{item.title}}</p>
  13. </van-swipe-item>
  14. </van-swipe>
  15. <div style="border-radius: 10px;overflow: hidden;">
  16. <van-grid :border="false" :column-num="3">
  17. <van-grid-item to="/news/index">
  18. <van-image src="../../static/images/icon/icon_new.png" width="40" height="40" />
  19. <p>新闻资讯</p>
  20. </van-grid-item>
  21. <van-grid-item>
  22. <van-image src="../../static/images/icon/icon_bidding.png" width="40" height="40" />
  23. <p>竞价大厅</p>
  24. </van-grid-item>
  25. <van-grid-item to="/notice/index">
  26. <van-image src="../../static/images/icon/icon_project.png" width="40" height="40" />
  27. <p>项目公告</p>
  28. </van-grid-item>
  29. <van-grid-item to="/policy">
  30. <van-image src="../../static/images/icon/icon_statute.png" width="40" height="40" />
  31. <p>政策法规</p>
  32. </van-grid-item>
  33. <van-grid-item to="/interaction/index">
  34. <van-image src="../../static/images/icon/icon_talk.png" width="40" height="40" />
  35. <p>互动交流</p>
  36. </van-grid-item>
  37. <van-grid-item to="/supply/index">
  38. <van-image src="../../static/images/icon/icon_need.png" width="40" height="40" />
  39. <p>个人供求</p>
  40. </van-grid-item>
  41. </van-grid>
  42. </div>
  43. <p class="newTit">新闻咨询</p>
  44. <div style="border-radius: 10px;overflow: hidden;">
  45. <van-list
  46. v-model="loading"
  47. :finished="finished"
  48. finished-text="没有更多了"
  49. @load="getList()"
  50. >
  51. <!-- @load="newList"-->
  52. <van-cell v-for="item in newList" :key="item.id" :title="item.title" :label="item.newsTime">
  53. <!-- 使用 right-icon 插槽来自定义右侧图标 -->
  54. <template #right-icon>
  55. <van-image :src="item.img" class="search-icon" width="30%" />
  56. </template>
  57. </van-cell>
  58. </van-list>
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. import { newList } from "@/api/index";
  64. export default {
  65. name: "index",
  66. data() {
  67. return {
  68. //是否显示加载
  69. loading: false,
  70. //是否滚动到底部
  71. finished: false,
  72. //查询参数
  73. queryParams: {
  74. pageNum: 1,
  75. pageSize: 5,
  76. deptId:100,
  77. number:2
  78. },
  79. //新闻集合
  80. newList:[],
  81. //轮播图集合
  82. bannerList:''
  83. };
  84. },
  85. created() {
  86. //this.getList();
  87. this.getBanner();
  88. },
  89. methods: {
  90. getList(){
  91. this.loading = true;
  92. this.queryParams.number = 2 ;
  93. this.queryParams.pageSize = 5 ;
  94. newList(this.queryParams).then(response => {
  95. for (var i = 0; i < response.rows.length; i++) {
  96. this.newList.push(response.rows[i]);
  97. var imgStrs = response.rows[i].content.match(/<IMG src=\"([^\"]*?)\">/gi)
  98. if (imgStrs != null && imgStrs != '') {
  99. this.newList[i].img = imgStrs[0].substr(10,(imgStrs[0].length-12));
  100. }
  101. }
  102. if(this.newList.length >= response.total){
  103. this.finished = true;
  104. return;
  105. }
  106. this.queryParams.pageNum += 1 ;
  107. this.loading = false;
  108. });
  109. },
  110. getBanner(){
  111. this.loading = true;
  112. this.queryParams.number = 1 ;
  113. this.queryParams.pageSize = 5 ;
  114. newList(this.queryParams).then(response => {
  115. this.bannerList = response.rows;
  116. for (var i = 0; i < response.rows.length; i++) {
  117. var imgStrs = response.rows[i].content.match(/<IMG src=\"([^\"]*?)\">/gi)
  118. if (imgStrs != null && imgStrs != '') {
  119. this.bannerList[i].img = imgStrs[0].substr(10,(imgStrs[0].length-12));
  120. }
  121. }
  122. this.loading = false;
  123. });
  124. }
  125. },
  126. };
  127. </script>
  128. <style scoped lang="scss">
  129. .app-container {
  130. padding: 6% 3% 0;
  131. }
  132. .bannerTit{
  133. position: absolute;
  134. bottom: 0;
  135. background: #000;
  136. opacity: 0.5;
  137. width: 100%;
  138. height: 0.8rem;
  139. line-height: 0.8rem;
  140. color: #eee;
  141. text-align: center;
  142. overflow: hidden;
  143. padding: 0 5%;
  144. }
  145. .link{
  146. color: #000;
  147. }
  148. .my-swipe {
  149. border-radius: 30px;
  150. margin-top: 0.4rem;
  151. margin-bottom: 0.4rem;
  152. }
  153. .my-swipe .van-swipe-item .van-image{
  154. width: 100%;
  155. }
  156. .van-grid-item p{
  157. margin-top: 10px;
  158. }
  159. .newTit{
  160. font-size: 0.45rem;
  161. margin: 0.4rem 0;
  162. font-family: Source Han Sans SC, Source Han Sans SC-Medium;
  163. font-weight: 500;
  164. text-align: left;
  165. color: #333333;
  166. }
  167. .search-icon {
  168. line-height: inherit;
  169. margin-left: 10px;
  170. }
  171. </style>