Browse Source

房屋新增编辑,搜索记录页面

jw-featrue-zhanlibiao
mk 2 years ago
parent
commit
0bd68867d7
  1. 3
      app.json
  2. 2
      pages/index/index.wxml
  3. 37
      pages/work/work.js
  4. 10
      pages/work/work.wxml
  5. 47
      pages/work/work.wxss
  6. 14
      project.private.config.json
  7. 2
      subpages/addResi/pages/addResi/addResi.wxml
  8. 480
      subpages/addhouse/pages/addhouse/addhouse.js
  9. 3
      subpages/addhouse/pages/addhouse/addhouse.json
  10. 173
      subpages/addhouse/pages/addhouse/addhouse.wxml
  11. 192
      subpages/addhouse/pages/addhouse/addhouse.wxss
  12. BIN
      subpages/addhouse/pages/images/header.png
  13. 117
      subpages/searchResult/pages/searchRecords/searchRecords.js
  14. 4
      subpages/searchResult/pages/searchRecords/searchRecords.json
  15. 15
      subpages/searchResult/pages/searchRecords/searchRecords.wxml
  16. 126
      subpages/searchResult/pages/searchRecords/searchRecords.wxss
  17. 31
      subpages/searchResult/pages/searchResult/searchResult.js
  18. 7
      subpages/searchResult/pages/searchResult/searchResult.wxml
  19. 3
      subpages/searchResult/pages/searchResult/searchResult.wxss
  20. 22
      utils/api.js

3
app.json

