From f68191c5a1dcdf6d43292bbd98e40099596cf9a5 Mon Sep 17 00:00:00 2001
From: weicw <594098497@qq.com>
Date: Fri, 1 Sep 2023 19:46:18 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E7=85=A7=E6=96=87=E6=A1=A3=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/house-info.js | 11 +-
pages.json | 96 ++---------
pages/house/liked.vue | 344 +++++++++++++++++++++++++++++++++++++
pages/house/views.vue | 344 +++++++++++++++++++++++++++++++++++++
pages/user/user.vue | 29 +---
sub_pages/house/add.vue | 123 +++++++++----
sub_pages/house/detail.vue | 61 +++++--
sub_pages/house/house.vue | 3 +-
8 files changed, 854 insertions(+), 157 deletions(-)
create mode 100644 pages/house/liked.vue
create mode 100644 pages/house/views.vue
diff --git a/api/house-info.js b/api/house-info.js
index c47f889..7448f8d 100644
--- a/api/house-info.js
+++ b/api/house-info.js
@@ -21,6 +21,12 @@ export const updateHouseInfo = (data) => http.put('/house/info', data)
// 删除房源信息
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 {
pageHouseInfo,
listHouseInfo,
@@ -28,5 +34,8 @@ export default {
getUserDetail,
updateHouseInfo,
removeHouseInfo,
- addHouseInfo
+ addHouseInfo,
+ likeHouse,
+ getLikeHouseList,
+ getViewsHouseList
}
diff --git a/pages.json b/pages.json
index 1b05c6d..a968801 100755
--- a/pages.json
+++ b/pages.json
@@ -99,12 +99,6 @@
"navigationBarTitleText": "身份认证",
"enablePullDownRefresh": false
}
- }, {
- "path": "certification/house/house",
- "style": {
- "navigationBarTitleText": "房产认证",
- "enablePullDownRefresh": false
- }
}, {
"path": "certification/education/education",
"style": {
@@ -263,78 +257,8 @@
"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",
"style": {
"navigationBarTitleText": "意见反馈",
@@ -552,13 +476,27 @@
"enablePullDownRefresh": false
}
- }, {
+ },
+ {
"path": "pages/house/house",
"style": {
"navigationBarTitleText": "房源列表",
"enablePullDownRefresh": false
}
-
+ },
+ {
+ "path": "pages/house/liked",
+ "style": {
+ "navigationBarTitleText": "收藏房源",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/house/views",
+ "style": {
+ "navigationBarTitleText": "浏览历史",
+ "enablePullDownRefresh": false
+ }
}
],
"globalStyle": {
diff --git a/pages/house/liked.vue b/pages/house/liked.vue
new file mode 100644
index 0000000..b27a99c
--- /dev/null
+++ b/pages/house/liked.vue
@@ -0,0 +1,344 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.houseTitle }}
+ {{ item.extent }}m²|{{ item.toward }}
+ {{ item.monthlyRent }}元/月
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.houseTitle }}
+ {{ item.extent }}m²|{{ item.toward }}
+ {{ item.monthlyRent }}元/月
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/house/views.vue b/pages/house/views.vue
new file mode 100644
index 0000000..d7cfca2
--- /dev/null
+++ b/pages/house/views.vue
@@ -0,0 +1,344 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.houseTitle }}
+ {{ item.extent }}m²|{{ item.toward }}
+ {{ item.monthlyRent }}元/月
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.houseTitle }}
+ {{ item.extent }}m²|{{ item.toward }}
+ {{ item.monthlyRent }}元/月
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/user.vue b/pages/user/user.vue
index 6bf95cc..acd2e75 100644
--- a/pages/user/user.vue
+++ b/pages/user/user.vue
@@ -122,13 +122,13 @@
-
+
-
+
@@ -448,34 +448,9 @@
// uni.setStorageSync('gradeId',res.data.gradeId)
// uni.setStorageSync('gradeName',res.data.gradeName)
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 {
app.isLogin = false
- // app.handleLogout()
}
})
diff --git a/sub_pages/house/add.vue b/sub_pages/house/add.vue
index 20d9e4d..65c3c59 100644
--- a/sub_pages/house/add.vue
+++ b/sub_pages/house/add.vue
@@ -1,7 +1,7 @@
+ label-width="200rpx" >
@@ -10,45 +10,38 @@
-
+
-
-
+
+
+
+ 详细地址
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ maxlength="30" :border="false" placeholder="请选择房子户型" :disabled="true" disabledColor="#FFFFFF" />
@@ -57,26 +50,68 @@
:border="false" placeholder="该房屋面积" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ :border="false" placeholder="请选择楼层" :disabled="true" disabledColor="#FFFFFF"/>
-
+
-
+
-
+
@@ -84,7 +119,7 @@
+ :border="false" placeholder="请选择房源朝向" :disabled="true" disabledColor="#FFFFFF"/>
@@ -180,6 +215,9 @@
+
+
@@ -238,7 +276,8 @@
form: {
houseTitle: '',
area: '',
- status: 10
+ status: 10,
+ address: ''
},
fileList1: [],
fileList2: [],
@@ -251,6 +290,7 @@
showLeaseMethod: false,
showFloor: false,
showToward: false,
+ showPremium: false,
houseLabel: [],
showRegion: false,
@@ -408,7 +448,7 @@
}
});
},
-
+
// 上传图片
uploadFile() {
const app = this
@@ -421,6 +461,17 @@
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() {
@@ -572,6 +623,10 @@
this.form.toward = e.value[0]
this.showToward = false
},
+ confirmPremium(e) {
+ this.form.premium = e.value[0]
+ this.showPremium = false
+ },
closeToward() {
this.showToward = false
},
@@ -824,7 +879,7 @@
font-size: 30rpx;
padding-top: 20rpx;
color: #333333;
- font-weight: 600;
+ // font-weight: 600;
.line {
background-color: #681752;
@@ -838,4 +893,8 @@
}
}
+
+ /deep/ .u-form-item__body {
+ padding: 0 !important;
+ }
\ No newline at end of file
diff --git a/sub_pages/house/detail.vue b/sub_pages/house/detail.vue
index 6e631b3..1b987e7 100644
--- a/sub_pages/house/detail.vue
+++ b/sub_pages/house/detail.vue
@@ -74,19 +74,19 @@
租金(元/m²):{{ form.rent || '' }}
-
+
房号:{{ form.roomNumber || '' }}
-
+
密码:{{ form.password || '' }}
- 业主电话:{{ form.phone || '' }}
- 物业费:{{ form.propertyFees || '' }}
- 租期:{{ form.tenancy || '' }}
-
+ 业主电话:{{ form.phone || '' }}
+ 物业费:{{ form.propertyFees || '' }}
+ 租期:{{ form.tenancy || '' }}
+
佣金:{{ form.commission || '' }}
-
+
是否可溢价:{{ form.premium || '' }}
@@ -152,9 +152,9 @@
-
+
- 已收藏
+ 已收藏
收藏
@@ -172,6 +172,10 @@
import store from '@/store'
import storage from '@/utils/storage'
import * as HouseInfoApi from '@/api/house-info.js'
+ import {
+ getAgentUser,
+ getUser
+ } from '@/api/user.js'
const menu = [{
name: '推荐',
@@ -302,7 +306,6 @@
padding: '12rpx 0',
borderRadius: '12rpx'
},
- heart: false,
swiperType: 'video',
latitude: 39.909,
longitude: 116.39742,
@@ -310,13 +313,26 @@
latitude: 39.909,
longitude: 116.39742,
iconPath: 'https://oss.wsdns.cn/20230803/49fe9c001370488caf29c3decb34f6c7.png?x-oss-process=image/resize,w_750/quality,Q_90'
- }]
+ }],
+ agentUser: {},
+ isManager: false
};
},
onLoad(options) {
this.houseId = options.houseId
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() {},
onBackPress() {},
@@ -349,15 +365,26 @@
})
},
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) {
- if (!phone) {
- return false
+ if (this.agentUser && this.agentUser.phone) {
+ uni.makePhoneCall({
+ phoneNumber: this.agentUser.phone
+ })
+ }else if(phone) {
+ uni.makePhoneCall({
+ phoneNumber: phone
+ })
}
- uni.makePhoneCall({
- phoneNumber: phone
- })
+
+
}
},
watch: {
diff --git a/sub_pages/house/house.vue b/sub_pages/house/house.vue
index 775ef1c..13203f6 100644
--- a/sub_pages/house/house.vue
+++ b/sub_pages/house/house.vue
@@ -38,7 +38,7 @@
-