policyList.vue 15 KB

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