From 603a38b9660398e6ed059f9b039aae4d2c535bb6 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Mon, 1 Apr 2024 12:57:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=85=E6=B0=91=E6=90=9C=E7=B4=A2=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/resiAndHouse/resiAndHouse.js | 522 ++++++++---------- pages/resiAndHouse/resiAndHouse.json | 2 + pages/resiAndHouse/resiAndHouse.wxml | 112 ++-- pages/resiAndHouse/resiAndHouse.wxss | 13 +- pages/work2/work2.js | 6 +- pages/work2/work2.wxml | 2 +- pages/work2/work2.wxss | 1 + .../searchResult/pages/punchCard/punchCard.js | 5 +- .../pages/punchCard/punchCard.wxml | 4 +- .../pages/punchCard/punchCard.wxss | 4 +- 10 files changed, 304 insertions(+), 367 deletions(-) diff --git a/pages/resiAndHouse/resiAndHouse.js b/pages/resiAndHouse/resiAndHouse.js index 21663ed..83c037e 100644 --- a/pages/resiAndHouse/resiAndHouse.js +++ b/pages/resiAndHouse/resiAndHouse.js @@ -1,322 +1,268 @@ // pages/resiAndHouse/resiAndHouse.js -import api, {getAllOrgCategoryCount,getResidentBaseInfo,getCommunityHouse} from "../../utils/api" +import api, { + getAllOrgCategoryCount, + getResidentBaseInfo, + getCommunityHouse +} from "../../utils/api" const App = getApp() Page({ - /** - * 页面的初始数据 - */ - data: { - selectValue:0, - activeType:0, - tabList:[], - tableData:[], - resiList:[ - { - name:'', - resiTags:[''], - nationalityName:'', - nationName:'', - mobile:'', - idNum:'', - agencyName:'', - homeName:'', - updatedTime:'' - } - - ], - selectedText:[], - pageNo:1, - pageSize:10, - lowerThreshold:'10', - cascaderValue:'同德路社区居委会', - loadMoreVisible:false, - loadMoreType: "none", - selectVale:'resi', - keyWord:'', - angencyId:null, - category:'', - searchOrgIdPath:'', - angencyList:[],//组织树 - showAngenCascader:false, - fieldName:{text: 'agencyName', value: 'agencyId', children: 'subAgencyList' } - }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - this.setData({ - angencyId:App.globalData.user.agencyId, - angencyName:App.globalData.user.angencyName, - - }) - this.getAgencygridtree() - this.getAllOrgCategoryCount() - this.onSearchMessage() - }, -// - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { + /** + * 页面的初始数据 + */ + data: { + activeType: 0, + tabList: [], + tableData: [], + resiList: [{ + name: '', + resiTags: [''], + nationalityName: '', + nationName: '', + mobile: '', + idNum: '', + agencyName: '', + homeName: '', + updatedTime: '' + } - }, + ], + pageNo: 1, + pageSize: 10, + lowerThreshold: '10', + loadMoreVisible: false, + loadMoreType: "none", + nodata:false, + selectVale: 'resi', + keyWord: null, + angencyId: null, + category: null, + searchOrgIdPath: '', + angencyList: [], //组织树 + showAngenCascader: false, + agencyName:'', + fieldName: { + text: 'agencyName', + value: 'agencyId', + children: 'subAgencyList' + } + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + searchOrgIdPath: App.globalData.user.agencyId, + cascaderName: App.globalData.user.agencyName, + agencyName: App.globalData.user.agencyName + }) + this.getAgencygridtree() + this.getAllOrgCategoryCount() + this.getTableData() + }, + // + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - this.onAllSearchMessage() - }, + }, - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + }, - }, + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { + }, - }, + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - this.getIntelligentMessage() - }, + }, - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + this.getIntelligentMessage() + }, - }, + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { + }, - }, - toOCRCard(){ - wx.navigateTo({ - url: '/subpages/OCRCard/pages/index/index', - }) - }, - handelClickTab(e){ - this.setData({ - activeType: e.currentTarget.dataset.index - }) - }, - handelBlurKeyWord(e){ - this.setData({ - keyWord:e.detail.value - }) - }, - handelClickSearchType(e){ - this.setData({ - selectVale:e.currentTarget.dataset.type - }) - }, - handelClickShowTree(){ - this.setData({ - showAngenCascader:true - }) - }, - // 组织树 - getAgencygridtree() { - // let parm ={ - // agencyId:this.data.angencyId, - // purpose:'query' - // } - api.getAgencygridtree().then(res => { - this.setData({ - angencyList: [res.data], - - }) - console.log('zuzhishu',angencyList) - - }).catch(err => { - console.log(err); - }) - }, - 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({ - loadMoreVisible: false, - nodata: true - }) - } - }else{ - this.setData({ - loadMoreVisible: false, - nodata: true, - }) - } - }, - handelClickToOcr(){ - wx.navigateTo({ - url: '/subpages/OCRCard/pages/index/index', - }) - }, + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { - getAllOrgCategoryCount(){ - let parm ={ - residentInfo:this.data.keyWord, - agencyId: this.data.searchOrgIdPath, - orgId:'e723c89ee5ed0cc382576833e7c6a220', - level:'community' - } - api.getAllOrgCategoryCount(parm).then(res=>{ - if(res.code == 0){ - this.setData({ - tabList:res.data.filter(item=>item.categoryName =='党员'||item.categoryName =='关注人群' || item.categoryName =='特殊人群'||item.categoryName =='非健康人群'||item.categoryName =='居民') - }) - - } - }).catch(err=>{ - console.log(err); - }) - }, - toResiDetail(e){ - // '1765976717767618562' - console.log(e); - wx.navigateTo({ - url: `/subpages/searchResult/pages/punchCard/punchCard?resiId=${e.currentTarget.dataset.resiid}`, - }) - }, - onFinish(e){ - const selectedValues = e.detail.type - console.log("123",selectedValues) + }, + toOCRCard() { + wx.navigateTo({ + url: '/subpages/OCRCard/pages/index/index', + }) + }, + handelClickTab(e) { + this.setData({ + activeType: e.currentTarget.dataset.index, + category: e.currentTarget.dataset.category + }) + this.getTableData() + }, + handelBlurKeyWord(e) { + this.setData({ + keyWord: e.detail.value + }) + }, + handelClickSearchType(e) { + this.setData({ + selectVale: e.currentTarget.dataset.type + }) + }, + handelClickShowTree() { + this.setData({ + showAngenCascader: true + }) + }, + // 组织树 + getAgencygridtree() { + + api.getAgencygridtree().then(res => { 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 - }) + angencyList: [res.data], }) - }, - onClose(){ + }).catch(err => { + console.log(err); + }) + }, + async handelClickSearch() { + this.setData({ + pageNo:1, + tableData:[] + }) + this.getTableData() + }, + handelClickToOcr() { + wx.navigateTo({ + url: '/subpages/OCRCard/pages/index/index', + }) + }, +// 获取居民概览 + getAllOrgCategoryCount() { + let parm = { + residentInfo: this.data.keyWord, + agencyId: this.data.searchOrgIdPath, + orgId: 'e723c89ee5ed0cc382576833e7c6a220', + 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' + } + }) this.setData({ - showAngenCascader:false + tabList: res.data.filter(item => item.categoryName == '党员' || item.categoryName == '关注人群' || item.categoryName == '特殊人群' || item.categoryName == '非健康人群' || item.categoryName == '居民') }) - }, - onSearchMessage(){ - let parm ={ - searchKey:this.data.keyWord, - pageSize:this.data.pageSize, - pageNo:this.data.pageNo - } - getResidentBaseInfo(parm).then(res=>{ - console.log("11111",res); - this.setData({ - 'resiList':res.data.list - }) - 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({ - 'resiList':res.data.list - }) - }).catch(err=>{ - console.log(err); - }) - }, - onScrollToLower(e){ - console.log("111"+e) - if (this.data.loadMoreType === 'more') { - this.setData({ - loadMoreVisible: true, - }) - this.data.pageNo += 1 - this.onAllSearchMessage() + }).catch(err => { + console.log(err); + }) + }, + toResiDetail(e) { + // '1765976717767618562' + console.log(e); + wx.navigateTo({ + url: `/subpages/searchResult/pages/punchCard/punchCard?resiId=${e.currentTarget.dataset.resiid}`, + }) + }, + onFinish(e) { + this.setData({ + pageNo: 1, + searchOrgIdPath:e.detail.selectedOptions[e.detail.selectedOptions.length-1].agencyId, + cascaderName:e.detail.selectedOptions.map(item=>item.agencyName).join(',') + }) + this.getTableData() + }, + onClose() { + this.setData({ + showAngenCascader: false + }) + }, + + onScrollToLower(e) { - } + if (this.data.loadMoreType === 'more') { + this.setData({ + loadMoreVisible: true, + }) + this.data.pageNo += 1 + this.getTableData() + } }, - onAllSearchMessage(){ + getTableData: async function() { + try{ this.setData({ - // 加载更多为true loadMoreVisible: true, nodata: false, loadMoreType: "more", }) - const parm={ - searchKey:this.data.keyWord, - pageSize:this.data.pageSize, - pageNo:this.data.pageNo, + let parm = { + searchKey: this.data.keyWord, + pageSize: this.data.pageSize, + pageNo: this.data.pageNo, 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({ - loadMoreType: res.data.resiList.length === this.data.pageSize ? 'more' : 'none', - resiList: this.data.resiList.concat(res.data.list), - + loadMoreType: data.list.length === this.data.pageSize ? 'more' : 'none', + tableData: this.data.tableData.concat(data.list), }) - if(TouchList) - console.log(resiList) - if (this.data.resiList.length == 0) { - this.setData({ - loadMoreVisible: false, - nodata: true - }) - } - }).catch(err=>{ - console.log(err); + if (this.data.tableData.length == 0) { this.setData({ - loadMoreVisible: false, - nodata: true, - }) + loadMoreVisible: false, + nodata: true + }) + } + } else { + this.setData({ + loadMoreVisible: false, + nodata: true, + loadMoreType:'none' + }) + } + } catch(err) { + console.log(err); + this.setData({ + loadMoreVisible: false, + nodata: true, + loadMoreType:'none' }) - }, - - }) \ No newline at end of file + } + }, + +}) \ No newline at end of file diff --git a/pages/resiAndHouse/resiAndHouse.json b/pages/resiAndHouse/resiAndHouse.json index 59d8127..46b3a80 100644 --- a/pages/resiAndHouse/resiAndHouse.json +++ b/pages/resiAndHouse/resiAndHouse.json @@ -1,6 +1,8 @@ { "usingComponents": { "custom-tab-bar":"../../components/custom-tab-bar", + "load-more": "../../components/loadMore/loadMore", + "no-data": "../../components/noData/nodata", "van-tab": "@vant/weapp/tab/index", "van-tabs": "@vant/weapp/tabs/index", "van-cascader": "@vant/weapp/cascader/index", diff --git a/pages/resiAndHouse/resiAndHouse.wxml b/pages/resiAndHouse/resiAndHouse.wxml index 8dee8c4..45a8b85 100644 --- a/pages/resiAndHouse/resiAndHouse.wxml +++ b/pages/resiAndHouse/resiAndHouse.wxml @@ -2,7 +2,7 @@ - 海伦路街道 + {{agencyName}} @@ -19,8 +19,8 @@ - - 搜索 + + 搜索 @@ -28,10 +28,10 @@ - + - {{cascaderValue}} + {{cascaderName}} 切换 @@ -39,74 +39,62 @@ - + {{item.categoryCount}} {{item.categoryName}} - - - - - - {{item.name}} - - - {{itemC}} + + + + + {{item.name}} + + + {{itemC}} + - - - 信息完整度: - 40% + + 信息完整度: + 40% + - - - - 国籍: - {{item.nationalityName || "--"}} + + + 国籍: + {{item.nationalityName || "--"}} + + + 民族: + {{item.nationName || '--'}} + - - 民族: - {{item.nationName || '--'}} + + 电话: + {{item.mobile}} + + + 证件号 + + {{item.idNum}} + + + 地址: + {{item.agencyName || ''}} {{item.homeName || ''}} + + + 最新更新时间: + {{item.updatedTime|| '--'}} - - 电话: - {{item.mobile}} - - - 证件号 - - {{item.idNum}} - - - 地址: - {{item.agencyName || ''}} {{item.homeName || ''}} - - - 最新更新时间: - {{item.updatedTime|| '--'}} - - - - - - - + + + - + - - + + \ No newline at end of file diff --git a/pages/resiAndHouse/resiAndHouse.wxss b/pages/resiAndHouse/resiAndHouse.wxss index 3fee28e..bb52c79 100644 --- a/pages/resiAndHouse/resiAndHouse.wxss +++ b/pages/resiAndHouse/resiAndHouse.wxss @@ -152,7 +152,6 @@ page{ margin-top: 20rpx; } .text_4 { - width: 401rpx; overflow-wrap: break-word; color: rgba(51,51,51,1); font-size: 36rpx; @@ -161,6 +160,7 @@ page{ text-align: left; white-space: nowrap; line-height: 52rpx; + text-align: center; margin-right:20rpx ; } @@ -1088,14 +1088,9 @@ page{ line-height: 40rpx; margin: 20rpx 0 0 31rpx; } - .content{ - width: 100%; - padding:0 20rpx ; - margin-top: 20rpx; - box-sizing: border-box; - } - .content .scroll { - height: calc(100vh - 130rpx); + +.scroll { + height: calc(100vh - 750rpx); } .text_61 { width: 639rpx; diff --git a/pages/work2/work2.js b/pages/work2/work2.js index 46ab0c7..137e2dd 100644 --- a/pages/work2/work2.js +++ b/pages/work2/work2.js @@ -1,4 +1,6 @@ // pages/work2/work2.js +const App = getApp() + Page({ /** @@ -12,7 +14,9 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - + this.setData({ + agencyName:App.globalData.user.agencyName, + }) }, /** diff --git a/pages/work2/work2.wxml b/pages/work2/work2.wxml index dd12468..39c2e3c 100644 --- a/pages/work2/work2.wxml +++ b/pages/work2/work2.wxml @@ -3,7 +3,7 @@ - 海伦路街道 + {{agencyName}} diff --git a/pages/work2/work2.wxss b/pages/work2/work2.wxss index 6ef5b53..f418369 100644 --- a/pages/work2/work2.wxss +++ b/pages/work2/work2.wxss @@ -24,6 +24,7 @@ display:flex; flex-direction: row; justify-items:self-end; + align-items: center; margin: 130rpx 0 0 29rpx; width: 100%; } diff --git a/subpages/searchResult/pages/punchCard/punchCard.js b/subpages/searchResult/pages/punchCard/punchCard.js index 63c7537..2515139 100644 --- a/subpages/searchResult/pages/punchCard/punchCard.js +++ b/subpages/searchResult/pages/punchCard/punchCard.js @@ -599,9 +599,8 @@ Page({ try { let res = await api.getResiInfo(this.data.resiId); let marriageName = '--' - if (res.data.baseInfoDto.categoryInfo.categoryNames) { - res.data.baseInfoDto.categoryInfo.categoryNames = res.data.baseInfoDto.categoryInfo.categoryNames.join(',') - + if (res.data.residentCategoryStr) { + res.data.baseInfoDto.categoryInfo.categoryNames = res.data.residentCategoryStr.split(',') } if(res.data.familyInfoDto.marriage){ marriageName = this.data.marriageList.filter(item=>item.value == res.data.familyInfoDto.marriage)[0].label diff --git a/subpages/searchResult/pages/punchCard/punchCard.wxml b/subpages/searchResult/pages/punchCard/punchCard.wxml index e956373..c79cf04 100644 --- a/subpages/searchResult/pages/punchCard/punchCard.wxml +++ b/subpages/searchResult/pages/punchCard/punchCard.wxml @@ -18,8 +18,8 @@ 地址: - {{form - .resideInfoDtos[0].agencyName + form.resideInfoDtos[0].homeName}} + {{form + .resideInfoDtos[0].agencyName}}{{form.resideInfoDtos[0].homeName}} 创建时间: diff --git a/subpages/searchResult/pages/punchCard/punchCard.wxss b/subpages/searchResult/pages/punchCard/punchCard.wxss index efafa91..993dec2 100644 --- a/subpages/searchResult/pages/punchCard/punchCard.wxss +++ b/subpages/searchResult/pages/punchCard/punchCard.wxss @@ -201,7 +201,9 @@ page { margin-top: 20rpx; box-sizing: border-box; } - +.top .left .tags::-webkit-scrollbar { + display: none; + } .top .left .tags .tag { background-color: rgba(236, 236, 236, 0.500000); border-radius: 4rpx;