park_deatil.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <template>
  2. <view class="content">
  3. <view class="page-section-spacing" style="width: 100%;">
  4. <swiper class="swiper"
  5. indicator-dots="true"
  6. autoplay="true"
  7. duration="500"
  8. style="height:300rpx">
  9. <swiper-item v-for="(item , index) in swiperList" :key="index">
  10. <image :src="item.pic_path" mode="aspectFill" style="width: 100%;height: 100%;"></image>
  11. </swiper-item>
  12. </swiper>
  13. </view>
  14. <view class="header-detail-box">
  15. <view class="header-title">
  16. {{detailObj.name || '-'}}
  17. </view>
  18. <view class="header-content-box display-around display-wrap">
  19. <view class="display-between-column items-center width-30 margin-bottom-20">
  20. <view class="display-flex-start"><image src="/static/park/detail/enterprise.png" mode="aspectFill" class="park-footer-img"></image>{{detailObj.company_count || '-'}}</view>
  21. <view class="park-footer-font">入驻企业</view>
  22. </view>
  23. <view class="display-between-column items-center width-30 margin-bottom-20">
  24. <view class="display-flex-start">
  25. <image src="/static/park/detail/mu.png" mode="aspectFill" class="park-footer-img"></image>
  26. {{detailObj.cover_area || '-'}}<text style="font-size: 18rpx;">亩</text>
  27. </view>
  28. <view class="park-footer-font">占地亩数</view>
  29. </view>
  30. <view class="display-between-column items-center width-30 margin-bottom-20">
  31. <view class="display-flex-start">
  32. <image src="/static/park/detail/rent.png" mode="aspectFill" class="park-footer-img"></image>
  33. {{detailObj.price || '-'}}<text style="font-size: 18rpx;">元/㎡/月</text>
  34. </view>
  35. <view class="park-footer-font">租赁价格</view>
  36. </view>
  37. <view class="display-between-column items-center width-30 margin-bottom-20">
  38. <view class="display-flex-start">
  39. <image src="/static/park/detail/area.png" mode="aspectFill" class="park-footer-img"></image>
  40. {{detailObj.building_area || '-'}}<text style="font-size: 18rpx;">万㎡</text>
  41. </view>
  42. <view class="park-footer-font">建设面积</view>
  43. </view>
  44. <view class="display-between-column items-center width-30 margin-bottom-20">
  45. <view class="display-flex-start">
  46. <image src="/static/park/detail/area1.png" mode="aspectFill" class="park-footer-img"></image>
  47. {{detailObj.area_left_industry || '-'}}<text style="font-size: 18rpx;">万㎡</text>
  48. </view>
  49. <view class="park-footer-font">出租面积</view>
  50. </view>
  51. <view class="display-between-column items-center width-30 margin-bottom-20">
  52. <view class="display-flex-start"><image src="/static/park/detail/level.png" mode="aspectFill" class="park-footer-img"></image>{{detailObj.level}}</view>
  53. <view class="park-footer-font">园区级别</view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="header-detail-box">
  58. <view class="header-title">
  59. 园区基本信息
  60. </view>
  61. <view class="display-around-column content-font">
  62. <view class="display-flex-start items-center margin-bottom-20">
  63. <view class="width-30 margin-left-60 color-cf">运营机构</view>
  64. <view class="width-70">{{detailObj.manager || '-'}}</view>
  65. </view>
  66. <view class="display-flex-start items-center margin-bottom-20">
  67. <view class="width-30 margin-left-60 color-cf">产业定位</view>
  68. <view class="width-70">{{detailObj.target || '-'}}</view>
  69. </view>
  70. <view class="display-flex-start items-center margin-bottom-20">
  71. <view class="width-30 margin-left-60 color-cf">园区类型</view>
  72. <view class="width-70">{{detailObj.building_types || '-'}}</view>
  73. </view>
  74. <view class="display-flex-start items-center margin-bottom-20">
  75. <view class="width-30 margin-left-60 color-cf">物业费</view>
  76. <view class="width-70">{{detailObj.service_price || '-'}}<text style="font-size: 24rpx;">元/㎡/月</text></view>
  77. </view>
  78. <view class="display-flex-start items-center margin-bottom-20">
  79. <view class="width-30 margin-left-60 color-cf">电费</view>
  80. <view class="width-70">{{detailObj.power_price || '-'}}<text style="font-size:24rpx;">KW·h</text></view>
  81. </view>
  82. <view class="display-flex-start items-center margin-bottom-20">
  83. <view class="width-30 margin-left-60 color-cf">水费</view>
  84. <view class="width-70">{{detailObj.water_price || '-'}}<text style="font-size: 24rpx;">元/m³</text></view>
  85. </view>
  86. <view class="display-flex-start items-center margin-bottom-20">
  87. <view class="width-30 margin-left-60 color-cf">一层楼高</view>
  88. <view class="width-70">{{detailObj.max_height || '-'}}<text style="font-size: 24rpx;">m</text></view>
  89. </view>
  90. <view class="display-flex-start items-center margin-bottom-20">
  91. <view class="width-30 margin-left-60 color-cf">最大承重</view>
  92. <view class="width-70">{{detailObj.max_weight || '-'}}<text style="font-size: 24rpx;">kg</text></view>
  93. </view>
  94. <view class="display-flex-start items-center margin-bottom-20">
  95. <view class="width-30 margin-left-60 color-cf">联系电话</view>
  96. <view class="width-70" @click="makeCall(detailObj.phone)" style="color: #007AFF;">{{detailObj.phone}}</view>
  97. </view>
  98. <view class="display-flex-start items-center">
  99. <view class="width-30 margin-left-60 color-cf">详细地址</view>
  100. <view class="width-70">{{detailObj.address || '-'}}</view>
  101. </view>
  102. </view>
  103. <map style="width: 100%;height: 300rpx;margin-top: 20rpx;" :latitude="latitude" :longitude="longitude" :markers="covers" @tap="goTxMap(latitude,longitude)">
  104. </map>
  105. </view>
  106. <view class="detail-footer-tabs">
  107. <v-tabs v-model="current" :tabs="tabs" @change="changeTab"></v-tabs>
  108. <view class="tabs-box">
  109. <view v-if="current == 0" class="margin-bottom-20 content-font">
  110. {{detailObj.desc || '-'}}
  111. </view>
  112. <view v-if="current == 1" class="margin-bottom-20 content-font">
  113. {{detailObj.facilities || '-'}}
  114. </view>
  115. </view>
  116. </view>
  117. <footer-share style="width: 100%;" :isCollection="false" @collectionPages="collectionPage" @sharePages="sharePage"></footer-share>
  118. </view>
  119. </view>
  120. </template>
  121. <script>
  122. import md5 from '@/common/md5.js';
  123. export default {
  124. components: {
  125. },
  126. data() {
  127. return {
  128. swiperList:[
  129. // {
  130. // img:'/static/swiper/swiper1.jpg'
  131. // },
  132. // {
  133. // img:'/static/swiper/swiper2.jpg'
  134. // },
  135. ],
  136. nowId:'',
  137. levelList:{
  138. '1':'国家级',
  139. '2':'省级',
  140. '3':'市级',
  141. '4':'区级'
  142. },
  143. parkType:{
  144. '1':'标准厂房',
  145. '2':'写字楼',
  146. '3':'商业综合体',
  147. '1,2':'标准厂房,写字楼',
  148. '1,3':'标准厂房,商业综合体',
  149. '2,3':'写字楼,商业综合体',
  150. },
  151. trafficList:{
  152. '1':'班车',
  153. '2':'地铁',
  154. '3':'公交',
  155. '1,2':'班车,地铁',
  156. '1,3':'班车,公交',
  157. '2,3':'地铁,公交',
  158. },
  159. detailObj:{
  160. parkName:'新鸿辉工业园',
  161. nums:484,
  162. area1:1,
  163. price:20,
  164. area2:1.2,
  165. area3:0.9,
  166. level:'区级',
  167. direction:'制造,智能制造',
  168. type:'工业厂房,办公写字楼,商业综合体',
  169. property:1,
  170. elePrice:1.1,
  171. waterPrice:8,
  172. oneHeight:4.5,
  173. bearing:750, //承重
  174. tel:'81190876',
  175. address:'西咸新区空港新城底张镇',
  176. introduce:'新鸿辉工业园坐落于陕西省西安市西咸新区空港新城底张镇,占地面积一万平方米,内有大小企业共484家。',
  177. facilities:'食堂、停车场、公寓、咖啡厅、便利店' //设施
  178. },
  179. latitude:'', //纬度
  180. longitude:'', //经度
  181. covers: [],
  182. current: 0,
  183. tabs: ['园区介绍', '配套设施']
  184. }
  185. },
  186. onLoad(option) {
  187. console.log(option)
  188. // this.nowId = option.id;
  189. this.getDetailInfo(option.id)
  190. },
  191. methods: {
  192. makeCall(tel){
  193. let telStr = tel;
  194. if(telStr.indexOf(';') !== -1){
  195. tel = telStr.split(';')
  196. }else {
  197. tel = telStr.split(';')
  198. }
  199. console.log(tel)
  200. uni.makePhoneCall({
  201. phoneNumber:tel[1]
  202. })
  203. },
  204. goTxMap(la,lo){
  205. let that = this;
  206. uni.openLocation({
  207. latitude:Number(la),
  208. longitude:Number(lo),
  209. name:that.detailObj.name,
  210. address:that.detailObj.address
  211. })
  212. },
  213. changeTab(index) {
  214. console.log('当前选中的项:' + index)
  215. },
  216. collectionPage(){
  217. console.log('已收藏')
  218. },
  219. sharePage(){
  220. console.log('分享')
  221. uni.showShareMenu({
  222. title: this.detailObj.name,
  223. path:'pages/park/park_detail?id='+this.detailObj.id,
  224. success(res) {
  225. console.log(res)
  226. }
  227. })
  228. },
  229. showFacilities(room,restaurant,traffic){
  230. if(room && restaurant){
  231. this.detailObj.facilities = room + ',' + restaurant + ',' + traffic;
  232. }else if (room && !restaurant){
  233. this.detailObj.facilities = room + ',' + traffic;
  234. } else if(!room && restaurant){
  235. this.detailObj.facilities = restaurant + ',' + traffic;
  236. }else if (!room && !restaurant){
  237. this.detailObj.facilities = traffic;
  238. }
  239. },
  240. getDetailInfo(parkId){
  241. let md5Sign = md5("method="+'park'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
  242. let url = getApp().globalData.shareUrl+'api/api.php'+'?method=park&source=park&action=info_by_id&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
  243. let postData = {
  244. order_by:"weight desc",
  245. id:parkId
  246. // s_show:1,
  247. // page:1,
  248. // page_size:7
  249. }
  250. uni.request({
  251. url:url,
  252. method: 'POST',
  253. header: {
  254. 'content-type': 'application/x-www-form-urlencoded'
  255. },
  256. data:postData,
  257. success: (res) => {
  258. if(res.data.code === 200){
  259. if(res.data.data.park_pics.length){
  260. res.data.data.park_pics.forEach((item)=>{item.pic_path = getApp().globalData.shareUrl + item.pic_path})
  261. this.swiperList = res.data.data.park_pics;
  262. }else{
  263. this.swiperList = [{pic_path:'/static/park/1.png'}]
  264. }
  265. this.detailObj = res.data.data;
  266. this.detailObj.location = this.detailObj.location.split(',');
  267. this.latitude = this.detailObj.location[0];
  268. this.longitude = this.detailObj.location[1];
  269. this.covers = [{'latitude': this.latitude,'longitude': this.longitude,}]
  270. this.detailObj.level = this.levelList[this.detailObj.level];
  271. this.detailObj.building_types = this.parkType[this.detailObj.building_types];
  272. let room = this.detailObj.room == '1' ? '宿舍':'';
  273. let restaurant = this.detailObj.restaurant == '1' ? '餐厅':'';
  274. let traffic = this.trafficList[this.detailObj.traffic];
  275. this.showFacilities(room,restaurant,traffic);
  276. }else {
  277. uni.showToast({
  278. title:res.data.msg,
  279. duration:2000
  280. })
  281. }
  282. },
  283. fail: () => {
  284. console.log("连接失败");
  285. }
  286. });
  287. }
  288. }
  289. }
  290. </script>
  291. <style>
  292. .content {
  293. display: flex;
  294. flex-direction: column;
  295. align-items: center;
  296. justify-content: center;
  297. }
  298. .logo {
  299. height: 200rpx;
  300. width: 200rpx;
  301. margin-top: 200rpx;
  302. margin-left: auto;
  303. margin-right: auto;
  304. margin-bottom: 50rpx;
  305. }
  306. .text-area {
  307. display: flex;
  308. justify-content: center;
  309. }
  310. .title {
  311. font-size: 36rpx;
  312. color: #8f8f94;
  313. }
  314. .header-title {
  315. font-size: 32rpx;
  316. font-weight: 600;
  317. line-height: 36rpx;
  318. letter-spacing: 0.02em;
  319. color: #0D1937;
  320. margin: 20rpx 0 25rpx 10rpx;
  321. }
  322. .header-content-box {
  323. font-size: 30rpx;
  324. }
  325. .header-detail-box {
  326. width: 90%;
  327. border-radius: 10rpx;
  328. box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
  329. margin-top: 20rpx;
  330. padding: 20rpx;
  331. }
  332. .park-footer-img{
  333. width: 24rpx;
  334. height: 24rpx;
  335. margin-right: 6rpx;
  336. }
  337. .park-footer-font {
  338. color: #CFCFCF;
  339. font-size: 26rpx;
  340. margin-top: 10rpx;
  341. }
  342. .width-30 {
  343. width: 30%;
  344. }
  345. .width-70 {
  346. width: 70%;
  347. }
  348. .content-font {
  349. font-size: 28rpx;
  350. }
  351. .margin-left-60 {
  352. margin-left: 60rpx;
  353. }
  354. .margin-bottom-20 {
  355. margin-bottom: 20rpx;
  356. }
  357. .color-cf {
  358. color: #ccc;
  359. }
  360. .detail-footer-tabs {
  361. width: 90%;
  362. padding: 20rpx;
  363. margin-bottom:80rpx;
  364. }
  365. .tabs-box {
  366. padding-left: 20rpx;
  367. margin-top: 20rpx;
  368. }
  369. </style>