Browse Source

数字格式化,消息列表参数改成未读

lisu
mk 1 year ago
parent
commit
070bd0da1b
  1. 36
      pages/index/index.js
  2. 23
      pages/index/index.wxml
  3. 2
      subpages/resnoinformation/pages/resnoinformation/resnoinformation.wxss

36
pages/index/index.js

@ -17,7 +17,7 @@ Page({
nodata:false,
emptyHouseNum:'',
catesNonIntResiNum:'',
readFlag:'1',
readFlag:'0',
agencyName:'--'
},
@ -62,17 +62,13 @@ onScrollToLower(e){
loadMoreVisible: true,
nodata: false,
loadMoreType: "more",
tableData:[]
})
const parm = {
type:this.data.selectValue == 0? null :this.data.selectValue - 1,
limit:this.data.pageSize,
page:this.data.pageNo,
readFlag:this.data.readFlag
}
if(!parm.type) delete parm.type
if(this.data.tableData.length !==0){
return
}
getIntelligentMessage(parm).then(res=>{
res.data.list.forEach(item => {
if (item.msgType === 'resident_base_info') {
@ -205,32 +201,15 @@ onScrollToLower(e){
},
// 人房信息采集
getSituation(){
wx.showLoading({
title: '加载中',
})
// getSituation().then(res=>{
// this.setData({
// collectedHouseCount:res.data.collectedHouseCount.toLocaleString(),
// collectedPopulationCount:res.data.collectedPopulationCount.toLocaleString(),
// pendingHouseCount:res.data.pendingHouseCount,
// pendingPopulationCount:res.data.pendingPopulationCount,
// populationCount:res.data.populationCount,
// realEstateCount:res.data.realEstateCount,
// })
// wx.hideLoading()
// }).catch(err=>{
// wx.hideLoading()
// console.log(err);
// })
overView().then(res=>{
console.log('123',res)
this.setData({
emptyHouseNum: res.data.emptyHouseNum.toLocaleString(),
catesNonIntResiNum: res.data.catesNonIntResiNum.toLocaleString(),
collectedHouseCount:res.data.totalHouseNum.toLocaleString(),
collectedPopulationCount:res.data.totalResiNum.toLocaleString(),
emptyHouseNum: this.formatNumberWithCommas(res.data.emptyHouseNum),
catesNonIntResiNum:this.formatNumberWithCommas(res.data.catesNonIntResiNum),
collectedHouseCount:this.formatNumberWithCommas(res.data.totalHouseNum),
collectedPopulationCount:this.formatNumberWithCommas(res.data.totalResiNum),
})
wx.hideLoading()
}).catch(err=>{
@ -238,6 +217,9 @@ onScrollToLower(e){
console.log(err);
})
},
formatNumberWithCommas(number) {
return new Intl.NumberFormat().format(number);
},
onAddResident(){
wx.navigateTo({
url: '../../subpages/addResi/pages/addResi/addResi',

23
pages/index/index.wxml

@ -92,28 +92,5 @@
</view>
</view>
</view>
<!-- <view class="content">
<view class="box">
<view class="hd_news">
<test class="reminder">消息提醒</test>
<test class="more_more">更多</test>
</view>
<view class="card" wx:for="{{tableData}}" wx:key="index" data-item="{{item}}" data-index="{{index}}" bind:tap="toDetail">
<view class="right">
<view class="top">
<text class="title">{{item.content}}</text>
<text class="{{item.readFlag != '1'?'':'gray'}}" style="font-size: 26rpx;">{{item.readFlag != '1'?'未读':'已读'}}</text>
</view>
</view>
<view class="right">
<view class="top">
<text class="title">{{item.content}}</text>
<text class="{{item.readFlag != '1'?'':'gray'}}" style="font-size: 26rpx;">{{item.readFlag != '1'?'未读':'已读'}}</text>
</view>
</view>
</view>
</view>
</view> -->
<custom-tab-bar></custom-tab-bar>

2
subpages/resnoinformation/pages/resnoinformation/resnoinformation.wxss

@ -174,7 +174,7 @@ text-align: center;
font-weight: 500;
text-align: center;
white-space: nowrap;
line-height: 42rpx;
line-height: 34rpx;
margin-right: 10rpx;
margin-left: 10rpx;

Loading…
Cancel
Save