修复bug
This commit is contained in:
@@ -13,12 +13,12 @@
|
|||||||
@change="onSearch"></uni-data-select>
|
@change="onSearch"></uni-data-select>
|
||||||
</view>
|
</view>
|
||||||
<view class="region">
|
<view class="region">
|
||||||
<u--input class="where-input" v-model="where.priceScene" type="number" @confirm="onSearch" placeholder="价格区间" clearable border="none" :customStyle="{height: '35px'}"/>
|
<u--input class="where-input" v-model="where.priceScene" type="text" @confirm="onSearch" placeholder="价格区间" clearable border="none" :customStyle="{height: '35px'}"/>
|
||||||
<!-- <uni-data-select class="select-width" v-model="where.priceScene" :localdata="price" placeholder="价格区间"
|
<!-- <uni-data-select class="select-width" v-model="where.priceScene" :localdata="price" placeholder="价格区间"
|
||||||
@change="onSearch"></uni-data-select> -->
|
@change="onSearch"></uni-data-select> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="region">
|
<view class="region">
|
||||||
<u--input class="where-input" v-model="where.extentScene" type="number" @confirm="onSearch" placeholder="面积m²" clearable border="none" :customStyle="{height: '35px'}"/>
|
<u--input class="where-input" v-model="where.extentScene" type="text" @confirm="onSearch" placeholder="面积m²" clearable border="none" :customStyle="{height: '35px'}"/>
|
||||||
<!-- <uni-data-select class="select-width" v-model="where.extentScene" :localdata="extent" placeholder="面积"
|
<!-- <uni-data-select class="select-width" v-model="where.extentScene" :localdata="extent" placeholder="面积"
|
||||||
@change="onSearch"></uni-data-select> -->
|
@change="onSearch"></uni-data-select> -->
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<u-sticky offset-top="5" zIndex="999">
|
<u-sticky :offset-top="stickyTop" zIndex="999">
|
||||||
<view class="search-fix fixed" v-if="scrollTop < 30">
|
<view class="search-fix fixed" v-if="scrollTop < 30">
|
||||||
<view class="search">
|
<view class="search">
|
||||||
<u-notice-bar bgColor="#ffffff" direction="column" :text="hotKeywords" speed="250" @click="onNoticeBar"></u-notice-bar>
|
<u-notice-bar bgColor="#ffffff" direction="column" :text="hotKeywords" speed="250" @click="onNoticeBar"></u-notice-bar>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
</u-sticky>
|
</u-sticky>
|
||||||
<!-- 幻灯片 -->
|
<!-- 幻灯片 -->
|
||||||
<view class="swiper">
|
<view class="swiper">
|
||||||
<u-swiper :list="swiperList" :height="180" :radius="0" @change="change" @click="click"></u-swiper>
|
<u-swiper :list="swiperList" :height="180" :radius="0" @click="click"></u-swiper>
|
||||||
</view>
|
</view>
|
||||||
<!-- 选项卡 -->
|
<!-- 选项卡 -->
|
||||||
<view class="tabs">
|
<view class="tabs">
|
||||||
@@ -144,7 +144,8 @@
|
|||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
old: {
|
old: {
|
||||||
scrollTop: 0
|
scrollTop: 0
|
||||||
}
|
},
|
||||||
|
stickyTop: 60
|
||||||
};
|
};
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -155,6 +156,12 @@
|
|||||||
uni.$u.mpShare = {
|
uni.$u.mpShare = {
|
||||||
title: '爱尚家找房'
|
title: '爱尚家找房'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
this.stickyTop = res.statusBarHeight + 44 + 20
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onShow() {},
|
onShow() {},
|
||||||
onBackPress() {},
|
onBackPress() {},
|
||||||
|
|||||||
@@ -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">
|
||||||
@@ -17,8 +17,9 @@
|
|||||||
</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 :disabled="true" disabledColor="#FFFFFF" slot="value" class="input" v-model="form.city" inputAlign="right" maxlength="30"
|
<u-input :disabled="true" disabledColor="#FFFFFF" slot="value" class="input"
|
||||||
:border="false" placeholder="请选择所在城市" />
|
v-model="form.city" inputAlign="right" maxlength="30" :border="false"
|
||||||
|
placeholder="请选择所在城市" />
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<!-- <u-form-item prop="address">
|
<!-- <u-form-item prop="address">
|
||||||
@@ -31,17 +32,18 @@
|
|||||||
<view class="his-head">
|
<view class="his-head">
|
||||||
<text class="title">详细地址</text>
|
<text class="title">详细地址</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="form-wrapper" @click="openMap">
|
<view class="form-wrapper" @click="openMap">
|
||||||
<view class="textarea">
|
<view class="textarea">
|
||||||
<u--textarea v-model="form.address" placeholder="请输入详细地址"
|
<u--textarea v-model="form.address" placeholder="请输入详细地址" maxlength="200"
|
||||||
maxlength="200" :disabled="true" disabledColor="#FFFFFF"></u--textarea>
|
:disabled="true" disabledColor="#FFFFFF"></u--textarea>
|
||||||
</view>
|
</view>
|
||||||
</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="请选择房子户型" :disabled="true" disabledColor="#FFFFFF" />
|
maxlength="30" :border="false" placeholder="请选择房子户型" :disabled="true"
|
||||||
|
disabledColor="#FFFFFF" />
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item prop="extent">
|
<u-form-item prop="extent">
|
||||||
@@ -53,25 +55,26 @@
|
|||||||
<u-form-item prop="leaseMethod">
|
<u-form-item prop="leaseMethod">
|
||||||
<u-cell title="租赁方式" :isLink="true" @click="showLeaseMethod = true">
|
<u-cell title="租赁方式" :isLink="true" @click="showLeaseMethod = true">
|
||||||
<u-input slot="value" class="input" v-model="form.leaseMethod" inputAlign="right"
|
<u-input slot="value" class="input" v-model="form.leaseMethod" inputAlign="right"
|
||||||
maxlength="30" :border="false" placeholder="请选择租赁方式" :disabled="true" disabledColor="#FFFFFF"/>
|
maxlength="30" :border="false" placeholder="请选择租赁方式" :disabled="true"
|
||||||
|
disabledColor="#FFFFFF" />
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item prop="rent">
|
<u-form-item prop="rent">
|
||||||
<u-cell title="租金(元/m²)" :isLink="false">
|
<u-cell title="租金(元/m²)" :isLink="false">
|
||||||
<u-input type="digit" slot="value" class="input" v-model="form.rent" inputAlign="right" maxlength="30"
|
<u-input type="digit" slot="value" class="input" v-model="form.rent" inputAlign="right"
|
||||||
:border="false" placeholder="请输入租金" />
|
maxlength="30" :border="false" placeholder="请输入租金" />
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item prop="monthlyRent">
|
<u-form-item prop="monthlyRent">
|
||||||
<u-cell title="月租金(每月)" :isLink="false">
|
<u-cell title="月租金(每月)" :isLink="false">
|
||||||
<u-input type="digit" slot="value" class="input" :value="monthlyRent" inputAlign="right" disabled-color="#FFFFFF"
|
<u-input type="digit" slot="value" class="input" :value="monthlyRent" inputAlign="right"
|
||||||
maxlength="30" :border="false" placeholder="请输入月租金" disabled />
|
disabled-color="#FFFFFF" maxlength="30" :border="false" placeholder="请输入月租金" disabled />
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item prop="propertyFees">
|
<u-form-item prop="propertyFees">
|
||||||
<u-cell title="物业费" :isLink="false">
|
<u-cell title="物业费" :isLink="false">
|
||||||
<u-input type="digit" slot="value" class="input" v-model="form.propertyFees" inputAlign="right"
|
<u-input type="digit" slot="value" class="input" v-model="form.propertyFees"
|
||||||
maxlength="30" :border="false" placeholder="请输入物业费" />
|
inputAlign="right" maxlength="30" :border="false" placeholder="请输入物业费" />
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item prop="tenancy">
|
<u-form-item prop="tenancy">
|
||||||
@@ -82,8 +85,8 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item prop="commission">
|
<u-form-item prop="commission">
|
||||||
<u-cell title="佣金" :isLink="false">
|
<u-cell title="佣金" :isLink="false">
|
||||||
<u-input type="digit" slot="value" class="input" v-model="form.commission" inputAlign="right" maxlength="30"
|
<u-input type="digit" slot="value" class="input" v-model="form.commission"
|
||||||
:border="false" placeholder="请输入佣金" />
|
inputAlign="right" maxlength="30" :border="false" placeholder="请输入佣金" />
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item prop="premium">
|
<u-form-item prop="premium">
|
||||||
@@ -95,7 +98,7 @@
|
|||||||
<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="请选择楼层" :disabled="true" disabledColor="#FFFFFF"/>
|
: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">
|
||||||
@@ -119,7 +122,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="请选择房源朝向" :disabled="true" disabledColor="#FFFFFF"/>
|
:border="false" placeholder="请选择房源朝向" :disabled="true" disabledColor="#FFFFFF" />
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
@@ -152,7 +155,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="images">
|
<u-form-item prop="images">
|
||||||
<view class="his-head">
|
<view class="his-head">
|
||||||
<text class="title">房源照片</text>
|
<text class="title">房源照片</text>
|
||||||
@@ -198,7 +201,7 @@
|
|||||||
@close="closeBirthday" @confirm="confirmBirthday" :minDate="0" :maxDate="1112102400000"
|
@close="closeBirthday" @confirm="confirmBirthday" :minDate="0" :maxDate="1112102400000"
|
||||||
@cancel="closeBirthday" :closeOnClickOverlay="true">
|
@cancel="closeBirthday" :closeOnClickOverlay="true">
|
||||||
</u-datetime-picker>
|
</u-datetime-picker>
|
||||||
|
|
||||||
<u-picker :show="showHouseType" :columns="dict.houseType" @confirm="confirmHouseType"
|
<u-picker :show="showHouseType" :columns="dict.houseType" @confirm="confirmHouseType"
|
||||||
@cancel="closeHouseType" :closeOnClickOverlay="true" @close="closeHouseType">
|
@cancel="closeHouseType" :closeOnClickOverlay="true" @close="closeHouseType">
|
||||||
</u-picker>
|
</u-picker>
|
||||||
@@ -211,8 +214,8 @@
|
|||||||
<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"
|
<u-picker :show="showPremium" :columns="[['是','否']]" @confirm="confirmPremium"
|
||||||
:closeOnClickOverlay="true" @close="showPremium = false">
|
@cancel="showPremium = false" :closeOnClickOverlay="true" @close="showPremium = false">
|
||||||
</u-picker>
|
</u-picker>
|
||||||
|
|
||||||
|
|
||||||
@@ -242,7 +245,11 @@
|
|||||||
dateFormat
|
dateFormat
|
||||||
} from '@/utils/util.js'
|
} from '@/utils/util.js'
|
||||||
import * as UserApi from '@/api/user'
|
import * as UserApi from '@/api/user'
|
||||||
import { updateHouseInfo,getHouseInfo,addHouseInfo } from '@/api/house-info.js'
|
import {
|
||||||
|
updateHouseInfo,
|
||||||
|
getHouseInfo,
|
||||||
|
addHouseInfo
|
||||||
|
} from '@/api/house-info.js'
|
||||||
import * as UploadApi from '@/api/upload'
|
import * as UploadApi from '@/api/upload'
|
||||||
import * as DictApi from '@/api/dict.js'
|
import * as DictApi from '@/api/dict.js'
|
||||||
|
|
||||||
@@ -258,7 +265,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectId : 0,
|
selectId: 0,
|
||||||
tabs,
|
tabs,
|
||||||
tabIndex: 10,
|
tabIndex: 10,
|
||||||
dict: null,
|
dict: null,
|
||||||
@@ -319,12 +326,15 @@
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
monthlyRent() {
|
monthlyRent() {
|
||||||
const {extent, rent} = this.form
|
const {
|
||||||
if(extent && rent) {
|
extent,
|
||||||
return (extent * rent).toFixed(2)
|
rent
|
||||||
}else {
|
} = this.form
|
||||||
return 0
|
let monthlyRent = 0
|
||||||
}
|
if (extent && rent) {
|
||||||
|
monthlyRent = (extent * rent).toFixed(2)
|
||||||
|
}
|
||||||
|
return monthlyRent;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -332,7 +342,7 @@
|
|||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
if(options.id > 0){
|
if (options.id > 0) {
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: '编辑房源'
|
title: '编辑房源'
|
||||||
})
|
})
|
||||||
@@ -359,18 +369,18 @@
|
|||||||
DictApi.listDictionary().then(res => {
|
DictApi.listDictionary().then(res => {
|
||||||
this.dict = res.data;
|
this.dict = res.data;
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
getHouse(id){
|
getHouse(id) {
|
||||||
const app = this
|
const app = this
|
||||||
console.log('id: ',id);
|
console.log('id: ', id);
|
||||||
getHouseInfo(id).then(res => {
|
getHouseInfo(id).then(res => {
|
||||||
console.log('res: ',res);
|
console.log('res: ', res);
|
||||||
app.form = res.data
|
app.form = res.data
|
||||||
app.houseLabel = JSON.parse(app.form.houseLabel) || []
|
app.houseLabel = JSON.parse(app.form.houseLabel) || []
|
||||||
app.fileList1 = JSON.parse(app.form.files) || []
|
app.fileList1 = JSON.parse(app.form.files) || []
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onChangeTab(e) {
|
onChangeTab(e) {
|
||||||
@@ -457,7 +467,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 上传图片
|
// 上传图片
|
||||||
uploadFile() {
|
uploadFile() {
|
||||||
const app = this
|
const app = this
|
||||||
@@ -491,18 +501,19 @@
|
|||||||
app.disabled = true
|
app.disabled = true
|
||||||
app.form.houseLabel = JSON.stringify(app.houseLabel)
|
app.form.houseLabel = JSON.stringify(app.houseLabel)
|
||||||
app.form.files = JSON.stringify(app.fileList1)
|
app.form.files = JSON.stringify(app.fileList1)
|
||||||
app.form.videoUrl = app.fileList2[0]?app.fileList2[0].url: null
|
app.form.videoUrl = app.fileList2[0] ? app.fileList2[0].url : null
|
||||||
|
app.form.monthlyRent = app.monthlyRent
|
||||||
const saveOrUpdate = app.selectId > 0 ? updateHouseInfo : addHouseInfo;
|
const saveOrUpdate = app.selectId > 0 ? updateHouseInfo : addHouseInfo;
|
||||||
saveOrUpdate(app.form).then(result => {
|
saveOrUpdate(app.form).then(result => {
|
||||||
app.$toast('保存成功')
|
app.$toast('保存成功')
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
},1000)
|
}, 1000)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.$u.toast(err)
|
uni.$u.toast(err)
|
||||||
})
|
})
|
||||||
}).catch(errors => {
|
}).catch(errors => {
|
||||||
console.log('errors: ',errors);
|
console.log('errors: ', errors);
|
||||||
uni.$u.toast('校验失败')
|
uni.$u.toast('校验失败')
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -605,7 +616,7 @@
|
|||||||
this.form.city = data[1].label
|
this.form.city = data[1].label
|
||||||
this.form.region = data[2].label
|
this.form.region = data[2].label
|
||||||
this.form.area = `${data[0].label} ${data[1].label} ${data[2].label}`
|
this.form.area = `${data[0].label} ${data[1].label} ${data[2].label}`
|
||||||
console.log("this.form.area: ",this.form.area);
|
console.log("this.form.area: ", this.form.area);
|
||||||
},
|
},
|
||||||
changeHandler(e) {
|
changeHandler(e) {
|
||||||
console.log("e: ", e);
|
console.log("e: ", e);
|
||||||
@@ -695,7 +706,7 @@
|
|||||||
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
||||||
status: 'success',
|
status: 'success',
|
||||||
message: '',
|
message: '',
|
||||||
url: event.name == 2 ?result.path: result.url,
|
url: event.name == 2 ? result.path : result.url,
|
||||||
thumb: result.thumbUrl
|
thumb: result.thumbUrl
|
||||||
}))
|
}))
|
||||||
fileListLen++
|
fileListLen++
|
||||||
@@ -759,6 +770,7 @@
|
|||||||
background-color: #0d0119;
|
background-color: #0d0119;
|
||||||
opacity: .3;
|
opacity: .3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-title {
|
.page-title {
|
||||||
width: 94%;
|
width: 94%;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
@@ -905,7 +917,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-form-item__body {
|
/deep/ .u-form-item__body {
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user