index.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. <template>
  2. <view class="content">
  3. <view class="display-flex-start map-header-box">
  4. <!-- <uni-easyinput prefixIcon="search" v-model="headerVal" placeholder="请输入园区名称搜索" @iconClick="headerSerach()" class="map-search-box"></uni-easyinput> -->
  5. <view class="input-box">
  6. <image src="/static/policy/u377.png" alt="search" @click="headerSerach()"/>
  7. <input type="text" placeholder="请输入园区名称搜索" v-model="headerVal"/>
  8. </view>
  9. <navigator url="/pages/park/map_search"><button type="default" class="map-search-btn">地图查找</button></navigator>
  10. </view>
  11. <view class="park-select-box">
  12. <view class="park-select" @click="showFilterBox()">
  13. <view class="park-select-font">园区类型</view>
  14. <view class="corner"></view>
  15. </view>
  16. <view class="park-filter-box" v-show="filterBoxFlag">
  17. <view class="filter-content display-wrap" style="justify-content: space-around;">
  18. <view class="content-font" :class="item.isSelected ? 'filter-selected' : ''" v-for="(item,index) in filterList" :key="index" @click="filterPark(index,item.typeId)">{{item.name}}</view>
  19. </view>
  20. <view class="display-around" style="margin-top: 50rpx;">
  21. <button class="filter-left-btn" @click="restartBtn()">重置</button>
  22. <button class="filter-left-btn bgcolor-02A7F0" @click="submitBtn()">确定</button>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="" style="position:relative;width: 90%;margin-top: 20rpx;">
  27. <view class="park-box" v-for="(item , index) in parkList" :key="item.id" @click="goParkDetailFn(item.id)">
  28. <image :src="item.park_pics[0].pic_path || '/static/park/1.png'" mode="aspectFill" style="width:100%;height:400rpx;border-radius:32rpx 32rpx 0 0;"></image>
  29. <view class="park-content-box">
  30. <view class="park-title">{{item.name || '-'}}</view>
  31. <view class="park-address display-flex-start">
  32. <view class="display-flex-start" style="margin-right: 10rpx;"><image src="/static/park/park-time.png" mode="aspectFill" class="park-title-img"></image>{{item.addtime | globalTime}}建成</view>
  33. <view class="display-flex-start"><image src="/static/park/park-name.png" mode="aspectFill" class="park-title-img"></image>{{item.manager || '-'}}</view>
  34. </view>
  35. <view class="park-footer-box display-between">
  36. <view class="display-between-column width-30">
  37. <view class="display-flex-start"><image src="/static/park/park-num.png" mode="aspectFill" class="park-footer-img"></image>{{item.company_count || '-'}}</view>
  38. <view class="park-footer-font">企业数量</view>
  39. </view>
  40. <view class="display-between-column width-30">
  41. <view class="display-flex-start">
  42. <image src="/static/park/park-area.png" mode="aspectFill" class="park-footer-img"></image>
  43. {{item.cover_area || '-'}}<text style="font-size: 12rpx;">万㎡</text></view>
  44. <view class="park-footer-font">占地面积</view>
  45. </view>
  46. <view class="display-between-column width-30">
  47. <view class="display-flex-start">
  48. <image src="/static/park/park-area2.png" mode="aspectFill" class="park-footer-img"></image>
  49. {{item.building_area || '-'}}<text style="font-size: 12rpx;">万㎡</text></view>
  50. <view class="park-footer-font">建设面积</view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import md5 from '@/common/md5.js';
  60. export default {
  61. data() {
  62. return {
  63. message:'找园区',
  64. filterBoxFlag:false,
  65. headerVal:'',
  66. parkList:[
  67. // {
  68. // url:'/static/park/1.png',
  69. // title:'华潮科技产业园',
  70. // time:'2015-10-25',
  71. // num:484,
  72. // area1:1.72,
  73. // area2:1.01
  74. // },
  75. // {
  76. // url:'/static/park/1.png',
  77. // title:'华潮科技产业园',
  78. // time:'2015-10-25',
  79. // num:484,
  80. // area1:1.72,
  81. // area2:1.01
  82. // },
  83. // {
  84. // url:'/static/park/1.png',
  85. // title:'华潮科技产业园',
  86. // time:'2015-10-25',
  87. // num:484,
  88. // area1:1.72,
  89. // area2:1.01
  90. // },
  91. ],
  92. filterList:[
  93. {
  94. name:'工业厂房',
  95. isSelected:false,
  96. typeId:'1'
  97. },
  98. {
  99. name:'写字楼',
  100. isSelected:false,
  101. typeId:'2'
  102. },
  103. {
  104. name:'商务综合体',
  105. isSelected:false,
  106. typeId:'3'
  107. },
  108. ],
  109. filterIndex:0
  110. }
  111. },
  112. onLoad() {
  113. this.getPark()
  114. },
  115. methods: {
  116. filterPark(index,id){
  117. this.filterList[index].isSelected = !this.filterList[index].isSelected;
  118. },
  119. restartBtn(){
  120. this.filterList.forEach((item)=>{item.isSelected = false});
  121. },
  122. submitBtn(){
  123. let typeStr = []
  124. let typeList = this.filterList.filter((item)=>{return item.isSelected})
  125. typeList.forEach((item)=>{typeStr.push(item.typeId)})
  126. typeStr = typeStr.join(',')
  127. this.getPark(this.headerVal,typeStr)
  128. this.filterBoxFlag = false;
  129. },
  130. showFilterBox(){
  131. this.filterBoxFlag = !this.filterBoxFlag;
  132. },
  133. goParkDetailFn(id){
  134. uni.navigateTo({
  135. url:'/pages/park/park_deatil?id='+id
  136. })
  137. },
  138. getPark(searchVal,typeList){
  139. let md5Sign = md5("method="+'park'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
  140. let url = getApp().globalData.shareUrl+'api/api.php'+'?method=park&source=park&action=list&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
  141. let postData = {
  142. order_by:"weight desc",
  143. }
  144. if(searchVal && !typeList){
  145. postData = {
  146. order_by:"weight desc",
  147. ss_name:searchVal
  148. }
  149. }
  150. if(typeList){
  151. postData = {
  152. order_by:"weight desc",
  153. ss_name:searchVal,
  154. park_type:typeList
  155. }
  156. }
  157. uni.request({
  158. url:url,
  159. method: 'POST',
  160. header: {
  161. 'content-type': 'application/x-www-form-urlencoded'
  162. },
  163. data:postData,
  164. success: (res) => {
  165. console.log(res)
  166. if(res.data.code === 200){
  167. res.data.data.list.forEach((item)=>{if(item.park_pics.length){item.park_pics[0].pic_path = getApp().globalData.shareUrl + item.park_pics[0].pic_path}});
  168. this.parkList = res.data.data.list;
  169. }
  170. },
  171. fail: () => {
  172. console.log("连接失败");
  173. }
  174. });
  175. },
  176. headerSerach(){
  177. this.getPark(this.headerVal)
  178. }
  179. }
  180. }
  181. </script>
  182. <style>
  183. .content {
  184. display: flex;
  185. flex-direction: column;
  186. align-items: center;
  187. justify-content: center;
  188. }
  189. .logo {
  190. height: 200rpx;
  191. width: 200rpx;
  192. margin-top: 200rpx;
  193. margin-left: auto;
  194. margin-right: auto;
  195. margin-bottom: 50rpx;
  196. }
  197. .text-area {
  198. display: flex;
  199. justify-content: center;
  200. }
  201. .title {
  202. font-size: 36rpx;
  203. color: #8f8f94;
  204. }
  205. .map-header-box {
  206. background-color: #02A7F0;
  207. padding: 20rpx 0rpx 20rpx 0rpx;
  208. width: 100%;
  209. }
  210. /* .map-search-box {
  211. background-color: #fff;
  212. margin-left: 30rpx;
  213. margin-right: 20rpx;
  214. border-radius: 10rpx;
  215. width: 70%;
  216. } */
  217. .input-box {
  218. width: 75%;
  219. display: flex;
  220. justify-content: center;
  221. align-items: center;
  222. position: relative;
  223. }
  224. .input-box image {
  225. position: absolute;
  226. left: 60rpx;
  227. width: 30rpx;
  228. height: 30rpx;
  229. }
  230. .input-box input {
  231. background-color: #ffffff;
  232. width: 90%;
  233. height: 70rpx;
  234. border-radius: 10rpx;
  235. padding: 3rpx;
  236. font-size: 24rpx;
  237. padding-left: 80rpx;
  238. box-sizing: border-box;
  239. }
  240. .map-search-btn {
  241. height: 66rpx;
  242. font-size: 26rpx;
  243. color: #fff!important;
  244. background-color: #F59A23!important;
  245. border-radius: 10rpx;
  246. }
  247. .park-box {
  248. border-radius: 32rpx;
  249. position: relative;
  250. height: 500rpx;
  251. }
  252. .park-content-box {
  253. width: calc(100% - 58rpx);
  254. background-color: #FFFFFF;
  255. border-radius: 56rpx 0px 32rpx 32rpx;
  256. position: absolute;
  257. top: 250rpx;
  258. font-size: 24rpx;
  259. padding: 30rpx;
  260. box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
  261. }
  262. .park-title {
  263. font-weight: 600;
  264. line-height: 36rpx;
  265. letter-spacing: 0.02em;
  266. color: #0D1937;
  267. }
  268. .park-address {
  269. font-weight: 600;
  270. font-size: 19rpx;
  271. letter-spacing: 0.02em;
  272. color: #CFCFCF;
  273. margin-top: 10rpx;
  274. }
  275. .park-title-img {
  276. width: 16rpx;
  277. height: 16rpx;
  278. margin-right: 4rpx;
  279. }
  280. .park-footer-box {
  281. margin-top: 30rpx;
  282. }
  283. .park-footer-img{
  284. width: 24rpx;
  285. height: 24rpx;
  286. margin-right: 6rpx;
  287. }
  288. .park-footer-font {
  289. color: #CFCFCF;
  290. font-size: 19rpx;
  291. margin-top: 10rpx;
  292. }
  293. .width-30 {
  294. width: 30%;
  295. }
  296. .park-select-box {
  297. width: 98%;
  298. height: 90rpx;
  299. border-radius: 10rpx;
  300. box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
  301. position: relative;
  302. }
  303. .park-select {
  304. padding: 10rpx;
  305. background-color: #d7d7d7;
  306. width: 20%;
  307. text-align: center;
  308. height: 40rpx;
  309. line-height: 40rpx;
  310. border-radius: 10rpx;
  311. display: flex;
  312. align-items: center;
  313. justify-content: space-around;
  314. margin-left: 20rpx;
  315. margin-top: 15rpx;
  316. font-size: 26rpx;
  317. }
  318. .park-select-font {
  319. color: #7F7F7F
  320. }
  321. .corner {
  322. width: 0;
  323. height: 0;
  324. border: 10rpx solid #7f7f7f;
  325. border-bottom-color: transparent;
  326. border-left-color: transparent;
  327. border-right-color: transparent;
  328. margin-top: 12rpx;
  329. }
  330. .park-filter-box {
  331. width: 95%;
  332. padding: 20rpx;
  333. background-color: #fff;
  334. box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
  335. position: absolute;
  336. top: 100rpx;
  337. z-index: 99;
  338. }
  339. .filter-content {
  340. color: #7F7F7F;
  341. font-size: 20rpx;
  342. }
  343. .content-font {
  344. padding: 10rpx;
  345. }
  346. .filter-left-btn {
  347. font-size: 22rpx;
  348. width: 20%;
  349. line-height: 27px;
  350. height: 50rpx;
  351. background-color: #C8C7C7;
  352. color: #fff;
  353. border: none;
  354. font-weight: 600;
  355. }
  356. .bgcolor-02A7F0{
  357. background-color: #02A7F0;
  358. }
  359. .filter-selected {
  360. background-color: #3ADBDB;
  361. color: #fff;
  362. border-radius: 10rpx;
  363. }
  364. </style>