This commit is contained in:
gxwebsoft
2023-09-01 19:51:55 +08:00
8 changed files with 854 additions and 157 deletions

View File

@@ -21,6 +21,12 @@ export const updateHouseInfo = (data) => http.put('/house/info', data)
// 删除房源信息 // 删除房源信息
export const removeHouseInfo = (id) => http.delete('/house/info/' + id) export const removeHouseInfo = (id) => http.delete('/house/info/' + id)
// 收藏房源
export const likeHouse = (data) => http.post('/house/like-log', data)
export const getLikeHouseList = () => http.get('/house/like-log')
export const getViewsHouseList = () => http.get('/house/views-log')
export default { export default {
pageHouseInfo, pageHouseInfo,
listHouseInfo, listHouseInfo,
@@ -28,5 +34,8 @@ export default {
getUserDetail, getUserDetail,
updateHouseInfo, updateHouseInfo,
removeHouseInfo, removeHouseInfo,
addHouseInfo addHouseInfo,
likeHouse,
getLikeHouseList,
getViewsHouseList
} }

View File

@@ -99,12 +99,6 @@
"navigationBarTitleText": "身份认证", "navigationBarTitleText": "身份认证",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "certification/house/house",
"style": {
"navigationBarTitleText": "房产认证",
"enablePullDownRefresh": false
}
}, { }, {
"path": "certification/education/education", "path": "certification/education/education",
"style": { "style": {
@@ -263,78 +257,8 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "user/base/sex/sex",
"style": {
"navigationBarTitleText": "注册引导",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, },
{ {
"path": "user/base/birthday/birthday",
"style": {
"navigationBarTitleText": "注册引导",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "user/base/height/height",
"style": {
"navigationBarTitleText": "注册引导",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "user/base/address/address",
"style": {
"navigationBarTitleText": "注册引导",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "user/base/yearpay/yearpay",
"style": {
"navigationBarTitleText": "注册引导",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "user/base/nickname/nickname",
"style": {
"navigationBarTitleText": "注册引导",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "user/base/avatar/avatar",
"style": {
"navigationBarTitleText": "注册引导",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "user/base/photo/photo",
"style": {
"navigationBarTitleText": "注册引导",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "feedback/feedback", "path": "feedback/feedback",
"style": { "style": {
"navigationBarTitleText": "意见反馈", "navigationBarTitleText": "意见反馈",
@@ -552,13 +476,27 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, { },
{
"path": "pages/house/house", "path": "pages/house/house",
"style": { "style": {
"navigationBarTitleText": "房源列表", "navigationBarTitleText": "房源列表",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path": "pages/house/liked",
"style": {
"navigationBarTitleText": "收藏房源",
"enablePullDownRefresh": false
}
},
{
"path": "pages/house/views",
"style": {
"navigationBarTitleText": "浏览历史",
"enablePullDownRefresh": false
}
} }
], ],
"globalStyle": { "globalStyle": {

344
pages/house/liked.vue Normal file
View File

@@ -0,0 +1,344 @@
<template>
<view class="page">
<!-- 搜索 -->
<view style="height: 20rpx;"></view>
<uv-waterfall ref="waterfall" v-model="list" left-gap="10" right-gap="10" column-gap="8"
@changeList="changeList">
<!-- 第一列数据 -->
<template v-slot:list1>
<!-- 为了磨平部分平台的BUG必须套一层view -->
<view class="house-list">
<block v-for="(item,index) in list1" :key="index">
<view class="item" @click="$push('sub_pages/house/detail?houseId=' + item.houseId)">
<image :src="item.files[0].url" mode="widthFix">
</image>
<view class="info">
<view class="title">{{ item.houseTitle }}</view>
<view class="desc"><text>{{ item.extent }}|{{ item.toward }}</text></view>
<view class="price">{{ item.monthlyRent }}/</view>
</view>
</view>
</block>
</view>
</template>
<!-- 第二列数据 -->
<template v-slot:list2>
<!-- 为了磨平部分平台的BUG必须套一层view -->
<view class="house-list">
<block v-for="(item,index) in list2" :key="index">
<view class="item" @click="$push('sub_pages/house/detail?houseId=' + item.houseId)">
<image :src="item.files[0].url" mode="widthFix">
</image>
<view class="info">
<view class="title">{{ item.houseTitle }}</view>
<view class="desc"><text>{{ item.extent }}|{{ item.toward }}</text></view>
<view class="price">{{ item.monthlyRent }}/</view>
</view>
</view>
</block>
</view>
</template>
</uv-waterfall>
<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" v-if="list.length == 0">
</u-empty>
</view>
</template>
<script>
import * as Util from '@/utils/util.js'
import store from '@/store'
import storage from '@/utils/storage'
import * as DictApi from '@/api/dict.js'
import * as HouseInfoApi from '@/api/house-info.js'
const menu = [{
name: '推荐',
reset: true
},
{
name: '必看好房',
reset: false
}
];
const region = [];
const price = [];
const extent = [];
const sort = [];
const loginUserId = uni.getStorageSync('userId')
export default {
data() {
return {
list: [],
list1: [], // 瀑布流第一列数据
list2: [], // 瀑布流第二列数据
loadMore: true,
status: '加载更多',
page: 1,
where: {},
dict: null,
cityList: [],
// 控制onShow事件是否刷新订单列表
canReset: false,
disabled: false,
swiperList: [
'https://file.wsdns.cn/20230802/f33f5ac239c843438b36f40941d946ef.png',
'https://file.wsdns.cn/20230802/1116a02b07904991b2ebdc2c3da4a691.png',
],
menu,
region,
price,
extent,
sort,
// priceScene: null,
scrollTop: 0,
old: {
scrollTop: 0
},
actionStyle: {
background: '#3f72f4',
color: '#ffffff',
padding: '12rpx 0',
borderRadius: '12rpx'
},
};
},
onLoad() {
this.getDict()
this.list = []
this.onRefreshList()
},
onShow() {},
onBackPress() {},
onUnload() {
},
onPageScroll(e) {
this.scrollTop = e.scrollTop
},
// 触底函数
onReachBottom() {
},
methods: {
// 这点非常重要e.name在这里返回是list1或list2要手动将数据追加到相应列
changeList(e) {
this[e.name].push(e.value);
},
onRefreshList() {
const app = this
const userId = uni.getStorageSync('userId')
app.where.page = app.page
// if (app.priceScene) {
// app.where.monthlyRentStart = app.priceScene
// app.where.monthlyRentEnd = app.priceScene
// }
console.log('app: ', app.where);
return new Promise((resolve, reject) => {
HouseInfoApi.getLikeHouseList()
.then(result => {
const list = result.data.map(item => {
const d = item.houseInfo
d.files = JSON.parse(d.files) || []
return d
})
// 合并新数据
app.list.push.apply(app.list,list);
if (result.data.count > app.list.length) {
app.canReset = true
} else {
app.canReset = false
}
console.log("app.list: ", app.list);
resolve(list)
})
})
},
getDict() {
const app = this
DictApi.listDictionary().then(res => {
app.dict = res.data
app.price = res.data.price[0].map(d => {
return {
value: d,
text: d
}
})
app.extent = res.data.extent[0].map(d => {
return {
value: d,
text: d
}
})
app.sort = res.data.sort[0].map(d => {
console.log('d: ', d);
return {
value: d,
text: d
}
})
uni.request({
url: 'https://file.wsdns.cn/json/city.js',
success(res) {
res.data.map(e => {
if (e.value == '450000') {
e.children.map(city => {
if (city.value == '450100') {
app.region = city.children.map(r => {
return {
value: r.label,
text: r.label
}
})
}
})
}
});
}
})
})
},
onSearch(text) {
this.list = [];
this.$refs.waterfall.clear();
this.list1 = [];
this.list2 = [];
this.page = 1
console.log('extentScene: ', this.where.extentScene);
if (text == '0-100㎡') {
this.where.extentScene = '100'
}
if (text == '100-150㎡') {
this.where.extentScene = '100-150'
}
if (text == '150-200㎡') {
this.where.extentScene = '150-200'
}
if (text == '200-300㎡') {
this.where.extentScene = '200-300'
}
if (text == '300-400㎡') {
this.where.extentScene = '300-400'
}
if (text == '400-600㎡') {
this.where.extentScene = '400-600'
}
if (text == '600-1000㎡') {
this.where.extentScene = '600-1000'
}
if (text == '1000㎡以上') {
this.where.extentScene = '1000'
}
this.onRefreshList()
// this.$push('/sub_pages/member/member', this.where)
},
},
watch: {
}
};
</script>
<style lang="scss" scoped>
.page {
.search-fix {
width: 750rpx;
margin: auto;
display: flex;
.search {
width: 710rpx;
margin: 15rpx auto;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.search-tools {
width: 720rpx;
margin: auto;
display: flex;
justify-content: space-around;
font-size: 22rpx;
.region {
width: 178rpx;
background-color: #ffffff;
* {
font-size: 22rpx;
}
}
}
.fixed {
position: fixed;
top: 300rpx;
left: 125rpx;
}
.no-fixed {
position: absolute;
top: 0rpx;
left: 125rpx;
}
.tabs {
margin-top: 50rpx;
}
.house-list {
// width: 700rpx;
// margin: 20rpx auto;
// display: flex;
// flex-wrap: wrap;
// justify-content: space-between;
.item {
margin-bottom: 40rpx;
border-radius: 20rpx;
// box-shadow: 0 3rpx 10rpx 0px #cccccc;
background-color: #ffffff;
width: 338rpx;
image {
border-radius: 20rpx 20rpx 0 0;
height: 420rpx;
width: 338rpx;
}
.info {
padding: 20rpx 20rpx;
display: flex;
flex-direction: column;
.title {
font-size: 30rpx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden; //溢出内容隐藏
text-overflow: ellipsis; //文本溢出部分用省略号表示
display: -webkit-box; //特别显示模式
-webkit-line-clamp: 2; //行数
line-clamp: 2;
-webkit-box-orient: vertical; //盒子中内容竖直排列
}
.desc {
color: #999999;
font-size: 28rpx;
}
.price {
color: #ff0000;
font-size: 30rpx;
}
}
}
}
}
</style>

344
pages/house/views.vue Normal file
View File

@@ -0,0 +1,344 @@
<template>
<view class="page">
<!-- 搜索 -->
<view style="height: 20rpx;"></view>
<uv-waterfall ref="waterfall" v-model="list" left-gap="10" right-gap="10" column-gap="8"
@changeList="changeList">
<!-- 第一列数据 -->
<template v-slot:list1>
<!-- 为了磨平部分平台的BUG必须套一层view -->
<view class="house-list">
<block v-for="(item,index) in list1" :key="index">
<view class="item" @click="$push('sub_pages/house/detail?houseId=' + item.houseId)">
<image :src="item.files[0].url" mode="widthFix">
</image>
<view class="info">
<view class="title">{{ item.houseTitle }}</view>
<view class="desc"><text>{{ item.extent }}|{{ item.toward }}</text></view>
<view class="price">{{ item.monthlyRent }}/</view>
</view>
</view>
</block>
</view>
</template>
<!-- 第二列数据 -->
<template v-slot:list2>
<!-- 为了磨平部分平台的BUG必须套一层view -->
<view class="house-list">
<block v-for="(item,index) in list2" :key="index">
<view class="item" @click="$push('sub_pages/house/detail?houseId=' + item.houseId)">
<image :src="item.files[0].url" mode="widthFix">
</image>
<view class="info">
<view class="title">{{ item.houseTitle }}</view>
<view class="desc"><text>{{ item.extent }}|{{ item.toward }}</text></view>
<view class="price">{{ item.monthlyRent }}/</view>
</view>
</view>
</block>
</view>
</template>
</uv-waterfall>
<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" v-if="list.length == 0">
</u-empty>
</view>
</template>
<script>
import * as Util from '@/utils/util.js'
import store from '@/store'
import storage from '@/utils/storage'
import * as DictApi from '@/api/dict.js'
import * as HouseInfoApi from '@/api/house-info.js'
const menu = [{
name: '推荐',
reset: true
},
{
name: '必看好房',
reset: false
}
];
const region = [];
const price = [];
const extent = [];
const sort = [];
const loginUserId = uni.getStorageSync('userId')
export default {
data() {
return {
list: [],
list1: [], // 瀑布流第一列数据
list2: [], // 瀑布流第二列数据
loadMore: true,
status: '加载更多',
page: 1,
where: {},
dict: null,
cityList: [],
// 控制onShow事件是否刷新订单列表
canReset: false,
disabled: false,
swiperList: [
'https://file.wsdns.cn/20230802/f33f5ac239c843438b36f40941d946ef.png',
'https://file.wsdns.cn/20230802/1116a02b07904991b2ebdc2c3da4a691.png',
],
menu,
region,
price,
extent,
sort,
// priceScene: null,
scrollTop: 0,
old: {
scrollTop: 0
},
actionStyle: {
background: '#3f72f4',
color: '#ffffff',
padding: '12rpx 0',
borderRadius: '12rpx'
},
};
},
onLoad() {
this.getDict()
this.list = []
this.onRefreshList()
},
onShow() {},
onBackPress() {},
onUnload() {
},
onPageScroll(e) {
this.scrollTop = e.scrollTop
},
// 触底函数
onReachBottom() {
},
methods: {
// 这点非常重要e.name在这里返回是list1或list2要手动将数据追加到相应列
changeList(e) {
this[e.name].push(e.value);
},
onRefreshList() {
const app = this
const userId = uni.getStorageSync('userId')
app.where.page = app.page
// if (app.priceScene) {
// app.where.monthlyRentStart = app.priceScene
// app.where.monthlyRentEnd = app.priceScene
// }
console.log('app: ', app.where);
return new Promise((resolve, reject) => {
HouseInfoApi.getViewsHouseList()
.then(result => {
const list = result.data.map(item => {
const d = item.houseInfo
d.files = JSON.parse(d.files) || []
return d
})
// 合并新数据
app.list.push.apply(app.list,list);
if (result.data.count > app.list.length) {
app.canReset = true
} else {
app.canReset = false
}
console.log("app.list: ", app.list);
resolve(list)
})
})
},
getDict() {
const app = this
DictApi.listDictionary().then(res => {
app.dict = res.data
app.price = res.data.price[0].map(d => {
return {
value: d,
text: d
}
})
app.extent = res.data.extent[0].map(d => {
return {
value: d,
text: d
}
})
app.sort = res.data.sort[0].map(d => {
console.log('d: ', d);
return {
value: d,
text: d
}
})
uni.request({
url: 'https://file.wsdns.cn/json/city.js',
success(res) {
res.data.map(e => {
if (e.value == '450000') {
e.children.map(city => {
if (city.value == '450100') {
app.region = city.children.map(r => {
return {
value: r.label,
text: r.label
}
})
}
})
}
});
}
})
})
},
onSearch(text) {
this.list = [];
this.$refs.waterfall.clear();
this.list1 = [];
this.list2 = [];
this.page = 1
console.log('extentScene: ', this.where.extentScene);
if (text == '0-100㎡') {
this.where.extentScene = '100'
}
if (text == '100-150㎡') {
this.where.extentScene = '100-150'
}
if (text == '150-200㎡') {
this.where.extentScene = '150-200'
}
if (text == '200-300㎡') {
this.where.extentScene = '200-300'
}
if (text == '300-400㎡') {
this.where.extentScene = '300-400'
}
if (text == '400-600㎡') {
this.where.extentScene = '400-600'
}
if (text == '600-1000㎡') {
this.where.extentScene = '600-1000'
}
if (text == '1000㎡以上') {
this.where.extentScene = '1000'
}
this.onRefreshList()
// this.$push('/sub_pages/member/member', this.where)
},
},
watch: {
}
};
</script>
<style lang="scss" scoped>
.page {
.search-fix {
width: 750rpx;
margin: auto;
display: flex;
.search {
width: 710rpx;
margin: 15rpx auto;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.search-tools {
width: 720rpx;
margin: auto;
display: flex;
justify-content: space-around;
font-size: 22rpx;
.region {
width: 178rpx;
background-color: #ffffff;
* {
font-size: 22rpx;
}
}
}
.fixed {
position: fixed;
top: 300rpx;
left: 125rpx;
}
.no-fixed {
position: absolute;
top: 0rpx;
left: 125rpx;
}
.tabs {
margin-top: 50rpx;
}
.house-list {
// width: 700rpx;
// margin: 20rpx auto;
// display: flex;
// flex-wrap: wrap;
// justify-content: space-between;
.item {
margin-bottom: 40rpx;
border-radius: 20rpx;
// box-shadow: 0 3rpx 10rpx 0px #cccccc;
background-color: #ffffff;
width: 338rpx;
image {
border-radius: 20rpx 20rpx 0 0;
height: 420rpx;
width: 338rpx;
}
.info {
padding: 20rpx 20rpx;
display: flex;
flex-direction: column;
.title {
font-size: 30rpx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden; //溢出内容隐藏
text-overflow: ellipsis; //文本溢出部分用省略号表示
display: -webkit-box; //特别显示模式
-webkit-line-clamp: 2; //行数
line-clamp: 2;
-webkit-box-orient: vertical; //盒子中内容竖直排列
}
.desc {
color: #999999;
font-size: 28rpx;
}
.price {
color: #ff0000;
font-size: 30rpx;
}
}
}
}
}
</style>

View File

@@ -122,13 +122,13 @@
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv2os.png" isLink title="房源管理" @click="$push('sub_pages/house/house')"></u-cell> <u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv2os.png" isLink title="房源管理" @click="$push('sub_pages/house/house')"></u-cell>
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26y.png" isLink title="访客记录"></u-cell> <u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26y.png" isLink title="访客记录"></u-cell>
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x.png" isLink title="浏览历史"></u-cell> <u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x.png" isLink title="浏览历史"></u-cell>
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26y%20%281%29.png" isLink title="我的收藏"></u-cell> <u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26y%20%281%29.png" isLink title="我的收藏" @click="$push('pages/house/liked')"></u-cell>
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x%20%281%29.png" isLink title="关于我们"></u-cell> <u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x%20%281%29.png" isLink title="关于我们"></u-cell>
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x%20%282%29.png" isLink title="联系专属经纪人" :border="false" @click="showMyMatchmaker"></u-cell> <u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x%20%282%29.png" isLink title="联系专属经纪人" :border="false" @click="showMyMatchmaker"></u-cell>
</u-cell-group> </u-cell-group>
<u-cell-group v-else :border="false"> <u-cell-group v-else :border="false">
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x.png" isLink title="浏览历史"></u-cell> <u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x.png" isLink title="浏览历史"></u-cell>
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26y%20%281%29.png" isLink title="收藏房源"></u-cell> <u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26y%20%281%29.png" isLink title="收藏房源" @click="$push('pages/house/liked')"></u-cell>
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x%20%281%29.png" isLink title="关于我们"></u-cell> <u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x%20%281%29.png" isLink title="关于我们"></u-cell>
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26w.png" isLink title="预约看房记录"></u-cell> <u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26w.png" isLink title="预约看房记录"></u-cell>
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x%20%282%29.png" isLink title="联系专属经纪人" :border="false" @click="showMyMatchmaker"></u-cell> <u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x%20%282%29.png" isLink title="联系专属经纪人" :border="false" @click="showMyMatchmaker"></u-cell>
@@ -448,34 +448,9 @@
// uni.setStorageSync('gradeId',res.data.gradeId) // uni.setStorageSync('gradeId',res.data.gradeId)
// uni.setStorageSync('gradeName',res.data.gradeName) // uni.setStorageSync('gradeName',res.data.gradeName)
app.isLogin = true app.isLogin = true
// const roleName = res.data.roles[0].roleName
// app.roleName = roleName
// storage.set('roleName',roleName)
// // 判断会员身份
// const roleName = storage.get('roleName')
// if(roleName == '尊享会员'){
// app.roleName = roleName
// return false
// }
// const exclusive = app.form.roles.filter(d => d.roleName == '尊享会员')
// const ordinary = app.form.roles.filter(d => d.roleName == '普通会员')
// if(ordinary){
// console.log("111111: ",111111);
// app.roleName = '普通会员'
// storage.set('roleName',d.roleName)
// }
// if(exclusive){
// console.log("222222: ",222222);
// app.roleName = '尊享会员'
// storage.set('roleName',d.roleName)
// }
} else { } else {
app.isLogin = false app.isLogin = false
// app.handleLogout()
} }
}) })

View File

@@ -1,7 +1,7 @@
<template> <template>
<view class="container"> <view class="container">
<u--form :model="form" ref="uForm" :rules="rules" labelPosition="top" :labelStyle="{paddingLeft: '10rpx'}" <u--form :model="form" ref="uForm" :rules="rules" labelPosition="top" :labelStyle="{paddingLeft: '10rpx'}"
label-width="200rpx"> label-width="200rpx" >
<!-- 表单组件 --> <!-- 表单组件 -->
<view class="his-head"> <view class="his-head">
@@ -10,45 +10,38 @@
<view class="form-wrapper"> <view class="form-wrapper">
<u-cell-group :border="false"> <u-cell-group :border="false">
<u-form-item prop="houseTitle"> <u-form-item prop="houseTitle">
<u-cell title="标题" :isLink="true" customStyle=""> <u-cell title="标题" :isLink="false" customStyle="">
<u-input slot="value" class="input" v-model="form.houseTitle" inputAlign="right" <u-input slot="value" class="input" v-model="form.houseTitle" inputAlign="right"
maxlength="30" :border="false" placeholder="请输入标题" /> maxlength="30" :border="false" placeholder="请输入标题" />
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="area"> <u-form-item prop="area">
<u-cell title="城市" @click="onArea" :isLink="true"> <u-cell title="城市" @click="onArea" :isLink="true">
<u-input slot="value" class="input" v-model="form.city" inputAlign="right" maxlength="30" <u-input :disabled="true" disabledColor="#FFFFFF" slot="value" class="input" v-model="form.city" inputAlign="right" maxlength="30"
:border="false" placeholder="请选择所在城市" /> :border="false" placeholder="请选择所在城市" />
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="address"> <!-- <u-form-item prop="address">
<u-cell title="详细地址" :isLink="true"> <u-cell title="详细地址" :isLink="true">
<u-input slot="value" class="input" v-model="form.address" inputAlign="right" maxlength="30" <u-input slot="value" class="input" v-model="form.address" inputAlign="right" maxlength="30"
:border="false" placeholder="请输入详细地址" /> :border="false" placeholder="请输入详细地址" :disabled="true" disabledColor="#FFFFFF"/>
</u-cell> </u-cell>
</u-form-item> -->
<u-form-item prop="address">
<view class="his-head">
<text class="title">详细地址</text>
</view>
<view class="form-wrapper" @click="openMap">
<view class="textarea">
<u--textarea v-model="form.address" placeholder="请输入详细地址"
maxlength="200" :disabled="true" disabledColor="#FFFFFF"></u--textarea>
</view>
</view>
</u-form-item> </u-form-item>
<u-form-item prop="houseType"> <u-form-item prop="houseType">
<u-cell title="户型" :isLink="true" @click="showHouseType = true"> <u-cell title="户型" :isLink="true" @click="showHouseType = true">
<u-input slot="value" class="input" v-model="form.houseType" inputAlign="right" <u-input slot="value" class="input" v-model="form.houseType" inputAlign="right"
maxlength="30" :border="false" placeholder="请选择房子户型" /> maxlength="30" :border="false" placeholder="请选择房子户型" :disabled="true" disabledColor="#FFFFFF" />
</u-cell>
</u-form-item>
<u-form-item prop="leaseMethod">
<u-cell title="租赁方式" :isLink="true" @click="showLeaseMethod = true">
<u-input slot="value" class="input" v-model="form.leaseMethod" inputAlign="right"
maxlength="30" :border="false" placeholder="请选择租赁方式" />
</u-cell>
</u-form-item>
<u-form-item prop="rent">
<u-cell title="租金(元/m²)" :isLink="true">
<u-input slot="value" class="input" v-model="form.rent" inputAlign="right" maxlength="30"
:border="false" placeholder="请输入租金" />
</u-cell>
</u-form-item>
<u-form-item prop="monthlyRent">
<u-cell title="月租金(每月)" :isLink="true">
<u-input slot="value" class="input" v-model="form.monthlyRent" inputAlign="right"
maxlength="30" :border="false" placeholder="请输入您的月租金" />
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="extent"> <u-form-item prop="extent">
@@ -57,26 +50,68 @@
:border="false" placeholder="该房屋面积" /> :border="false" placeholder="该房屋面积" />
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="leaseMethod">
<u-cell title="租赁方式" :isLink="true" @click="showLeaseMethod = true">
<u-input slot="value" class="input" v-model="form.leaseMethod" inputAlign="right"
maxlength="30" :border="false" placeholder="请选择租赁方式" :disabled="true" disabledColor="#FFFFFF"/>
</u-cell>
</u-form-item>
<u-form-item prop="rent">
<u-cell title="租金(元/m²)" :isLink="false">
<u-input type="digit" slot="value" class="input" v-model="form.rent" inputAlign="right" maxlength="30"
:border="false" placeholder="请输入租金" />
</u-cell>
</u-form-item>
<u-form-item prop="monthlyRent">
<u-cell title="月租金(每月)" :isLink="false">
<u-input type="digit" slot="value" class="input" v-model="form.monthlyRent" inputAlign="right"
maxlength="30" :border="false" placeholder="请输入月租金" />
</u-cell>
</u-form-item>
<u-form-item prop="propertyFees">
<u-cell title="物业费" :isLink="false">
<u-input type="digit" slot="value" class="input" v-model="form.propertyFees" inputAlign="right"
maxlength="30" :border="false" placeholder="请输入物业费" />
</u-cell>
</u-form-item>
<u-form-item prop="tenancy">
<u-cell title="租期" :isLink="false">
<u-input slot="value" class="input" v-model="form.tenancy" inputAlign="right" maxlength="30"
:border="false" placeholder="请输入租期" />
</u-cell>
</u-form-item>
<u-form-item prop="commission">
<u-cell title="佣金" :isLink="false">
<u-input type="digit" slot="value" class="input" v-model="form.commission" inputAlign="right" maxlength="30"
:border="false" placeholder="请输入佣金" />
</u-cell>
</u-form-item>
<u-form-item prop="premium">
<u-cell title="可溢价" :isLink="true" @click="showPremium = true">
<u-input slot="value" class="input" v-model="form.premium" inputAlign="right" maxlength="30"
:border="false" placeholder="请选择楼是否可溢价" />
</u-cell>
</u-form-item>
<u-form-item prop="floor"> <u-form-item prop="floor">
<u-cell title="楼层" :isLink="true" @click="showFloor = true"> <u-cell title="楼层" :isLink="true" @click="showFloor = true">
<u-input slot="value" class="input" v-model="form.floor" inputAlign="right" maxlength="30" <u-input slot="value" class="input" v-model="form.floor" inputAlign="right" maxlength="30"
:border="false" placeholder="请选择楼层" /> :border="false" placeholder="请选择楼层" :disabled="true" disabledColor="#FFFFFF"/>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="roomNumber"> <u-form-item prop="roomNumber">
<u-cell title="房号" :isLink="true"> <u-cell title="房号" :isLink="false">
<u-input slot="value" class="input" v-model="form.roomNumber" inputAlign="right" <u-input slot="value" class="input" v-model="form.roomNumber" inputAlign="right"
maxlength="30" :border="false" placeholder="请输入房号" /> maxlength="30" :border="false" placeholder="请输入房号" />
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="phone"> <u-form-item prop="phone">
<u-cell title="业主电话" :isLink="true"> <u-cell title="业主电话" :isLink="false">
<u-input slot="value" class="input" v-model="form.phone" inputAlign="right" maxlength="30" <u-input slot="value" class="input" v-model="form.phone" inputAlign="right" maxlength="30"
:border="false" placeholder="请输入业主电话" /> :border="false" placeholder="请输入业主电话" />
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="password"> <u-form-item prop="password">
<u-cell title="密码" :isLink="true"> <u-cell title="密码" :isLink="false">
<u-input slot="value" class="input" v-model="form.password" inputAlign="right" <u-input slot="value" class="input" v-model="form.password" inputAlign="right"
maxlength="30" :border="false" placeholder="请输入房屋密码" /> maxlength="30" :border="false" placeholder="请输入房屋密码" />
</u-cell> </u-cell>
@@ -84,7 +119,7 @@
<u-form-item prop="toward"> <u-form-item prop="toward">
<u-cell title="朝向" :isLink="true" @click="showToward = true"> <u-cell title="朝向" :isLink="true" @click="showToward = true">
<u-input slot="value" class="input" v-model="form.toward" inputAlign="right" maxlength="30" <u-input slot="value" class="input" v-model="form.toward" inputAlign="right" maxlength="30"
:border="false" placeholder="请选择房源朝向" /> :border="false" placeholder="请选择房源朝向" :disabled="true" disabledColor="#FFFFFF"/>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
</u-cell-group> </u-cell-group>
@@ -180,6 +215,9 @@
<u-picker :show="showToward" :columns="dict.toward" @confirm="confirmToward" @cancel="closeToward" <u-picker :show="showToward" :columns="dict.toward" @confirm="confirmToward" @cancel="closeToward"
:closeOnClickOverlay="true" @close="closeToward"> :closeOnClickOverlay="true" @close="closeToward">
</u-picker> </u-picker>
<u-picker :show="showPremium" :columns="[['是','否']]" @confirm="confirmPremium" @cancel="showPremium = false"
:closeOnClickOverlay="true" @close="showPremium = false">
</u-picker>
@@ -238,7 +276,8 @@
form: { form: {
houseTitle: '', houseTitle: '',
area: '', area: '',
status: 10 status: 10,
address: ''
}, },
fileList1: [], fileList1: [],
fileList2: [], fileList2: [],
@@ -251,6 +290,7 @@
showLeaseMethod: false, showLeaseMethod: false,
showFloor: false, showFloor: false,
showToward: false, showToward: false,
showPremium: false,
houseLabel: [], houseLabel: [],
showRegion: false, showRegion: false,
@@ -408,7 +448,7 @@
} }
}); });
}, },
// 上传图片 // 上传图片
uploadFile() { uploadFile() {
const app = this const app = this
@@ -421,6 +461,17 @@
HouseInfoApi.updateUserProfile(app.form) HouseInfoApi.updateUserProfile(app.form)
}) })
}, },
openMap() {
const app = this
uni.chooseLocation({
success: (res) => {
app.form.address = res.address
app.form.latitude = res.latitude
app.form.longitude = res.longitude
console.log(res);
}
})
},
// 确认修改 // 确认修改
async handleSubmit() { async handleSubmit() {
@@ -572,6 +623,10 @@
this.form.toward = e.value[0] this.form.toward = e.value[0]
this.showToward = false this.showToward = false
}, },
confirmPremium(e) {
this.form.premium = e.value[0]
this.showPremium = false
},
closeToward() { closeToward() {
this.showToward = false this.showToward = false
}, },
@@ -824,7 +879,7 @@
font-size: 30rpx; font-size: 30rpx;
padding-top: 20rpx; padding-top: 20rpx;
color: #333333; color: #333333;
font-weight: 600; // font-weight: 600;
.line { .line {
background-color: #681752; background-color: #681752;
@@ -838,4 +893,8 @@
} }
} }
/deep/ .u-form-item__body {
padding: 0 !important;
}
</style> </style>

