comList.vue 12 KB

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