房源信息模块
This commit is contained in:
@@ -15,14 +15,18 @@ export const getUserDetail = (userId) => http.get('/house/info/detail/' + userId
|
||||
// 新增房源信息
|
||||
export const addHouseInfo = (data) => http.post('/house/info', data)
|
||||
|
||||
// 编辑房源信息
|
||||
export const updateHouseInfo = (data) => http.put('/house/info', data)
|
||||
|
||||
// 删除房源信息
|
||||
export const removeHouseInfo = (id) => http.get('/house/info/remove/' + id)
|
||||
export const removeHouseInfo = (id) => http.delete('/house/info/' + id)
|
||||
|
||||
export default {
|
||||
pageHouseInfo,
|
||||
listHouseInfo,
|
||||
getHouseInfo,
|
||||
getUserDetail,
|
||||
updateHouseInfo,
|
||||
removeHouseInfo,
|
||||
addHouseInfo
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@ module.exports = {
|
||||
appSecret: '1f1d186d98ea4620ac65afbf34940051',
|
||||
|
||||
// 开发环境
|
||||
// apiUrl: "http://127.0.0.1:9090/api",
|
||||
apiUrl: "http://127.0.0.1:9090/api",
|
||||
// socketUrl: 'ws://localhost:9190',
|
||||
// fileUrl: 'https://file.wsdns.cn',
|
||||
|
||||
// 测试环境
|
||||
apiUrl: 'https://server.gxwebsoft.com/api',
|
||||
// apiUrl: 'https://server.gxwebsoft.com/api',
|
||||
socketUrl: 'wss://server.gxwebsoft.com',
|
||||
fileUrl: 'https://file.wsdns.cn',
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<!-- 搜索 -->
|
||||
<view class="search-fix">
|
||||
<view class="search">
|
||||
<u-search placeholder="请输入搜索关键词" v-model="keyword" :actionStyle="actionStyle" :showAction="false"
|
||||
shape="square" bgColor="#ffffff" :animation="true"></u-search>
|
||||
<u-search placeholder="请输入搜索关键词" v-model="where.keywords" :actionStyle="actionStyle" :showAction="false"
|
||||
shape="square" bgColor="#ffffff" :animation="true" @search="onSearch"></u-search>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-tools">
|
||||
@@ -13,15 +13,15 @@
|
||||
@change="onSearch"></uni-data-select>
|
||||
</view>
|
||||
<view class="region">
|
||||
<uni-data-select class="select-width" v-model="where.price" :localdata="price" placeholder="价格区间"
|
||||
<uni-data-select class="select-width" v-model="where.priceScene" :localdata="price" placeholder="价格区间"
|
||||
@change="onSearch"></uni-data-select>
|
||||
</view>
|
||||
<view class="region">
|
||||
<uni-data-select class="select-width" v-model="where.extent" :localdata="extent" placeholder="面积"
|
||||
<uni-data-select class="select-width" v-model="where.extentScene" :localdata="extent" placeholder="面积"
|
||||
@change="onSearch"></uni-data-select>
|
||||
</view>
|
||||
<view class="region">
|
||||
<uni-data-select class="select-width" v-model="where.sort" :localdata="sort" placeholder="排序"
|
||||
<uni-data-select class="select-width" v-model="where.sortScene" :localdata="sort" placeholder="排序"
|
||||
@change="onSearch"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
@@ -35,12 +35,10 @@
|
||||
<view class="info">
|
||||
<view class="title">{{ item.houseTitle }}</view>
|
||||
<view class="desc"><text>{{ item.extent }}m²|{{ item.toward }}</text></view>
|
||||
<view class="price">{{ item.rent }}元/月</view>
|
||||
<view class="price">{{ item.monthlyRent }}元/月</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" v-if="list.length == 0">
|
||||
</u-empty>
|
||||
|
||||
<!-- <view class="item">
|
||||
<image src="https://file.wsdns.cn/20230802/8bf0658596ab458d94666cbf4b1177e9.jpg" mode="widthFix">
|
||||
@@ -53,6 +51,8 @@
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" v-if="list.length == 0">
|
||||
</u-empty>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -61,6 +61,7 @@
|
||||
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 = [{
|
||||
@@ -72,42 +73,10 @@
|
||||
reset: false
|
||||
}
|
||||
];
|
||||
const region = [{
|
||||
value: 0,
|
||||
text: "青秀区"
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
text: "兴宁区"
|
||||
}
|
||||
];
|
||||
const price = [{
|
||||
value: 0,
|
||||
text: "3000"
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
text: "4000"
|
||||
}
|
||||
];
|
||||
const extent = [{
|
||||
value: 0,
|
||||
text: "200平"
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
text: "300平"
|
||||
}
|
||||
];
|
||||
const sort = [{
|
||||
value: 0,
|
||||
text: "升序"
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
text: "降序"
|
||||
}
|
||||
];
|
||||
const region = [];
|
||||
const price = [];
|
||||
const extent = [];
|
||||
const sort = [];
|
||||
const loginUserId = uni.getStorageSync('userId')
|
||||
|
||||
export default {
|
||||
@@ -118,6 +87,8 @@
|
||||
status: '加载更多',
|
||||
page: 1,
|
||||
where: {},
|
||||
dict: null,
|
||||
cityList: [],
|
||||
// 控制onShow事件是否刷新订单列表
|
||||
canReset: false,
|
||||
disabled: false,
|
||||
@@ -130,6 +101,7 @@
|
||||
price,
|
||||
extent,
|
||||
sort,
|
||||
// priceScene: null,
|
||||
scrollTop: 0,
|
||||
old: {
|
||||
scrollTop: 0
|
||||
@@ -144,6 +116,7 @@
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
this.getDict()
|
||||
this.list = []
|
||||
this.onRefreshList()
|
||||
},
|
||||
@@ -169,6 +142,11 @@
|
||||
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.pageHouseInfo(app.where)
|
||||
.then(result => {
|
||||
@@ -183,11 +161,89 @@
|
||||
} else {
|
||||
app.canReset = false
|
||||
}
|
||||
console.log("app.list: ",app.list);
|
||||
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.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: {
|
||||
|
||||
@@ -202,7 +258,7 @@
|
||||
display: flex;
|
||||
|
||||
.search {
|
||||
width: 690rpx;
|
||||
width: 710rpx;
|
||||
margin: 15rpx auto;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -211,14 +267,18 @@
|
||||
}
|
||||
|
||||
.search-tools {
|
||||
width: 700rpx;
|
||||
width: 720rpx;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
font-size: 22rpx;
|
||||
|
||||
.region {
|
||||
width: 170rpx;
|
||||
width: 178rpx;
|
||||
background-color: #ffffff;
|
||||
* {
|
||||
font-size: 22rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,17 +4,21 @@
|
||||
<u-sticky offset-top="5" zIndex="999">
|
||||
<view class="search-fix fixed" v-if="scrollTop < 30">
|
||||
<view class="search">
|
||||
<view class="region">青秀区</view>
|
||||
<u-notice-bar bgColor="#ffffff" direction="column" :text="hotKeywords" speed="250" @click="onNoticeBar"></u-notice-bar>
|
||||
<!-- <uni-data-select class="select-width" v-model="where.region" :localdata="region"
|
||||
placeholder="所在区域"></uni-data-select> -->
|
||||
<view class="input">
|
||||
<u-search placeholder="您想找哪里" bgColor="#ffffff" v-model="keyword" :animation="true"></u-search>
|
||||
<u-search placeholder="您想找哪里" bgColor="#ffffff" v-model="where.keywords" :showAction="false" :animation="true" @search="onSearch"></u-search>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-fix" v-else>
|
||||
<view class="search">
|
||||
<view class="region">青秀区</view>
|
||||
<u-notice-bar bgColor="#ffffff" direction="column" :text="hotKeywords" speed="250"></u-notice-bar>
|
||||
<!-- <uni-data-select class="select-width" v-model="where.region" :localdata="region"
|
||||
placeholder="所在区域"></uni-data-select> -->
|
||||
<view class="input">
|
||||
<u-search placeholder="您想找哪里" bgColor="#ffffff" v-model="keyword" :animation="true"></u-search>
|
||||
<u-search placeholder="您想找哪里" bgColor="#ffffff" v-model="where.keywords" :showAction="false" :animation="true" @search="onSearch"></u-search>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -25,7 +29,7 @@
|
||||
</view>
|
||||
<!-- 选项卡 -->
|
||||
<view class="tabs">
|
||||
<u-tabs :list="menu" @click="click"></u-tabs>
|
||||
<u-tabs :list="menu" @click="onClick"></u-tabs>
|
||||
</view>
|
||||
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
|
||||
@scrolltolower="lower" @scroll="onScroll">
|
||||
@@ -52,6 +56,7 @@
|
||||
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 = [{
|
||||
@@ -72,7 +77,10 @@
|
||||
loadMore: true,
|
||||
status: '加载更多',
|
||||
page: 1,
|
||||
where: {},
|
||||
where: {
|
||||
recommend: 1
|
||||
},
|
||||
region: [],
|
||||
// 控制onShow事件是否刷新订单列表
|
||||
canReset: false,
|
||||
disabled: false,
|
||||
@@ -80,6 +88,10 @@
|
||||
'https://file.wsdns.cn/20230802/f33f5ac239c843438b36f40941d946ef.png',
|
||||
'https://file.wsdns.cn/20230802/1116a02b07904991b2ebdc2c3da4a691.png',
|
||||
],
|
||||
hotKeywords: [
|
||||
'五象航洋城',
|
||||
'富雅国际金融中心'
|
||||
],
|
||||
menu,
|
||||
scrollTop: 0,
|
||||
old: {
|
||||
@@ -89,6 +101,7 @@
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
this.getDict()
|
||||
this.list = []
|
||||
this.onRefreshList()
|
||||
},
|
||||
@@ -110,6 +123,18 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getDict() {
|
||||
DictApi.getDictionaryOptions({
|
||||
dictCode: 'region'
|
||||
}).then(res => {
|
||||
this.region = res.data.map(d => {
|
||||
return {
|
||||
value: d.dictDataCode,
|
||||
text: d.dictDataName
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
onRefreshList() {
|
||||
const app = this
|
||||
const userId = uni.getStorageSync('userId')
|
||||
@@ -132,6 +157,28 @@
|
||||
})
|
||||
})
|
||||
},
|
||||
onClick(e){
|
||||
const index = e.index
|
||||
this.where = {}
|
||||
if(index == 0){
|
||||
this.where.recommend = 1
|
||||
}
|
||||
if(index == 1){
|
||||
this.where.mustSee = 1
|
||||
}
|
||||
this.onSearch()
|
||||
},
|
||||
onNoticeBar(index){
|
||||
// console.log('this.hotKeywords[index]: ',this.hotKeywords[index]);
|
||||
this.where.keywords = this.hotKeywords[index]
|
||||
this.onSearch()
|
||||
},
|
||||
onSearch() {
|
||||
this.list = []
|
||||
this.page = 1
|
||||
this.onRefreshList()
|
||||
// this.$push('/sub_pages/member/member', this.where)
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -141,7 +188,7 @@
|
||||
<style lang="scss" scoped>
|
||||
.page {
|
||||
.search-fix {
|
||||
width: 500rpx;
|
||||
width: 600rpx;
|
||||
margin: auto;
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
@@ -149,7 +196,7 @@
|
||||
box-shadow: 0 3rpx 10rpx 0px #cccccc;
|
||||
|
||||
.search {
|
||||
width: 400rpx;
|
||||
width: 580rpx;
|
||||
margin: 15rpx auto;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -160,19 +207,22 @@
|
||||
color: #666666;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.input{
|
||||
width: 250rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fixed {
|
||||
position: fixed;
|
||||
top: 300rpx;
|
||||
left: 125rpx;
|
||||
left: 75rpx;
|
||||
}
|
||||
|
||||
.no-fixed {
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
left: 125rpx;
|
||||
left: 75rpx;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
@@ -228,4 +278,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.select-width{
|
||||
width: 200rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -120,17 +120,17 @@
|
||||
<view class="my-service">
|
||||
<u-cell-group v-if="userInfo.gradeId == 15" :border="false">
|
||||
<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="访客记录" @click="showMyMatchmaker"></u-cell>
|
||||
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x.png" isLink title="浏览历史" @click="showMyMatchmaker"></u-cell>
|
||||
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26y%20%281%29.png" isLink title="我的收藏" @click="showMyMatchmaker"></u-cell>
|
||||
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x%20%281%29.png" isLink title="关于我们" @click="showMyMatchmaker"></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_rwv26y%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-group>
|
||||
<u-cell-group v-else :border="false">
|
||||
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x.png" isLink title="浏览历史" @click="showMyMatchmaker"></u-cell>
|
||||
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26y%20%281%29.png" isLink title="收藏房源" @click="showMyMatchmaker"></u-cell>
|
||||
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x%20%281%29.png" isLink title="关于我们" @click="showMyMatchmaker"></u-cell>
|
||||
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26w.png" isLink title="预约看房记录" @click="showMyMatchmaker"></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_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_rwv26x%20%282%29.png" isLink title="联系专属经纪人" :border="false" @click="showMyMatchmaker"></u-cell>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
@@ -445,6 +445,8 @@
|
||||
app.form = res.data
|
||||
app.userInfo = res.data
|
||||
store.dispatch('setUserInfo', res.data)
|
||||
// uni.setStorageSync('gradeId',res.data.gradeId)
|
||||
// uni.setStorageSync('gradeName',res.data.gradeName)
|
||||
app.isLogin = true
|
||||
|
||||
|
||||
|
||||
@@ -161,11 +161,10 @@
|
||||
HouseReservationApi.addHouseReservation(app.form).then(result => {
|
||||
app.$toast(result.message)
|
||||
}).catch(err => {
|
||||
uni.$u.toast(err)
|
||||
uni.$u.toast(err.message)
|
||||
})
|
||||
}).catch(errors => {
|
||||
console.log("errors: ",errors);
|
||||
uni.$u.toast('校验失败')
|
||||
// uni.$u.toast('校验失败')
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
import * as UserProfileApi from '@/api/love-user-profile.js'
|
||||
import * as UploadApi from '@/api/upload'
|
||||
import * as UserFeedbackApi from '@/api/user-feedback.js'
|
||||
import dict, * as DictApi from '@/api/dict.js'
|
||||
import * as DictApi from '@/api/dict.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</u-form-item>
|
||||
<u-form-item prop="area">
|
||||
<u-cell title="城市" @click="onArea" :isLink="true">
|
||||
<u-input slot="value" class="input" v-model="form.area" inputAlign="right" maxlength="30"
|
||||
<u-input slot="value" class="input" v-model="form.city" inputAlign="right" maxlength="30"
|
||||
:border="false" placeholder="请选择所在城市" />
|
||||
</u-cell>
|
||||
</u-form-item>
|
||||
@@ -129,7 +129,7 @@
|
||||
<view class="form-wrapper">
|
||||
<view class="images">
|
||||
<u-upload :fileList="fileList1" :maxSize="3145728" :width="72" :height="72"
|
||||
@afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="6"></u-upload>
|
||||
@afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="9"></u-upload>
|
||||
</view>
|
||||
</view>
|
||||
</u-form-item>
|
||||
@@ -180,7 +180,7 @@
|
||||
<!-- 操作按钮 -->
|
||||
<view class="footer">
|
||||
<view class="btn-wrapper">
|
||||
<u-button text="发布" color="linear-gradient(to bottom, #27b0fd, #3f72f4)" :disabled="disabled"
|
||||
<u-button text="保存" color="linear-gradient(to bottom, #27b0fd, #3f72f4)" :disabled="disabled"
|
||||
shape="circle" @click="handleSubmit()"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -196,7 +196,7 @@
|
||||
dateFormat
|
||||
} from '@/utils/util.js'
|
||||
import * as UserApi from '@/api/user'
|
||||
import * as HouseInfoApi from '@/api/house-info.js'
|
||||
import { updateHouseInfo,getHouseInfo } from '@/api/house-info.js'
|
||||
import * as UploadApi from '@/api/upload'
|
||||
import * as DictApi from '@/api/dict.js'
|
||||
|
||||
@@ -212,6 +212,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectId : 0,
|
||||
tabs,
|
||||
tabIndex: 10,
|
||||
dict: null,
|
||||
@@ -270,7 +271,14 @@
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad() {
|
||||
onLoad(options) {
|
||||
if(options.id > 0){
|
||||
uni.setNavigationBarTitle({
|
||||
title: '编辑房源'
|
||||
})
|
||||
this.selectId = options.id
|
||||
this.getHouse(options.id)
|
||||
}
|
||||
this.getDict()
|
||||
},
|
||||
|
||||
@@ -287,6 +295,16 @@
|
||||
this.dict = res.data;
|
||||
})
|
||||
},
|
||||
getHouse(id){
|
||||
const app = this
|
||||
console.log('id: ',id);
|
||||
getHouseInfo(id).then(res => {
|
||||
console.log('res: ',res);
|
||||
app.form = res.data
|
||||
app.houseLabel = JSON.parse(app.form.houseLabel) || []
|
||||
app.fileList1 = JSON.parse(app.form.files) || []
|
||||
})
|
||||
},
|
||||
onChangeTab(e) {
|
||||
const app = this
|
||||
app.tabIndex = e.value
|
||||
@@ -393,8 +411,9 @@
|
||||
this.$refs.uForm.validate().then(() => {
|
||||
app.form.houseLabel = JSON.stringify(app.houseLabel)
|
||||
app.form.files = JSON.stringify(app.fileList1)
|
||||
HouseInfoApi.addHouseInfo(app.form).then(result => {
|
||||
app.$toast(result.message)
|
||||
const saveOrUpdate = app.selectId > 0 ? updateHouseInfo : addHouseInfo;
|
||||
saveOrUpdate(app.form).then(result => {
|
||||
app.$toast('保存成功')
|
||||
}).catch(err => {
|
||||
uni.$u.toast(err)
|
||||
})
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
|
||||
<!-- 幻灯片 -->
|
||||
<view class="swiper">
|
||||
<u-swiper :list="form.files" :height="250" :radius="0" @change="e => currentNum = e.current"
|
||||
<u-swiper :list="swiperList" :height="250" :radius="0" @change="e => currentNum = e.current"
|
||||
indicatorStyle="right: 20px; bottom: 50px" @click="click">
|
||||
<view slot="indicator" class="indicator-num">
|
||||
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ swiperList.length + 1 }}</text>
|
||||
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ swiperList.length }}</text>
|
||||
</view>
|
||||
</u-swiper>
|
||||
|
||||
<!-- 房源参数 -->
|
||||
<view class="house-info">
|
||||
<view class="title">
|
||||
{{ form.houseTitle }}
|
||||
{{ form.houseTitle || '' }}
|
||||
<!-- 五象航洋城三室一厅采光好新房精装修三房一厅 采光好,乘诚意出售 -->
|
||||
</view>
|
||||
<view class="label">
|
||||
@@ -23,19 +23,19 @@
|
||||
</view>
|
||||
<view class="dict">
|
||||
<view class="dict-item">
|
||||
<text class="title">{{ form.monthlyRent }}元/月</text>
|
||||
<text class="title">{{ form.monthlyRent || 0 }}元/月</text>
|
||||
<text class="desc">月租</text>
|
||||
</view>
|
||||
<view class="dict-item">
|
||||
<text class="title">{{ form.extent }}m²</text>
|
||||
<text class="title">{{ form.extent || 0 }}m²</text>
|
||||
<text class="desc">建筑面积</text>
|
||||
</view>
|
||||
<view class="dict-item">
|
||||
<text class="title">{{ form.houseType }}</text>
|
||||
<text class="title">{{ form.houseType || '' }}</text>
|
||||
<text class="desc">户型</text>
|
||||
</view>
|
||||
<view class="dict-item">
|
||||
<text class="title">{{ form.floor }}</text>
|
||||
<text class="title">{{ form.floor || '' }}</text>
|
||||
<text class="desc">楼层</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -50,24 +50,32 @@
|
||||
</view>
|
||||
<view class="field-list">
|
||||
<view class="item col-2">
|
||||
城市:{{ form.city }}
|
||||
城市:{{ form.city || '' }}
|
||||
</view>
|
||||
<view class="item col-2">
|
||||
区/县:{{ form.region }}
|
||||
区/县:{{ form.region || '' }}
|
||||
</view>
|
||||
<view class="item col-1">
|
||||
详细地址:{{ form.address }}
|
||||
详细地址:{{ form.address || '' }}
|
||||
</view>
|
||||
<view class="item col-2">
|
||||
租金(元/m²):{{ form.rent }}
|
||||
租金(元/m²):{{ form.rent || '' }}
|
||||
</view>
|
||||
<view class="item col-2">
|
||||
房号:{{ form.roomNumber }}
|
||||
房号:{{ form.roomNumber || '' }}
|
||||
</view>
|
||||
<view class="item col-2">
|
||||
密码:{{ form.password }}
|
||||
密码:{{ form.password || '' }}
|
||||
</view>
|
||||
<view class="item col-2">业主电话:{{ form.phone || '' }}</view>
|
||||
<view class="item col-2">物业费:{{ form.propertyFees || '' }}</view>
|
||||
<view class="item col-2">租期:{{ form.tenancy || '' }}</view>
|
||||
<view class="item col-2" v-if="form.gradeName == '公司员工'">
|
||||
佣金:{{ form.commission || '' }}
|
||||
</view>
|
||||
<view class="item col-2" v-if="form.gradeName == '公司员工'">
|
||||
是否可溢价:{{ form.premium || '' }}
|
||||
</view>
|
||||
<view class="item col-2">业主电话:{{ form.phone }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -115,9 +123,7 @@
|
||||
<u-gap></u-gap>
|
||||
<view class="user-card">
|
||||
<u-cell :title="`${form.nickname}`" :label="`发布房源10套`" :border="false">
|
||||
<u-avatar slot="icon" size="50"
|
||||
:src="form.avatar"
|
||||
customStyle="margin: -3px 5px -3px 0"></u-avatar>
|
||||
<u-avatar slot="icon" size="50" :src="form.avatar" customStyle="margin: -3px 5px -3px 0"></u-avatar>
|
||||
<!-- <view solt="label">
|
||||
<text class="desc-text">{{ `ID:${item.userId}` }}</text>
|
||||
<text class="desc-text">{{ `粉丝:${item.id}` }}</text>
|
||||
@@ -141,7 +147,7 @@
|
||||
<view class="item" @click="$push('sub_pages/checkout/checkout?id=' + form.houseId)">
|
||||
<u-button icon="map" type="error" text="预约看房"></u-button>
|
||||
</view>
|
||||
<view class="item" @click="onCall">
|
||||
<view class="item" @click="onCall(form.phone)">
|
||||
<u-button icon="phone" type="primary" text="电话咨询"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -265,10 +271,7 @@
|
||||
form: {
|
||||
|
||||
},
|
||||
swiperList: [
|
||||
'https://file.wsdns.cn/20230802/f33f5ac239c843438b36f40941d946ef.png',
|
||||
'https://file.wsdns.cn/20230802/1116a02b07904991b2ebdc2c3da4a691.png',
|
||||
],
|
||||
swiperList: [],
|
||||
menu,
|
||||
region,
|
||||
price,
|
||||
@@ -318,6 +321,7 @@
|
||||
HouseInfoApi.getHouseInfo(houseId).then(res => {
|
||||
app.form = res.data
|
||||
app.form.files = JSON.parse(res.data.files) || []
|
||||
app.swiperList = app.form.files
|
||||
app.form.houseLabel = JSON.parse(res.data.houseLabel) || []
|
||||
// app.form.supporting = JSON.parse(res.data.supporting) || []
|
||||
}).catch(err => {
|
||||
@@ -327,9 +331,12 @@
|
||||
onHeart() {
|
||||
this.heart = !this.heart
|
||||
},
|
||||
onCall() {
|
||||
onCall(phone) {
|
||||
if (!phone) {
|
||||
return false
|
||||
}
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: '15878179339'
|
||||
phoneNumber: phone
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -7,20 +7,25 @@
|
||||
:actionStyle="actionStyle"></u-search>
|
||||
</view>
|
||||
</u-sticky>
|
||||
|
||||
{{ select }}
|
||||
<view class="order-total">
|
||||
<view class="pay-btn">
|
||||
<view class="btn">
|
||||
<u-button text="上架" plain size="small" @click="onPay(item.logId)"></u-button>
|
||||
<u-button text="上架" plain size="small" @click="onStatus(0)"></u-button>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<u-button text="下架" plain size="small" @click="onPay(item.logId)"></u-button>
|
||||
<u-button text="下架" plain size="small" @click="onStatus(1)"></u-button>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<u-button text="删除" plain size="small" @click="onPay(item.logId)"></u-button>
|
||||
<u-button text="删除" plain size="small" @click="onDel()"></u-button>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<u-button text="编辑" plain size="small" @click="onEdit()"></u-button>
|
||||
</view>
|
||||
<!-- <view class="btn">
|
||||
<u-button text="分享" plain size="small" @click="onPay(item.logId)"></u-button>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="btn" v-if="item.payStatus == 10">
|
||||
<u-button text="取消订单" size="small" @click="onRemove(item.logId)"></u-button>
|
||||
</view> -->
|
||||
@@ -33,39 +38,19 @@
|
||||
</u-radio-group>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item" @click="$push('sub_pages/house/detail?id=')">
|
||||
<view class="badge" @click="onBadge(1)"><u-badge :isDot="true" type="info" :bgColor="bgColor"></u-badge></view>
|
||||
<image class="image" src="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwr9ba.jpg"></image>
|
||||
<block v-for="(item,index) in list" :key="index">
|
||||
<view class="item" @click="$push('sub_pages/house/add?id=' + item.houseId)">
|
||||
<view class="badge" @click.stop="onBadge(item.houseId)"><u-badge :isDot="true" type="info" :bgColor="item.houseId == selectId ? bgColor : ''"></u-badge></view>
|
||||
<image class="image" :src="item.files[0].url" mode="widthFix"></image>
|
||||
<view class="info">
|
||||
<view class="title">整租·万科云城 2室1厅1卫</view>
|
||||
<view class="desc"><text>50.8m²|南</text></view>
|
||||
<view class="price">6600元/月</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" @click="$push('sub_pages/house/detail?id=')">
|
||||
<image class="image" src="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwr9ba.jpg"></image>
|
||||
<view class="info">
|
||||
<view class="title">整租·万科云城 2室1厅1卫</view>
|
||||
<view class="desc"><text>50.8m²|南</text></view>
|
||||
<view class="price">6600元/月</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" @click="$push('sub_pages/house/detail?id=')">
|
||||
<image class="image" src="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwr9ba.jpg"></image>
|
||||
<view class="info">
|
||||
<view class="title">整租·万科云城 2室1厅1卫</view>
|
||||
<view class="desc"><text>50.8m²|南</text></view>
|
||||
<view class="price">6600元/月</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" @click="$push('sub_pages/house/detail?id=')">
|
||||
<image class="image" src="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwr9ba.jpg"></image>
|
||||
<view class="info">
|
||||
<view class="title">整租·万科云城 2室1厅1卫</view>
|
||||
<view class="desc"><text>50.8m²|南</text></view>
|
||||
<view class="price">6600元/月</view>
|
||||
<view class="title">{{ item.houseTitle }}</view>
|
||||
<view class="desc"><text>{{ item.extent }}m²|{{ item.toward }}</text></view>
|
||||
<view class="price">{{ item.rent }}元/月</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<u-empty mode="data" icon="https://file.wsdns.cn/empty/data.png" v-if="list.length == 0">
|
||||
</u-empty>
|
||||
</view>
|
||||
</view>
|
||||
<u-gap></u-gap>
|
||||
@@ -89,12 +74,19 @@
|
||||
import * as UserProfileApi from '@/api/love-user-profile.js'
|
||||
import * as UploadApi from '@/api/upload'
|
||||
import * as DictApi from '@/api/dict.js'
|
||||
import * as HouseInfoApi from '@/api/house-info.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
loadMore: true,
|
||||
status: '加载更多',
|
||||
page: 1,
|
||||
where: {},
|
||||
select: [],
|
||||
bgColor: '#ffffff'
|
||||
bgColor: '#ffffff',
|
||||
selectId: 0
|
||||
}
|
||||
},
|
||||
|
||||
@@ -102,6 +94,8 @@
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad() {
|
||||
this.list = []
|
||||
this.onRefreshList()
|
||||
// this.getDict()
|
||||
},
|
||||
|
||||
@@ -112,13 +106,74 @@
|
||||
// this.$refs.datetimePicker.setFormatter(this.formatter)
|
||||
},
|
||||
|
||||
// 触底函数
|
||||
onReachBottom() {
|
||||
console.log("触底函数: ");
|
||||
const app = this
|
||||
if (app.loadMore) {
|
||||
app.page = ++app.page;
|
||||
app.onRefreshList()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onRefreshList() {
|
||||
const app = this
|
||||
const userId = uni.getStorageSync('userId')
|
||||
app.where.page = app.page
|
||||
app.where.userId = userId
|
||||
return new Promise((resolve, reject) => {
|
||||
HouseInfoApi.pageHouseInfo(app.where)
|
||||
.then(result => {
|
||||
const list = result.data.list.map(d => {
|
||||
d.files = JSON.parse(d.files) || []
|
||||
return d
|
||||
})
|
||||
// 合并新数据
|
||||
app.list = app.list.concat(list)
|
||||
if (result.data.count > app.list.length) {
|
||||
app.canReset = true
|
||||
} else {
|
||||
app.canReset = false
|
||||
}
|
||||
console.log("app.list: ",app.list);
|
||||
resolve(list)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onEdit(){
|
||||
const { selectId } = this
|
||||
if(selectId > 0){
|
||||
this.$push('sub_pages/house/add?id=' + selectId)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onDel(){
|
||||
const app = this
|
||||
const { selectId } = this
|
||||
if(selectId > 0){
|
||||
HouseInfoApi.removeHouseInfo(selectId).then(res => {
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
onStatus(status){
|
||||
console.log('this.select: ',this.select);
|
||||
},
|
||||
|
||||
onSearch() {
|
||||
this.$push('/sub_pages/member/member', this.where)
|
||||
console.log('this.where: ',this.where);
|
||||
this.list = []
|
||||
this.page = 1
|
||||
this.onRefreshList()
|
||||
// this.$push('/sub_pages/member/member', this.where)
|
||||
},
|
||||
onBadge(id){
|
||||
this.selectId = id
|
||||
this.bgColor = '#ff0000'
|
||||
this.select.push(id)
|
||||
console.log('this.select: ',this.select);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -131,8 +186,6 @@
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.container {}
|
||||
|
||||
|
||||
.search-wrapper {
|
||||
display: flex;
|
||||
height: 64rpx;
|
||||
|
||||
@@ -348,7 +348,7 @@
|
||||
|
||||
.uni-select {
|
||||
font-size: 14px;
|
||||
border: 1px solid $uni-border-3;
|
||||
// border: 1px solid $uni-border-3;
|
||||
box-sizing: border-box;
|
||||
border-radius: 4px;
|
||||
padding: 0 5px;
|
||||
@@ -360,7 +360,7 @@
|
||||
/* #endif */
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
border-bottom: solid 1px $uni-border-3;
|
||||
// border-bottom: solid 1px $uni-border-3;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
height: 35px;
|
||||
|
||||
Reference in New Issue
Block a user