@ -20,7 +20,8 @@
"root": "subpages/searchResult",
"name": "searchResult",
"pages": [
"pages/searchResult/searchResult"
"pages/searchResult/searchResult",
"pages/searchRecords/searchRecords"
]
},
{

2
pages/index/index.wxml

@ -18,7 +18,7 @@
</view>
<view class="content">
<scroll-view class="scroll" scroll-y="{{true}}" lower-threshold="{{ lowerThreshold }}" bindscrolltolower="onScrollToLower">
<view class="card" wx:for="{{tableData}}" >
<view class="card" wx:for="{{tableData}}" wx:key="index" >
<view class="title {{item.delFlag == '1'?'gray':''}}" >{{item.content}}</view>
<view class="type">
<image src="../../images/resi.png" wx:if="{{item.msgType == 'resident_base_info'}}" mode=""/>

37
pages/work/work.js

@ -8,7 +8,8 @@ Page({
*/
data: {
setlectVal:'resi',
keyWord:''
keyWord:'',
SearchRecordsList:[]
},
/**
@ -19,7 +20,7 @@ Page({
statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight,
share:app.globalData.share,
agencyName:app.globalData.user.agencyName
agencyName:app.globalData.user.agencyName,
})
this.getSituation()
},
@ -49,7 +50,9 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
SearchRecordsList:wx.getStorageSync('searchRecords') || []
})
},
/**
@ -107,5 +110,33 @@ Page({
wx.navigateTo({
url: `/subpages/searchResult/pages/searchResult/searchResult?type=${this.data.setlectVal}&keyWord=${this.data.keyWord}`,
})
console.log(this.data.setlectVal);
if(this.data.setlectVal == 'house'){
// 获取当前的搜索记录
let records = wx.getStorageSync('searchRecords') || [];
// 检查关键词是否已存在于记录中,如果存在,则先移除它(这样我们可以将其放到数组的前面)
const index = records.indexOf(this.data.keyWord);
if (index > -1) {
records.splice(index, 1);
}
// 将新的关键词添加到记录的开始
records.unshift(this.data.keyWord);
// 为了避免本地存储数据太大,您可以限制记录的数量,例如最多保存10条
if (records.length > 10) {
records.pop();
}
// 保存更新后的搜索记录
wx.setStorageSync('searchRecords', records);
}
},
handelClickSearchRecordsList(e){
wx.navigateTo({
url: `/subpages/searchResult/pages/searchResult/searchResult?type=${this.data.setlectVal}&keyWord=${e.currentTarget.dataset.value}`,
})
},
navToSearchRecords(){
wx.navigateTo({
url: '/subpages/searchResult/pages/searchRecords/searchRecords',
})
}
})

10
pages/work/work.wxml

@ -14,12 +14,18 @@
<input type="text" placeholder="{{setlectVal == 'resi'?'姓名/手机/身份证/住址等任意组合关键词':'输入小区/楼栋/单元/门牌号/房主等任意组合关键词'}}" bindblur="handelBlurKeyWord" value="{{keyWord}}" />
<view class="btn_box" bind:tap="handelClickSearch">搜索</view>
</view>
<view class="jump">
<view class="jump" wx:if="{{setlectVal == 'resi'}}">
<image style="height: 50rpx;width: 50rpx; margin-right: 11rpx;" src="../../images/work/card.png" mode=""/>
<view>识别身份证查询</view>
<image style="height: 32rpx;width: 32rpx;" src="../../images/work/right.png" mode=""/>
</view>
<view class="list"></view>
<view class="searChrecord" wx:else>
<view class="label"> 最近查询: </view>
<view class="item_list">
<view class="item" wx:for="{{SearchRecordsList}}" wx:key="index" bind:tap="handelClickSearchRecordsList" data-value='{{item}}'> {{item}}</view>
</view>
<image src="../../images/work/right.png" bind:tap="navToSearchRecords" mode=""/>
</view>
</view>
</view>
<view class="body">

47
pages/work/work.wxss

@ -135,6 +135,53 @@ page {
font-weight: 500;
color: #FFFFFF;
}
.content .searChrecord{
font-size:26rpx;
color: #FFFFFF;
margin-top: 30rpx;
display: flex;
overflow: hidden;
justify-content: space-around;
align-items: center;
}
.content .searChrecord .item_list {
flex: 1;
display: flex;
justify-content: start;
overflow: hidden;
margin: 0 20rpx;
box-sizing: border-box;
}
.content .searChrecord .item_list .label{
width: 111rpx;
}
.content .searChrecord .item_list .item{
padding: 7rpx 16rpx;
height: 40rpx;
line-height: 26rpx;
width: fit-content;
text-overflow: ellipsis;
white-space: nowrap;
background: linear-gradient(0deg, #579EFD 0%, #408DF3 100%);
opacity: 0.9;
border-radius: 20rpx;
box-sizing: border-box;
margin-left: 10rpx;
}
.content .searChrecord .item_list .item:last-child {
flex: 1;
overflow: hidden;
max-width: 150rpx;
text-overflow: ellipsis;
white-space: nowrap;
text-align: center;
}
.content .searChrecord image{
width: 32rpx;
height: 32rpx;
}
.header .content .jump view{
flex: 1;
text-align: left;

14
project.private.config.json

@ -42,6 +42,20 @@
"query": "type=edit&resiId=1695348130663325697",
"launchMode": "default",
"scene": null
},
{
"name": "新增房屋",
"pathName": "subpages/addhouse/pages/addhouse/addhouse",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "搜索记录",
"pathName": "subpages/searchResult/pages/searchRecords/searchRecords",
"query": "",
"launchMode": "default",
"scene": null
}
]
}

2
subpages/addResi/pages/addResi/addResi.wxml

@ -3,7 +3,7 @@
<image src="../../../../images/back.png" class="back" style=" top: {{statusHeight}}px;width: 30rpx;height: 30rpx;" bindtap="back" mode=""/>
<image class="header-bg" src="../images/header.png" mode="widthFix" />
<view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;">
{{formType == 'edit'?'修改居民信息':'填写居民信息'}}
{{formType == 'edit'?'修改居民信息':'新增居民信息'}}
</view>
<view class="content">
<view class="h2">填写居民信息</view>

480
subpages/addhouse/pages/addhouse/addhouse.js

@ -1,20 +1,213 @@
// subpages/addhouse/pages/addhouse/addhouse.js
import api from "../../../../utils/api"
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
form:{
neighborHoodId: "", //小区id
buildingId: "", //楼栋id
buildingUnitId: "",//单元id
doorName: "", //门牌号
houseType: "",//房屋类型
purpose: "",//房屋用途
rentFlag: null,//房屋状态
ownerPhone: "",//联系方式
ownerName: "",//房主姓名
ownerIdCard: "",//房主证件号
remark: "",
coding: "",
sysCoding: "",//房屋编码
familyTags: []//家庭标签
},
gridName: '',
gridId: '',
neighborHoodIdList:[],
neighborHoodIdName:'',
buildingList:[],
buildingName:'',
houseTypeList:[
{
label:'楼房',
value:'1'
},
{
label:'平房',
value:'2'
}, {
label:'别墅',
value:'3'
},
],
purposeList:[
{
label:'住宅',
value:'1'
},
{
label:'商业',
value:'2'
}, {
label:'办公',
value:'3'
}, {
label:'工业',
value:'4'
}, {
label:'仓储',
value:'5'
}, {
label:'商住混用',
value:'6'
}, {
label:'其他',
value:'7'
},
],
isFirstLoadGrid:true,
isFirstLoadVillage: true,
isFirstLoadBuilding:true,
isFirstLoadUnit:true,
rentFlagList:[
{
label:'自住',
value:0
}, {
label:'出租',
value:1
}, {
label:'闲置',
value:2
}, {
label:'未出售',
value:3
},
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
onLoad: async function (options) {
console.log(options);
this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight,
agencyId:'7b6f9a9f9f38d5f9fa7ce94a93d6eb28',//app.globalData.user.agencyId
'form.agencyId':app.globalData.user.agencyId,
'form.agencyName':app.globalData.user.agencyName,
formType:options.type,
houseId:options.houseId
})
await this.getGridoptionDict()
if(options.houseId){
wx.setNavigationBarTitle({
title: '修改房屋信息',
})
await this.getClearHouseDeatilById()
}else{
this.setData({
isFirstLoadGrid:false,
isFirstLoadVillage: false,
isFirstLoadBuilding:false,
isFirstLoadUnit:false,
isFirstLoadHouse:false,
})
}
},
getClearHouseDeatilById: async function() {
try {
let res = await api.getClearHouseDeatilById(this.data.houseId);
wx.showLoading({
title: '加载中...',
})
await this.setDataAsync({
form:res.data,
gridId:res.data.gridId
});
setTimeout(()=>{
this.bindPickerChangeGrid();
},1000)
setTimeout(()=>{
this.bindPickerChangeneighborHoodId();
},1500)
setTimeout(()=>{
this.bindPickerChangebuilding()
},2000)
setTimeout(()=>{
this.bindPickerChangeUnit()
wx.hideLoading()
},2500)
} catch(err) {
console.log(err);
}
},
setDataAsync: function(data) {
return new Promise((resolve) => {
this.setData(data, resolve);
});
},
getGridoptionDict(){
let parm ={
agencyId:this.data.agencyId,
purpose:'addorupdate'
}
api.getGridoptionDict(parm).then(res=>{
this.setData({
gridList:res.data,
})
}).catch(err=>{
console.log(err);
})
},
getQuartersOptions(gridId){
let parm = {
gridId,
agencyId:this.data.agecyId
}
api.getQuartersOptions(parm).then(res=>{
this.setData({
neighborHoodIdList:res.data
})
}).catch(err=>{
console.log(err);
})
},
// 获取楼栋列表
getBuildingoption(neighborHoodId){
api.getBuildingoption(neighborHoodId).then(res=>{
this.setData({
buildingList:res.data
})
}).catch(err=>{
console.log(err);
})
},
// 获取单元列表
getUnitoption(buildingId){
api.getUnitoption(buildingId).then(res=>{
this.setData({
unitList:res.data
})
}).catch(err=>{
console.log(err);
})
},
// 获取房屋列表
getHouseoption(buildingUnitId){
api.getHouseoption(buildingUnitId).then(res=>{
this.setData({
houseList:res.data
})
}).catch(err=>{
console.log(err);
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
@ -62,5 +255,288 @@ Page({
*/
onShareAppMessage() {
},
// 获取网格列表
bindPickerChangeGrid(e){
if (this.data.isFirstLoadGrid) {
// 编辑回填逻辑
const id = this.data.gridId;
const gridName = this.data.gridList.filter(item => item.value == id)[0].label;
this.setData({
gridName: gridName,
gridId: id
});
this.getQuartersOptions(id);
this.setData({
isFirstLoadGrid: false
});
} else {
// 正常修改逻辑
const selectedIndex = e.detail.value;
const selectedVillage = this.data.gridList[selectedIndex];
this.setData({
gridName:selectedVillage.label,
gridId:selectedVillage.value,
neighborHoodIdName:'',
neighborHoodIdList:[],
buildingName:'',
buildingList:[],
unitName:'',
unitList:[],
doorName:'',
houseList:[],
});
this.getQuartersOptions(selectedVillage.value);
}
},
bindPickerChangeneighborHoodId(e) {
if (this.data.isFirstLoadVillage) {
// 编辑回填逻辑
const id = this.data.form.neighborHoodId;
const neighborHoodIdName = this.data.neighborHoodIdList.filter(item => item.value == id)[0].label;
this.setData({
neighborHoodIdName: neighborHoodIdName,
"form.neighborHoodId": id
});
this.getBuildingoption(id);
this.setData({
isFirstLoadVillage: false
});
} else {
// 正常修改逻辑
const selectedIndex = e.detail.value;
const selectedVillage = this.data.neighborHoodIdList[selectedIndex];
this.setData({
neighborHoodIdName: selectedVillage.label,
"form.neighborHoodId": selectedVillage.value
});
this.getBuildingoption(selectedVillage.value);
}
},
bindPickerChangebuilding(e){
if (this.data.isFirstLoadBuilding) {
const id = this.data.form.buildingId;
const buildingName = this.data.buildingList.filter(item => item.value == id)[0].label;
this.setData({
buildingName: buildingName,
"form.buildingId": id
});
this.getUnitoption(id);
this.setData({
isFirstLoadBuilding: false
});
} else {
const selectedIndex = e.detail.value;
const selectedVillage = this.data.buildingList[selectedIndex];
this.setData({
buildingName: selectedVillage.label,
"form.buildingId": selectedVillage.value
});
this.getUnitoption(selectedVillage.value);
}
},
bindPickerChangeUnit(e){
if (this.data.isFirstLoadUnit) {
const id = this.data.form.buildingUnitId;
const unitName = this.data.unitList.filter(item => item.value == id)[0].label;
this.setData({
unitName: unitName,
"form.buildingUnitId": id
});
this.getHouseoption(id);
this.setData({
isFirstLoadunit: false
});
} else {
const selectedIndex = e.detail.value;
const selectedVillage = this.data.unitList[selectedIndex];
this.setData({
unitName: selectedVillage.label,
"form.buildingUnitId": selectedVillage.value
});
this.getHouseoption(selectedVillage.value);
}
},
// bindPickerChangeHouse(e){
// if (this.data.isFirstLoadHouse) {
// const id = this.data.form.doorName;
// const doorName = this.data.houseList.filter(item => item.value == id)[0].label;
// this.setData({
// doorName: doorName,
// "form.doorName": id
// });
// this.setData({
// isFirstLoadHouse: false
// });
// } else {
// const selectedIndex = e.detail.value;
// const selectedVillage = this.data.houseList[selectedIndex];
// this.setData({
// doorName: selectedVillage.label,
// "form.doorName": selectedVillage.value
// });
// }
// },
bindDoorNameInput(e){
this.setData({
'form.doorName':e.detail.value
})
},
bindsysCodingInput(e){
this.setData({
'form.sysCoding':e.detail.value,
'form.coding':res.data.sysCoding
})
},
bindPickerChangehouseType(e){
this.setData({
"form.houseType" :this.data.houseTypeList[e.detail.value].value,
})
},
bindPickerChangePurpose(e){
this.setData({
"form.purpose" :this.data.purposeList[e.detail.value].value,
})
},
bindPickerChangeRentFlag(e){
this.setData({
"form.rentFlag" :this.data.rentFlagList[e.detail.value].value,
})
},
bindOwnerNameInput(e){
this.setData({
'form.ownerName':e.detail.value
})
},
bindOwnerPhoneInput(e){
this.setData({
'form.ownerPhone':e.detail.value
})
},
bindOwnerIdCardInput(e){
this.setData({
'form.ownerIdCard':e.detail.value
})
},
bindRemarkInput(e){
this.setData({
'form.remark':e.detail.value
})
},
handelClickSysCoding(){
if(!this.data.form.buildingUnitId){
wx.showToast({
title: '请先选择单元',
icon:'none'
})
}
api.getHouseCoding(this.data.form.buildingUnitId).then(res=>{
this.setData({
'form.sysCoding':res.data.sysCoding,
'form.coding':res.data.sysCoding
})
}).catch(err=>{
console.log(err);
})
},
bindRemarkInput(e){
this.setData({
'form.remark':e.detail.value
})
},
showToast(title){
wx.showToast({
title: title,
duration:2000,
icon:'none'
})
},
submit: async function() {
if(!this.data.gridId){
this.showToast('请选择所在网格')
return
}
if(!this.data.form.neighborHoodId){
this.showToast('请选择所在小区')
return
}
if(!this.data.form.buildingId){
this.showToast('请选择所在楼栋')
return
}
if(!this.data.form.buildingUnitId){
this.showToast('请选择所在单元')
return
}
if(!this.data.form.doorName){
this.showToast('请选择门牌号')
return
}
if(!this.data.form.sysCoding){
this.showToast('请输入房屋编码')
return
}
if(!this.data.form.houseType){
this.showToast('请选择房屋类型')
return
}
if(!this.data.form.purpose){
this.showToast('请选择房屋用途')
return
}
if(this.data.form.rentFlag == null){
this.showToast('请选择房屋状态')
return
}
const parm = {...this.data.form}
if(this.data.formType == 'edit'){
parm.houseId = this.data.houseId
try {
const res = await api.updateCommunityHouse(parm)
if(res.code === 0){
wx.showToast({
title: '编辑成功',
duration:3000,
success:function(){
setTimeout(()=>{
wx.navigateBack({
delta: 1
})
},3000)
}
})
}
}catch(err) {
console.log(err);
}
}else{
try {
const res = await api.saveCommunityHouse(parm)
if(res.code === 0){
wx.showToast({
title: '新增成功',
duration:3000,
success:function(){
setTimeout(()=>{
wx.navigateBack({
delta: 1
})
},3000)
}
})
}
}catch(err) {
console.log(err);
}
}
},
back(){
wx.navigateBack({
delta: 1
})
}
})

3
subpages/addhouse/pages/addhouse/addhouse.json

@ -1,3 +1,4 @@
{
"usingComponents": {}
"usingComponents": {},
"navigationStyle": "custom"
}

173
subpages/addhouse/pages/addhouse/addhouse.wxml

@ -1,2 +1,173 @@
<!--subpages/addhouse/pages/addhouse/addhouse.wxml-->
<text>subpages/addhouse/pages/addhouse/addhouse.wxml</text>
<view class="header">
<image src="../../../../images/back.png" class="back" style=" top: {{statusHeight}}px;width: 30rpx;height: 30rpx;" bindtap="back" mode=""/>
<image class="header-bg" src="../images/header.png" mode="widthFix" />
<view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;">
{{formType == 'edit'?'修改房屋信息':'新增房屋信息'}}
</view>
<view class="content">
<view class="h2">填写房屋信息</view>
<view class="tag"> 带 <b>*</b> 号为必填项</view>
</view>
</view>
<view class="content">
<view class="form_card">
<view class="title"><text class="tag"></text> 基本信息</view>
<view class="form_item">
<view class="label">
<text class="must">*</text>
<view class="title">所在网格</view>
</view>
<view class="input">
<picker bindchange="bindPickerChangeGrid" range-key="label" value="{{index}}" range="{{gridList}}">
<view class="{{gridName?'':'gray'}}">
{{gridName?gridName:'请选择'}}
</view>
</picker>
<image src="../../../../images/right.png" mode=""/>
</view>
</view>
<view class="form_item">
<view class="label">
<text class="must">*</text>
<view class="title">所在小区</view>
</view>
<view class="input">
<picker bindchange="bindPickerChangeneighborHoodId" range-key="label" value="{{index}}" range="{{neighborHoodIdList}}">
<view class="{{neighborHoodIdName?'':'gray'}}">
{{neighborHoodIdName?neighborHoodIdName:'请选择'}}
</view>
</picker>
<image src="../../../../images/right.png" mode=""/>
</view>
</view>
<view class="form_item">
<view class="label">
<text class="must">*</text>
<view class="title">所在楼栋</view>
</view>
<view class="input">
<picker bindchange="bindPickerChangebuilding" range-key="label" value="{{index}}" range="{{buildingList}}">
<view class="{{buildingName?'':'gray'}}">
{{buildingName?buildingName:'请选择'}}
</view>
</picker>
<image src="../../../../images/right.png" mode=""/>
</view>
</view>
<view class="form_item">
<view class="label">
<text class="must">*</text>
<view class="title">所在单元</view>
</view>
<view class="input">
<picker bindchange="bindPickerChangeUnit" range-key="label" value="{{index}}" range="{{unitList}}">
<view class="{{unitName?'':'gray'}}">
{{unitName?unitName:'请选择'}}
</view>
</picker>
<image src="../../../../images/right.png" mode=""/>
</view>
</view>
<view class="form_item">
<view class="label ">
<text class="must">*</text>
<view class="title">门牌号</view>
</view>
<view class="input">
<input confirm-type="next" bindblur="bindDoorNameInput" bindinput="bindDoorNameInput" value="{{form.doorName}}" placeholder-class="gray" placeholder="请输入" />
</view>
</view>
<view class="form_item">
<view class="label ">
<text class="must">*</text>
<view class="title">房屋编码</view>
</view>
<view class="input">
<input confirm-type="next" bindblur="bindsysCodingInput" bindinput="bindsysCodingInput" value="{{form.coding}}" placeholder-class="gray" placeholder="请输入" />
<view class="right_btn" bind:tap="handelClickSysCoding">生成</view>
</view>
</view>
<view class="form_item">
<view class="label">
<text class="must">*</text>
<view class="title">房屋类型</view>
</view>
<view class="input">
<picker bindchange="bindPickerChangehouseType" range-key="label" value="{{index}}" range="{{houseTypeList}}">
<view class="{{form.houseType?'':'gray'}}">
{{form.houseType?houseTypeList[form.houseType - 1].label:'请选择'}}
</view>
</picker>
<image src="../../../../images/right.png" mode=""/>
</view>
</view>
<view class="form_item">
<view class="label">
<text class="must">*</text>
<view class="title">房屋用途</view>
</view>
<view class="input">
<picker bindchange="bindPickerChangePurpose" range-key="label" value="{{index}}" range="{{purposeList}}">
<view class="{{form.purpose?'':'gray'}}">
{{form.purpose?purposeList[form.purpose - 1].label:'请选择'}}
</view>
</picker>
<image src="../../../../images/right.png" mode=""/>
</view>
</view>
<view class="form_item">
<view class="label">
<text class="must">*</text>
<view class="title">房屋状态</view>
</view>
<view class="input">
<picker bindchange="bindPickerChangeRentFlag" range-key="label" value="{{index}}" range="{{rentFlagList}}">
<view class="{{form.rentFlag!=null?'':'gray'}}">
{{form.rentFlag!=null?rentFlagList[form.rentFlag].label:'请选择'}}
</view>
</picker>
<image src="../../../../images/right.png" mode=""/>
</view>
</view>
<view class="form_item">
<view class="label">
<!-- <text class="must">*</text> -->
<view class="title">房主姓名</view>
</view>
<view class="input">
<input confirm-type="next" bindblur="bindOwnerNameInput" bindinput="bindOwnerNameInput" value="{{form.ownerName}}" placeholder-class="gray" placeholder="请输入" />
</view>
</view>
<view class="form_item">
<view class="label">
<!-- <text class="must">*</text> -->
<view class="title">房主电话</view>
</view>
<view class="input">
<input confirm-type="next" bindblur="bindOwnerPhoneInput" bindinput="bindOwnerPhoneInput" value="{{form.ownerPhone}}" placeholder-class="gray" placeholder="请输入" />
</view>
</view>
<view class="form_item">
<view class="label">
<!-- <text class="must">*</text> -->
<view class="title">证件号</view>
</view>
<view class="input">
<input confirm-type="next" bindblur="bindOwnerIdCardInput" bindinput="bindOwnerIdCardInput" value="{{form.ownerIdCard}}" placeholder-class="gray" placeholder="请输入" />
</view>
</view>
<view class="form_textarea">
<view class="label">
<view class="title">备注</view>
</view>
<view class="1">
<view class="textarea">
<textarea class="input" placeholder-style="color: #C1C1C1;" value="{{form.remark}}" bindblur="bindRemarkInput" bindinput="bindRemarkInput" maxlength="100" placeholder-class="gray" placeholder="不超过100字" />
</view>
</view>
</view>
</view>
<view class="bottom_btn" bind:tap="submit">提交</view>
</view>

192
subpages/addhouse/pages/addhouse/addhouse.wxss

@ -1 +1,193 @@
/* subpages/addhouse/pages/addhouse/addhouse.wxss */
page {
width: 100%;
min-height: 100vh;
overflow-y: auto;
background-color: #f7f7f7;
}
.gray{
color: #C1C1C1;
}
.m-top20{
margin-top: 20rpx;
}
.header {
width: 100%;
height: 444rpx;
overflow: hidden;
/* position: fixed;
top: 0;
left: 0;
z-index: 1000; */
}
.header .header-bg {
width: 100%;
height: 444rpx;
position: absolute;
height: 100%;
z-index: -999;
}
.back {
width: 30rpx;
height: 30rpx;
margin-left: 20rpx;
position: absolute;
margin-top: 20rpx;
border-radius: 0rpx;
z-index: 101;
}
.header .navigation {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
color: #333333;
font-size: 32rpx;
position: relative;
z-index: 100;
}
.header .content{
margin: 140rpx 0 0 69rpx;
}
.header .content .h2{
font-size: 44rpx;
font-family: PingFang SC;
font-weight: 800;
color: #333333;
margin-bottom: 28rpx;
}
.header .content .tag{
width: 200rpx;
height: 50rpx;
position: relative;
line-height: 48rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #94A6C2;
padding-left: 15rpx;
}
.header .content .tag b {
color: #FF2A00;
}
.header .content .tag image {
width: 170rpx;
height: 50rpx;
position: absolute;
top: 0;
left: 0;
z-index: -888;
}
.content{
width: 100%;
height: auto;
padding: 0 20rpx;
box-sizing: border-box;
position: relative;
top: -60rpx;
}
.form_card {
background-color: #fff;
border-radius: 10rpx;
padding: 0 30rpx 30rpx;
box-sizing: border-box;
height: auto;
}
.form_card > .title{
height: 90rpx;
line-height: 90rpx;
font-size: 34rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
position: relative;
}
.form_card .title .tag{
width: 10rpx;
height: 28rpx;
background: #3A80E7;
border-radius: 4rpx;
position: absolute;
left: -30rpx;
top: 50%;
transform: translateY(-14rpx);
}
.form_card .form_item{
display: flex;
align-items: center;
border-top: 1px solid #EAEAEA;
height: 100rpx;
}
.form_card .form_textarea{
border-top: 1px solid #EAEAEA;
}
.form_card .form_textarea .input{
background-color: #f7f7f7;
border-radius: 20rpx;
padding:27rpx ;
}
.form_card .form_item .label,
.form_card .form_textarea .label
{
width: 130rpx;
height: 100%;
line-height: 100rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #666666;
position: relative;
}
.form_card .form_item .label .must{
font-size: 32rpx;
font-weight: 500;
color: #FF2A00;
position: absolute;
left: -18rpx;
top: 50%;
transform: translateY(-50rpx);
}
.form_card .form_item .input{
flex: 1;
display: flex;
justify-content: space-around;
align-items: center;
margin-left: 51rpx;
overflow: hidden;
}
.form_card .form_item .input .right_btn{
height: 56rpx;
line-height: 26rpx;
font-size: 28rpx;
padding: 15rpx 27rpx;
width: fit-content;
color: #fff;
background-color: #3A80E7;
border-radius: 27rpx;
box-sizing: border-box;
}
.form_card .form_item .input .residentCategorySty{
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.form_card .form_item .input picker,
.form_card .form_item .input input{
flex: 1;
}
.form_card .form_item .input image{
height: 22rpx;
width: 22rpx;
}
.bottom_btn{
width: 600rpx;
height: 86rpx;
background: linear-gradient(87deg, #81B5FB 0%, #3E92FF 100%);
border-radius: 43rpx;
text-align: center;
color: #fff;
margin: 30rpx auto 0;
line-height: 86rpx;
}

BIN
subpages/addhouse/pages/images/header.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 KiB

117
subpages/searchResult/pages/searchRecords/searchRecords.js

@ -0,0 +1,117 @@
// subpages/searchResult/pages/searchRecords/searchRecords.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
SearchRecordsList:[],
keyWord:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
SearchRecordsList:wx.getStorageSync('searchRecords') || []
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
handelClickSearch(e){
if(!this.data.keyWord) {
wx.showToast({
title: '请输入查询内容',
icon:'none'
})
return
}
wx.navigateTo({
url: `/subpages/searchResult/pages/searchResult/searchResult?type='house&keyWord=${this.data.keyWord}`,
})
// 获取当前的搜索记录
let records = wx.getStorageSync('searchRecords') || [];
// 检查关键词是否已存在于记录中,如果存在,则先移除它(这样我们可以将其放到数组的前面)
const index = records.indexOf(this.data.keyWord);
if (index > -1) {
records.splice(index, 1);
}
// 将新的关键词添加到记录的开始
records.unshift(this.data.keyWord);
// 为了避免本地存储数据太大,您可以限制记录的数量,例如最多保存10条
if (records.length > 10) {
records.pop();
}
// 保存更新后的搜索记录
wx.setStorageSync('searchRecords', records);
},
handelBlurKeyWord(e){
this.setData({
keyWord: e.detail.value
})
},
handelClickSearchRecordsList(e){
wx.navigateTo({
url: `/subpages/searchResult/pages/searchResult/searchResult?type=house&keyWord=${e.currentTarget.dataset.value}`,
})
},
handelDelete(){
wx.removeStorageSync('searchRecords');
this.setData({
SearchRecordsList:[]
})
}
})

4
subpages/searchResult/pages/searchRecords/searchRecords.json

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationStyle": "custom"
}

