feat(house): 优化房源区域选择及删除功能
- 保存按钮布局调整优化,提升用户体验 - 房源详情地区显示只展示市级,简化展示信息 - 地区选择器调整,只显示市,确保区域数据统一 - 删除房源操作添加确认弹窗,避免误删 - 省市区数据加载逻辑简化,使用固定城区列表替代异步接口请求 - 替换首页及闪屏logo图片,更新为新资源路径 - 隐藏房源详情页电话咨询按钮,暂不支持电话功能 - 代码格式和注释优化,提升代码可读性
This commit is contained in:
@@ -259,12 +259,9 @@
|
||||
</u--form>
|
||||
|
||||
<u-gap height="80"></u-gap>
|
||||
<!-- 操作按钮 -->
|
||||
<!-- 保存按钮 -->
|
||||
<view class="footer">
|
||||
<view class="btn-wrapper">
|
||||
<u-button text="保存" color="linear-gradient(to bottom, #27b0fd, #3f72f4)" :disabled="disabled"
|
||||
shape="circle" @click="handleSubmit()"></u-button>
|
||||
</view>
|
||||
<u-button text="保存" color="linear-gradient(to bottom, #27b0fd, #3f72f4)" :disabled="disabled" shape="circle" @click="handleSubmit()"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -318,7 +315,7 @@
|
||||
status: 10,
|
||||
address: ''
|
||||
},
|
||||
fileList1: [],
|
||||
fileList1: [],
|
||||
fileList2: [],
|
||||
loading: false,
|
||||
// regionsData: [
|
||||
@@ -407,18 +404,20 @@
|
||||
})
|
||||
|
||||
},
|
||||
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) || []
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
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) || []
|
||||
// 回显时只显示市
|
||||
if (app.form.city) {
|
||||
app.form.area = app.form.city
|
||||
}
|
||||
})
|
||||
},
|
||||
onChangeTab(e) {
|
||||
const app = this
|
||||
app.tabIndex = e.value
|
||||
@@ -651,7 +650,7 @@
|
||||
onArea() {
|
||||
this.$refs.area.open()
|
||||
},
|
||||
//地址选择成功
|
||||
//地址选择成功 - 存储省市区,但显示只显示市
|
||||
chooseSuccess(e) {
|
||||
console.log('chooseSuccess 收到数据:', JSON.stringify(e));
|
||||
const data = e.value
|
||||
@@ -664,12 +663,14 @@
|
||||
// 根据选择层级保存数据
|
||||
if (data.length >= 3 && data[2]) {
|
||||
this.form.region = data[2].label
|
||||
this.form.area = `${data[0].label} ${data[1].label} ${data[2].label}`
|
||||
// 显示只显示市
|
||||
this.form.area = data[1].label
|
||||
} else {
|
||||
this.form.region = ''
|
||||
this.form.area = `${data[0].label} ${data[1].label}`
|
||||
// 显示只显示市
|
||||
this.form.area = data[1].label
|
||||
}
|
||||
console.log('地区选择完成 - province:', this.form.province, 'city:', this.form.city, 'area:', this.form.area);
|
||||
console.log('地区选择完成 - province:', this.form.province, 'city:', this.form.city, 'region:', this.form.region, 'area:', this.form.area);
|
||||
},
|
||||
changeHandler(e) {
|
||||
console.log("e: ", e);
|
||||
@@ -706,15 +707,12 @@
|
||||
closeToward() {
|
||||
this.showToward = false
|
||||
},
|
||||
|
||||
closeVideo(){
|
||||
closeVideo() {
|
||||
this.form.videoUrl = ''
|
||||
updateHouseInfo(this.form).then(res => {
|
||||
this.$toast('删除成功')
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
confirmRegion(e) {
|
||||
this.form.region = e.value[0] + ' ' + e.value[1]
|
||||
this.showRegion = false
|
||||
@@ -911,6 +909,18 @@
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.action-btns {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
gap: 20rpx;
|
||||
|
||||
.u-button {
|
||||
flex: 1;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-item {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
|
||||
Reference in New Issue
Block a user