Browse Source

房屋画像部分基础信息及业务记录列表

dev
duanliangtao 2 years ago
parent
commit
2b9206fa0c
  1. 7
      app.json
  2. 239
      subpages/businessRecord/businessRecord.js
  3. 3
      subpages/businessRecord/businessRecord.json
  4. 23
      subpages/businessRecord/businessRecord.wxml
  5. 132
      subpages/businessRecord/businessRecord.wxss
  6. 86
      subpages/house/pages/housePortrait/housePortrait.js
  7. 5
      subpages/house/pages/housePortrait/housePortrait.json
  8. 49
      subpages/house/pages/housePortrait/housePortrait.wxml
  9. 65
      subpages/house/pages/housePortrait/housePortrait.wxss
  10. 2
      subpages/searchResult/pages/searchResult/searchResult.js
  11. 45
      utils/businessRecords.js

7
app.json

@ -8,7 +8,9 @@
"pages/mine/mine",
"pages/webView/webView",
"pages/statistics/statistics",
"pages/setup/setup"
"pages/setup/setup",
"subpages/house/pages/housePortrait/housePortrait",
"subpages/businessRecord/businessRecord"
],
"subPackages": [
{
@ -96,7 +98,8 @@
"pages": [
"pages/index/index"
]
},{
},
{
"root": "subpages/myTroubleshootDemand",
"name": "myTroubleshootDemand",
"pages": [

239
subpages/businessRecord/businessRecord.js

@ -0,0 +1,239 @@
import {getComplainList,getShengList,getPunchRecord,getShequList,getshijianList,getxuqiuList,getfuwuList} from "../../utils/businessRecords";
Page({
/**
* 页面的初始数据
*/
data: {
tabList: [{
label: "12345投诉",
value: '12345'
}, {
label: '满意度调查',
value: 'provinceSurvey'
}, {
label: '满意度自查',
value: 'selfSurvey'
}, {
label: '上报事件',
value: 'event'
}, {
label: '居民需求',
value: 'need'
}, {
label: '社区服务',
value: 'serve'
}, {
label: '打卡记录',
value: 'punchRecord'
}],
tabValue: '12345',
data: {},
residIds:["1704792537883688962","1705416782032064514"]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
this.setData({
tabValue: "12345"
})
this.show12345("12345");
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
tabChange({currentTarget: {dataset:{index}}}) {
this.setData({
tabValue: index
})
if(index === "12345"){
this.show12345(index);
}else if(index === "provinceSurvey"){
let params = {
"residList": this.data.residIds
}
getShengList(params).then(res => {
if (res.data && res.data.length > 0) {
let renamedArray = [];
res.data.forEach(item => {
let renamedItem = {
categorycode: item.scope,
eventcontent: item.problemDesc
};
renamedArray.push(renamedItem);
});
this.data.data[index]= renamedArray;
this.setData({
data: this.data.data
})
}
})
}else if(index === "selfSurvey"){
let params = {
"residList": this.data.residIds
}
getShequList(params).then(res => {
if (res.data && res.data.length > 0) {
let renamedArray = [];
res.data.forEach(item => {
let renamedItem = {
categorycode: item.scope,
eventcontent: item.problemDesc
};
renamedArray.push(renamedItem);
});
this.data.data[index]= renamedArray;
this.setData({
data: this.data.data
})
}
})
}else if(index === "event"){
let params = {
"residList": this.data.residIds
}
getshijianList(params).then(res => {
if (res.data && res.data.length > 0) {
let renamedArray = [];
res.data.forEach(item => {
let renamedItem = {
categorycode: item.categorycode,
eventcontent: item.eventcontent
};
renamedArray.push(renamedItem);
});
this.data.data[index]= renamedArray;
this.setData({
data: this.data.data
})
}
})
}else if(index === "need"){
let params = {
"residList": this.data.residIds
}
getxuqiuList(params).then(res => {
if (res.data && res.data.length > 0) {
let renamedArray = [];
res.data.forEach(item => {
let renamedItem = {
categorycode: item.parentName,
eventcontent: item.content
};
renamedArray.push(renamedItem);
});
this.data.data[index]= renamedArray;
this.setData({
data: this.data.data
})
}
})
}else if(index === "serve"){
let params = {
"residList": this.data.residIds
}
getfuwuList(params).then(res => {
if (res.data && res.data.length > 0) {
let renamedArray = [];
res.data.forEach(item => {
let renamedItem = {
categorycode: item.serviceCategoryKey,
eventcontent: item.serviceName
};
renamedArray.push(renamedItem);
});
this.data.data[index]= renamedArray;
this.setData({
data: this.data.data
})
}
})
}else if(index === "punchRecord"){
let params = {
"residList": this.data.residIds
}
getPunchRecord(params).then(res => {
if (res.data && res.data.length > 0) {
let renamedArray = [];
res.data.forEach(item => {
let renamedItem = {
categorycode: item.scope,
eventcontent: item.problemDesc
};
renamedArray.push(renamedItem);
});
this.data.data[index]= renamedArray;
this.setData({
data: this.data.data
})
}
})
}else{
console.log("else");
}
},
show12345(index){
console.log("init")
let params = {
"residList": this.data.residIds,
"eventType": "3"
}
getComplainList(params).then(res => {
this.data.data[index]= res.data.list;
this.setData({
data: this.data.data
})
console.log(this.data.data[index]);
})
}
})

3
subpages/businessRecord/businessRecord.json

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

23
subpages/businessRecord/businessRecord.wxml

@ -0,0 +1,23 @@
<view class="tag-list">
<view wx:for="{{tabList}}"
class="tag {{item.value === tabValue?'cur':''}}"
wx:key="index"
bind:tap="tabChange"
data-index="{{item.value}}">
{{item.label}}
</view>
</view>
<view class="table">
<view class="row header">
<view class="cell">事件类型</view>
<view class="cell">事件描述</view>
</view>
<!-- <block wx:for="{{data[tabValue]}}" wx:for-item="item" wx:for-index="index"> -->
<block bind:tap="gotopage" data-obj="{{item}}" wx:for="{{data[tabValue]}}" wx:key="index">
<view class="row {{index % 2 == 0 ? 'even' : 'odd'}}">
<view class="cell">{{item.categorycode}}</view>
<view class="cell">{{item.eventcontent}}</view>
</view>
</block>
</view>

132
subpages/businessRecord/businessRecord.wxss

@ -0,0 +1,132 @@
.tag-list {
display: flex;
flex-wrap: wrap; /* 使得元素可以换行显示 */
margin: 0 -8rpx;
margin-bottom: 15px;
}
.tag-list .tag {
padding: 10rpx 20rpx;
font-size: 23rpx;
margin: 10rpx 8rpx;
text-align: center; /* 使标签文本居中 */
}
.tag-list .tag.cur {
border-bottom: 3px solid #3A80E7;
color: #3A80E7;
font-weight: bold;
}
.frequency {
width: 80rpx;
flex: 0 0 80rpx;
margin-right: 20rpx;
border-radius: 20rpx;
padding: 20rpx 0;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.frequency .num {
font-size: 40rpx;
font-weight: bold;
}
.frequency .txt {
font-size: 20rpx;
font-weight: 500;
}
.frequency.orange {
background: #FFEBE2;
color: #FC7031;
}
.frequency.purple {
background: #E2E2FF;
color: #8482F7;
}
.frequency.blue {
background: #D3EDFF;
color: #4AA2E2;
}
.right-con {
flex: 0 0 calc(100% - 100rpx);
width: calc(100% - 100rpx);
}
.right-con .right-con-txt {
font-size: 32rpx;
font-weight: 500;
color: #333333;
line-height: 42rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
height: 84rpx;
}
.right-con-address {
display: flex;
align-items: center;
margin-right: 14rpx;
margin-top: 30rpx;
}
.right-con-address .icon {
width: 24rpx;
height: 30rpx;
}
.right-con-address .right-con-address-txt {
font-size: 28rpx;
font-weight: 500;
color: #999999;
line-height: 40rpx;
}
/* 表格样式 */
.table {
width: 100%;
}
.row {
display: flex;
align-items: center;
}
.header {
font-weight: bold;
padding: 10px 0;
}
.cell {
flex: 1;
padding: 10px 0;
font-size: 23rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.cell:nth-child(1) {
flex-basis: 30%;
font-size: 23rpx;
}
.cell:nth-child(2) {
flex-basis: 70%;
font-size: 23rpx;
}
.even {
background-color: #f0f4fd;
}
.odd {
background-color: #fff;
}

86
subpages/house/pages/housePortrait/housePortrait.js

@ -0,0 +1,86 @@
// subpages/house/pages/housePortrait/housePortrait.js
import api from "../../../../utils/api"
Page({
/**
* 页面的初始数据
*/
data: {
detail: {},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
houseId:options.houseId
})
this.getData()
},
getData() {
api.getClearHouseDeatilById(this.data.houseId).then((res) => {
this.setData({
detail: res.data
})
}).catch((error) => {
console.error("发生错误:", error);
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
gotopage({currentTarget: {dataset}}) {
const {url} = dataset
console.log(url)
wx.navigateTo({
url
})
},
})

5
subpages/house/pages/housePortrait/housePortrait.json

@ -0,0 +1,5 @@
{
"usingComponents": {
"BusinessRecord": "../../../businessRecord/businessRecord"
}
}

49
subpages/house/pages/housePortrait/housePortrait.wxml

@ -0,0 +1,49 @@
<view class="housePortrait-container">
<view class="card">
<view class="title">
<text>{{detail.fullName?detail.fullName:'-'}}</text>
<view class="view" bind:tap="gotopage" data-url="/subpages/addhouse/pages/addhouse/addhouse?type=edit&houseId={{houseId}}">
编辑
<image mode="widthFix" src="../../../../images/right.png"></image>
</view>
</view>
<view>
<view class="line">
<view class="field">房屋类型:{{detail.houseTypeName?detail.houseTypeName:'-'}}</view>
<view class="field">房屋用途:{{detail.purposeName?detail.purposeName:'-'}}</view>
<view class="field">房屋状态:{{detail.rentName?detail.rentName:'-'}}</view>
</view>
<view class="field">房主姓名:{{detail.ownerName?detail.ownerName:'-'}}</view>
<view class="field">联系电话:{{detail.ownerPhone?detail.ownerPhone:'-'}}</view>
<view class="field">房主证件号:{{detail.ownerIdCard?detail.ownerIdCard:'-'}}</view>
<view class="field">备注:{{detail.remark?detail.remark:'-'}}</view>
<view class="field">创建时间:{{detail.createdTime?detail.createdTime:'-'}}</view>
<view class="field">更新时间:{{detail.updatedTime?detail.updatedTime:'-'}}</view>
</view>
</view>
<view class="card">
<view class="title">
<text>关系图谱</text>
<view class="view" bind:tap="gotopage" data-url="/subpages/statistics/pages/problemList/problemList?type={{tabValue}}">
新增居民
<image mode="widthFix" src="../../../../images/right.png"></image>
</view>
</view>
</view>
<view class="card">
<view class="title">
<text>业务记录</text>
</view>
<BusinessRecord/>
</view>
<view class="card">
<view class="title">
<text>更新记录</text>
</view>
<ProblemList bind:change="tabChange"/>
</view>
</view>

65
subpages/house/pages/housePortrait/housePortrait.wxss

@ -0,0 +1,65 @@
.housePortrait-container {
padding: 20rpx;
box-sizing: border-box;
}
.card {
background: #fff;
border-radius: 20rpx;
padding: 30rpx;
margin-bottom: 20rpx;
}
.card .title {
font-size: 34rpx;
font-weight: bold;
color: #333333;
display: flex;
align-items: center;
margin-left: -30rpx;
margin-bottom: 39rpx;
position: relative;
}
.card .title:before {
content: '';
display: block;
width: 10rpx;
height: 28rpx;
background: #3A80E7;
border-radius: 4rpx;
margin-right: 20rpx;
}
.card .title .view {
font-size: 28rpx;
font-weight: 400;
color: #999999;
display: flex;
align-items: center;
position: absolute;
right: 0;
top: 0;
}
.card .title .view image {
width: 24rpx;
}
.card .field {
font-size: 24rpx;
font-weight: 500;
color: #999999;
margin-top: 20rpx;
}
.card .line {
display: flex;
flex-wrap: nowrap;
}
.card .line .field {
font-size: 24rpx;
font-weight: 500;
color: #999999;
margin-top: 20rpx;
flex: 0 0 30%;
}

2
subpages/searchResult/pages/searchResult/searchResult.js

@ -160,7 +160,7 @@ Page({
}else{
wx.navigateTo({
url: `/subpages/addhouse/pages/addhouse/addhouse?type=edit&houseId=${e.currentTarget.dataset.item.id}`,
url: `/subpages/house/pages/housePortrait/housePortrait?type=edit&houseId=${e.currentTarget.dataset.item.id}`,
})
}

45
utils/businessRecords.js

@ -0,0 +1,45 @@
var request = require('./request.js')
const paramsFormat = function (params) {
let strArray = []
for(let key in params) {
if(params[key] || params[key] == 0 || params[key] == '0') {
strArray.push(key+'='+params[key])
}
}
return strArray.join('&')
}
// 12345事件
export function getComplainList(params) {
return request.post(`actual/base/peopleRoomOverview/eventPageList`, params)
}
// 省满意度
export function getShengList(params) {
return request.post(`actual/base/peopleRoomOverview/provincialSatisfactionPageList`, params)
}
// 满意度自查
export function getShequList(params) {
return request.post(`actual/base/peopleRoomOverview/communitySatisfactionPageList`, params)
}
// 上报事件
export function getshijianList(params) {
return request.post(`actual/base/peopleRoomOverview/eventPageList`, params)
}
// 居民需求
export function getxuqiuList(params) {
return request.post(`actual/base/peopleRoomOverview/demandOfResidentsPageList`, params)
}
// 社区服务
export function getfuwuList(params) {
return request.post(`actual/base/peopleRoomOverview/communityServicePageList`, params)
}
// 打卡记录
export function getPunchRecord(params) {
return request.post(`actual/base/peopleRoomOverview/provincialSatisfactionPageList`, params)
}
Loading…
Cancel
Save