feat(house): 优化房源区域选择及删除功能

- 保存按钮布局调整优化,提升用户体验
- 房源详情地区显示只展示市级,简化展示信息
- 地区选择器调整,只显示市,确保区域数据统一
- 删除房源操作添加确认弹窗,避免误删
- 省市区数据加载逻辑简化,使用固定城区列表替代异步接口请求
- 替换首页及闪屏logo图片,更新为新资源路径
- 隐藏房源详情页电话咨询按钮,暂不支持电话功能
- 代码格式和注释优化,提升代码可读性
This commit is contained in:
2026-05-01 10:55:34 +08:00
parent ee17e5fb9d
commit d66a8dfe8c
15 changed files with 114 additions and 65 deletions

26
.idea/workspace.xml generated
View File

@@ -4,7 +4,9 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="ec5c6cc2-d0e3-4470-b342-660aa89effe0" name="Changes" comment="feat(area-selector): 重构地区选择器数据加载逻辑&#10;&#10;- 将数据请求逻辑独立为 requestCityData 方法&#10;- 集成腾讯地图行政区域 API 获取准确地区数据&#10;- 实现地区数据格式转换适配组件需求&#10;- 添加内置精简地区数据作为降级方案&#10;- 优化异步处理和错误捕获机制&#10;- 修复子级数据为空时的显示问题" />
<list default="true" id="ec5c6cc2-d0e3-4470-b342-660aa89effe0" name="Changes" comment="feat(area-selector): 重构地区选择器数据加载逻辑&#10;&#10;- 将数据请求逻辑独立为 requestCityData 方法&#10;- 集成腾讯地图行政区域 API 获取准确地区数据&#10;- 实现地区数据格式转换适配组件需求&#10;- 添加内置精简地区数据作为降级方案&#10;- 优化异步处理和错误捕获机制&#10;- 修复子级数据为空时的显示问题">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -73,6 +75,7 @@
<workItem from="1749371022185" duration="5619000" />
<workItem from="1770982606471" duration="56000" />
<workItem from="1775219711691" duration="2835000" />
<workItem from="1775277870399" duration="755000" />
</task>
<task id="LOCAL-00001" summary="爱尚家接口合并到cms-api.websoft.top">
<option name="closed" value="true" />
@@ -138,12 +141,31 @@
<option name="project" value="LOCAL" />
<updated>1775224711201</updated>
</task>
<option name="localTasksCounter" value="9" />
<task id="LOCAL-00009" summary="feat(area-selector): 重构地区选择器数据加载逻辑&#10;&#10;- 将数据请求逻辑独立为 requestCityData 方法&#10;- 集成腾讯地图行政区域 API 获取准确地区数据&#10;- 实现地区数据格式转换适配组件需求&#10;- 添加内置精简地区数据作为降级方案&#10;- 优化异步处理和错误捕获机制&#10;- 修复子级数据为空时的显示问题">
<option name="closed" value="true" />
<created>1775278015655</created>
<option name="number" value="00009" />
<option name="presentableId" value="LOCAL-00009" />
<option name="project" value="LOCAL" />
<updated>1775278015655</updated>
</task>
<option name="localTasksCounter" value="10" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_NEW_TODO" value="false" />

View File

@@ -0,0 +1,17 @@
{
"version": 2,
"sessions": {
"0839885c6a514b4f9b378f70d7ca86e5": [
{
"expertId": "SeniorDeveloper",
"name": "Will",
"profession": "高级开发工程师",
"avatarUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/avatars/02-Engineering/SeniorDeveloper/SeniorDeveloper.png",
"promptUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/experts/02-Engineering/SeniorDeveloper/SeniorDeveloper_zh.md",
"usedAt": 1775884910819,
"industryId": "all"
}
]
},
"lastUpdated": 1775889214452
}

View File

