policyList.vue 12 KB

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