Browse Source

代码提交

work_tab_bar
juwei001 1 year ago
parent
commit
dfe56009a6
  1. BIN
      images/house/czMax.png
  2. BIN
      images/house/czMin.png
  3. BIN
      images/house/wcsMax.png
  4. BIN
      images/house/wcsMin.png
  5. BIN
      images/house/xzMax.png
  6. BIN
      images/house/xzMin.png
  7. BIN
      images/house/zzMax.png
  8. BIN
      images/house/zzMin.png
  9. 271
      pages/resiAndHouse/resiAndHouse.js
  10. 59
      pages/resiAndHouse/resiAndHouse.wxml
  11. 785
      pages/resiAndHouse/resiAndHouse.wxss
  12. 3
      project.config.json
  13. 26
      utils/api.js
  14. 4
      utils/config.js

BIN
images/house/czMax.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

BIN
images/house/czMin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B

BIN
images/house/wcsMax.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

BIN
images/house/wcsMin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

BIN
images/house/xzMax.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

BIN
images/house/xzMin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

BIN
images/house/zzMax.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

BIN
images/house/zzMin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

271
pages/resiAndHouse/resiAndHouse.js

@ -1,7 +1,10 @@
// pages/resiAndHouse/resiAndHouse.js
import api, {
getAllOrgCategoryCount,
getResidentBaseInfo,
getTopTree,
getNextTree,
houseSearch,
allOrgHouseInfo,
getCommunityHouse
} from "../../utils/api"
const App = getApp()
@ -14,6 +17,7 @@ Page({
activeType: 0,
tabList: [],
tableData: [],
tableFwData: [],
resiList: [{
name: '',
resiTags: [''],
@ -31,21 +35,52 @@ Page({
pageSize: 10,
lowerThreshold: '10',
loadMoreVisible: false,
loadFwMoreVisible: false,
loadMoreType: "none",
nodata:false,
loadFwMoreType: "none",
nodata: false,
selectVale: 'resi',
keyWord: '',
keyWord: '1',
angencyId: null,
category: null,
searchOrgIdPath: '',
cascaderFwValue: '',
angencyList: [], //组织树
angencyFwList: [], //房屋组织树
showAngenCascader: false,
agencyName:'',
agencyName: '',
fieldName: {
text: 'agencyName',
value: 'agencyId',
children: 'subAgencyList'
}
},
fieldNameFw: {
text: 'label',
value: 'id',
children: 'children'
},
cascaderNameFw: null,
showFw: false,
params: {
agencyId: '',
orgId: '',
level: 'district',
orgInfo:''
},
params1: {
"searchKey": "",
"pageSize": 50,
"pageNo": 1,
"searchOrgIdPath": "7b6f9a9f9f38d5f9fa7ce94a93d6eb28",
},
activeFwType: 0,
fwTypes: [
{ name: '房屋', num: 0, value: '' },
{ name: '自住', num: 0, value: '0' },
{ name: '出租', num: 0, value: '1' },
{ name: '闲置', num: 0, value: '2' },
{ name: '未出售', num: 0, value: '3' },
]
},
/**
* 生命周期函数--监听页面加载
@ -54,11 +89,23 @@ Page({
this.setData({
searchOrgIdPath: App.globalData.user.agencyId,
cascaderName: App.globalData.user.agencyName,
agencyName: App.globalData.user.agencyName
cascaderNameFw: App.globalData.user.agencyName,
agencyName: App.globalData.user.agencyName,
params: {
...this.data.params,
agencyId:App.globalData.user.agencyId,
orgId:App.globalData.user.agencyId
},
params1: {
...this.data.params1,
searchOrgIdPath:App.globalData.user.agencyId,
}
})
this.getTableFwData()
this.getAgencygridtree()
this.getAllOrgCategoryCount()
this.getTableData()
this.getTopTreeData()
},
//
/**
@ -117,15 +164,119 @@ Page({
this.setData({
activeType: e.currentTarget.dataset.index,
category: e.currentTarget.dataset.category,
tableData:[]
tableData: []
})
this.getTableData()
},
handelClickTabFw(e) {
this.setData({
activeFwType: e.currentTarget.dataset.index,
// category: e.currentTarget.dataset.category,
tableFwData: [],
params1: {
...this.data.params1,
pageNo: 1,
"category": e.currentTarget.dataset.category,
},
})
this.getTableFwData()
},
handelBlurKeyWord(e) {
this.setData({
keyWord: e.detail.value
})
},
getTopTreeData() {
getTopTree().then(res => {
const arr = res.data.children.map(item => {
return {
...item,
children: []
}
})
this.setData({
angencyFwList: [{ ...res.data, children: arr }],
})
})
},
getTreeFun(id, arr, data) {
return arr.map(item => {
if (id == item.id) {
return {
...item,
children: data,
}
}
if (item.children && item.children.length > 0) {
return {
...item,
children: this.getTreeFun(id, item.children, data),
}
}
return item
})
},
onChangeFw(e) {
const { value, tabIndex, selectedOptions } = e.detail;
if (tabIndex > 0 && selectedOptions[selectedOptions.length - 1].level != 'building') {
const level = selectedOptions[selectedOptions.length - 1].level
getNextTree({ level, id: value }).then(res => {
if (res.data.length > 0) {
const data = res.data.map(item => {
if (item.level != 'building') {
return {
...item,
children: []
}
}
return {
...item,
children: null
}
});
const arr = this.getTreeFun(value, this.data.angencyFwList, data);
this.setData({
angencyFwList: arr,
})
} else {
const arr = this.getTreeFun(value, this.data.angencyFwList, null);
this.setData({
angencyFwList: arr,
})
}
})
}
},
onCloseFw() {
this.setData({
showFw: false,
});
},
onFinishFw(e) {
const { selectedOptions, value } = e.detail;
// const fieldNameFw = selectedOptions
// .map((option) => option.text || option.name)
// .join('/');
const level = selectedOptions[selectedOptions.length - 1].level
this.setData({
cascaderNameFw: e.detail.selectedOptions.map(item => item.label).join(' '),
showFw: false,
cascaderFwValue: value,
params: {
...this.data.params,
orgId: value,
level,
},
params1: {
...this.data.params1,
searchOrgIdPath: value,
orgId: value,
level,
},
});
this.getTableFwData()
},
handelClickSearchType(e) {
this.setData({
selectVale: e.currentTarget.dataset.type
@ -136,6 +287,11 @@ Page({
showAngenCascader: true
})
},
handelClickShowTreeFw() {
this.setData({
showFw: true
})
},
// 组织树
getAgencygridtree() {
@ -148,23 +304,30 @@ Page({
})
},
async handelClickSearch() {
if (this.data.selectVale === 'resi') {
this.setData({
pageNo:1,
tableData:[]
pageNo: 1,
tableData: []
})
this.getAllOrgCategoryCount()
this.getTableData()
}else{
this.setData({
pageNo: 1,
tableFwData: []
})
this.getTableFwData()
}
},
handelClickToOcr() {
wx.navigateTo({
url: '/subpages/OCRCard/pages/index/index',
})
},
// 获取居民概览
// 获取居民概览
getAllOrgCategoryCount() {
let parm = {
residentInfo: this.data.keyWord,
agencyId:App.globalData.user.agencyId,
agencyId: App.globalData.user.agencyId,
orgId: this.data.searchOrgIdPath,
level: 'agency'
}
@ -193,17 +356,23 @@ Page({
// '1765976717767618562'
console.log(e);
wx.navigateTo({
url: `/subpages/searchResult/pages/resiInfo/resiInfo?resiId=${e.currentTarget.dataset.resiid}`,
url: `/subpages/searchResult/pages/punchCard/punchCard?resiId=${e.currentTarget.dataset.resiid}`,
})
},
onClickJump(e) {
console.log('e::', e)
// '1765976717767618562'?resiId=${e.currentTarget.dataset.resiid}
wx.navigateTo({
url: `/subpages/house/pages/housePortrait/housePortrait?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(','),
tableData:[]
searchOrgIdPath: e.detail.selectedOptions[e.detail.selectedOptions.length - 1].agencyId,
cascaderName: e.detail.selectedOptions.map(item => item.agencyName).join(','),
tableData: []
})
this.getAllOrgCategoryCount()
this.getTableData()
},
onClose() {
@ -222,8 +391,18 @@ Page({
this.getTableData()
}
},
getTableData: async function() {
try{
onScrollFwToLower(e) {
console.log('this.data.loadFwMoreType::','zoule', this.data.loadFwMoreType)
if (this.data.loadFwMoreType === 'more') {
this.setData({
loadFwMoreVisible: true,
})
this.data.params1.pageNo += 1
this.getTableFwData()
}
},
getTableData: async function () {
try {
this.setData({
loadMoreVisible: true,
nodata: false,
@ -233,8 +412,8 @@ Page({
searchKey: this.data.keyWord,
pageSize: this.data.pageSize,
pageNo: this.data.pageNo,
category:this.data.category,
searchOrgIdPath:this.data.searchOrgIdPath
category: this.data.category,
searchOrgIdPath: this.data.searchOrgIdPath
}
let {
data,
@ -256,17 +435,59 @@ Page({
this.setData({
loadMoreVisible: false,
nodata: true,
loadMoreType:'none'
loadMoreType: 'none'
})
}
} catch(err) {
} catch (err) {
console.log(err);
this.setData({
loadMoreVisible: false,
nodata: true,
loadMoreType:'none'
loadMoreType: 'none'
})
}
},
getTableFwData: async function () {
this.setData({
loadMoreVisible: true,
nodata: false,
loadMoreType: "more",
})
await allOrgHouseInfo({ ...this.data.params }).then(res => {
const data = [];
let num = 0;
res.data.forEach((item, index) => {
if (index < 4) {
let value = item.name == '自住' ? '0' : item.name == '出租' ? '1' : item.name == '闲置' ? '2' : item.name == '未出售' ? '3' : '';
data.push({ ...item, value });
num = num + parseInt(item.num);
}
})
const arr = [{ name: '房屋', num, value: '' }, ...data];
this.setData({
fwTypes: arr
})
})
await houseSearch({ ...this.data.params1, searchKey: this.data.keyWord }).then(res => {
const { code, data } = res;
if (code == 0) {
this.setData({
loadFwMoreType: data.list.length === this.data.params1.pageSize ? 'more' : 'none',
tableFwData: this.data.tableFwData.concat(data.list),
})
if (this.data.tableData.length == 0) {
this.setData({
loadMoreVisible: false,
nodata: true
})
}
} else {
this.setData({
loadMoreVisible: false,
nodata: true,
loadMoreType: 'none'
})
}
})
}
})

59
pages/resiAndHouse/resiAndHouse.wxml

@ -56,8 +56,6 @@
</view>
<view class="text-wrapper_9">
<!-- <text lines="1" class="text_19">信息完整度:</text>
<text lines="1" class="text_20">40%</text> -->
</view>
</view>
<view class="box_19">
@ -93,7 +91,64 @@
</scroll-view>
</view>
</view>
<view class="group_2" wx:if="{{selectVale === 'house'}}">
<view class="section_2">
<view class="box_16">
<text lines="1" class="text_4" bind:tap="handelClickShowTreeFw">{{cascaderNameFw}}</text>
<view class="image-text_9">
<view class="image-text_qh">
<text lines="1" class="text_5" bind:tap="handelClickShowTreeFw">切换</text>
<image src="../../images/swapHorizontal.png" class="image_8"></image>
</view>
</view>
</view>
<view class="box_17">
<view class="tabs">
<view class="tab_item_fw {{activeFwType === index ? 'border_bto' : ''}}" wx:for="{{fwTypes}}" bind:tap="handelClickTabFw" data-index="{{index}}" data-category="{{item.value}}">
<view class="num">{{item.num}}</view>
<view class="name" style="color:{{activeFwType === index?'#3974f6':'#666666'}}">{{item.name}}</view>
</view>
</view>
</view>
<view style="margin-left: 24rpx;">
<text class="text_51">注:</text>
<image src="../../images/house/zzMin.png" class="image_81"></image>
<text lines="1" class="text_51" bind:tap="handelClickShowTreeFw">自住</text>
<image src="../../images/house/czMin.png" class="image_81 image_82"></image>
<text style="margin-left:1" lines="1" class="text_51" bind:tap="handelClickShowTreeFw">出租</text>
<image src="../../images/house/xzMin.png" class="image_81 image_82"></image>
<text lines="1" class="text_51" bind:tap="handelClickShowTreeFw">闲置</text>
<image src="../../images/house/wcsMin.png" class="image_81 image_82"></image>
<text lines="1" class="text_51" bind:tap="handelClickShowTreeFw">未出售</text>
</view>
<scroll-view class="scroll_fw form_item_fw" scroll-y="{{true}}" lower-threshold="{{ lowerThreshold }}" bindscrolltolower="onScrollFwToLower">
<view class="form_item_fw">
<view wx:for="{{tableFwData}}" :wx:key="{{index}}" bind:tap="onClickJump" data-resiId="{{item.id}}" class="form_item_fw_item">
<view class="item_fw">
<view class="item_imgs_fw">
<image class="item_img_fw_img" wx:if="{{item.rentFlagName=='自住'}}" src="../../images/house/zzMax.png"></image>
<image class="item_img_fw_img" wx:if="{{item.rentFlagName=='出租'}}" src="../../images/house/czMax.png"></image>
<image class="item_img_fw_img" wx:if="{{item.rentFlagName=='闲置'}}" src="../../images/house/xzMax.png"></image>
<image class="item_img_fw_img" wx:if="{{item.rentFlagName=='未出售'}}" src="../../images/house/wcsMax.png"></image>
</view>
<view class="item_texts_fw">
<view class="item_text_hh">{{item.houseName}}</view>
<view class="item_text_rs">
{{item.resiTotal}}人
</view>
</view>
</view>
</view>
</view>
<load-more loadVisible="{{loadFwMoreVisible}}" loadType="{{loadFwMoreType}}"></load-more>
<no-data isShow="{{nodata}}" wx:if="{{tableFwData.length==0}}"></no-data>
</scroll-view>
</view>
</view>
<custom-tab-bar></custom-tab-bar>
<van-popup show="{{ showAngenCascader }}" round position="bottom">
<van-cascader field-names="{{fieldName}}" wx:if="{{showAngenCascader}}" value="{{ searchOrgIdPath }}" title="请选择" options="{{ angencyList }}" bind:close="onClose" bind:finish="onFinish" />
</van-popup>
<van-popup show="{{ showFw }}" round position="bottom">
<van-cascader wx:if="{{ showFw }}" field-names="{{ fieldNameFw }}" value="{{ cascaderFwValue }}" title="请选择所在地区" options="{{ angencyFwList }}" bind:close="onCloseFw" bind:change="onChangeFw" bind:finish="onFinishFw" />
</van-popup>

785
pages/resiAndHouse/resiAndHouse.wxss

File diff suppressed because it is too large

3
project.config.json

@ -45,7 +45,8 @@
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false
"useCompilerPlugins": false,
"condition": false
},
"compileType": "miniprogram",
"libVersion": "2.19.4",

26
utils/api.js

@ -66,6 +66,11 @@ module.exports = {
getAllOrgCategoryCount,
getResiInfo,
userXiangQ,
getTopTree,
getNextTree,
houseSearch,
allOrgHouseInfo,
getLogList,
updatetResi
}
@ -348,5 +353,26 @@ function updatetResi(parm) {
return fly.post(`actual/base/residentBaseInfo/update`,parm)
}
// 社区查询-房屋查询
function houseSearch(parm) {
console.log('parmparm:', parm)
return fly.post(`actual/base/communityHouse/houseSearch`,parm)
}
// 社区查询-房屋概览查询
function allOrgHouseInfo(parm) {
return fly.get(`actual/base/streetOverview/allOrgHouseInfo`,parm)
}
// 懒加载树状一级
function getTopTree(parm) {
return fly.get(`actual/base/communityBuilding/tree/initTree`,parm)
}
// 懒加载树状多层下级
function getNextTree(parm) {
return fly.get(`actual/base/communityBuilding/tree/nextTreeNode`,parm)
}
// 获取打卡记录
function getLogList(parm) {
return fly.get(`actual/base/clockRecords/logList`,parm)
}

4
utils/config.js

@ -6,8 +6,8 @@ module.exports = {
function BASEURL() {
// return 'https://epmet-preview.elinkservice.cn/api/' // 演示环境
// return 'http://192.168.1.144/api/' //测试环境
return 'http://219.146.91.110:30801/api/'
return 'http://192.168.1.144/api/' //测试环境
// return 'http://219.146.91.110:30801/api/'
//return http://219.146.91.110:30801/api //外网
}

Loading…
Cancel
Save