View File

@@ -74,19 +74,19 @@
<view class="item col-2"> <view class="item col-2">
租金(/){{ form.rent || '' }} 租金(/){{ form.rent || '' }}
</view> </view>
<view class="item col-2"> <view v-if="isManager" class="item col-2">
房号{{ form.roomNumber || '' }} 房号{{ form.roomNumber || '' }}
</view> </view>
<view class="item col-2"> <view v-if="isManager" class="item col-2">
密码{{ form.password || '' }} 密码{{ form.password || '' }}
</view> </view>
<view class="item col-2">业主电话{{ form.phone || '' }}</view> <view v-if="isManager" class="item col-2">业主电话{{ form.phone || '' }}</view>
<view class="item col-2">物业费{{ form.propertyFees || '' }}</view> <view v-if="isManager" class="item col-2">物业费{{ form.propertyFees || '' }}</view>
<view class="item col-2">租期{{ form.tenancy || '' }}</view> <view v-if="isManager" class="item col-2">租期{{ form.tenancy || '' }}</view>
<view class="item col-2" v-if="form.gradeName == '公司员工'"> <view class="item col-2" v-if="isManager">
佣金{{ form.commission || '' }} 佣金{{ form.commission || '' }}
</view> </view>
<view class="item col-2" v-if="form.gradeName == '公司员工'"> <view class="item col-2" v-if="isManager">
是否可溢价{{ form.premium || '' }} 是否可溢价{{ form.premium || '' }}
</view> </view>
</view> </view>
@@ -152,9 +152,9 @@
<u-gap height="100"></u-gap> <u-gap height="100"></u-gap>
<view class="pay-tools"> <view class="pay-tools">
<view class="item" @click="onHeart"> <view class="item" @click="onHeart">
<u-icon name="heart-fill" size="28" color="#ff0000" v-if="heart"></u-icon> <u-icon name="heart-fill" size="28" color="#ff0000" v-if="form.liked"></u-icon>
<u-icon name="heart" size="28" v-else></u-icon> <u-icon name="heart" size="28" v-else></u-icon>
<text v-if="heart">已收藏</text> <text v-if="form.liked">已收藏</text>
<text v-else>收藏</text> <text v-else>收藏</text>
</view> </view>
<view class="item" @click="$push('sub_pages/checkout/checkout?id=' + form.houseId)"> <view class="item" @click="$push('sub_pages/checkout/checkout?id=' + form.houseId)">
@@ -172,6 +172,10 @@
import store from '@/store' import store from '@/store'
import storage from '@/utils/storage' import storage from '@/utils/storage'
import * as HouseInfoApi from '@/api/house-info.js' import * as HouseInfoApi from '@/api/house-info.js'
import {
getAgentUser,
getUser
} from '@/api/user.js'
const menu = [{ const menu = [{
name: '推荐', name: '推荐',
@@ -302,7 +306,6 @@
padding: '12rpx 0', padding: '12rpx 0',
borderRadius: '12rpx' borderRadius: '12rpx'
}, },
heart: false,
swiperType: 'video', swiperType: 'video',
latitude: 39.909, latitude: 39.909,
longitude: 116.39742, longitude: 116.39742,
@@ -310,13 +313,26 @@
latitude: 39.909, latitude: 39.909,
longitude: 116.39742, longitude: 116.39742,
iconPath: 'https://oss.wsdns.cn/20230803/49fe9c001370488caf29c3decb34f6c7.png?x-oss-process=image/resize,w_750/quality,Q_90' iconPath: 'https://oss.wsdns.cn/20230803/49fe9c001370488caf29c3decb34f6c7.png?x-oss-process=image/resize,w_750/quality,Q_90'
}] }],
agentUser: {},
isManager: false
}; };
}, },
onLoad(options) { onLoad(options) {
this.houseId = options.houseId this.houseId = options.houseId
this.getHouseInfo() this.getHouseInfo()
if(options.user_id) {
getAgentUser(options.user_id).then(res => {
this.agentUser = res.data
})
}
getUser().then(res=>{
this.isManager = res.data.gradeId == 15
}).catch((err)=>{
console.log(err);
})
}, },
onShow() {}, onShow() {},
onBackPress() {}, onBackPress() {},
@@ -349,15 +365,26 @@
}) })
}, },
onHeart() { onHeart() {
this.heart = !this.heart const app = this;
HouseInfoApi.likeHouse({
houseId: this.form.houseId,
houseUserId: this.form.userId
}).then(res=>{
app.form.liked = res.data
})
}, },
onCall(phone) { onCall(phone) {
if (!phone) { if (this.agentUser && this.agentUser.phone) {
return false uni.makePhoneCall({
phoneNumber: this.agentUser.phone
})
}else if(phone) {
uni.makePhoneCall({
phoneNumber: phone
})
} }
uni.makePhoneCall({
phoneNumber: phone
})
} }
}, },
watch: { watch: {

View File

@@ -38,7 +38,7 @@
<view class="list"> <view class="list">
<block v-for="(item,index) in list" :key="index"> <block v-for="(item,index) in list" :key="index">
<view class="item" @click="addHouseInfo(item.houseId)"> <view class="item" @click="addHouseInfo(item.houseId)">
<view class="badge" @click.stop="onBadge(item,index)"><u-badge :isDot="true" type="info" <view class="badge" @click.stop="onBadge(item,index)"><u-badge :isDot="true" type="info"
:bgColor="item.selected ? bgColor : ''"></u-badge></view> :bgColor="item.selected ? bgColor : ''"></u-badge></view>
<view class="status"> <view class="status">
<u-tag :text="item.status == 0 ? '上架' : '下架'" plain <u-tag :text="item.status == 0 ? '上架' : '下架'" plain
@@ -351,6 +351,7 @@
position: relative; position: relative;
.badge { .badge {
scale: 3;
position: absolute; position: absolute;
left: 30rpx; left: 30rpx;
top: 30rpx; top: 30rpx;