policyList.vue 15 KB

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