comList.vue 9.9 KB

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