Browse Source

首页增加满意度自查

lisu
李素 1 year ago
parent
commit
8b89448785
  1. 47
      pages/index/index.js
  2. 47
      pages/index/index.wxml
  3. 121
      pages/index/index.wxss

47
pages/index/index.js

@ -2,12 +2,14 @@
// 获取应用实例 // 获取应用实例
const app = getApp() const app = getApp()
import api, {getIntelligentMessage,getToken,getStaffbasicinfo,clearMessage,getSituation,overView} from "../../utils/api" import api, {getIntelligentMessage,getToken,getStaffbasicinfo,clearMessage,getSituation,overView} from "../../utils/api"
import {getInspRecord} from '../../utils/api'
import config from "../../utils/config" import config from "../../utils/config"
Page({ Page({
data: { data: {
topDisplay:false, topDisplay:false,
selectList:['全部消息','居民信息采集','房屋信息采集','社区满意度自查'], selectList:['全部消息','居民信息采集','房屋信息采集','社区满意度自查'],
selectValue:0, selectValue:0,
communitySelfInspList:[],
pageSize:5, pageSize:5,
pageNo:1, pageNo:1,
tableData:[], tableData:[],
@ -32,12 +34,13 @@ Page({
navigationHeight: app.globalData.deviceInfo.navigationHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight,
share:app.globalData.share, share:app.globalData.share,
}) })
this.getInspRecord()
}, },
onShow(){ onShow(){
this.getIntelligentMessage() this.getIntelligentMessage()
this.getSituation() this.getSituation()
this.getInspRecord()
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.setData({ this.setData({
@ -46,8 +49,48 @@ Page({
}) })
this.getIntelligentMessage() this.getIntelligentMessage()
this.getStaffbasicinfo() this.getStaffbasicinfo()
this.getInspRecord()
},
getInspRecord(){
let parm ={
pageSize:1000,
pageNo:1
}
getInspRecord(parm).then(res=>{
res.data.list = res.data.list.reverse();
let curMonth = new Date().getMonth() - 0 + 1
let communitySelfInspTop = res.data.list.filter(item => item.monthName-0 === curMonth).length?res.data.list.filter(item => item.monthName-0 === curMonth)[0]:{}
let communitySelfInspList = res.data.list.filter(item => item.monthName-0 !== curMonth).splice(0,2)
this.setData({
communitySelfInspTop,communitySelfInspList,curMonth
})
// this.setData({
// communitySelfInspTop:res.data.list.splice(0,1)[0],
// communitySelfInspList:res.data.list.splice(0,2),
// })
app.globalData.questionnaireUrl = this.data.communitySelfInspTop.questionnaireUrl
}).catch(err=>{
wx.hideLoading()
console.log(err);
})
},
toDetaill(e){
wx.navigateTo({
url: `/subpages/communitySelfInsp/pages/synthesis/synthesis?inspRecordId=${encodeURIComponent(e.currentTarget.dataset.item.id)}&qrCodeImgUrl=${encodeURIComponent(e.currentTarget.dataset.item.qrCodeImgUrl)}&agencyName=${encodeURIComponent(e.currentTarget.dataset.item.agencyName)}&monthName=${encodeURIComponent(e.currentTarget.dataset.item.monthName)}&questionnaireUrl=${encodeURIComponent(e.currentTarget.dataset.item.questionnaireUrl)}&status=${encodeURIComponent(e.currentTarget.dataset.item.status)}`
})
},
toSynthesis(){
wx.navigateTo({
url: `/subpages/communitySelfInsp/pages/synthesis/synthesis?inspRecordId=${this.data.communitySelfInspTop.id}&qrCodeImgUrl=${this.data.communitySelfInspTop.qrCodeImgUrl}&agencyName=${this.data.communitySelfInspTop.agencyName}&monthName=${this.data.communitySelfInspTop.monthName}&questionnaireUrl=${this.data.communitySelfInspTop.questionnaireUrl}`,
})
},
toHistoryQuery(){
wx.navigateTo({
url: '/subpages/communitySelfInsp/pages/historyQuery/historyQuery',
})
}, },
onScrollToLower(e){ onScrollToLower(e){
if (this.data.loadMoreType === 'more') { if (this.data.loadMoreType === 'more') {
this.setData({ this.setData({

47
pages/index/index.wxml

@ -70,6 +70,53 @@
</view> </view>
</view> </view>
</view> </view>
<view class="content">
<view class="hd_news">
<text class="news_remind">满意度自查</text>
<text class="more" bind:tap="toHistoryQuery">历史自查></text>
</view>
<view class="card">
<view class="content">
<view class="bg_new_box">
<block wx:if="{{communitySelfInspTop.monthName}}">
<!-- <block wx:if='true'> -->
<view class="new_h2" bind:tap="toSynthesis" >
{{communitySelfInspTop.agencyName}}{{communitySelfInspTop.monthName}}月份满意度自查
</view>
<view class="new_submitt">已提交 <b>{{communitySelfInspTop.personQty?communitySelfInspTop.personQty:'--'}}</b> 人</view>
<view class="button_a">
<button class="btn_fx" bind:tap="handelClickShare" data-item="{{communitySelfInspTop}}" open-type="share" >一键分享</button>
<view class="btn_tj" bind:tap="toSynthesis">查看统计</view>
</view>
</block>
<view class="new_h2" wx:else >
未创建{{curMonth}}月份满意度自查
</view>
<view class="bg_new_right">
<text class="tag" wx:if="{{communitySelfInspTop.monthName}}">进行中</text>
<image src="../../images/work/map.png" mode="" style="max-height: 200rpx;width: 200rpx;"/>
</view>
</view>
<!-- -->
</view>
<view class="list">
<view class="list_card" wx:for="{{communitySelfInspList}}" wx:key="index" data-item="{{item}}" bind:tap="toDetaill">
<view style="height: 100%; width: 100%;">
<view class="new_left">
<view class="new_hh">{{item.agencyName}}{{item.monthName}}月份满意度自查</view>
<view class="new_submit">已提交:{{item.personQty}}人</view>
</view>
<view class="right">
<view style="float: right; "> <text>{{item.synthesisScore}}</text>分</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="content"> <view class="content">
<view class="hd_news"> <view class="hd_news">
<text class="news_remind">消息提醒</text> <text class="news_remind">消息提醒</text>

121
pages/index/index.wxss

@ -997,4 +997,123 @@ line-height: 40rpx;
.imge2{ .imge2{
width: 309rpx; width: 309rpx;
height: 300rpx; height: 300rpx;
} }
/* pages/work/work.wxss */
.list_card {
font-size: 40rpx;
font-family: DIN Alternate;
color: #FF783C;
/* align-items: center; */
}
.right text{
font-size: 40rpx;
font-family: DIN Alternate;
color: #FF783C;
/* align-items: center; */
}
.right{
}
.bg_new_box{
background: #F9FBFE;
height: 300rpx;
width: 95%;
margin-top: -30rpx;
margin-left: -10rpx;
margin-bottom: 10rpx;
border-radius: 10px;
}
.bg_new_box {
position: relative;
}
.bg_new_right{
position: absolute;
float: right;
top: 50%;
transform: translateY(-50%);
right: 0;
}
.new_h2{
margin-top: 30rpx;
margin-left: 30rpx;
font-family: PingFang SC;
font-weight: bold;
font-size: 34rpx;
color: #333333;
line-height: 52rpx;
}
.new_submitt{
margin-top: 20rpx;
font-size: 30rpx;
opacity: 0.5;
bottom: 0;
margin-left: 30rpx;
}
.list_card {
display: flex;
flex-direction: column;
justify-content: space-around;
/* align-items: center; */
color: #333333;
border-bottom: 1px solid #f7f7f7;
padding: 30rpx 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 32rpx;
font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
font-weight: 500;
}
.list_card:last-child {
margin-top: 29rpx;
}
.list_card .special {
font-size: 40rpx;
font-family: "DIN Alternate", "Helvetica Neue", Arial, sans-serif;
color: #FF783C;
}
.new_left{
float: left;
margin-left: 32rpx;
font-size: 36rpx;
}
.new_hh{
margin-bottom: 12rpx;
}
.new_submit{
margin-top: 30rpx;
font-size: 30rpx;
opacity: 0.5;
bottom: 0;
margin-top: auto;
}
.btn_fx {
margin-left: 32rpx;
width: 160rpx;
font-size: 28rpx;
height: 56rpx;
background: #FF783C;
border-radius: 28rpx;
text-align: center;
line-height: 56rpx;
padding: 0 !important;
color: #fff;
margin-top: 30rpx;
}
.btn_tj {
margin-left: 232rpx;
margin-top: -55rpx;
width: 160rpx;
height: 56rpx;
background: #13c8bd;
border-radius: 28rpx;
text-align: center;
line-height: 56rpx;
color: #fff;
font-size: 28rpx;
}
.bg_new_left{
margin-right: 20px;
}

Loading…
Cancel
Save