移动端
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

246 linhas
6.1 KiB

  1. <template>
  2. <div class="app-container">
  3. <div class="header_main">
  4. 执法依据
  5. <div class="return_btn" @click="onClickLeft"></div>
  6. </div>
  7. <div class="jg"></div>
  8. <div class="search_box">
  9. <van-popover
  10. v-model="showPopover"
  11. trigger="click"
  12. :actions="enforceNewsTypeOptions"
  13. placement="bottom-start"
  14. @select="popChange"
  15. >
  16. <template #reference>
  17. <div class="select_box">
  18. <p>{{popValue}}</p>
  19. <van-icon name="arrow-down" color="#1D6FE9" />
  20. </div>
  21. </template>
  22. </van-popover>
  23. <div class="search">
  24. <input type="text" v-model="searchInput" placeholder="请输入执法依据名称" />
  25. <img src="../../../../static/images/lawEnforcement/new/index_icon_04.png" @click="goSearch">
  26. </div>
  27. </div>
  28. <div class="main_box">
  29. <van-list
  30. v-model="loading"
  31. :finished="finished"
  32. finished-text="没有更多了"
  33. @load="getList"
  34. >
  35. <div class="peopleList">
  36. <van-row v-for="(item,index) in list" :key="index" @click="$router.push({name:'lawEnforcementBasisDetail',query: {content:item}})" >
  37. <van-col :span="24">
  38. <img src="../../../../static/images/lawEnforcement/icon/record_icon_03.png"/>
  39. <p>{{item.title}}</p>
  40. </van-col>
  41. </van-row>
  42. </div>
  43. </van-list>
  44. </div>
  45. </div>
  46. </template>
  47. <script>
  48. import { getNewsList , enforceNewsType } from "@/api/lawEnforcement/index";
  49. export default {
  50. name: "programmeDetail",
  51. data() {
  52. return {
  53. showPopover: false,
  54. // 通过 actions 属性来定义菜单选项
  55. enforceNewsTypeOptions: [],
  56. loading: false,
  57. finished: false,
  58. searchInput:'',
  59. queryParams: {
  60. // 分页
  61. pageNum: 1,
  62. pageSize: 10,
  63. // 查询排序
  64. orderByColumn: "id",
  65. isAsc: "desc",
  66. number: "002",
  67. deptId: null,
  68. title:''
  69. },
  70. list:[],
  71. popValue:'执法依据'
  72. };
  73. },
  74. created() {
  75. enforceNewsType().then(response => {
  76. for (var i = 0; i < response.data.length; i++) {
  77. this.enforceNewsTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  78. }
  79. });
  80. },
  81. methods: {
  82. getList(){
  83. var _this = this;
  84. getNewsList(_this.queryParams).then(response => {
  85. response.rows.map(res=>{
  86. // res.businessType = res.businessType == '' ? '' : this.selectDictLabel(this.businessTypeOptions, res.businessType);
  87. this.list.push(res);
  88. })
  89. if(this.list.length >= response.total){
  90. this.finished = true;
  91. return;
  92. }else{
  93. this.loading = false;
  94. this.queryParams.pageNum += 1 ;
  95. }
  96. });
  97. },
  98. popChange(action,index){
  99. console.log(action,index)
  100. this.popValue = action.text;
  101. this.queryParams.number = action.value;
  102. this.list = [];
  103. this.queryParams.pageNum = 1 ;
  104. this.finished = false;
  105. this.loading = false;
  106. this.getList();
  107. },
  108. goSearch(){
  109. if (this.searchInput == ''){
  110. location.reload()
  111. }
  112. this.list = [];
  113. this.finished = false;
  114. this.loading = false;
  115. this.queryParams.title = this.searchInput;
  116. this.queryParams.pageNum = 1;
  117. this.getList();
  118. },
  119. },
  120. }
  121. </script>
  122. <style scoped lang="scss">
  123. .app-container {
  124. padding: 0 0 0.2rem;
  125. }
  126. .jg{
  127. height: 116px;
  128. }
  129. .search_box{
  130. display: flex;
  131. justify-content: space-between;
  132. align-items: center;
  133. width: 92%;
  134. margin: 10PX auto;
  135. .van-popover__wrapper{
  136. flex: 1;
  137. margin-right: 10PX;
  138. }
  139. .select_box{
  140. border: 1px solid #1D6FE9;
  141. border-radius: 50PX;
  142. padding: 0 12PX ;
  143. background: #ffffff;
  144. height: 30PX;
  145. line-height: 30PX;
  146. display: flex;
  147. justify-content: space-around;
  148. align-items: center;
  149. p{
  150. display: -webkit-box;
  151. -webkit-box-orient: vertical;
  152. -webkit-line-clamp: 1;
  153. word-break: break-all;
  154. overflow: hidden;
  155. }
  156. }
  157. .search{
  158. background: #ffffff;
  159. display: flex;
  160. justify-content: space-between;
  161. align-items: center;
  162. width: 70%;
  163. border: 1px solid #1D6FE9;
  164. padding: 1PX 1PX 1PX 12PX ;
  165. border-radius: 50PX;
  166. input{
  167. flex: 1;
  168. background: transparent;
  169. }
  170. }
  171. }
  172. .header_main{
  173. height: 116px;
  174. background: url('../../../../static/images/lawEnforcement/new/list_head.png') no-repeat;
  175. background-size: 100% 100%;
  176. position: fixed;
  177. top: 0;
  178. left: 0;
  179. width: 100%;
  180. font-size: 36px;
  181. line-height: 116px;
  182. text-align: center;
  183. color: #fff;
  184. z-index: 999;
  185. .return_btn{
  186. width: 24px;
  187. height: 43.2px;
  188. background: url('../../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  189. background-size: 20px 36px;
  190. position: absolute;
  191. left: 38px;
  192. top: 36px;
  193. }
  194. .add_btn{
  195. width: 56.4px;
  196. height: 40.8px;
  197. background: url('../../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  198. background-size: 47px 34px;
  199. position: absolute;
  200. right: 38px;
  201. top: 36px;
  202. }
  203. }
  204. .peopleList{
  205. padding: 0 3%;
  206. text-align: left;
  207. .van-row{
  208. border-bottom: 1px solid #dddddd;
  209. display: flex;
  210. align-items: center;
  211. &:last-child{
  212. border: none;
  213. }
  214. .van-col--24{
  215. display: flex;
  216. align-items: center;
  217. p{
  218. margin-left: 10PX;
  219. }
  220. }
  221. .van-col{
  222. text-align: left;
  223. font-size: 14PX;
  224. color: #333333;
  225. padding: 15PX 0;
  226. img{
  227. display: block;
  228. }
  229. }
  230. }
  231. }
  232. .main_box{
  233. width: 96%;
  234. margin: 0 auto;
  235. border-radius: 10PX;
  236. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  237. overflow: hidden;
  238. background-color: #FFF;
  239. }
  240. </style>