|
@@ -1,33 +1,17 @@
|
|
|
<template>
|
|
|
<view class="project-detail">
|
|
|
<swiper class="swiper" circular :indicator-dots="true">
|
|
|
- <swiper-item>
|
|
|
- <image class="image"
|
|
|
- src="https://assets.api.uizard.io/api/cdn/stream/0ba939e8-082b-42f9-a314-be3e195b3b25.png"
|
|
|
- mode="aspectFill">
|
|
|
- </image>
|
|
|
- </swiper-item>
|
|
|
- <swiper-item>
|
|
|
- <image class="image"
|
|
|
- src="https://assets.api.uizard.io/api/cdn/stream/0ba939e8-082b-42f9-a314-be3e195b3b25.png"
|
|
|
- mode="aspectFill">
|
|
|
- </image>
|
|
|
- </swiper-item>
|
|
|
- <swiper-item>
|
|
|
- <image class="image"
|
|
|
- src="https://assets.api.uizard.io/api/cdn/stream/0ba939e8-082b-42f9-a314-be3e195b3b25.png"
|
|
|
- mode="aspectFill">
|
|
|
+ <swiper-item v-for="item in responsibility" :key="item.id">
|
|
|
+ <image class="image" :src="item.url" mode="aspectFill">
|
|
|
</image>
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
|
<view class="project-title">
|
|
|
- <view class="project-name">维绿大厦项目</view>
|
|
|
+ <view class="project-name">{{detail.name}}</view>
|
|
|
<view class="project-label">距离您2km</view>
|
|
|
<uni-icons class="wx-icon" type="weixin" size="38" color="#43b156"></uni-icons>
|
|
|
</view>
|
|
|
- <view class="project-label project-article">
|
|
|
- 维绿大厦位于武进区,交通便利,环境优美,周围公园便于锻炼。
|
|
|
- </view>
|
|
|
+ <view class="project-label project-article">{{detail.comment}}</view>
|
|
|
<view class="project-content">
|
|
|
<view class="content-title">地理位置</view>
|
|
|
<view class="content-map">
|
|
@@ -35,30 +19,12 @@
|
|
|
</view>
|
|
|
<view class="content-title">配套设施</view>
|
|
|
<view class="content-device">
|
|
|
- <view class="device-item">
|
|
|
- <uni-icons class="device-icon" custom-prefix="iconfont" type="icon-gongyuan" size="16"></uni-icons>
|
|
|
- <text class="device-label">公园环境</text>
|
|
|
- </view>
|
|
|
- <view class="device-item">
|
|
|
- <uni-icons class="device-icon" custom-prefix="iconfont" type="icon-jiaotong" size="18"></uni-icons>
|
|
|
+ <view class="device-item"
|
|
|
+ v-for="item in $field.findTypeNameByList('supportingFacilities',detail.supportingFacilities)"
|
|
|
+ :key="item.id">
|
|
|
+ <uni-icons class="device-icon" custom-prefix="iconfont" :type="item.icon" size="18"></uni-icons>
|
|
|
<text class="device-label">交通便利</text>
|
|
|
</view>
|
|
|
- <view class="device-item">
|
|
|
- <uni-icons class="device-icon" custom-prefix="iconfont" type="icon-tubiao_-" size="18"></uni-icons>
|
|
|
- <text class="device-label">医疗完善</text>
|
|
|
- </view>
|
|
|
- <view class="device-item">
|
|
|
- <uni-icons class="device-icon" custom-prefix="iconfont" type="icon-wifi" size="16"></uni-icons>
|
|
|
- <text class="device-label">免费wifi</text>
|
|
|
- </view>
|
|
|
- <view class="device-item">
|
|
|
- <uni-icons class="device-icon" custom-prefix="iconfont" type="icon-zhishiku" size="16"></uni-icons>
|
|
|
- <text class="device-label">幼儿教育</text>
|
|
|
- </view>
|
|
|
- <view class="device-item">
|
|
|
- <uni-icons class="device-icon" custom-prefix="iconfont" type="icon-gouwu" size="18"></uni-icons>
|
|
|
- <text class="device-label">便捷购物</text>
|
|
|
- </view>
|
|
|
</view>
|
|
|
<view class="content-title">房源列表</view>
|
|
|
<view class="house-list">
|
|
@@ -72,13 +38,19 @@
|
|
|
import {
|
|
|
getOpenHouseListByPage
|
|
|
} from '@/request/api/house.js'
|
|
|
+ import {
|
|
|
+ getProjectDetailById
|
|
|
+ } from '@/request/api/project.js'
|
|
|
import houseItems from "@/components/house/houseItems.vue";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- latitude: 27.973361,
|
|
|
- longitude: 120.658992,
|
|
|
- list: []
|
|
|
+ list: [],
|
|
|
+ detail: {},
|
|
|
+ responsibility: [],
|
|
|
+ coordinates: [],
|
|
|
+ latitude: 39.90923,
|
|
|
+ longitude: 116.397428
|
|
|
}
|
|
|
},
|
|
|
onLoad(body) {
|
|
@@ -87,13 +59,25 @@
|
|
|
},
|
|
|
onReady() {
|
|
|
this._mapContext = uni.createMapContext("map", this);
|
|
|
- this.addMarkers();
|
|
|
},
|
|
|
components: {
|
|
|
houseItems
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
|
+ getProjectDetailById(9).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.detail = res.data;
|
|
|
+ if (this.detail.picture) this.responsibility = JSON.parse(this.detail.picture);
|
|
|
+ if (this.detail.coordinates) {
|
|
|
+ this.coordinates = this.detail.coordinates.split(',');
|
|
|
+ this.latitude = this.coordinates[1];
|
|
|
+ this.longitude = this.coordinates[0];
|
|
|
+ this.addMarkers();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
getOpenHouseListByPage({
|
|
|
currPage: 1,
|
|
|
pageSize: 10
|
|
@@ -105,14 +89,12 @@
|
|
|
},
|
|
|
addMarkers() {
|
|
|
const positions = [{
|
|
|
- latitude: 23.099994,
|
|
|
- longitude: 113.324520,
|
|
|
+ latitude: this.coordinates[1],
|
|
|
+ longitude: this.coordinates[0],
|
|
|
}]
|
|
|
-
|
|
|
+ console.log(positions);
|
|
|
const markers = []
|
|
|
-
|
|
|
positions.forEach((p, i) => {
|
|
|
- console.log(i)
|
|
|
markers.push(
|
|
|
Object.assign({}, {
|
|
|
id: i + 1,
|