Browse Source

Merge branch 'work_tab_bar' into data-page

work_tab_bar
mk 2 years ago
parent
commit
5c135b728d
  1. 95
      pages/resiAndHouse/resiAndHouse.js
  2. 27
      pages/resiAndHouse/resiAndHouse.wxml
  3. 10
      pages/resiAndHouse/resiAndHouse.wxss

95
pages/resiAndHouse/resiAndHouse.js

@ -7,6 +7,7 @@ Page({
* 页面的初始数据
*/
data: {
selectValue:0,
activeType:0,
tabList:[],
tableData:[],
@ -24,11 +25,17 @@ Page({
}
],
selectedText:[],
pageNo:1,
pageSize:10,
lowerThreshold:'10',
loadMoreVisible:false,
loadMoreType: "none",
selectVale:'resi',
keyWord:'',
angencyId:null,
category:'',
searchOrgIdPath:'',
angencyList:[],//组织树
showAngenCascader:false,
fieldName:{text: 'agencyName', value: 'agencyId', children: 'subAgencyList' }
@ -38,7 +45,9 @@ Page({
*/
onLoad(options) {
this.setData({
angencyId:App.globalData.user.agencyId
angencyId:App.globalData.user.agencyId,
angencyName:App.globalData.user.angencyName,
})
this.getAgencygridtree()
this.getAllOrgCategoryCount()
@ -56,7 +65,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.onAllSearchMessage()
},
/**
@ -77,7 +86,7 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
this.getIntelligentMessage()
},
/**
@ -168,6 +177,7 @@ Page({
url: '/subpages/OCRCard/pages/index/index',
})
},
getAllOrgCategoryCount(){
let parm ={
residentInfo:this.data.keyWord,
@ -178,8 +188,9 @@ Page({
api.getAllOrgCategoryCount(parm).then(res=>{
if(res.code == 0){
this.setData({
tabList:res.data.filter(item=>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=>{
console.log(err);
@ -193,7 +204,14 @@ Page({
})
},
onFinish(e){
console.log(e);
const selectedValues = e.detail
console.log("123",selectedValues)
this.setData({
angencyName:selectedValues.selectedOptions.map(item=>item.agencyName).join(","),
showCascader: false
});
console.log('123121',e.detail.selectedOptions);
},
onClose(){
this.setData({
@ -218,18 +236,73 @@ Page({
},
onAllSearchMessage(){
let parm ={
searchKey:" ",
searchKey:this.data.keyWord,
pageSize:this.data.pageSize,
pageNo:this.data.pageNo
pageNo:this.data.pageNo,
category:this.data.category,
searchOrgIdPath:this.data.searchOrgIdPath
}
getResidentBaseInfo(parm).then(res=>{
console.log("11111",res);
this.setData({
'resiList':res.data.list
})
console.log("123",this.resiList);
}).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()
}
},
onAllSearchMessage(){
this.setData({
// 加载更多为true
loadMoreVisible: true,
nodata: false,
loadMoreType: "more",
})
const parm={
searchKey:this.data.keyWord,
pageSize:this.data.pageSize,
pageNo:this.data.pageNo,
category:this.data.category,
searchOrgIdPath:this.data.searchOrgIdPat
}
getResidentBaseInfo(parm).then(res=>{
// res.data.list = res.data.list.map(item => {
// if (item.createdByName && item.createdByName.length >= 3) {
// item.createdByName = item.createdByName.slice(1,3);
// }
// return item;
// });
this.setData({
loadMoreType: res.data.list.length === this.data.pageSize ? 'more' : 'none',
resiList: this.data.resiList.concat(res.data.list),
})
console.log(resiList)
if (this.data.resiList.length == 0) {
this.setData({
loadMoreVisible: false,
nodata: true
})
}
}).catch(err=>{
console.log(err);
this.setData({
loadMoreVisible: false,
nodata: true,
})
})
},
})

27
pages/resiAndHouse/resiAndHouse.wxml

@ -24,14 +24,14 @@
</view>
</view>
</view>
</view>
</view>
<view class="group_2" wx:if="{{selectVale === 'resi'}}">
<view class="section_2">
<view class="box_16">
<text lines="1" class="text_4">海伦路社区重庆南路89号</text>
<text lines="1" class="text_4" wx:for="{{selectedText}}" wx:key="{{index}}">{{agencyName}}</text>
<view class="image-text_9">
<text lines="1" class="text_5" bind:tap="handelClickShowTree">切换</text>
<image src="../../images/swapHorizontal.png" class="image_8"></image>
@ -46,7 +46,9 @@
</view>
</view>
<view class="form_item" wx:for="{{resiList}}" :wx:key="{{index}}" bind:tap="toResiDetail" data-resiId="{{item.resiId}}">
<view class="content">
<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="box_18">
<text lines="1" class="text_16">{{item.name}}</text>
<view class="resi_tag">
@ -61,13 +63,13 @@
</view>
</view>
<view class="box_19">
<view class="text-wrapper_10" wx:if="{{item.nationalityName}}">
<view class="text-wrapper_10" >
<text lines="1" class="text_21">国籍:</text>
<text lines="1" class="text_22">{{item.nationalityName || "--"}}</text>
</view>
<view class="text-wrapper_11" wx:if="{{item.nationName}}">
<view class="text-wrapper_11" >
<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>
<view class="text-wrapper_12">
@ -83,17 +85,22 @@
<text lines="1" class="text_30">地址:</text>
<text lines="1" class="text_31">{{item.agencyName || ''}} {{item.homeName || ''}}</text>
</view>
<view class="text-wrapper_15" wx:if="{{item.updatedTime}}">
<view class="text-wrapper_15" >
<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>
</scroll-view>
</view>
</view>
</view>
</view>
<custom-tab-bar></custom-tab-bar>
<van-popup show="{{ showAngenCascader }}" round position="bottom">
<van-cascader
field-names="{{fieldName}}"
field-names="{{fieldName}}"
wx:if="{{ showAngenCascader }}"
value="{{ cascaderValue }}"
title="请选择"

10
pages/resiAndHouse/resiAndHouse.wxss

@ -140,7 +140,6 @@ page{
width: 710rpx;
height: 100%;
display: flex;
overflow-y: scroll;
flex-direction: column;
margin: 21rpx 0 0 20rpx;
}
@ -1089,6 +1088,15 @@ 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);
}
.text_61 {
width: 639rpx;
height: 28rpx;

Loading…
Cancel
Save