@@ -2,7 +2,7 @@
<view class="page-wrap">
<view class="main">
<view class="logo">
<image src="@/static/logo-chang.png" mode="widthFix"></image>
<image src="@/static/logo-chang.jpg" mode="widthFix"></image>
<!-- <image src="https://oss.jimeigroup.cn/static/flash-logo-text.png" mode="widthFix"></image> -->
<!-- <text class="logo-name">
爱尚家找房

View File

@@ -7,9 +7,9 @@
shape="square" bgColor="#ffffff" :animation="true" @search="onSearch"></u-search>
</view>
</view>
<view class="search-tools">
<view class="search-tools">
<view class="region">
<uni-data-select class="select-width" v-model="where.keywords" :localdata="houseArea" placeholder="区域"
<uni-data-select class="select-width" v-model="where.region" :localdata="region" placeholder="区域"
@change="onSearch"></uni-data-select>
</view>
<view class="region">
@@ -125,9 +125,10 @@
loadMore: true,
status: '加载更多',
page: 1,
where: {
status: 0
},
where: {
status: 0,
region: ''
},
dict: null,
cityList: [],
// 控制onShow事件是否刷新订单列表
@@ -245,23 +246,11 @@
}
})
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
}
})
}
})
}
});
// 城区列表
app.region = ['青秀区', '良庆区', '江南区', '兴宁区', '邕宁区', '西乡塘区'].map(d => {
return {
value: d,
text: d
}
})
})

View File

@@ -3,7 +3,7 @@
<u-navbar placeholder fixed>
<template slot="left">
<view style="display: flex;align-items: center;height: 44px;">
<image style="height: 30px;" src="@/static/logo-chang.png" mode="heightFix"></image>
<image style="height: 30px;" src="@/static/logo-chang.jpg" mode="heightFix"></image>
</view>
</template>
</u-navbar>

View File

@@ -7,7 +7,7 @@
<text>账号登录</text>
</view> -->
<view class="logo">
<image src="https://wx.qlogo.cn/mmhead/Q3auHgzwzM6r6ngnJicOXYQpXicJiazznz68m2kXIbY1SibhPtzX4dc6BQ/0" mode="widthFix"></image>
<image src="/static/logo.jpg" mode="widthFix"></image>
</view>
<!-- <view class="sub-title">
<text>未注册的手机号登录后将自动注册</text>

BIN
static/empty-02.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

BIN
static/logo-chang.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

BIN
static/logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -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;

View File

@@ -196,7 +196,7 @@
@click="$push('sub_pages/checkout/checkout?id=' + form.houseId)"></u-button>
</view> -->
<view class="item">
<u-button icon="phone" type="primary" text="电话咨询"></u-button>
<!-- <u-button icon="phone" type="primary" text="电话咨询"></u-button> -->
<!-- <u-button icon="phone" type="primary" text="电话咨询" @click="makePhoneCall()"></u-button> -->
</view>
</view>

View File

@@ -15,9 +15,9 @@
<view class="btn">
<u-button text="下架" plain size="small" @click="onStatus(10)"></u-button>
</view>
<!-- <view class="btn">
<view class="btn">
<u-button text="删除" plain size="small" @click="onDel()"></u-button>
</view> -->
</view>
<view class="btn">
<u-button text="编辑" plain size="small" @click="onEdit()"></u-button>
</view>
@@ -158,17 +158,28 @@
},
onDel() {
const app = this
app.list.map(d => {
if (d.selected == true) {
HouseInfoApi.removeHouseInfo(d.houseId).then(res => {
app.$success(res.message)
onDel() {
const app = this
const selectedItems = app.list.filter(d => d.selected == true)
if (selectedItems.length === 0) {
app.$error('请选择要删除的房源')
return
}
uni.showModal({
title: '删除确认',
content: `确定要删除选中的 ${selectedItems.length} 条房源吗?此操作不可恢复!`,
success: (res) => {
if (res.confirm) {
selectedItems.forEach(d => {
HouseInfoApi.removeHouseInfo(d.houseId).then(res => {
app.$success(res.message)
})
})
app.onSearch()
}
})
app.onSearch()
},
}
})
},
onStatus(status) {
const app = this
app.list.map(d => {