policyList.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  1. <template>
  2. <view>
  3. <view :class="['custom-header', { 'is-back': isBack }, bgColor]">
  4. <view class="back-container" @click="handleBack" v-if="canBack">
  5. <view class="back-text">返回</view>
  6. </view>
  7. <view class="content-container">
  8. <view class="content-text">涉企政策</view>
  9. </view>
  10. </view>
  11. <view :style="[{top:CustomBar + 'px'}]">
  12. <view class="search-box1">
  13. <view class="choose-box">
  14. <jp-picker2 class="choose-boxp" v-model="searchForm.des2" empty="政策类型" rangeKey="label" rangeValue="value"
  15. :range="parkList2" @change="picker2change" >
  16. </jp-picker2>
  17. </view>
  18. <view class="choose-box">
  19. <jp-picker2 class="choose-boxp" v-model="searchForm.des3" empty="政策级别" rangeKey="label" rangeValue="value"
  20. :range="parkList" @change="picker2change">
  21. </jp-picker2>
  22. </view>
  23. <view class="choose-box">
  24. <jp-picker2 class="choose-boxp" v-model="searchForm.des8" empty="类别" rangeKey="label" rangeValue="value"
  25. :range="parkList3" @change="picker2change">
  26. </jp-picker2>
  27. </view>
  28. </view>
  29. <view class="center-box">
  30. <view class="center-left-box">
  31. <view class="btn-box-1 mart-t">
  32. {{pageInfo2.des3||0}}
  33. </view>
  34. <view class="btn-box-2 mart-t">
  35. {{pageInfo2.total_count3}}
  36. </view>
  37. <view class="btn-box-3 mart-t">
  38. {{Zcscount}}
  39. </view>
  40. </view>
  41. <view class="center-left-box">
  42. <view class="btn-box-text mart-t">
  43. 当日活跃数
  44. </view>
  45. <view class="btn-box-text mart-t">
  46. 当月活跃数
  47. </view>
  48. <view class="btn-box-text mart-t">
  49. 政策总数
  50. </view>
  51. </view>
  52. </view>
  53. <view class="choose-box2" style="margin-top: 20rpx;margin-left: 20rpx;margin-right: 20rpx;">
  54. <view style="width: 560rpx;">
  55. <input type="text" placeholder="输入政策标题关键词" v-model="searchForm.des1" confirm-type="search"
  56. ></input>
  57. </view>
  58. <text style="padding-left: 40rpx;flex: 1;" class="cuIcon-search color-white" @click="doSearch"></text>
  59. </view>
  60. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" :up="upOption" @up="upCallback">
  61. <view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
  62. v-for="(item, index) in dataList" :key="index" @touchstart="ListTouchStart"
  63. @touchmove="ListTouchMove" @touchend="ListTouchEnd" :data-target="'move-box-' + index">
  64. <view class="item-box" @click="gotoBuildInfo(item.id)">
  65. <view class="item-title-L">
  66. <view class="item-title">
  67. <span class="color-cheng" v-if="item.des2 === '1'">【工信】</span>
  68. <span class="color-cheng" v-else-if="item.des2 === '2'">【科技】</span>
  69. <span class="color-cheng" v-else-if="item.des2 === '3'">【发改】</span>
  70. <span class="color-cheng" v-else-if="item.des2 === '4'">【商务】</span>
  71. <span class="color-cheng" v-else-if="item.des2 === '5'">【人才政策】</span>
  72. <span class="color-cheng" v-else-if="item.des2 === '6'">【其他】</span>
  73. <span class="color-lan" v-if="item.des3 === '1'">【国家】</span>
  74. <span class="color-lan" v-else-if="item.des3 === '2'">【省级】</span>
  75. <span class="color-lan" v-else-if="item.des3 === '3'">【市级】</span>
  76. <span class="color-lan" v-else-if="item.des3 === '4'">【区级】</span>
  77. <span class="color-cheng" v-if="item.des8 === '1'">【政策法规】</span>
  78. <span class="color-cheng" v-else-if="item.des8 === '2'">【品牌申报】</span>
  79. <span class="color-cheng" v-else-if="item.des8 === '3'">【展会活动】</span>
  80. {{item.des1}}
  81. </view>
  82. <view style="display: flex;flex-direction: initial;">
  83. <view class="item-des1">
  84. 政策发文日期:{{item.stime}}
  85. </view>
  86. <view class="item-des2">
  87. 阅读数:{{item.des9||0}}
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </mescroll-body>
  94. </view>
  95. </view>
  96. </template>
  97. <script>
  98. import uniFab from '@/components/uni-fab/uni-fab.vue';
  99. import loginService from '@/api/auth/loginService.js'
  100. import DoublePicker from '@/components/DoublePicker/DoublePicker.vue'
  101. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  102. import MescrollMoreItemMixin from "@/components/mescroll-uni/mixins/mescroll-more-item.js";
  103. export default {
  104. mixins: [MescrollMixin, MescrollMoreItemMixin], // 使用mixin (在main.js注册全局组件)
  105. onShow(option) {
  106. //this.$auth.checkLogin()
  107. this.isLogin=this.$auth.checkisLogin();
  108. this.canBack = window.history.length > 1;
  109. },
  110. components: {
  111. uniFab
  112. },
  113. data() {
  114. return {
  115. isBack: true, // 是否显示返回按钮
  116. backText: '返回', // 返回按钮的文本
  117. bgColor: 'bg-blue', // 背景颜色
  118. isLogin:"",
  119. Zcscount:"",
  120. pageInfo2:{},
  121. searchForm: {
  122. des1:"",
  123. des2:"",
  124. des3:"",
  125. des8:"",
  126. },
  127. picture:["https://ydwqfw.com.cn/yd_qycpfbH5/bg1.jpg",
  128. "https://ydwqfw.com.cn/yd_qycpfbH5/bg2.jpg",
  129. "https://ydwqfw.com.cn/yd_qycpfbH5/bg3.jpg",
  130. "https://ydwqfw.com.cn/yd_qycpfbH5/bg4.jpg"],
  131. parkList2: [ {label: '全部',value: ''},{label: '工信',value: '1'},{label: '科技',value: '2'}
  132. ,{label: '发改',value: '3'},{label: '商务',value: '4'},{label: '人才政策',value: '5'},{label: '其他',value: '6'}],
  133. parkList3: [{label: '全部',value: ''}, {label: '政策法规',value: '1'},{label: '品牌申报',value: '2'},{label: '展会活动',value: '3'}
  134. ],
  135. curWord: "", //当前搜索关键词
  136. dataList: [], // 数据列表
  137. modalName: null,
  138. tablePage: {
  139. total: 0,
  140. currentPage: 1,
  141. pageSize: 10,
  142. orders: []
  143. },
  144. loading: false,
  145. parkId: '',
  146. parkList: [{label: '全部',value: ''},{label: '国家',value: '1'},{label: '省级',value: '2'}
  147. ,{label: '市级',value: '3'},{label: '区级',value: '4'}],
  148. canBack:false,
  149. }
  150. },
  151. created() {
  152. //this.getParkList()
  153. this.getZcs()
  154. },
  155. methods: {
  156. // //选择属地
  157. // getParkList2() {
  158. // loginService.getAreaList({
  159. // }).then(({
  160. // data
  161. // }) => {
  162. // this.parkList2 = data.map((item) => {
  163. // return {
  164. // label: item.des1,
  165. // value: item.des1
  166. // }
  167. // })
  168. // }).catch(e => {
  169. // console.log(e)
  170. // })
  171. // },
  172. //选择行业
  173. // getParkList() {
  174. // loginService.getHyList({
  175. // }).then(({
  176. // data
  177. // }) => {
  178. // this.parkList = data.map((item) => {
  179. // return {
  180. // label: item.industry,
  181. // value: item.industry
  182. // }
  183. // })
  184. // }).catch(e => {
  185. // console.log(e)
  186. // })
  187. // },
  188. getZcs(){
  189. loginService.getDzfCount().then(({
  190. data
  191. }) => {
  192. this.pageInfo2 = data;
  193. }).catch((e) => {
  194. uni.hideLoading();
  195. })
  196. loginService.getZcs({}).then(({ data }) => {
  197. this.Zcscount = data;
  198. });
  199. },
  200. // 新增
  201. add() {
  202. uni.navigateTo({
  203. url: '/pages/comEdit/comEdit'
  204. })
  205. },
  206. // 修改
  207. edit(id) {
  208. uni.navigateTo({
  209. url: '/pages/comEdit/comEdit?id=' + id
  210. })
  211. },
  212. gotoBuildInfo(id) {
  213. uni.navigateTo({
  214. url: `/pages/policy/policyInfo?id=${id}&ischeck=1`
  215. })
  216. },
  217. // 删除
  218. del(id) {
  219. uni.showModal({
  220. title: '提示',
  221. content: '您确认要删除数据吗',
  222. showCancel: true,
  223. success: (res) => {
  224. if (res.confirm) {
  225. loginService.deleteCom(id).then(({
  226. data
  227. }) => {
  228. uni.showToast({
  229. title: data,
  230. icon: "success"
  231. })
  232. this.doSearch()
  233. })
  234. }
  235. }
  236. });
  237. },
  238. /*获取数据列表 */
  239. upCallback(page) {
  240. this.loading = true
  241. loginService.policyList({
  242. current: page.num,
  243. size: page.size,
  244. orders: [{ column: 'a.create_date', asc: false }],
  245. ...this.searchForm
  246. }).then(({
  247. data
  248. }) => {
  249. let curPageData = data.records
  250. this.mescroll.endBySize(curPageData.length, data.total);
  251. //如果是第一页需手动制空列表
  252. if (page.num == 1)
  253. this.dataList = [];
  254. //追加新数据
  255. this.dataList = this.dataList.concat(curPageData);
  256. }).catch(e => {
  257. //联网失败, 结束加载
  258. this.mescroll.endErr();
  259. })
  260. },
  261. remoteMethod (query) {
  262. if (query) {
  263. this.loading = true
  264. setTimeout(() => {
  265. this.loading = false
  266. this.parkList = this.parkList.filter((item) => {
  267. return item.label.toLowerCase().includes(query.toLowerCase())
  268. })
  269. }, 200)
  270. } else {
  271. this.parkList = []
  272. }
  273. },
  274. picker2change(e) {
  275. this.doSearch() ;
  276. },
  277. // 输入监听
  278. inputWord(e) {
  279. },
  280. // 搜索
  281. doSearch() {
  282. this.dataList = []; // 先清空列表,显示加载进度
  283. this.mescroll.resetUpScroll();
  284. },
  285. // ListTouch触摸开始
  286. ListTouchStart(e) {
  287. this.listTouchStart = e.touches[0].pageX
  288. },
  289. // ListTouch计算方向
  290. ListTouchMove(e) {
  291. this.listTouchDirection = e.touches[0].pageX - this.listTouchStart > -60 ? 'right' : 'left'
  292. },
  293. // ListTouch计算滚动
  294. ListTouchEnd(e) {
  295. if (this.listTouchDirection == 'left') {
  296. this.modalName = e.currentTarget.dataset.target
  297. } else {
  298. this.modalName = null
  299. }
  300. this.listTouchDirection = null
  301. },
  302. handleBack() {
  303. // 返回逻辑,比如跳转至上一页
  304. this.$router.go(-1);
  305. }
  306. }
  307. }
  308. </script>
  309. <style>
  310. .ellipsis-description {
  311. font-size: 12px;
  312. line-height: $line-height-base;
  313. display: -webkit-box;
  314. /*作为弹性伸缩盒子模型显示*/
  315. -webkit-line-clamp: 1;
  316. /*显示的行数;如果要设置2行加...则设置为2*/
  317. overflow: hidden;
  318. /*超出的文本隐藏*/
  319. text-overflow: ellipsis;
  320. /* 溢出用省略号*/
  321. -webkit-box-orient: vertical;
  322. /*伸缩盒子的子元素排列:从上到下*/
  323. }
  324. .cu-bar .search-form {
  325. background-color: white;
  326. }
  327. .item-line{
  328. display: flex;
  329. height: 48rpx;
  330. margin-top: 20rpx;
  331. }
  332. .item-line2{
  333. height: 48rpx;
  334. margin-top: 20rpx;
  335. }
  336. .subtitle{
  337. color: #E5880E;
  338. }
  339. .item-name{
  340. margin-top: 5rpx;
  341. font-size: 30rpx;
  342. color: #333;
  343. }
  344. .item-name2{
  345. font-size: 29rpx;
  346. color: #8387AA;
  347. }
  348. .item-name3{
  349. display: flex;
  350. width: 100%;
  351. padding-right: 30rpx;
  352. flex: 1;
  353. justify-content: flex-end;
  354. font-size: 29rpx;
  355. color: #8387AA;
  356. }
  357. .item-content{
  358. color: #1497EF;
  359. font-size: 30rpx;
  360. }
  361. .btn-box{
  362. display: flex;
  363. }
  364. .line-zs{
  365. width: 2rpx;
  366. height: 30rpx;
  367. background: #36A7F3;
  368. }
  369. .edit-botton{
  370. width: 100rpx;
  371. height: 48rpx;
  372. line-height: 48rpx;
  373. color: #fff;
  374. font-size: 28rpx;
  375. margin-right: 20rpx;
  376. border-radius: 10rpx;
  377. background: #5A9EE9;
  378. text-align: center;
  379. }
  380. .del-botton{
  381. width: 100rpx;
  382. height: 48rpx;
  383. line-height: 48rpx;
  384. color: #fff;
  385. font-size: 28rpx;
  386. margin-right: 20rpx;
  387. border-radius: 10rpx;
  388. background: #F27C85;
  389. text-align: center;
  390. }
  391. .color-white{
  392. color: #fff;
  393. font-size: 40rpx;
  394. line-height: 60rpx;
  395. }
  396. .search-box{
  397. background: #36A7F3;
  398. display: flex;
  399. padding-left: 20rpx;
  400. padding-right: 20rpx;
  401. padding-bottom: 10rpx;
  402. }
  403. .input-box{
  404. background: #fff;
  405. height: 65rpx;
  406. width: 640rpx;
  407. display: flex;
  408. align-items: center;
  409. border-radius: 30rpx;
  410. padding-left: 30rpx;
  411. margin-right: 20rpx;
  412. }
  413. .input-boxinput{
  414. height: 75rpx;
  415. font-size: 15rpx;
  416. }
  417. .choose-box{
  418. background: #fff;
  419. width: 350rpx;
  420. border-radius: 30rpx;
  421. height: 60rpx;
  422. display: flex;
  423. align-items: center;
  424. justify-content: center;
  425. margin-right: 20rpx;
  426. }
  427. .choose-boxp{
  428. font-size: 32rpx;
  429. width: 80%;
  430. }
  431. .swiper {
  432. width: 750rpx;
  433. height: 310rpx;
  434. }
  435. .swiper-item {
  436. width: 750rpx;
  437. height: 310rpx;
  438. background-color: aliceblue;
  439. }
  440. .item-box{
  441. display: flex;
  442. width: 710rpx;
  443. margin-left: 20rpx;
  444. background: #FFFFFF;
  445. box-shadow: 0px 1px 3px 0px rgba(9,2,4,0.1);
  446. border-radius: 10px;
  447. padding-top: 20rpx;
  448. padding-left: 20rpx;
  449. padding-right: 10rpx;
  450. padding-bottom: 20rpx;
  451. margin-top: 20rpx;
  452. }
  453. .item-title-L{
  454. display: flex;
  455. width: 100%;
  456. margin-left: 10rpx;
  457. flex-direction: column;
  458. }
  459. .item-title{
  460. font-size: 29rpx;
  461. color: #333;
  462. font-weight: bold;
  463. align-items: center;
  464. }
  465. .item-des{
  466. margin-top: 10rpx;
  467. color: #565656;
  468. font-size: 24rpx;
  469. overflow: hidden; /* 超出部分隐藏 */
  470. text-overflow: ellipsis; /* 超出部分显示省略号 */
  471. display: -webkit-box; /* 使用Webkit的行盒模型 */
  472. -webkit-line-clamp: 3; /* 限制最多显示2行 */
  473. -webkit-box-orient: vertical; /* 垂直排列 */
  474. }
  475. .item-des1{
  476. margin-top: 10rpx;
  477. color: #565656;
  478. font-size: 24rpx;
  479. width: 80%;
  480. }
  481. .item-des2{
  482. margin-top: 10rpx;
  483. color: #565656;
  484. font-size: 24rpx;
  485. }
  486. /* 返回 */
  487. .item-img {
  488. width: 160rpx;
  489. height: 160rpx;
  490. }
  491. .custom-header {
  492. display: flex;
  493. align-items: center;
  494. justify-content: center;
  495. padding: 10px;
  496. width: 100%;
  497. }
  498. .is-back {
  499. position: relative;
  500. }
  501. .back-container {
  502. position: absolute;
  503. left: 10px;
  504. cursor: pointer;
  505. }
  506. .back-text {
  507. color: white; /* 返回按钮文本颜色 */
  508. }
  509. .back-text {
  510. color: white; /* 返回按钮文本颜色 */
  511. }
  512. .content-container {
  513. flex: 1;
  514. text-align: center;
  515. }
  516. .content-text {
  517. color: white; /* 标题文本颜色 */
  518. font-weight: bold;
  519. }
  520. /* 背景颜色 */
  521. .bg-blue {
  522. background-color: #4285f4; /* 假设这是一个蓝色背景 */
  523. }
  524. .choose-box2{
  525. background: #fff;
  526. width: 94%;
  527. border-radius: 23rpx;
  528. height: 70rpx;
  529. display: flex;
  530. padding-left: 29rpx;
  531. align-items: center;
  532. border: 1rpx solid #808080;
  533. }
  534. .choose-box3{
  535. display: flex;
  536. }
  537. .search-box1{
  538. display: flex;
  539. margin-top: 20rpx;
  540. margin-left: 20rpx;
  541. margin-right: 12rpx;
  542. }
  543. .input-box{
  544. background: #fff;
  545. height: 65rpx;
  546. width: 640rpx;
  547. display: flex;
  548. align-items: center;
  549. border-radius: 30rpx;
  550. padding-left: 30rpx;
  551. margin-right: 20rpx;
  552. }
  553. .input-boxinput{
  554. height: 75rpx;
  555. font-size: 15rpx;
  556. }
  557. .color-white{
  558. color: #808080;
  559. font-size: 40rpx;
  560. line-height: 60rpx;
  561. }
  562. .color-cheng{
  563. color: #f47920;
  564. }
  565. .color-lan{
  566. color: #4285f4;
  567. }
  568. .mart-t {
  569. margin-top: 30rpx;
  570. }
  571. .center-box{
  572. margin: 20rpx;
  573. width: 95%;
  574. border-radius: 25rpx;
  575. border-radius: 25rpx;
  576. background: #fff;
  577. box-shadow: 0px 8px 16px 2px rgba(101, 101, 101, 0.2);
  578. padding-bottom: 30rpx;
  579. display: flex;
  580. flex-wrap: wrap;
  581. }
  582. .center-left-box {
  583. width: 100%;
  584. padding-bottom: 30rpx;
  585. display: flex;
  586. flex-wrap: wrap;
  587. }
  588. .btn-box-text {
  589. flex:1;
  590. height: 20rpx;
  591. text-align: center;
  592. color: #000000;
  593. font-size: 14px;
  594. font-weight: 700;
  595. }
  596. .btn-box-1 {
  597. flex:1;
  598. height: 30rpx;
  599. text-align: center;
  600. color: #36A7F3;
  601. font-size: x-large;
  602. font-weight: 700;
  603. }
  604. .btn-box-2 {
  605. flex:1;
  606. height: 30rpx;
  607. text-align: center;
  608. color:#F3365A;
  609. font-size: x-large;
  610. font-weight: 700;
  611. }
  612. .btn-box-3 {
  613. flex:1;
  614. height: 30rpx;
  615. text-align: center;
  616. color:#15D578;
  617. font-size: x-large;
  618. font-weight: 700;
  619. }
  620. .btn-box-4 {
  621. flex:1;
  622. height: 30rpx;
  623. text-align: center;
  624. color:#F1A31B;
  625. font-size: x-large;
  626. font-weight: 700;
  627. }
  628. </style>