|
@@ -1,101 +1,102 @@
|
|
|
<template>
|
|
|
<div class="home-detail">
|
|
|
<div class="container">
|
|
|
- <div class="title">滨湖万丽</div>
|
|
|
- <div class="home-detail-content">
|
|
|
- <div class="home-detail-swiper">
|
|
|
- <div class="swiper-container">
|
|
|
- <div class="swiper-wrapper">
|
|
|
- <div v-for="item in swiperList" :key="item.id" class="swiper-slide"
|
|
|
- :style="`background-image:url(${item.imgUrl})`">
|
|
|
+ <div class="container-box" v-if="detail.id">
|
|
|
+ <div class="title">{{detail.projectName}}</div>
|
|
|
+ <div class="home-detail-content">
|
|
|
+ <div class="home-detail-swiper">
|
|
|
+ <div class="swiper-container">
|
|
|
+ <div class="swiper-wrapper">
|
|
|
+ <div v-for="item in swiperList" :key="item.id" class="swiper-slide"
|
|
|
+ :style="`background-image:url(${item.url})`">
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <div class="swiper-button-prev"></div>
|
|
|
+ <div class="swiper-button-next"></div>
|
|
|
</div>
|
|
|
- <div class="swiper-button-prev"></div>
|
|
|
- <div class="swiper-button-next"></div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="home-detail-information">
|
|
|
- <div class="house-name">滨湖万丽南排小高,耳朵户型凤凰层</div>
|
|
|
- <div class="tag">
|
|
|
- <span>120m²</span>
|
|
|
- <span>标签1</span>
|
|
|
- <span>标签2</span>
|
|
|
- <span>标签3</span>
|
|
|
- </div>
|
|
|
- <div class="house-price">
|
|
|
- <div>
|
|
|
- <span class="average alibaba">7116</span><span class="unit">元/月</span>
|
|
|
- </div>
|
|
|
- <div class="hui-button">预约看房</div>
|
|
|
- </div>
|
|
|
- <div class="content-title">基本信息</div>
|
|
|
- <div class="information-list">
|
|
|
- <div class="information-box">
|
|
|
- <div class="information-title">所属楼宇:</div>
|
|
|
- <div class="information-div">1号楼</div>
|
|
|
- </div>
|
|
|
- <div class="information-box">
|
|
|
- <div class="information-title">所属楼层:</div>
|
|
|
- <div class="information-div">2层</div>
|
|
|
+ <div class="home-detail-information">
|
|
|
+ <div class="house-name">{{detail.name}}</div>
|
|
|
+ <div class="tag">
|
|
|
+ <span>{{detail.area}}m²</span>
|
|
|
+ <span v-for="(tag,index) in detail.tagList" :key="index">{{tag.name}}</span>
|
|
|
</div>
|
|
|
- <div class="information-box">
|
|
|
- <div class="information-title">房源类型:</div>
|
|
|
- <div class="information-div">写字楼</div>
|
|
|
- </div>
|
|
|
- <div class="information-box">
|
|
|
- <div class="information-title">房间号码:</div>
|
|
|
- <div class="information-div">204</div>
|
|
|
- </div>
|
|
|
- <div class="information-box">
|
|
|
- <div class="information-title">房源面积:</div>
|
|
|
- <div class="information-div">120m²</div>
|
|
|
- </div>
|
|
|
- <div class="information-box">
|
|
|
- <div class="information-title">付款方式:</div>
|
|
|
- <div class="information-div">公对公帐户</div>
|
|
|
- </div>
|
|
|
- <div class="information-box" style="margin-bottom: 0;">
|
|
|
- <div class="information-title">产权证书:</div>
|
|
|
- <div class="information-div">SD123333234</div>
|
|
|
+ <div class="house-price">
|
|
|
+ <div>
|
|
|
+ <span class="average alibaba">{{detail.price}}</span><span class="unit">元/月</span>
|
|
|
+ </div>
|
|
|
+ <div class="hui-button">预约看房</div>
|
|
|
</div>
|
|
|
- <div class="information-box" style="margin-bottom: 0;">
|
|
|
- <div class="information-title">是否装修:</div>
|
|
|
- <div class="information-div">是</div>
|
|
|
+ <div class="content-title">基本信息</div>
|
|
|
+ <div class="information-list">
|
|
|
+ <div class="information-box">
|
|
|
+ <div class="information-title">所属楼宇:</div>
|
|
|
+ <div class="information-div">{{detail.projectItemName}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="information-box">
|
|
|
+ <div class="information-title">所属楼层:</div>
|
|
|
+ <div class="information-div">{{detail.projectItemTargetName}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="information-box">
|
|
|
+ <div class="information-title">房源类型:</div>
|
|
|
+ <div class="information-div">{{$field.findTypeName('houseType',detail.roomTypeId)}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="information-box">
|
|
|
+ <div class="information-title">房间号码:</div>
|
|
|
+ <div class="information-div">{{detail.roomNumber}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="information-box">
|
|
|
+ <div class="information-title">房源面积:</div>
|
|
|
+ <div class="information-div">{{detail.area}}m²</div>
|
|
|
+ </div>
|
|
|
+ <div class="information-box">
|
|
|
+ <div class="information-title">付款方式:</div>
|
|
|
+ <div class="information-div">{{$field.findTypeName('payWay',detail.payWay)}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="information-box">
|
|
|
+ <div class="information-title">产权证书:</div>
|
|
|
+ <div class="information-div">{{detail.propertyCertificateNumber}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="information-box">
|
|
|
+ <div class="information-title">是否装修:</div>
|
|
|
+ <div class="information-div">{{detail.decoration === 1 ? '已装修':'未装修'}}</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="content-title">房源简介</div>
|
|
|
- <div class="desc-text">
|
|
|
- 【小区优点】小区位置还不错,位于日月湖板块,主推大面积户型,洋房157平,小高层137平,改户可以选择。
|
|
|
- 【推荐人群】本小区适合想在日月湖买房,改善客户选择,可以选择洋房4室2卫的户型。
|
|
|
+ <div class="content-title">房源简介</div>
|
|
|
+ <div class="desc-text" v-html="detail.introduce"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="sub-title">周边配套</div>
|
|
|
- <div class="map-container">
|
|
|
- <div id="map"></div>
|
|
|
- <div class="content-device">
|
|
|
- <div class="people-tell">
|
|
|
- <img class="people-avatar"
|
|
|
- src="https://img0.baidu.com/it/u=3837888269,660016232&fm=253&fmt=auto&app=138&f=JPEG?w=1067&h=800"
|
|
|
- mode="aspectFill">
|
|
|
- </img>
|
|
|
- <div class="people-text">
|
|
|
- <div class="people-name">房东名称</div>
|
|
|
- <div class="people-organization">
|
|
|
- 组织名称
|
|
|
+ <div class="sub-title">周边配套</div>
|
|
|
+ <div class="map-container">
|
|
|
+ <div id="map"></div>
|
|
|
+ <div class="content-device">
|
|
|
+ <div class="people-tell">
|
|
|
+ <img class="people-avatar" :src="detail.chargePersonPortrait" mode="aspectFill">
|
|
|
+ </img>
|
|
|
+ <div class="people-text">
|
|
|
+ <div class="people-name">{{detail.chargePersonName}}</div>
|
|
|
+ <div class="people-organization">组织名称</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="device-list">
|
|
|
- <div class="device-item"
|
|
|
- v-for="item in $field.findTypeNameByList('supportingFacilities','1,2,3,4,5,6')"
|
|
|
- :key="item.id">
|
|
|
- <i :class="'iconfont device-icon ' + item.icon"></i>
|
|
|
- <span class="device-label">{{item.name}}</span>
|
|
|
+ <div class="device-list">
|
|
|
+ <div class="device-item"
|
|
|
+ v-for="item in $field.findTypeNameByList('supportingFacilities',detail.supportingFacilities)"
|
|
|
+ :key="item.id">
|
|
|
+ <i :class="'iconfont device-icon ' + item.icon"></i>
|
|
|
+ <span class="device-label">{{item.name}}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="skeleton-box" v-else>
|
|
|
+ <el-empty :description="description">
|
|
|
+ <span class="color-blue" style="cursor: pointer;" @click="login" v-if="description === '请登录后查看'">
|
|
|
+ 点击登录>>
|
|
|
+ </span>
|
|
|
+ </el-empty>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<house-foot></house-foot>
|
|
|
</div>
|
|
@@ -105,60 +106,59 @@
|
|
|
// 引入插件
|
|
|
import Swiper from 'swiper'; // 注意引入的是Swiper
|
|
|
import 'swiper/css/swiper.min.css' // 注意这里的引入
|
|
|
- import houseFoot from "@/components/website/houseFoot.vue"
|
|
|
- import AMapLoader from "@amap/amap-jsapi-loader"; //引入AMapLoader
|
|
|
- window._AMapSecurityConfig = {
|
|
|
- // 设置安全密钥
|
|
|
- securityJsCode: "3e392dc7eb2cf2c04b1b8899776e8905",
|
|
|
- };
|
|
|
+ import houseFoot from "@/components/website/houseFoot.vue"
|
|
|
+ import AMapLoader from "@amap/amap-jsapi-loader"; //引入AMapLoader
|
|
|
+ import Crypto from '@/uitls/crypto'
|
|
|
+ import {
|
|
|
+ getToken
|
|
|
+ } from '@/uitls/auth'
|
|
|
+ import {
|
|
|
+ getHouseDetailById
|
|
|
+ } from '@/httpApi/space'
|
|
|
+ import {
|
|
|
+ mapGetters
|
|
|
+ } from 'vuex';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
swiper: null,
|
|
|
- swiperList: [{
|
|
|
- id: 1,
|
|
|
- title: '采集国家二级保护野生植物审批',
|
|
|
- imgUrl: 'https://img0.baidu.com/it/u=3837888269,660016232&fm=253&fmt=auto&app=138&f=JPEG?w=1067&h=800',
|
|
|
- }, {
|
|
|
- id: 2,
|
|
|
- title: '农村危房改造',
|
|
|
- imgUrl: 'https://img0.baidu.com/it/u=3837888269,660016232&fm=253&fmt=auto&app=138&f=JPEG?w=1067&h=800',
|
|
|
- }, {
|
|
|
- id: 3,
|
|
|
- title: '乡村医生执业注册',
|
|
|
- imgUrl: 'https://img0.baidu.com/it/u=3837888269,660016232&fm=253&fmt=auto&app=138&f=JPEG?w=1067&h=800',
|
|
|
- }, {
|
|
|
- id: 4,
|
|
|
- title: '生鲜乳准运证明核发',
|
|
|
- imgUrl: 'https://img0.baidu.com/it/u=3837888269,660016232&fm=253&fmt=auto&app=138&f=JPEG?w=1067&h=800',
|
|
|
- }, {
|
|
|
- id: 5,
|
|
|
- title: '常量命名全部大写,单词间用下划线隔开,力求语义表达完整清楚, 不要嫌名字长',
|
|
|
- imgUrl: 'https://img0.baidu.com/it/u=3837888269,660016232&fm=253&fmt=auto&app=138&f=JPEG?w=1067&h=800',
|
|
|
- }, {
|
|
|
- id: 6,
|
|
|
- title: '使用 2 个空格进行缩进',
|
|
|
- imgUrl: 'https://img0.baidu.com/it/u=3837888269,660016232&fm=253&fmt=auto&app=138&f=JPEG?w=1067&h=800',
|
|
|
- }, {
|
|
|
- id: 7,
|
|
|
- title: '不同逻辑、不同语义、不同业务的代码之间插入一个空行分隔开来以 提升可读性',
|
|
|
- imgUrl: 'https://img0.baidu.com/it/u=3837888269,660016232&fm=253&fmt=auto&app=138&f=JPEG?w=1067&h=800',
|
|
|
- }, {
|
|
|
- id: 8,
|
|
|
- title: '使用字面量来代替对象构造器',
|
|
|
- imgUrl: 'https://img0.baidu.com/it/u=3837888269,660016232&fm=253&fmt=auto&app=138&f=JPEG?w=1067&h=800',
|
|
|
- }],
|
|
|
- detail: {}
|
|
|
+ swiperList: [],
|
|
|
+ detail: {},
|
|
|
+ detailId: '',
|
|
|
+ description: '无房源信息'
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
window.scrollTo(0, 0);
|
|
|
- this.getSwiper();
|
|
|
- this.initMap();
|
|
|
-
|
|
|
+ this.init();
|
|
|
},
|
|
|
methods: {
|
|
|
- initMap() {
|
|
|
+ init() {
|
|
|
+ if (!getToken()) return this.description = '请登录后查看';
|
|
|
+ this.detailId = Crypto.AES.decrypt(this.$route.query.id, 'bosshand');
|
|
|
+ if (!this.detailId) return this.description = '无房源信息';
|
|
|
+ this.getDetail();
|
|
|
+ },
|
|
|
+ getDetail() {
|
|
|
+ getHouseDetailById(this.detailId).then(res => {
|
|
|
+ if (res.state) {
|
|
|
+ this.detail = res.data;
|
|
|
+ if (this.detail.picture) {
|
|
|
+ this.swiperList = JSON.parse(this.detail.picture);
|
|
|
+ this.getSwiper();
|
|
|
+ }
|
|
|
+ if (this.detail.coordinates) {
|
|
|
+ this.coordinates = this.detail.coordinates.split(',');
|
|
|
+ this.initMap([this.coordinates[0], this.coordinates[1]]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ initMap(position) {
|
|
|
+ window._AMapSecurityConfig = {
|
|
|
+ // 设置安全密钥
|
|
|
+ securityJsCode: "3e392dc7eb2cf2c04b1b8899776e8905",
|
|
|
+ };
|
|
|
AMapLoader.load({
|
|
|
key: "880f8193c52d9dee80cd82212d9508cf", //申请好的Web端开发者key,调用 load 时必填
|
|
|
version: "2.0", //指定要加载的 JS API 的版本,缺省时默认为 1.4.15
|
|
@@ -166,11 +166,11 @@
|
|
|
//JS API 加载完成后获取AMap对象
|
|
|
const map = new AMap.Map("map", {
|
|
|
divMode: '2D', //默认使用 2D 模式
|
|
|
- zoom: 11, //地图级别
|
|
|
- center: [116.397428, 39.90923], //地图中心点
|
|
|
+ zoom: 20, //地图级别
|
|
|
+ center: position, //地图中心点
|
|
|
});
|
|
|
const marker = new AMap.Marker({
|
|
|
- position: [116.397428, 39.90923],
|
|
|
+ position: position,
|
|
|
});
|
|
|
map.add(marker);
|
|
|
}).catch((e) => {
|
|
@@ -179,16 +179,31 @@
|
|
|
},
|
|
|
getSwiper() {
|
|
|
this.swiper = new Swiper(".swiper-container", {
|
|
|
+ loop: true,
|
|
|
navigation: {
|
|
|
nextEl: '.swiper-button-next',
|
|
|
prevEl: '.swiper-button-prev',
|
|
|
},
|
|
|
})
|
|
|
+ },
|
|
|
+ login() {
|
|
|
+ this.$store.dispatch('app/changeEvent', {
|
|
|
+ type: 'login'
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
houseFoot
|
|
|
- }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(['event'])
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ event() {
|
|
|
+ let event = this.$store.getters.event;
|
|
|
+ if (event.type == 'homeDetailReload') this.init();
|
|
|
+ }
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -287,6 +302,11 @@
|
|
|
.container {
|
|
|
width: 1200px;
|
|
|
margin: 0 auto;
|
|
|
+ min-height: calc(100vh - 117px);
|
|
|
+ }
|
|
|
+
|
|
|
+ .skeleton-box {
|
|
|
+ padding-top: 50px;
|
|
|
}
|
|
|
|
|
|
.home-detail-content {
|
|
@@ -298,11 +318,17 @@
|
|
|
height: 480px;
|
|
|
|
|
|
.swiper-container,
|
|
|
- .swiper-wrapper {
|
|
|
+ .swiper-wrapper,
|
|
|
+ .swiper-slide {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
|
|
|
+ .swiper-slide {
|
|
|
+ background-size: 100% auto;
|
|
|
+ background-position: bottom;
|
|
|
+ }
|
|
|
+
|
|
|
.swiper-button-next:after,
|
|
|
.swiper-button-prev:after {
|
|
|
color: #eee;
|