policyList.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  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" >
  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" >
  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. // 输入监听
  219. inputWord(e) {
  220. },
  221. // 搜索
  222. doSearch() {
  223. this.dataList = []; // 先清空列表,显示加载进度
  224. this.mescroll.resetUpScroll();
  225. },
  226. // ListTouch触摸开始
  227. ListTouchStart(e) {
  228. this.listTouchStart = e.touches[0].pageX
  229. },
  230. // ListTouch计算方向
  231. ListTouchMove(e) {
  232. this.listTouchDirection = e.touches[0].pageX - this.listTouchStart > -60 ? 'right' : 'left'
  233. },
  234. // ListTouch计算滚动
  235. ListTouchEnd(e) {
  236. if (this.listTouchDirection == 'left') {
  237. this.modalName = e.currentTarget.dataset.target
  238. } else {
  239. this.modalName = null
  240. }
  241. this.listTouchDirection = null
  242. },
  243. handleBack() {
  244. // 返回逻辑,比如跳转至上一页
  245. this.$router.go(-1);
  246. }
  247. }
  248. }
  249. </script>
  250. <style>
  251. .ellipsis-description {
  252. font-size: 12px;
  253. line-height: $line-height-base;
  254. display: -webkit-box;
  255. /*作为弹性伸缩盒子模型显示*/
  256. -webkit-line-clamp: 1;
  257. /*显示的行数;如果要设置2行加...则设置为2*/
  258. overflow: hidden;
  259. /*超出的文本隐藏*/
  260. text-overflow: ellipsis;
  261. /* 溢出用省略号*/
  262. -webkit-box-orient: vertical;
  263. /*伸缩盒子的子元素排列:从上到下*/
  264. }
  265. .cu-bar .search-form {
  266. background-color: white;
  267. }
  268. .item-line{
  269. display: flex;
  270. height: 48rpx;
  271. margin-top: 20rpx;
  272. }
  273. .item-line2{
  274. height: 48rpx;
  275. margin-top: 20rpx;
  276. }
  277. .subtitle{
  278. color: #E5880E;
  279. }
  280. .item-name{
  281. margin-top: 5rpx;
  282. font-size: 30rpx;
  283. color: #333;
  284. }
  285. .item-name2{
  286. font-size: 29rpx;
  287. color: #8387AA;
  288. }
  289. .item-name3{
  290. display: flex;
  291. width: 100%;
  292. padding-right: 30rpx;
  293. flex: 1;
  294. justify-content: flex-end;
  295. font-size: 29rpx;
  296. color: #8387AA;
  297. }
  298. .item-content{
  299. color: #1497EF;
  300. font-size: 30rpx;
  301. }
  302. .btn-box{
  303. display: flex;
  304. }
  305. .line-zs{
  306. width: 2rpx;
  307. height: 30rpx;
  308. background: #36A7F3;
  309. }
  310. .edit-botton{
  311. width: 100rpx;
  312. height: 48rpx;
  313. line-height: 48rpx;
  314. color: #fff;
  315. font-size: 28rpx;
  316. margin-right: 20rpx;
  317. border-radius: 10rpx;
  318. background: #5A9EE9;
  319. text-align: center;
  320. }
  321. .del-botton{
  322. width: 100rpx;
  323. height: 48rpx;
  324. line-height: 48rpx;
  325. color: #fff;
  326. font-size: 28rpx;
  327. margin-right: 20rpx;
  328. border-radius: 10rpx;
  329. background: #F27C85;
  330. text-align: center;
  331. }
  332. .color-white{
  333. color: #fff;
  334. font-size: 40rpx;
  335. line-height: 60rpx;
  336. }
  337. .search-box{
  338. background: #36A7F3;
  339. display: flex;
  340. padding-left: 20rpx;
  341. padding-right: 20rpx;
  342. padding-bottom: 10rpx;
  343. }
  344. .input-box{
  345. background: #fff;
  346. height: 65rpx;
  347. width: 640rpx;
  348. display: flex;
  349. align-items: center;
  350. border-radius: 30rpx;
  351. padding-left: 30rpx;
  352. margin-right: 20rpx;
  353. }
  354. .input-boxinput{
  355. height: 75rpx;
  356. font-size: 15rpx;
  357. }
  358. .choose-box{
  359. background: #fff;
  360. width: 350rpx;
  361. border-radius: 30rpx;
  362. height: 60rpx;
  363. display: flex;
  364. align-items: center;
  365. justify-content: center;
  366. margin-right: 20rpx;
  367. }
  368. .choose-boxp{
  369. font-size: 32rpx;
  370. width: 80%;
  371. }
  372. .swiper {
  373. width: 750rpx;
  374. height: 310rpx;
  375. }
  376. .swiper-item {
  377. width: 750rpx;
  378. height: 310rpx;
  379. background-color: aliceblue;
  380. }
  381. .item-box{
  382. display: flex;
  383. width: 710rpx;
  384. margin-left: 20rpx;
  385. background: #FFFFFF;
  386. box-shadow: 0px 1px 3px 0px rgba(9,2,4,0.1);
  387. border-radius: 10px;
  388. padding-top: 20rpx;
  389. padding-left: 20rpx;
  390. padding-right: 10rpx;
  391. padding-bottom: 20rpx;
  392. margin-top: 20rpx;
  393. }
  394. .item-title-L{
  395. display: flex;
  396. width: 100%;
  397. margin-left: 10rpx;
  398. flex-direction: column;
  399. }
  400. .item-title{
  401. font-size: 29rpx;
  402. color: #333;
  403. font-weight: bold;
  404. align-items: center;
  405. }
  406. .item-des{
  407. margin-top: 10rpx;
  408. color: #565656;
  409. font-size: 24rpx;
  410. overflow: hidden; /* 超出部分隐藏 */
  411. text-overflow: ellipsis; /* 超出部分显示省略号 */
  412. display: -webkit-box; /* 使用Webkit的行盒模型 */
  413. -webkit-line-clamp: 3; /* 限制最多显示2行 */
  414. -webkit-box-orient: vertical; /* 垂直排列 */
  415. }
  416. /* 返回 */
  417. .item-img {
  418. width: 160rpx;
  419. height: 160rpx;
  420. }
  421. .custom-header {
  422. display: flex;
  423. align-items: center;
  424. justify-content: center;
  425. padding: 10px;
  426. width: 100%;
  427. }
  428. .is-back {
  429. position: relative;
  430. }
  431. .back-container {
  432. position: absolute;
  433. left: 10px;
  434. cursor: pointer;
  435. }
  436. .back-text {
  437. color: white; /* 返回按钮文本颜色 */
  438. }
  439. .back-text {
  440. color: white; /* 返回按钮文本颜色 */
  441. }
  442. .content-container {
  443. flex: 1;
  444. text-align: center;
  445. }
  446. .content-text {
  447. color: white; /* 标题文本颜色 */
  448. font-weight: bold;
  449. }
  450. /* 背景颜色 */
  451. .bg-blue {
  452. background-color: #4285f4; /* 假设这是一个蓝色背景 */
  453. }
  454. .choose-box2{
  455. background: #fff;
  456. width: 94%;
  457. border-radius: 23rpx;
  458. height: 70rpx;
  459. display: flex;
  460. padding-left: 29rpx;
  461. align-items: center;
  462. border: 1rpx solid #808080;
  463. }
  464. .choose-box3{
  465. display: flex;
  466. }
  467. .search-box1{
  468. display: flex;
  469. margin-top: 20rpx;
  470. margin-left: 20rpx;
  471. margin-right: 12rpx;
  472. }
  473. .input-box{
  474. background: #fff;
  475. height: 65rpx;
  476. width: 640rpx;
  477. display: flex;
  478. align-items: center;
  479. border-radius: 30rpx;
  480. padding-left: 30rpx;
  481. margin-right: 20rpx;
  482. }
  483. .input-boxinput{
  484. height: 75rpx;
  485. font-size: 15rpx;
  486. }
  487. .color-white{
  488. color: #808080;
  489. font-size: 40rpx;
  490. line-height: 60rpx;
  491. }
  492. </style>