|
@@ -3,8 +3,7 @@
|
|
|
<el-empty description="暂无房源" v-if="houseList.length === 0"></el-empty>
|
|
|
<div class="house-list-box" v-else>
|
|
|
<div class="house-list">
|
|
|
- <div class="house-item" v-for="house in houseList" :key="house.id"
|
|
|
- @click="$router.push('/website/homeDetail?id=' + encrypt(house.id))">
|
|
|
+ <div class="house-item" v-for="house in houseList" :key="house.id" @click="clickHouse(house)">
|
|
|
<div class="house-item-image">
|
|
|
<img :src="imageUrl(house.showPicture)" :alt="house.name" />
|
|
|
</div>
|
|
@@ -24,7 +23,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="pagination">
|
|
|
+ <div class="pagination" v-if="type === 'highseas'">
|
|
|
<el-pagination background layout="prev, pager, next" :page-size="pageSize" :current-page="currPage"
|
|
|
:total="totalCount" @current-change="changePage">
|
|
|
</el-pagination>
|
|
@@ -35,7 +34,8 @@
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- getOpenHouseListByPage
|
|
|
+ getOpenHouseListByPage,
|
|
|
+ search
|
|
|
} from '@/httpApi/space';
|
|
|
import Crypto from '@/uitls/crypto'
|
|
|
export default {
|
|
@@ -54,19 +54,28 @@
|
|
|
methods: {
|
|
|
init() {
|
|
|
if (this.type === 'highseas') {
|
|
|
- if (!this.$store.getters.city || !this.$store.getters.city.cityCode) return;
|
|
|
- getOpenHouseListByPage({
|
|
|
- currPage: this.currPage,
|
|
|
- pageSize: this.pageSize,
|
|
|
- addressCode: this.$store.getters.city.cityCode
|
|
|
- }).then(res => {
|
|
|
+ this.initHighSeas();
|
|
|
+ } else if (this.type === 'search') {
|
|
|
+ search(this.$route.query.value).then(res => {
|
|
|
if (res.state) {
|
|
|
- this.houseList = res.data.dataList;
|
|
|
- this.totalCount = res.data.totalCount;
|
|
|
+ this.houseList = res.data.houseList
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ initHighSeas() {
|
|
|
+ if (!this.$store.getters.city || !this.$store.getters.city.cityCode) return;
|
|
|
+ getOpenHouseListByPage({
|
|
|
+ currPage: this.currPage,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ addressCode: this.$store.getters.city.cityCode
|
|
|
+ }).then(res => {
|
|
|
+ if (res.state) {
|
|
|
+ this.houseList = res.data.dataList;
|
|
|
+ this.totalCount = res.data.totalCount;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
changePage(page) {
|
|
|
this.currPage = page;
|
|
|
this.init();
|
|
@@ -75,8 +84,9 @@
|
|
|
if (!data) return 'https://assets.api.uizard.io/api/cdn/stream/c05650d2-192b-4a56-ae97-05638f53804c.png';
|
|
|
return JSON.parse(data)[0].url;
|
|
|
},
|
|
|
- encrypt(text) {
|
|
|
- return Crypto.AES.encrypt(String(text), 'bosshand');
|
|
|
+ clickHouse(item) {
|
|
|
+ let id = Crypto.AES.encrypt(String(item.id), 'bosshand');
|
|
|
+ this.$router.push('/website/homeDetail?id=' + encodeURIComponent(id));
|
|
|
}
|
|
|
}
|
|
|
}
|