Browse Source

居民搜索逻辑调整

work_tab_bar
mk 1 year ago
parent
commit
603a38b966
  1. 288
      pages/resiAndHouse/resiAndHouse.js
  2. 2
      pages/resiAndHouse/resiAndHouse.json
  3. 42
      pages/resiAndHouse/resiAndHouse.wxml
  4. 13
      pages/resiAndHouse/resiAndHouse.wxss
  5. 6
      pages/work2/work2.js
  6. 2
      pages/work2/work2.wxml
  7. 1
      pages/work2/work2.wxss
  8. 5
      subpages/searchResult/pages/punchCard/punchCard.js
  9. 4
      subpages/searchResult/pages/punchCard/punchCard.wxml
  10. 4
      subpages/searchResult/pages/punchCard/punchCard.wxss

288
pages/resiAndHouse/resiAndHouse.js

@ -1,5 +1,9 @@
// pages/resiAndHouse/resiAndHouse.js // pages/resiAndHouse/resiAndHouse.js
import api, {getAllOrgCategoryCount,getResidentBaseInfo,getCommunityHouse} from "../../utils/api" import api, {
getAllOrgCategoryCount,
getResidentBaseInfo,
getCommunityHouse
} from "../../utils/api"
const App = getApp() const App = getApp()
Page({ Page({
@ -7,54 +11,56 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
selectValue:0, activeType: 0,
activeType:0, tabList: [],
tabList:[], tableData: [],
tableData:[], resiList: [{
resiList:[ name: '',
{ resiTags: [''],
name:'', nationalityName: '',
resiTags:[''], nationName: '',
nationalityName:'', mobile: '',
nationName:'', idNum: '',
mobile:'', agencyName: '',
idNum:'', homeName: '',
agencyName:'', updatedTime: ''
homeName:'',
updatedTime:''
} }
], ],
selectedText:[], pageNo: 1,
pageNo:1, pageSize: 10,
pageSize:10, lowerThreshold: '10',
lowerThreshold:'10', loadMoreVisible: false,
cascaderValue:'同德路社区居委会',
loadMoreVisible:false,
loadMoreType: "none", loadMoreType: "none",
selectVale:'resi', nodata:false,
keyWord:'', selectVale: 'resi',
angencyId:null, keyWord: null,
category:'', angencyId: null,
searchOrgIdPath:'', category: null,
angencyList:[],//组织树 searchOrgIdPath: '',
showAngenCascader:false, angencyList: [], //组织树
fieldName:{text: 'agencyName', value: 'agencyId', children: 'subAgencyList' } showAngenCascader: false,
agencyName:'',
fieldName: {
text: 'agencyName',
value: 'agencyId',
children: 'subAgencyList'
}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.setData({ this.setData({
angencyId:App.globalData.user.agencyId, searchOrgIdPath: App.globalData.user.agencyId,
angencyName:App.globalData.user.angencyName, cascaderName: App.globalData.user.agencyName,
agencyName: App.globalData.user.agencyName
}) })
this.getAgencygridtree() this.getAgencygridtree()
this.getAllOrgCategoryCount() this.getAllOrgCategoryCount()
this.onSearchMessage() this.getTableData()
}, },
// //
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
@ -66,7 +72,6 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.onAllSearchMessage()
}, },
/** /**
@ -103,220 +108,161 @@ Page({
onShareAppMessage() { onShareAppMessage() {
}, },
toOCRCard(){ toOCRCard() {
wx.navigateTo({ wx.navigateTo({
url: '/subpages/OCRCard/pages/index/index', url: '/subpages/OCRCard/pages/index/index',
}) })
}, },
handelClickTab(e){ handelClickTab(e) {
this.setData({ this.setData({
activeType: e.currentTarget.dataset.index activeType: e.currentTarget.dataset.index,
category: e.currentTarget.dataset.category
}) })
this.getTableData()
}, },
handelBlurKeyWord(e){ handelBlurKeyWord(e) {
this.setData({ this.setData({
keyWord:e.detail.value keyWord: e.detail.value
}) })
}, },
handelClickSearchType(e){ handelClickSearchType(e) {
this.setData({ this.setData({
selectVale:e.currentTarget.dataset.type selectVale: e.currentTarget.dataset.type
}) })
}, },
handelClickShowTree(){ handelClickShowTree() {
this.setData({ this.setData({
showAngenCascader:true showAngenCascader: true
}) })
}, },
// 组织树 // 组织树
getAgencygridtree() { getAgencygridtree() {
// let parm ={
// agencyId:this.data.angencyId,
// purpose:'query'
// }
api.getAgencygridtree().then(res => { api.getAgencygridtree().then(res => {
this.setData({ this.setData({
angencyList: [res.data], angencyList: [res.data],
}) })
console.log('zuzhishu',angencyList)
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}) })
}, },
async handelClickSearch(){ async handelClickSearch() {
this.setData({
loadMoreVisible: true,
nodata: false,
loadMoreType: "more",
})
let parm ={
searchKey:this.data.keyWord,
pageSize:this.data.pageSize,
pageNo:this.data.pageNo
}
let {data,code,msg} = await getResidentBaseInfo(parm)
if(code == 0){
console.log(this.data.tableData),
this.setData({
loadMoreType:data.list.length === this.data.pageSize ? 'more' : 'none',
tableData: this.data.tableData.concat(data.list),
})
if (this.data.tableData.length == 0) {
this.setData({ this.setData({
loadMoreVisible: false, pageNo:1,
nodata: true tableData:[]
})
}
}else{
this.setData({
loadMoreVisible: false,
nodata: true,
}) })
} this.getTableData()
}, },
handelClickToOcr(){ handelClickToOcr() {
wx.navigateTo({ wx.navigateTo({
url: '/subpages/OCRCard/pages/index/index', url: '/subpages/OCRCard/pages/index/index',
}) })
}, },
// 获取居民概览
getAllOrgCategoryCount(){ getAllOrgCategoryCount() {
let parm ={ let parm = {
residentInfo:this.data.keyWord, residentInfo: this.data.keyWord,
agencyId: this.data.searchOrgIdPath, agencyId: this.data.searchOrgIdPath,
orgId:'e723c89ee5ed0cc382576833e7c6a220', orgId: 'e723c89ee5ed0cc382576833e7c6a220',
level:'community' level: 'community'
}
api.getAllOrgCategoryCount(parm).then(res => {
if (res.code == 0) {
res.data.forEach(item => {
if (item.categoryName === '党员') {
item.category = 'party'
} else if (item.categoryName === '关注人群') {
item.category = 'attention'
} else if (item.categoryName === '特殊人群') {
item.category = 'special'
} else if (item.categoryName === '非健康人群') {
item.category = 'health'
} }
api.getAllOrgCategoryCount(parm).then(res=>{ })
if(res.code == 0){
this.setData({ this.setData({
tabList:res.data.filter(item=>item.categoryName =='党员'||item.categoryName =='关注人群' || item.categoryName =='特殊人群'||item.categoryName =='非健康人群'||item.categoryName =='居民') tabList: res.data.filter(item => item.categoryName == '党员' || item.categoryName == '关注人群' || item.categoryName == '特殊人群' || item.categoryName == '非健康人群' || item.categoryName == '居民')
}) })
} }
}).catch(err=>{ }).catch(err => {
console.log(err); console.log(err);
}) })
}, },
toResiDetail(e){ toResiDetail(e) {
// '1765976717767618562' // '1765976717767618562'
console.log(e); console.log(e);
wx.navigateTo({ wx.navigateTo({
url: `/subpages/searchResult/pages/punchCard/punchCard?resiId=${e.currentTarget.dataset.resiid}`, url: `/subpages/searchResult/pages/punchCard/punchCard?resiId=${e.currentTarget.dataset.resiid}`,
}) })
}, },
onFinish(e){ onFinish(e) {
const selectedValues = e.detail.type
console.log("123",selectedValues)
this.setData({
cascaderValue:selectedValues,
showAngenCascader: false
});
let parm={
searchOrgIdPath:e.detail.value,
searchKey:this.data.keyWord,
pageSize:this.data.pageSize,
pageNo:this.data.pageNo
}
getResidentBaseInfo(parm).then(res=>{
this.setData({
'resiList':res.data.list
})
})
},
onClose(){
this.setData({ this.setData({
showAngenCascader:false pageNo: 1,
searchOrgIdPath:e.detail.selectedOptions[e.detail.selectedOptions.length-1].agencyId,
cascaderName:e.detail.selectedOptions.map(item=>item.agencyName).join(',')
}) })
this.getTableData()
}, },
onSearchMessage(){ onClose() {
let parm ={
searchKey:this.data.keyWord,
pageSize:this.data.pageSize,
pageNo:this.data.pageNo
}
getResidentBaseInfo(parm).then(res=>{
console.log("11111",res);
this.setData({ this.setData({
'resiList':res.data.list showAngenCascader: false
})
console.log("123",this.resiList);
}).catch(err=>{
console.log(err);
}) })
}, },
onAllSearchMessage(){
let parm ={
searchKey:this.data.keyWord,
pageSize:this.data.pageSize,
pageNo:this.data.pageNo,
category:this.data.category,
searchOrgIdPath:this.data.searchOrgIdPath
}
getResidentBaseInfo(parm).then(res=>{
this.setData({ onScrollToLower(e) {
'resiList':res.data.list
})
}).catch(err=>{
console.log(err);
})
},
onScrollToLower(e){
console.log("111"+e)
if (this.data.loadMoreType === 'more') { if (this.data.loadMoreType === 'more') {
this.setData({ this.setData({
loadMoreVisible: true, loadMoreVisible: true,
}) })
this.data.pageNo += 1 this.data.pageNo += 1
this.onAllSearchMessage() this.getTableData()
} }
}, },
onAllSearchMessage(){ getTableData: async function() {
try{
this.setData({ this.setData({
// 加载更多为true
loadMoreVisible: true, loadMoreVisible: true,
nodata: false, nodata: false,
loadMoreType: "more", loadMoreType: "more",
}) })
const parm={ let parm = {
searchKey:this.data.keyWord, searchKey: this.data.keyWord,
pageSize:this.data.pageSize, pageSize: this.data.pageSize,
pageNo:this.data.pageNo, pageNo: this.data.pageNo,
category:this.data.category, category:this.data.category,
searchOrgIdPath:this.data.searchOrgIdPat searchOrgIdPath:this.data.searchOrgIdPath
}
getResidentBaseInfo(parm).then(res=>{
res.data.resiList = res.data.resiList.map(item => {
if (item.createdByName && item.createdByName.length >= 3) {
item.createdByName = item.createdByName.slice(1,3);
} }
return item; let {
}); data,
code,
msg
} = await getResidentBaseInfo(parm)
if (code == 0) {
this.setData({ this.setData({
loadMoreType: res.data.resiList.length === this.data.pageSize ? 'more' : 'none', loadMoreType: data.list.length === this.data.pageSize ? 'more' : 'none',
resiList: this.data.resiList.concat(res.data.list), tableData: this.data.tableData.concat(data.list),
}) })
if(TouchList) if (this.data.tableData.length == 0) {
console.log(resiList)
if (this.data.resiList.length == 0) {
this.setData({ this.setData({
loadMoreVisible: false, loadMoreVisible: false,
nodata: true nodata: true
}) })
} }
}).catch(err=>{ } else {
console.log(err);
this.setData({ this.setData({
loadMoreVisible: false, loadMoreVisible: false,
nodata: true, nodata: true,
loadMoreType:'none'
}) })
}
} catch(err) {
console.log(err);
this.setData({
loadMoreVisible: false,
nodata: true,
loadMoreType:'none'
}) })
}
}, },
}) })

2
pages/resiAndHouse/resiAndHouse.json

@ -1,6 +1,8 @@
{ {
"usingComponents": { "usingComponents": {
"custom-tab-bar":"../../components/custom-tab-bar", "custom-tab-bar":"../../components/custom-tab-bar",
"load-more": "../../components/loadMore/loadMore",
"no-data": "../../components/noData/nodata",
"van-tab": "@vant/weapp/tab/index", "van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index", "van-tabs": "@vant/weapp/tabs/index",
"van-cascader": "@vant/weapp/cascader/index", "van-cascader": "@vant/weapp/cascader/index",

42
pages/resiAndHouse/resiAndHouse.wxml

@ -2,7 +2,7 @@
<view class="group_1"> <view class="group_1">
<view class="block_1"> <view class="block_1">
<view class="box_15"> <view class="box_15">
<text lines="1" class="text_1">海伦路街道</text> <text lines="1" class="text_1">{{agencyName}}</text>
</view> </view>
<view class="text-wrapper_30"> <view class="text-wrapper_30">
<view bind:tap="handelClickSearchType" data-type="resi"> <view bind:tap="handelClickSearchType" data-type="resi">
@ -19,8 +19,8 @@
<image src="../../images/work/search.png" mode="" class="search_img" /> <image src="../../images/work/search.png" mode="" class="search_img" />
<input type="text" placeholder="姓名/手机/身份证" bindinput="handelBlurKeyWord" bindblur="handelBlurKeyWord" value="{{keyWord}}" /> <input type="text" placeholder="姓名/手机/身份证" bindinput="handelBlurKeyWord" bindblur="handelBlurKeyWord" value="{{keyWord}}" />
<view class="btn_box" bind:tap="handelClickSearch"> <view class="btn_box" bind:tap="handelClickSearch">
<image src="../../images/cardIcon.png" mode="" class="OCR_img" bind:tap="handelClickToOcr"/> <image src="../../images/cardIcon.png" mode="" class="OCR_img" bind:tap="handelClickToOcr" />
<text bindtap="onSearchMessage">搜索</text> <text>搜索</text>
</view> </view>
</view> </view>
@ -31,7 +31,7 @@
<view class="section_2"> <view class="section_2">
<view class="box_16"> <view class="box_16">
<text lines="1" class="text_4">{{cascaderValue}}</text> <text lines="1" class="text_4">{{cascaderName}}</text>
<view class="image-text_9"> <view class="image-text_9">
<text lines="1" class="text_5" bind:tap="handelClickShowTree">切换</text> <text lines="1" class="text_5" bind:tap="handelClickShowTree">切换</text>
<image src="../../images/swapHorizontal.png" class="image_8"></image> <image src="../../images/swapHorizontal.png" class="image_8"></image>
@ -39,20 +39,19 @@
</view> </view>
<view class="box_17"> <view class="box_17">
<view class="tabs"> <view class="tabs">
<view class="tab_item {{activeType === index ? 'border_bto' : ''}}" wx:for="{{tabList}}" bind:tap="handelClickTab" data-index="{{index}}"> <view class="tab_item {{activeType === index ? 'border_bto' : ''}}" wx:for="{{tabList}}" bind:tap="handelClickTab" data-index="{{index}}" data-category="{{item.category}}">
<view class="num">{{item.categoryCount}}</view> <view class="num">{{item.categoryCount}}</view>
<view class="name" style="color:{{activeType === index?'#3974f6':'#666666'}}">{{item.categoryName}}</view> <view class="name" style="color:{{activeType === index?'#3974f6':'#666666'}}">{{item.categoryName}}</view>
</view> </view>
</view> </view>
</view> </view>
<view class="content">
<scroll-view class="scroll" scroll-y="{{true}}" lower-threshold="{{ lowerThreshold }}" bindscrolltolower="onScrollToLower"> <scroll-view class="scroll" scroll-y="{{true}}" lower-threshold="{{ lowerThreshold }}" bindscrolltolower="onScrollToLower">
<view class="form_item" wx:for="{{resiList}}" :wx:key="{{index}}" bind:tap="toResiDetail" data-resiId="{{item.resiId}}"> <view class="form_item" wx:for="{{tableData}}" :wx:key="{{index}}" bind:tap="toResiDetail" data-resiId="{{item.resiId}}">
<view class="box_18"> <view class="box_18">
<text lines="1" class="text_16">{{item.name}}</text> <text lines="1" class="text_16">{{item.name}}</text>
<view class="resi_tag"> <view class="resi_tag" wx:if="{{item.categoryInfo.categoryNames}}">
<view class="text-wrapper_8" wx:for="{{item.categoryInfo.categoryNames}}" wx:for-item="itemC"> <view class="text-wrapper_8" wx:for="{{item.categoryInfo.categoryNames.split(',')}}" wx:for-item="itemC">
{{itemC}} {{itemC}}
</view> </view>
</view> </view>
@ -63,11 +62,11 @@
</view> </view>
</view> </view>
<view class="box_19"> <view class="box_19">
<view class="text-wrapper_10" > <view class="text-wrapper_10">
<text lines="1" class="text_21">国籍:</text> <text lines="1" class="text_21">国籍:</text>
<text lines="1" class="text_22">{{item.nationalityName || "--"}}</text> <text lines="1" class="text_22">{{item.nationalityName || "--"}}</text>
</view> </view>
<view class="text-wrapper_11" > <view class="text-wrapper_11">
<text lines="1" class="text_23">民族:</text> <text lines="1" class="text_23">民族:</text>
<text lines="1" class="text_24">{{item.nationName || '--'}}</text> <text lines="1" class="text_24">{{item.nationName || '--'}}</text>
</view> </view>
@ -85,28 +84,17 @@
<text lines="1" class="text_30">地址:</text> <text lines="1" class="text_30">地址:</text>
<text lines="1" class="text_31">{{item.agencyName || ''}} {{item.homeName || ''}}</text> <text lines="1" class="text_31">{{item.agencyName || ''}} {{item.homeName || ''}}</text>
</view> </view>
<view class="text-wrapper_15" > <view class="text-wrapper_15">
<text lines="1" class="text_32">最新更新时间:</text> <text lines="1" class="text_32">最新更新时间:</text>
<text lines="1" decode="true" class="text_33">{{item.updatedTime|| '--'}}</text> <text lines="1" decode="true" class="text_33">{{item.updatedTime|| '--'}}</text>
</view> </view>
</view> </view>
<load-more loadVisible="{{loadMoreVisible}}" loadType="{{loadMoreType}}"></load-more>
<no-data isShow="{{nodata}}" wx:if="{{nodata}}"></no-data>
</scroll-view> </scroll-view>
</view> </view>
</view>
</view> </view>
<custom-tab-bar></custom-tab-bar> <custom-tab-bar></custom-tab-bar>
<van-popup show="{{ showAngenCascader }}" round position="bottom"> <van-popup show="{{ showAngenCascader }}" round position="bottom">
<van-cascader <van-cascader field-names="{{fieldName}}" wx:if="{{showAngenCascader}}" value="{{ searchOrgIdPath }}" title="请选择" options="{{ angencyList }}" bind:close="onClose" bind:finish="onFinish" />
field-names="{{fieldName}}"
wx:if="{{ showAngenCascader }}"
value="{{ cascaderValue }}"
title="请选择"
options="{{ angencyList }}"
bind:close="onClose"
bind:finish="onFinish"
/>
</van-popup> </van-popup>

13
pages/resiAndHouse/resiAndHouse.wxss

@ -152,7 +152,6 @@ page{
margin-top: 20rpx; margin-top: 20rpx;
} }
.text_4 { .text_4 {
width: 401rpx;
overflow-wrap: break-word; overflow-wrap: break-word;
color: rgba(51,51,51,1); color: rgba(51,51,51,1);
font-size: 36rpx; font-size: 36rpx;
@ -161,6 +160,7 @@ page{
text-align: left; text-align: left;
white-space: nowrap; white-space: nowrap;
line-height: 52rpx; line-height: 52rpx;
text-align: center;
margin-right:20rpx ; margin-right:20rpx ;
} }
@ -1088,14 +1088,9 @@ page{
line-height: 40rpx; line-height: 40rpx;
margin: 20rpx 0 0 31rpx; margin: 20rpx 0 0 31rpx;
} }
.content{
width: 100%; .scroll {
padding:0 20rpx ; height: calc(100vh - 750rpx);
margin-top: 20rpx;
box-sizing: border-box;
}
.content .scroll {
height: calc(100vh - 130rpx);
} }
.text_61 { .text_61 {
width: 639rpx; width: 639rpx;

6
pages/work2/work2.js

@ -1,4 +1,6 @@
// pages/work2/work2.js // pages/work2/work2.js
const App = getApp()
Page({ Page({
/** /**
@ -12,7 +14,9 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.setData({
agencyName:App.globalData.user.agencyName,
})
}, },
/** /**

2
pages/work2/work2.wxml

@ -3,7 +3,7 @@
<view class="header"> <view class="header">
<view> <view>
<image src="/images/work2/Header.png "class="image_1" ></image> <image src="/images/work2/Header.png "class="image_1" ></image>
<text lines="1" class="text_1">海伦路街道</text> <text lines="1" class="text_1">{{agencyName}}</text>
</view> </view>
</view> </view>
<view class="box_2"> <view class="box_2">

1
pages/work2/work2.wxss

@ -24,6 +24,7 @@
display:flex; display:flex;
flex-direction: row; flex-direction: row;
justify-items:self-end; justify-items:self-end;
align-items: center;
margin: 130rpx 0 0 29rpx; margin: 130rpx 0 0 29rpx;
width: 100%; width: 100%;
} }

5
subpages/searchResult/pages/punchCard/punchCard.js

@ -599,9 +599,8 @@ Page({
try { try {
let res = await api.getResiInfo(this.data.resiId); let res = await api.getResiInfo(this.data.resiId);
let marriageName = '--' let marriageName = '--'
if (res.data.baseInfoDto.categoryInfo.categoryNames) { if (res.data.residentCategoryStr) {
res.data.baseInfoDto.categoryInfo.categoryNames = res.data.baseInfoDto.categoryInfo.categoryNames.join(',') res.data.baseInfoDto.categoryInfo.categoryNames = res.data.residentCategoryStr.split(',')
} }
if(res.data.familyInfoDto.marriage){ if(res.data.familyInfoDto.marriage){
marriageName = this.data.marriageList.filter(item=>item.value == res.data.familyInfoDto.marriage)[0].label marriageName = this.data.marriageList.filter(item=>item.value == res.data.familyInfoDto.marriage)[0].label

4
subpages/searchResult/pages/punchCard/punchCard.wxml

@ -18,8 +18,8 @@
</view> </view>
<view class="form"> <view class="form">
<view class="form_label">地址:</view> <view class="form_label">地址:</view>
<view class="form_value">{{form <view class="form_value"><text >{{form
.resideInfoDtos[0].agencyName + form.resideInfoDtos[0].homeName}}</view> .resideInfoDtos[0].agencyName}}</text>{{form.resideInfoDtos[0].homeName}}</view>
</view> </view>
<view class="form"> <view class="form">
<view class="form_label">创建时间:</view> <view class="form_label">创建时间:</view>

4
subpages/searchResult/pages/punchCard/punchCard.wxss

@ -201,7 +201,9 @@ page {
margin-top: 20rpx; margin-top: 20rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.top .left .tags::-webkit-scrollbar {
display: none;
}
.top .left .tags .tag { .top .left .tags .tag {
background-color: rgba(236, 236, 236, 0.500000); background-color: rgba(236, 236, 236, 0.500000);
border-radius: 4rpx; border-radius: 4rpx;

Loading…
Cancel
Save