index.vue 9.7 KB

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