15
subpages/searchResult/pages/searchRecords/searchRecords.wxml

@ -0,0 +1,15 @@
<view class="header">
<image src="../../../../images/back.png" class="back" style=" top: {{statusHeight}}px;width: 30rpx;height: 30rpx;" bindtap="back" mode=""/>
<view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;">
搜索历史
</view>
</view>
<view class="inout_box">
<image src="../../../../images/work/search.png" mode=""/>
<input type="text" placeholder="{{setlectVal == 'resi'?'姓名/手机/身份证/住址等任意组合关键词':'输入小区/楼栋/单元/门牌号/房主等任意组合关键词'}}" bindblur="handelBlurKeyWord" value="{{keyWord}}" />
<view class="btn_box" bind:tap="handelClickSearch">搜索</view>
</view>
<view class="h2"> <view>搜索历史</view> <view class="right" bind:tap="handelDelete"><image src="../../../../images/delete.png" mode=""/>清空记录</view></view>
<view class="flex">
<view class="item" wx:for="{{SearchRecordsList}}" wx:key="index" bind:tap="handelClickSearchRecordsList" data-value='{{item}}'> {{item}}</view>
</view>

126
subpages/searchResult/pages/searchRecords/searchRecords.wxss

@ -0,0 +1,126 @@
/* subpages/searchResult/pages/searchRecords/searchRecords.wxss */
page {
width: 100%;
min-height: 100vh;
overflow: hidden;
background-color: #f7f7f7;
}
.header {
width: 100%;
height: 150rpx;
background: linear-gradient(180deg, #7DB5FF 0%,#F7F7F7 100%);
box-sizing: border-box;
overflow: hidden;
}
.header .header-bg {
width: 100%;
height: 100%;
/* position: absolute;
z-index: 10;
left: 0;
top: 0; */
position: absolute;
height: 100%;
z-index: -999;
}
.header .navigation {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
position: relative;
z-index: 1;
}
.inout_box {
position: relative;
margin-top: 47rpx;
padding: 0 20rpx;
box-sizing: border-box;
}
.inout_box input{
width: auto;
border-radius: 47rpx;
padding:0 110rpx 0 69rpx;
height: 76rpx;
font-size: 26rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
border:1rpx #1472eb solid;
}
.inout_box image{
position: absolute;
left: 40rpx;
top: 24rpx;
width: 30rpx;
height: 30rpx;
}
.inout_box .btn_box{
width: 69rpx;
height: 30rpx;
line-height: 30rpx;
position: absolute;
top: 24rpx;
right:30rpx;
font-size: 28rpx;
color:#3A80E7;
padding-left: 15rpx;
border-left:2rpx #3A80E7 solid ;
}
.back {
width: 30rpx;
height: 30rpx;
margin-left: 20rpx;
position: absolute;
margin-top: 25rpx;
border-radius: 0rpx;
z-index: 2;
}
.h2{
font-size: 32rpx;
font-weight: 500;
width: 100%;
padding: 0 20rpx;
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
}
.h2 .right {
display: flex;
align-items: center;
color:#d8d8d8 ;
}
.h2 .right image{
width: 40rpx;
height: 40rpx;
}
.flex{
width: 100%;
height: auto;
display: flex;
flex-wrap: wrap;
margin-top:30rpx ;
padding: 0 20rpx;
}
.flex view{
padding: 10rpx 16rpx;
height: 40rpx;
line-height: 20rpx;
width: fit-content;
text-overflow: ellipsis;
font-size: 28rpx;
white-space: nowrap;
background: linear-gradient(0deg, #579EFD 0%, #408DF3 100%);
opacity: 0.9;
border-radius: 20rpx;
box-sizing: border-box;
margin:0 0rpx 10rpx 20rpx;
color: #fff;
}

31
subpages/searchResult/pages/searchResult/searchResult.js

@ -1,5 +1,5 @@
// subpages/searchResult/pages/searchResult/searchResult.js
import {getCommunityHouse,getResidentBaseInfo} from "../../../../utils/api"
import api, {getCommunityHouse,getResidentBaseInfo} from "../../../../utils/api"
const app = getApp()
Page({
@ -112,7 +112,21 @@ Page({
})
})
}else{
getCommunityHouse(parm).then(res=>{
this.setData({
loadMoreType: res.data.list.length === this.data.pageSize ? 'more' : 'none',
tableData: this.data.tableData.concat(res.data.list),
})
console.log(this.data.loadMoreType);
if (this.data.tableData.length == 0) {
this.setData({
loadMoreVisible: false,
nodata: true
})
}
}).catch(err=>{
console.log(err);
})
}
},
onScrollToLower(e){
@ -137,9 +151,16 @@ Page({
},
handelClickedit(e){
console.log(e);
wx.navigateTo({
url: `/subpages/addResi/pages/addResi/addResi?type=edit&resiId=${e.currentTarget.dataset.item.resiId}`,
})
if(this.data.type == 'resi'){
wx.navigateTo({
url: `/subpages/addResi/pages/addResi/addResi?type=edit&resiId=${e.currentTarget.dataset.item.resiId}`,
})
}else{
wx.navigateTo({
url: `/subpages/addhouse/pages/addhouse/addhouse?type=edit&houseId=${e.currentTarget.dataset.item.id}`,
})
}
},
back() {
//返回上一级,关闭当前页面

7
subpages/searchResult/pages/searchResult/searchResult.wxml

@ -12,10 +12,11 @@
</view>
<scroll-view class="scroll" scroll-y="{{true}}" lower-threshold="{{ lowerThreshold }}" bindscrolltolower="onScrollToLower">
<view class="card">
<view class="list_card" wx:for="{{tableData}}" data-item="{{item}}" bind:tap="handelClickedit">
<view class="list_card" wx:for="{{tableData}}" wx:key="index" data-item="{{item}}" bind:tap="handelClickedit">
<view class="left">
<view> {{item.name}} {{item.mobile}}</view>
<view class="address">地址:{{item.homeName}}</view>
<view wx:if="{{type=='resi'}}"> {{item.name}} {{item.mobile}}</view>
<view wx:else >{{item.quartersName + item.buildingName + item.buildingUnitName + item.houseName}}</view>
<view class="address" wx:if="{{type=='resi'}}">地址:{{item.homeName}}</view>
</view>
<view class="right">
<image src="../../../../images/right.png" mode=""/>

3
subpages/searchResult/pages/searchResult/searchResult.wxss

@ -98,6 +98,9 @@ page {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.content .card .list_card .left :nth-child(1),
.content .card .list_card .left :nth-child(2){

22
utils/api.js

@ -21,7 +21,11 @@ module.exports = {
getResidentEduInfo,
getFamilyInfoDetailById,
resiEdit,
getSituation
getSituation,
getHouseCoding,
saveCommunityHouse,
updateCommunityHouse,
getClearHouseDeatilById
}
// 消息列表
function getIntelligentMessage(param){
@ -111,3 +115,19 @@ function resiEdit (parm) {
function getSituation () {
return fly.get(`actual/base/wxcollect/situation`)
}
// 生成房屋码
function getHouseCoding (id) {
return fly.post(`actual/base/communityHouse/getHouseCoding/${id}`)
}
// 房屋新增
function saveCommunityHouse (parm) {
return fly.post(`actual/base/communityHouse/saveCommunityHouse`,parm)
}
// 房屋详情
function getClearHouseDeatilById (id) {
return fly.post(`actual/base/communityHouse/getClearHouseDeatilById/${id}`)
}
// 房屋编辑
function updateCommunityHouse (parm) {
return fly.post(`actual/base/communityHouse/updateCommunityHouse`,parm)
}
Loading…
Cancel
Save