移动端
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.
 
 

378 regels
10 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar fixed placeholder >
  4. <template #title>
  5. <van-image src="../../../static/images/lawEnforcement/logo.png" width="30" height="30" />
  6. <p style="">农业综合行政执法公众平台</p>
  7. </template>
  8. </van-nav-bar>
  9. <van-swipe class="my-swipe" :autoplay="3000" height="128" indicator-color="white">
  10. <van-swipe-item v-for="(item , index) in workImgList" :key="index">
  11. <van-image :src="item.img" height="128" @click="goWork(item.id)"/>
  12. <p class="bannerTit">{{item.title}}</p>
  13. </van-swipe-item>
  14. </van-swipe>
  15. <van-tabs type="card" animated>
  16. <van-tab title="工作动态">
  17. <van-cell-group>
  18. <van-cell v-for="(item , index) in workList" :key="index" :title="item.title" :value="item.newsTime" :to="{name:'workDetail',query:{id:item.id,type:'work'}}" />
  19. <van-cell title="查看更多>" style="text-align: center" :to="{name:'work',query:{type:'work'}}" />
  20. </van-cell-group>
  21. </van-tab>
  22. <van-tab title="通知公告">
  23. <van-cell-group>
  24. <van-cell v-for="(item , index) in noticeList" :key="index" :title="item.title" :value="item.newsTime" :to="{name:'workDetail',query:{id:item.id,type:'notice'}}" />
  25. <van-cell title="查看更多>" style="text-align: center" :to="{name:'work',query:{type:'notice'}}" />
  26. </van-cell-group>
  27. </van-tab>
  28. <van-tab title="执法依据">
  29. <van-cell-group>
  30. <van-cell v-for="(item , index) in enforcementList" :key="index" :title="item.title" :value="item.newsTime" :to="{name:'workDetail',query:{id:item.id,type:'enforcement'}}" />
  31. <van-cell title="查看更多>" style="text-align: center" :to="{name:'work',query:{type:'enforcement'}}" />
  32. </van-cell-group>
  33. </van-tab>
  34. </van-tabs>
  35. <van-cell-group class="listBox">
  36. <van-cell value="全部" is-link :to="{name:'work',query:{type:'scheme'}}">
  37. <template #title>
  38. <van-icon name="../../../static/images/lawEnforcement/icon/icon_zf.png" size="20"></van-icon>
  39. <span class="custom-title">执法方案<i class="bgBlue"></i></span>
  40. </template>
  41. </van-cell>
  42. <van-cell v-for="(item , index) in schemeList" :key="index" :title="item.schemeName" :value="item.applyTime" :to="{name:'schemeDetail',query:{id:item.id}}"></van-cell>
  43. </van-cell-group>
  44. <van-cell-group class="listBox">
  45. <van-cell value="全部" is-link :to="{name:'indexComplaint'}">
  46. <template #title>
  47. <van-icon name="../../../static/images/lawEnforcement/icon/icon_ts.png" size="20"></van-icon>
  48. <span class="custom-title">投诉建议<i class="bgBlue"></i></span>
  49. </template>
  50. </van-cell>
  51. <van-cell v-for="(item , index) in communicateList" :key="index" :to="{name:'indexComplaint',query:{id:item.id}}" :title="item.title" :value="item.replyTime"></van-cell>
  52. </van-cell-group>
  53. <div style="height: 20PX"></div>
  54. <law></law>
  55. </div>
  56. </template>
  57. <script>
  58. import request from "@/utils/request";
  59. import { getTopDeptId , news , scheme , communicate } from "@/api/lawEnforcement/index";
  60. import law from "@/components/common/law_footer";
  61. export default {
  62. name: "index",
  63. components: {
  64. law
  65. },
  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. queryParamsTask: {
  81. pageNum: 1,
  82. pageSize: 10,
  83. taskId: null,
  84. taskName: null,
  85. systemType: 26,
  86. },
  87. //新闻集合
  88. newList:[],
  89. //轮播图集合
  90. bannerList:'',
  91. //工作动态
  92. workList:[],
  93. //工作动态图片集合
  94. workImgList:[],
  95. //通知公告
  96. noticeList:[],
  97. //通知公告图片集合
  98. noticeImgList:[],
  99. //执法依据
  100. enforcementList:[],
  101. //执法依据图片集合
  102. enforcementImgList:[],
  103. //执法方案
  104. schemeList:[],
  105. //投诉建议
  106. communicateList:[],
  107. taskList:[],
  108. };
  109. },
  110. created() {
  111. this.getDeptId();
  112. },
  113. watch: {
  114. setUpModule: function (newVal, oldVal) {
  115. this.setUpModuleId = newVal;
  116. },
  117. },
  118. methods: {
  119. getDeptId(){
  120. getTopDeptId().then(response => {
  121. this.getNewList(response.data);
  122. // this.getTaskList();
  123. })
  124. },
  125. getNewList(deptId){
  126. news('003',deptId,8).then(response => {
  127. this.workList = response.data;
  128. for (var i = 0; i < response.data.length; i++) {
  129. var imgStrs = response.data[i].content.match(/<img.*?>/g);
  130. var title = response.data[i].title;
  131. var id = response.data[i].id;
  132. if (imgStrs != null && imgStrs != '') {
  133. this.workImgList.push({img:imgStrs[0].trim().substr(10,(imgStrs[0].trim().length-12)).replace(/amp;/g,''),title:title,id:id})
  134. }
  135. console.log(this.workImgList)
  136. }
  137. });
  138. news('001',deptId,8).then(response => {
  139. this.noticeList = response.data;
  140. });
  141. news('002',deptId,8).then(response => {
  142. this.enforcementList = response.data;
  143. });
  144. scheme(deptId,4).then(response => {
  145. console.log(response)
  146. this.schemeList = response.data;
  147. })
  148. var query = {
  149. deptId:deptId,
  150. pageNum:1,
  151. pageSize:4
  152. };
  153. communicate(query).then(response => {
  154. for (var i = 0 ; i < response.rows.length ; i++){
  155. response.rows[i].replyTime = response.rows[i].replyTime == '' ? '' : response.rows[i].replyTime.substr(0,10);
  156. console.log(response.rows[i].replyTime.substr(0,10))
  157. this.communicateList.push(response.rows[i])
  158. }
  159. })
  160. },
  161. /** 查询待办列表 */
  162. /*getTaskList() {
  163. this.loading = true;
  164. return request({
  165. url: "/activiti/process/taskList",
  166. method: "get",
  167. params: this.queryParamsTask,
  168. })
  169. .then((response) => {
  170. console.log(response)
  171. this.taskList = response.rows;
  172. this.total = response.total;
  173. console.log(this.total)
  174. this.loading = false;
  175. })
  176. .then(() => {
  177. });
  178. },*/
  179. getList(){
  180. this.loading = true;
  181. this.queryParams.number = 2 ;
  182. this.queryParams.pageSize = 5 ;
  183. newList(this.queryParams).then(response => {
  184. for (var i = 0; i < response.rows.length; i++) {
  185. this.newList.push(response.rows[i]);
  186. var imgStrs = response.rows[i].content.match(/<IMG src=\"([^\"]*?)\">/gi)
  187. if (imgStrs != null && imgStrs != '') {
  188. this.newList[i].img = imgStrs[0].substr(10,(imgStrs[0].length-12));
  189. }
  190. }
  191. console.log(this.newList)
  192. if(this.newList.length >= response.total){
  193. this.finished = true;
  194. return;
  195. }
  196. this.queryParams.pageNum += 1 ;
  197. this.loading = false;
  198. });
  199. },
  200. getBanner(){
  201. this.loading = true;
  202. this.queryParams.number = 1 ;
  203. this.queryParams.pageSize = 5 ;
  204. newList(this.queryParams).then(response => {
  205. this.bannerList = response.rows;
  206. for (var i = 0; i < response.rows.length; i++) {
  207. var imgStrs = response.rows[i].content.match(/<IMG src=\"([^\"]*?)\">/gi)
  208. if (imgStrs != null && imgStrs != '') {
  209. this.bannerList[i].img = imgStrs[0].substr(10,(imgStrs[0].length-12));
  210. }
  211. }
  212. this.loading = false;
  213. });
  214. },
  215. goWork(id){
  216. window.location = '/lawEnforcement/workDetail?type=work&id='+id;
  217. },
  218. },
  219. };
  220. </script>
  221. <style scoped lang="scss">
  222. @font-face {
  223. font-family: SourceHanSansCNBold;
  224. src: url("../../assets/fonts/SourceHanSansCN-Bold.otf");
  225. }
  226. .app-container {
  227. padding: 0 ;
  228. background-color: #FFFCFC; /* 浏览器不支持时显示 */
  229. background-image: linear-gradient(#1D6FE9,#4286EC,#FFFCFC);
  230. background-size: 100% 400Px;
  231. background-repeat: no-repeat;
  232. }
  233. .van-cell__title{
  234. color: #666666;
  235. flex: 0.7;
  236. display: -webkit-box;
  237. -webkit-box-orient: vertical;
  238. -webkit-line-clamp: 1;
  239. word-break: break-all;
  240. overflow: hidden;
  241. }
  242. .van-cell__value{
  243. flex: 0.3;
  244. }
  245. .van-tabs{
  246. .van-cell__title:last-child{
  247. flex: 1;
  248. }
  249. }
  250. .listBox{
  251. width: 96%;
  252. margin: 0 auto;
  253. border-radius: 8Px;
  254. overflow: hidden;
  255. box-shadow: 0PX 5PX 5PX #cccccc;
  256. margin-top: 10PX;
  257. .van-icon{
  258. vertical-align: middle;
  259. }
  260. .custom-title{
  261. font-size: 17PX;
  262. color: #333333;
  263. vertical-align: middle;
  264. line-height: 1;
  265. position: relative;
  266. }
  267. .tap{
  268. color: #1D6FE9;
  269. }
  270. .bgBlue{
  271. display: block;
  272. position: absolute;
  273. width: 17PX;
  274. height: 17PX;
  275. border-radius: 50%;
  276. background-color: rgba(29,111,233,0.26);
  277. top: -2PX;
  278. right: -8PX;
  279. }
  280. }
  281. /deep/ .van-nav-bar__title{
  282. display: flex;
  283. max-width: initial;
  284. p{
  285. line-height: 30Px;
  286. margin-left: 6Px;
  287. font-size: 21Px;
  288. color: #D60303;
  289. font-family: SourceHanSansCNBold;
  290. }
  291. }
  292. /deep/ .van-tabs__content{
  293. width: 96%;
  294. margin: 0 auto;
  295. box-shadow: 0px 5px 5px #ccc;
  296. }
  297. /deep/ van-tab__pane-wrapper{
  298. padding: 0 2%;
  299. }
  300. /deep/ .van-tab{
  301. border: none!important;
  302. color: #1D6FE9!important;
  303. }
  304. /deep/ .van-tab--active{
  305. border-radius: 30Px;
  306. color: #ffffff!important;
  307. box-shadow: 0px 5px 5px #ccc;
  308. background-color: #FE1313!important;
  309. }
  310. /deep/ .van-tabs--card>.van-tabs__wrap{
  311. height: 0.9rem;
  312. margin: 10Px 0;
  313. }
  314. /deep/ .van-tab__pane{
  315. background: #FFF;
  316. overflow: hidden;
  317. }
  318. /deep/ .van-tabs__nav--card{
  319. padding: 3Px 2%;
  320. border: none;
  321. border-radius: 1rem;
  322. height: 0.9rem;
  323. }
  324. .bannerTit{
  325. position: absolute;
  326. bottom: 10px;
  327. background: rgba(255,255,255,0.3);
  328. width: 100%;
  329. height: 0.8rem;
  330. line-height: 0.8rem;
  331. color: #fff;
  332. overflow: hidden;
  333. padding: 0 3%;
  334. font-size: 16Px;
  335. }
  336. .link{
  337. color: #000;
  338. }
  339. .my-swipe {
  340. border-radius: 8Px;
  341. width: 96%;
  342. margin: 0 auto;
  343. margin-top: 10Px;
  344. }
  345. .my-swipe .van-swipe-item .van-image{
  346. width: 100%;
  347. }
  348. .van-grid-item p{
  349. margin-top: 10px;
  350. }
  351. .newTit{
  352. font-size: 0.45rem;
  353. margin: 0.4rem 0;
  354. font-family: Source Han Sans SC, Source Han Sans SC-Medium;
  355. font-weight: 500;
  356. text-align: left;
  357. color: #333333;
  358. }
  359. .newContent{
  360. display: -webkit-box;
  361. -webkit-box-orient: vertical;
  362. -webkit-line-clamp: 2;
  363. word-break: break-all;
  364. overflow: hidden;
  365. }
  366. .search-icon {
  367. line-height: inherit;
  368. margin-left: 10px;
  369. }
  370. </style>