policyList.vue 13 KB

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