Browse Source

1.添加开屏图片

2.政策法规、平安榆山功能实装
3.物业打分功能实装
4.有么说么 我要报事提交成功后tip框被地址盖住的bug修复
刘绍文 2020.5.27
feature/v2.0
liushaowen 6 years ago
parent
commit
dda19fdd80
  1. 8
      epdc-resident-mp-yushan/app.json
  2. BIN
      epdc-resident-mp-yushan/images/property/star.png
  3. 6
      epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.js
  4. 10
      epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.wxml
  5. 11
      epdc-resident-mp-yushan/pages/index/index.js
  6. 42
      epdc-resident-mp-yushan/pages/property/property.js
  7. 16
      epdc-resident-mp-yushan/pages/property/property.wxml
  8. 17
      epdc-resident-mp-yushan/pages/property/property.wxss
  9. 84
      epdc-resident-mp-yushan/pages/welcome/welcome.js
  10. 4
      epdc-resident-mp-yushan/pages/welcome/welcome.json
  11. 16
      epdc-resident-mp-yushan/pages/welcome/welcome.wxml
  12. 81
      epdc-resident-mp-yushan/pages/welcome/welcome.wxss
  13. 48
      epdc-resident-mp-yushan/project.config.json
  14. 3
      epdc-resident-mp-yushan/subpages/discussion/components/tipDialog/tipDialog.wxss
  15. 2
      epdc-resident-mp-yushan/subpages/home/pages/notice/notice.json
  16. 2
      epdc-resident-mp-yushan/subpages/home/pages/notice/notice.wxml
  17. 2
      epdc-resident-mp-yushan/subpages/home/pages/noticeDetail/noticeDetail.json
  18. 2
      epdc-resident-mp-yushan/subpages/property/pages/myTopic/myTopic.wxml
  19. 13
      epdc-resident-mp-yushan/subpages/safety/components/announcementList/announcementList.js
  20. 3
      epdc-resident-mp-yushan/subpages/safety/components/announcementList/announcementList.json
  21. 24
      epdc-resident-mp-yushan/subpages/safety/components/announcementList/announcementList.wxml
  22. 70
      epdc-resident-mp-yushan/subpages/safety/components/announcementList/announcementList.wxss
  23. 42
      epdc-resident-mp-yushan/subpages/safety/components/banner/banner.js
  24. 3
      epdc-resident-mp-yushan/subpages/safety/components/banner/banner.json
  25. 28
      epdc-resident-mp-yushan/subpages/safety/components/banner/banner.wxml
  26. 80
      epdc-resident-mp-yushan/subpages/safety/components/banner/banner.wxss
  27. 14
      epdc-resident-mp-yushan/subpages/safety/components/loadMore/loadMore.js
  28. 3
      epdc-resident-mp-yushan/subpages/safety/components/loadMore/loadMore.json
  29. 7
      epdc-resident-mp-yushan/subpages/safety/components/loadMore/loadMore.wxml
  30. 18
      epdc-resident-mp-yushan/subpages/safety/components/loadMore/loadMore.wxss
  31. 21
      epdc-resident-mp-yushan/subpages/safety/components/policeInfo/policeInfo.js
  32. 3
      epdc-resident-mp-yushan/subpages/safety/components/policeInfo/policeInfo.json
  33. 33
      epdc-resident-mp-yushan/subpages/safety/components/policeInfo/policeInfo.wxml
  34. 119
      epdc-resident-mp-yushan/subpages/safety/components/policeInfo/policeInfo.wxss
  35. 13
      epdc-resident-mp-yushan/subpages/safety/components/precautionList/precautionList.js
  36. 3
      epdc-resident-mp-yushan/subpages/safety/components/precautionList/precautionList.json
  37. 24
      epdc-resident-mp-yushan/subpages/safety/components/precautionList/precautionList.wxml
  38. 70
      epdc-resident-mp-yushan/subpages/safety/components/precautionList/precautionList.wxss
  39. 72
      epdc-resident-mp-yushan/subpages/safety/components/pullingRefresh/pullingRefresh.js
  40. 3
      epdc-resident-mp-yushan/subpages/safety/components/pullingRefresh/pullingRefresh.json
  41. 9
      epdc-resident-mp-yushan/subpages/safety/components/pullingRefresh/pullingRefresh.wxml
  42. 30
      epdc-resident-mp-yushan/subpages/safety/components/pullingRefresh/pullingRefresh.wxss
  43. 24
      epdc-resident-mp-yushan/subpages/safety/components/sudoku/sudoku.js
  44. 3
      epdc-resident-mp-yushan/subpages/safety/components/sudoku/sudoku.json
  45. 14
      epdc-resident-mp-yushan/subpages/safety/components/sudoku/sudoku.wxml
  46. 111
      epdc-resident-mp-yushan/subpages/safety/components/sudoku/sudoku.wxss
  47. BIN
      epdc-resident-mp-yushan/subpages/safety/images/back.png
  48. BIN
      epdc-resident-mp-yushan/subpages/safety/images/loading.gif
  49. BIN
      epdc-resident-mp-yushan/subpages/safety/images/minjing.png
  50. BIN
      epdc-resident-mp-yushan/subpages/safety/images/name.png
  51. BIN
      epdc-resident-mp-yushan/subpages/safety/images/pingan.png
  52. BIN
      epdc-resident-mp-yushan/subpages/safety/images/tel.png
  53. BIN
      epdc-resident-mp-yushan/subpages/safety/images/temp.png
  54. BIN
      epdc-resident-mp-yushan/subpages/safety/images/tongbao.png
  55. 233
      epdc-resident-mp-yushan/subpages/safety/pages/index/index.js
  56. 13
      epdc-resident-mp-yushan/subpages/safety/pages/index/index.json
  57. 35
      epdc-resident-mp-yushan/subpages/safety/pages/index/index.wxml
  58. 42
      epdc-resident-mp-yushan/subpages/safety/pages/index/index.wxss
  59. 249
      epdc-resident-mp-yushan/subpages/safety/utils/api.js
  60. 11
      epdc-resident-mp-yushan/subpages/safety/utils/common.js
  61. 10
      epdc-resident-mp-yushan/utils/api.js

8
epdc-resident-mp-yushan/app.json

@ -1,5 +1,6 @@
{
"pages": [
"pages/welcome/welcome",
"pages/index/index",
"pages/toRegister/toRegister",
"pages/heart/heart",
@ -110,6 +111,13 @@
"pages/changeToIssue/changeToIssue",
"pages/myTopic/myTopic"
]
},
{
"root": "subpages/safety",
"name": "safety",
"pages": [
"pages/index/index"
]
}
],
"preloadRule": {

BIN
epdc-resident-mp-yushan/images/property/star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

6
epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.js

@ -32,13 +32,11 @@ Component({
},
// 跳转到平安榆山
navigateToSafe () {
this.showNotAvailable();
// this.triggerEvent('navigateToSafe')
this.triggerEvent('navigateToSafe')
},
// 跳转到政策法规
navigateToPolicy () {
this.showNotAvailable();
// this.triggerEvent('navigateToPolicy')
this.triggerEvent('navigateToPolicy')
},
// 跳转到综合服务
navigateToSyntheticalService () {

10
epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.wxml

@ -17,16 +17,16 @@
<view class="name">互帮互助</view>
</view>
<view class="item" hover-stay-time="150" hover-class="hover-sudoku" bindtap="navigateToSafe">
<image src="../../../../images/home/safe-grey.png" />
<image src="../../../../images/home/safe.png" />
<view class="name">平安榆山</view>
</view>
<view class="item" hover-stay-time="150" hover-class="hover-sudoku" bindtap="navigateToPolicy">
<image src="../../../../images/home/policy.png" />
<view class="name">政策法规</view>
</view>
<view class="item" hover-stay-time="150" hover-class="hover-sudoku" bindtap="navigateToEducation">
<image src="../../../../images/home/edu-grey.png" />
<view class="name">社区教育</view>
</view>
<view class="item" hover-stay-time="150" hover-class="hover-sudoku" bindtap="navigateToPolicy">
<image src="../../../../images/home/policy-grey.png" />
<view class="name">政策法规</view>
</view>
<view class="item" hover-stay-time="150" hover-class="hover-sudoku" bindtap="navigateToSyntheticalService">
<image src="../../../../images/home/synthetical-service-grey.png" />

11
epdc-resident-mp-yushan/pages/index/index.js

@ -260,6 +260,11 @@ Page({
url: '/pages/property/property'
})
},
navigateToSafe(){
wx.navigateTo({
url: '/subpages/safety/pages/index/index',
})
},
// 初始化加载
initLoad () {
this.setData({
@ -307,5 +312,11 @@ Page({
url: `/subpages/home/pages/newsDetail/newsDetail?id=${id}`
})
}
},
//政策法规
navigateToPolicy(){
wx.navigateTo({
url: '/subpages/home/pages/notice/notice'
})
}
})

42
epdc-resident-mp-yushan/pages/property/property.js

@ -18,7 +18,9 @@ Page({
isLoading: true,
timeStamp:'',
refreshFlag:true,
completeInfoDialogVisible:false
completeInfoDialogVisible:false,
tempScore:'',
showSubmit:false
},
onHide:function(){
if(this.data.refreshFlag){
@ -54,6 +56,10 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
showSubmit:false,
tempScore:""
})
if(this.data.refreshFlag){
this.setData({
isLoading:true
@ -87,6 +93,10 @@ Page({
});
},
initPropertyInfo(id){
this.setData({
showSubmit:false,
tempScore:''
})
wx.showLoading({
title:'载入中'
});
@ -94,6 +104,7 @@ Page({
this.setData({
projectInfo:res.data,
isLoading:false,
tempScore:res.data.userScore
})
wx.hideLoading({
complete: (res) => {},
@ -108,6 +119,35 @@ Page({
})
});
},
handleScoreInput(e){
this.setData({
tempScore:e.detail.value
})
},
changeScore(){
this.setData({
showSubmit:true
})
},
submitScore(){
//0~100
let score = Number(this.data.tempScore.trim());
if(isNaN(score) || this.data.tempScore.indexOf('.') != -1 || score < 0 || score >100 || this.data.tempScore.trim() == ''){
wx.showToast({
title: '请输入0~100的整数',
icon:'none'
})
return false;
}
let param = {
'propertyId':this.data.projectInfo.propertyId,
'projectId':this.data.tabList[this.data.currentTabIndex].id,
'score':score
}
api.submitScore(param).then(res=>{
this.initPropertyInfo(this.data.tabList[this.data.currentTabIndex].id)
})
},
// getRecommend(){
// var list=[];
// var item={

16
epdc-resident-mp-yushan/pages/property/property.wxml

@ -13,7 +13,10 @@
<!-- 物业项目信息 -->
<view class="propertyInfo" wx:if="{{!isLoading}}">
<view class="info-item">
<view style="font-size:35rpx;color:#333;font-weight:bold;">物业项目信息</view>
<view style="font-size:35rpx;color:#333;font-weight:bold;width:50%">物业项目信息</view>
<view style="font-size:35rpx;line-height:100rpx;text-align:right;width:49%">综合评分
<text style="color:#F82424;font-size:40rpx">{{projectInfo.avaScore==''||projectInfo.avaScore==undefined?'暂无评分':(projectInfo.avaScore+'分')}}</text>
</view>
</view>
<view class="info-item">
<image src="../../images/property/name.png" class="info-img"></image>
@ -39,6 +42,17 @@
<image src="../../images/property/address.png" class="info-img"></image>
<view class="info-detail">物业地址:</view>
<view class="info-detail" style="width:59%">{{projectInfo.propertyAddress}}</view>
</view>
<view class="info-item">
<image src="../../images/property/star.png" class="info-img"></image>
<view class="info-detail">我的物业评分:</view>
<view class="info-detail" style="width:59%;display:inline-flex" wx:if="{{projectInfo.propertyId != undefined}}">
<view class="scoreInput" style="margin-top:25rpx">
<input class="scoreInput" value="{{projectInfo.userScore==''?showSubmit?tempScore:'未打分':projectInfo.userScore}}" type="number" disabled="{{!showSubmit}}" bindinput="handleScoreInput" focus="{{showSubmit}}"></input>
</view>
<view wx:if="{{!showSubmit}}" class="scoreBtn" bindtap="changeScore">{{projectInfo.userScore==''?'打分':'修改'}}</view>
<view wx:else class="scoreBtn" bindtap="submitScore">确定</view>
</view>
</view>
<view class="info-group" wx:if="{{projectInfo.id != undefined}}">
<image src="{{projectInfo.groupAvatar}}" class="group-pic"></image>

17
epdc-resident-mp-yushan/pages/property/property.wxss

@ -277,4 +277,21 @@ page {
width: 150rpx;
right: 0;
bottom: 0;
}
.scoreBtn{
height: 55rpx;
width: 110rpx;
border-radius: 60rpx;
border: 1rpx solid #333;
background: #fff;
color: #333;
font-size: 30rpx;
text-align: center;
line-height: 50rpx;
margin-top: 20rpx;
margin-left: 112rpx;
}
.scoreInput{
height: 100%;
width: 200rpx;
}

84
epdc-resident-mp-yushan/pages/welcome/welcome.js

@ -0,0 +1,84 @@
const app = getApp()
Page({
data: {
deviceHeight: 0,
countdownNum: 0,
bgImage: '',
timer: '',
scene: '',
imgList: [],
datanum: 0, //第几个数组
datalength: 0, //数组长度
allTime: 3,//总时间
},
onLoad(options) {
if (options.scene) {
this.data.scene = options.scene
}
this.setData({
deviceHeight: app.globalData.height
})
this.getStartupPage()
},
// 倒计时进入
countDown() {
this.data.timer = setInterval(() => {
if (this.data.countdownNum > 1) {
this.data.allTime--
this.data.countdownNum--
this.setData({
countdownNum: this.data.countdownNum,
allTime: this.data.allTime
})
} else {
this.data.allTime--
this.setData({
datanum: this.data.datanum + 1,
allTime: this.data.allTime
})
clearInterval(this.data.timer)
if (this.data.scene) {
wx.reLaunch({
url: `/pages/index/index?scene=${this.data.scene}`
})
} else {
wx.reLaunch({
url: '/pages/index/index'
})
}
}
}, 1000)
},
// 立即进入
immeEnter() {
clearInterval(this.data.timer)
if (this.data.scene) {
wx.reLaunch({
url: `/pages/index/index?scene=${this.data.scene}`
})
} else {
wx.reLaunch({
url: '/pages/index/index'
})
}
},
// 获取启动页信息
getStartupPage() {
this.setData({
datalength: 1,
imgList: [{imgUrl:'https://epdc-yushan.elinkservice.cn/files-pro/20200522/02c3341b36d746338918c17676b2a864.png',duration:'3'}]
})
this.getloop()
},
//数组循环
getloop() {
if (this.data.imgList[this.data.datanum].duration > 0) {
this.setData({
bgImage: this.data.imgList[this.data.datanum].imgUrl,
countdownNum: this.data.imgList[this.data.datanum].duration
})
this.countDown()
}
}
})

4
epdc-resident-mp-yushan/pages/welcome/welcome.json

@ -0,0 +1,4 @@
{
"navigationBarTitleText": "欢迎页",
"navigationStyle": "custom"
}

16
epdc-resident-mp-yushan/pages/welcome/welcome.wxml

@ -0,0 +1,16 @@
<view class="welcome">
<view class="bg-img">
<image class="bgimg" src="{{bgImage}}"/>
</view>
<view class="content" style="height: calc(100vh - {{deviceHeight}}px - 100rpx); top: calc({{deviceHeight}}px + 100rpx)">
<view class="countdown" wx:if="countdownNum > 0">
<view bindtap="immeEnter" hover-class="hover-skip" class="time">{{allTime}}s | 跳过</view>
</view>
<!-- <view class="imme-enter">
<button hover-class="hover-btn" bindtap="immeEnter">立即进入</button>
</view> -->
</view>
</view>

81
epdc-resident-mp-yushan/pages/welcome/welcome.wxss

@ -0,0 +1,81 @@
page {
width: 100%;
height: 100vh;
}
.welcome {
width: 100%;
height: 100vh;
background: #fff;
position: relative;
overflow: hidden;
}
.welcome .bg-img {
width: 100%;
height: 100vh;
position: absolute;
left: 0;
top: 0;
}
.welcome .bg-img image {
width: 100%;
height:100%;
}
.welcome .content {
width: 100%;
position: relative;
z-index: 10;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding-bottom: 100rpx;
}
.welcome .content .countdown {
width: 100%;
height: 50rpx;
display: flex;
align-items: flex-start;
justify-content: flex-end;
box-sizing: border-box;
padding: 0 20rpx;
}
.welcome .content .countdown .time {
font-size: 28rpx;
color: #333;
width: 150rpx;
height: 50rpx;
line-height: 50rpx;
text-align: center;
background: rgba(255,255,255,0.5);
border-radius: 30rpx;
}
.welcome .content .countdown .hover-skip {
background: rgba(255,255,255,0.2);
}
.imme-enter {
width: 100%;
height: 84rpx;
display: flex;
align-items: center;
justify-content: center;
}
.imme-enter button {
background-image: linear-gradient(to right , #ff2d29, #ff4e4e);
height:84rpx;
line-height: 84rpx;
text-align:center;
color: #fff;
font-size: 36rpx;
border-radius: 16rpx;
padding: 0;
margin: 0;
outline: 0;
font-weight: normal;
width: 560rpx;
}
.imme-enter .hover-btn {
background: red;
}

48
epdc-resident-mp-yushan/project.config.json

@ -92,9 +92,51 @@
"scene": null
},
{
"id": 7,
"name": "pages/index/index",
"pathName": "pages/index/index",
"id": 5,
"name": "1",
"pathName": "subpages/home/pages/notice/notice",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/toRegister/toRegister",
"pathName": "pages/toRegister/toRegister",
"query": "",
"scene": null
},
{
"id": -1,
"name": "subpages/safety/pages/index/index",
"pathName": "subpages/safety/pages/index/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/property/property",
"pathName": "pages/property/property",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/register/register",
"pathName": "pages/register/register",
"query": "",
"scene": null
},
{
"id": -1,
"name": "subpages/discussion/pages/addIssue/addIssue",
"pathName": "subpages/discussion/pages/addIssue/addIssue",
"query": "",
"scene": null
},
{
"id": -1,
"name": "subpages/discussion/pages/categoryList/categoryList",
"pathName": "subpages/discussion/pages/categoryList/categoryList",
"query": "",
"scene": null
}

3
epdc-resident-mp-yushan/subpages/discussion/components/tipDialog/tipDialog.wxss

@ -7,7 +7,8 @@
background: rgba(0,0,0, 0.6);
display: flex;
justify-content: center;
align-items: center
align-items: center;
z-index:100;
}
.tip-dialog .content {

2
epdc-resident-mp-yushan/subpages/home/pages/notice/notice.json

@ -1,5 +1,5 @@
{
"usingComponents": {
},
"navigationBarTitleText": "通知"
"navigationBarTitleText": "政策法规"
}

2
epdc-resident-mp-yushan/subpages/home/pages/notice/notice.wxml

@ -13,7 +13,7 @@
<view class="notice-logo">
<image src="../../images/ic_tongzhixiaoxi.png" />
</view>
<span class="location">{{item.deptName}}-通知</span>
<span class="location">{{item.deptName}}-政策法规</span>
<span class="time">{{item.noticeTime}}</span>
</view>
</view>

2
epdc-resident-mp-yushan/subpages/home/pages/noticeDetail/noticeDetail.json

@ -1,5 +1,5 @@
{
"usingComponents": {
},
"navigationBarTitleText": "通知详情"
"navigationBarTitleText": "政策法规详情"
}

2
epdc-resident-mp-yushan/subpages/property/pages/myTopic/myTopic.wxml

@ -14,6 +14,6 @@
<view class="topic-nodata" wx:if="{{topicList.length === 0 && !preloadVisible}}">
<image class="no-data" src="../../images/topic_nodata.png" />
<view class="tip">您还未发布话题</view>
<view class="tip">快到物业群里发布吧~</view>
<view class="tip">快到群里发布吧~</view>
</view>
<load-more loadMoreVisible="{{nomoreVisible}}" loadMoreType="{{nomoreStatus}}"></load-more>

13
epdc-resident-mp-yushan/subpages/safety/components/announcementList/announcementList.js

@ -0,0 +1,13 @@
Component({
properties: {
newsList: {
type: Array,
value: []
}
},
methods: {
navigatetoNewsDetail (e) {
this.triggerEvent('navigatetoNewsDetail', {newsId: e.currentTarget.dataset.newsid})
}
}
})

3
epdc-resident-mp-yushan/subpages/safety/components/announcementList/announcementList.json

@ -0,0 +1,3 @@
{
"component": true
}

24
epdc-resident-mp-yushan/subpages/safety/components/announcementList/announcementList.wxml

@ -0,0 +1,24 @@
<wxs src="../../../../utils/filter.wxs" module="filters"></wxs>
<view class="news-list">
<view
hover-stay-time="150"
hover-class="hover-sudoku"
class="list-item"
data-newsid="{{item.id}}"
bindtap="navigatetoNewsDetail"
wx:for="{{newsList}}"
wx:for-item="item"
wx:for-index="index"
wx:key="index">
<view class="left">
<image src="{{item.newsImageUrl}}" />
</view>
<view class="right">
<view class="title">{{item.newsTitle}}</view>
<view class="bottom">
<view class="category">{{item.deptName}}-{{item.newsCategoryName}}</view>
<view class="time">{{filters.formatTimestamp(item.newsStartTime)}}</view>
</view>
</view>
</view>
</view>

70
epdc-resident-mp-yushan/subpages/safety/components/announcementList/announcementList.wxss

@ -0,0 +1,70 @@
.news-list {
width: 100%;
background: #fff;
box-sizing: border-box;
padding: 0 35rpx;
margin-top: 20rpx;
}
.news-list .list-item {
width: 100%;
height: 205rpx;
box-sizing: border-box;
padding: 30rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
}
.news-list .list-item .right {
width: calc(100% - 50rpx - 220rpx);
height: 146rpx;
}
.news-list .list-item .right .title {
color: #3f3f3f;
font-size: 30rpx;
line-height: 45rpx;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.news-list .list-item .right .bottom {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 20rpx;
}
.news-list .list-item .right .bottom .category {
color: #aaa;
font-size: 22rpx;
line-height: 48rpx;
width: calc(100% - 150rpx);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.news-list .list-item .right .bottom .time {
color: #aaa;
font-size: 22rpx;
line-height: 48rpx;
width: 150rpx;
text-align: right;
}
.news-list .list-item .left {
width: 250rpx;
height: 146rpx;
border-radius: 12rpx;
overflow: hidden;
}
.news-list .list-item .left image {
width: 100%;
height:100%;
}
.news-list .list-item + .list-item {
border-top: 1rpx solid #ece9ec;
}
.news-list .hover-sudoku {
background: rgba(0,0,0,0.1);
}

42
epdc-resident-mp-yushan/subpages/safety/components/banner/banner.js

@ -0,0 +1,42 @@
Component({
data: {
currentIndex: 0,
autoplay:false,
bannerInterval:0
},
properties: {
bannerList: {
type: Array,
value: []
}
},
lifetimes: {
},
pageLifetimes: {
show:function(){
console.log("show")
this.setData({
autoplay:true,
bannerInterval:3000
})
},
hide:function(){
this.setData({
autoplay:false,
bannerInterval:0
})
}
},
methods: {
swiperChange (e) {
this.setData({
currentIndex: e.detail.current
})
},
navigatetoBannerDetail (e) {
const { id, url, newsflag } = e.currentTarget.dataset
this.triggerEvent('navigatetoBannerDetail', {id, url, newsFlag: newsflag} )
}
}
})

3
epdc-resident-mp-yushan/subpages/safety/components/banner/banner.json

@ -0,0 +1,3 @@
{
"component": true
}

28
epdc-resident-mp-yushan/subpages/safety/components/banner/banner.wxml

@ -0,0 +1,28 @@
<view class="banner">
<swiper circular="{{true}}" autoplay="{{autoplay}}" interval="{{bannerInterval}}" current="{{currentIndex}}" bindchange="swiperChange">
<swiper-item
wx:for="{{bannerList}}"
wx:key="index"
wx:for-index="index"
wx:for-item="item">
<view
class="banner-item"
data-id="{{item.id}}"
data-url="{{item.url}}"
data-newsflag="{{item.newsFlag}}"
bindtap="navigatetoBannerDetail">
<image mode="aspectFill" class="banner-img" src="{{item.imgUrl}}" />
<view class="banner-content">
<view class="title">
<view class="title-text">{{item.title}}</view>
</view>
<view class="indication">
<block wx:for="{{bannerList}}" wx:key="index">
<view class="spot{{index == currentIndex? ' active' : ''}}"></view>
</block>
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>

80
epdc-resident-mp-yushan/subpages/safety/components/banner/banner.wxss

@ -0,0 +1,80 @@
.banner {
width: 100%;
height: 320rpx;
padding: 20rpx 0;
background: #fff;
}
.banner swiper {
width: 94%;
height: 320rpx;
margin:0 auto;
}
.banner-item {
width: 100%;
height: 320rpx;
position: relative;
}
.banner-item .banner-img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.banner-item .banner-content {
position: relative;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 100;
display: flex;
align-items: flex-end;
}
.banner-item .banner-content .title {
width: 100%;
height: 50rpx;
background: rgba(0,0,0, 0.4);
box-sizing: border-box;
padding: 0 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.banner-item .banner-content .title .title-text {
width: 75%;
height: 50rpx;
color: #fff;
font-size: 26rpx;
line-height: 50rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* 自定义轮播指示点样式 */
.indication {
height: 50rpx;
display:flex;
position: absolute;
bottom: -2rpx;
right: 20rpx;
flex-direction:row;
align-items:center;
justify-content:center;
}
/* 未选中指示点样式 */
.spot{
width: 15rpx;
height: 15rpx;
border-radius: 50%;
margin-right: 10rpx;
background-color: #c6c6c8;
}
/*选中指示样式 */
.spot.active{
width: 15rpx;
height: 15rpx;
border-radius: 50%;
background-color: #fff;
}

14
epdc-resident-mp-yushan/subpages/safety/components/loadMore/loadMore.js

@ -0,0 +1,14 @@
Component({
data: {
},
properties: {
loadMoreVisible: {
type: Boolean,
value: false
},
loadMoreType: {
type: String,
value: 'loading'
}
}
})

3
epdc-resident-mp-yushan/subpages/safety/components/loadMore/loadMore.json

@ -0,0 +1,3 @@
{
"component": true
}

7
epdc-resident-mp-yushan/subpages/safety/components/loadMore/loadMore.wxml

@ -0,0 +1,7 @@
<view class="load-more" style="visibility: {{loadMoreVisible ? 'visible' : 'hidden'}}">
<block wx:if="{{loadMoreType == 'loading'}}">
<image class="load-image" src="../../images/loading.gif" />
<view class="load-text">正在加载中...</view>
</block>
<view wx:else class="load-text">没有更多了~</view>
</view>

18
epdc-resident-mp-yushan/subpages/safety/components/loadMore/loadMore.wxss

@ -0,0 +1,18 @@
.load-more {
width: 100%;
height: 100rpx;
background: #f7f7f7;
display: flex;
justify-content: center;
align-items: center;
}
.load-more .load-text {
color: #999;
font-size: 26rpx;
}
.load-more .load-image {
width: 30rpx;
height: 30rpx;
object-fit: cover;
margin-right: 10rpx;
}

21
epdc-resident-mp-yushan/subpages/safety/components/policeInfo/policeInfo.js

@ -0,0 +1,21 @@
Component({
properties: {
sudokuState: {
type: Object,
value: {
consultAvailable: '0',
appraiseAvailable: '0'
}
},
policeInfo:{
type:Object
}
},
data:{
},
methods: {
joinGroup(e){
this.triggerEvent("joinGroup",e);
}
}
})

3
epdc-resident-mp-yushan/subpages/safety/components/policeInfo/policeInfo.json

@ -0,0 +1,3 @@
{
"component": true
}

33
epdc-resident-mp-yushan/subpages/safety/components/policeInfo/policeInfo.wxml

@ -0,0 +1,33 @@
<wxs src="../../../../utils/filter.wxs" module="filters"></wxs>
<view class="sudoku">
<view class="myPolice">
<view class="info-police" wx:for='{{policeInfo.policeList}}' wx:for-item="item" wx:for-index="index" wx:key="index">
<image src="{{item.policeAvatar}}" class="group-pic"></image>
<view class="police-detail">
<view class="police-name" style="border-bottom:0.5px solid #E7EEEE;">
<image src="../../images/name.png" class="info-img"></image>
<view>姓名:{{item.policeName}}</view>
</view>
<view class="police-name">
<image src="../../images/tel.png" class="info-img"></image>
<view>联系方式:{{item.policeTel}}</view>
</view>
</view>
</view>
<view class="info-group" wx:if='{{policeInfo.policeList.length != 0}}'>
<image src="{{policeInfo.groupAvatar}}" class="group-pic"></image>
<view class="group-detail">
<view class="group-name">{{policeInfo.groupName}}</view>
<view class="group-number"><text space="nbsp">共{{policeInfo.numberGroupMember}}人 {{policeInfo.numberGroupPartyMember}}名党员</text></view>
</view>
<view class="group-join">
<!-- <image src="../../images/property/red-join.png" class="join-button"></image> -->
<!-- <view class="join-text">加入</view> -->
<view class="join-button" data-joinStatus="{{policeInfo.groupMemberFlag}}" data-groupName="{{policeInfo.groupName}}" data-state="{{policeInfo.groupState}}" data-groupId="{{policeInfo.groupId}}" bindtap="joinGroup">{{policeInfo.groupMemberFlag=='0'?'加入':policeInfo.groupMemberFlag=='1'?'待审核':'进入'}}</view>
</view>
</view>
</view>
<view wx:if='{{policeInfo.policeList.length==0}}' class="no-police-data">
暂无民警信息~
</view>
</view>

119
epdc-resident-mp-yushan/subpages/safety/components/policeInfo/policeInfo.wxss

@ -0,0 +1,119 @@
.sudoku {
background:#fff;
margin-top: 20rpx;
}
.content {
width: 100%;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 215rpx;
box-sizing: border-box;
padding-bottom: 20rpx;
}
.item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.item image {
width:126rpx;
height:126rpx;
}
.item .name {
font-size: 28rpx;
color: #3f3f3f;
}
.sudoku .hover-sudoku {
background: rgba(0,0,0,0.1);
}
.info-group{
width: 94%;
margin-left: 20rpx;
display: flex;
line-height: 100rpx;
padding-top: 20rpx;
}
.group-pic{
width: 120rpx;
height: 120rpx;
border-radius: 60px;
padding: 20rpx;
}
.group-detail{
width: 50%;
display: inline-block;
padding-left: 40rpx;
height: 120rpx;
}
.group-name{
font-size: 30rpx;
font-weight: bold;
height: 75rpx;
word-break: break-all;
line-height: 50rpx;
}
.group-number{
font-size: 25rpx;
color: #999;
height: 30rpx;
}
.group-join{
display: inline-block;
margin:0 auto;
}
.join-button{
height: 55rpx;
width: 110rpx;
border-radius: 60rpx;
background: #F82424;
color: white;
font-size: 30rpx;
text-align: center;
line-height: 50rpx;
margin-top: 50rpx;
}
.join-text{
font-size: 30rpx;
position: relative;
color: #fff;
margin-top: -120rpx;
margin-left: 20rpx;
}
.info-police{
width: 94%;
margin-left: 20rpx;
display: flex;
line-height: 100rpx;
padding-top: 20rpx;
}
.group-pic{
width: 120rpx;
height: 120rpx;
border-radius: 60px;
padding: 20rpx;
}
.police-detail{
display: grid;
padding-left: 40rpx;
height: 120rpx;
width: 70%;
}
.police-name{
font-size: 30rpx;
height: 75rpx;
word-break: break-all;
line-height: 75rpx;
display: inline-flex;
}
.no-police-data{
text-align: center;
height: 400rpx;
line-height: 400rpx;
}
.info-img{
height: 45rpx;
width: 45rpx;
padding-top: 15rpx;
display: inline-block;
}

13
epdc-resident-mp-yushan/subpages/safety/components/precautionList/precautionList.js

@ -0,0 +1,13 @@
Component({
properties: {
newsList: {
type: Array,
value: []
}
},
methods: {
navigatetoNewsDetail (e) {
this.triggerEvent('navigatetoNewsDetail', {newsId: e.currentTarget.dataset.newsid})
}
}
})

3
epdc-resident-mp-yushan/subpages/safety/components/precautionList/precautionList.json

@ -0,0 +1,3 @@
{
"component": true
}

24
epdc-resident-mp-yushan/subpages/safety/components/precautionList/precautionList.wxml

@ -0,0 +1,24 @@
<wxs src="../../../../utils/filter.wxs" module="filters"></wxs>
<view class="news-list">
<view
hover-stay-time="150"
hover-class="hover-sudoku"
class="list-item"
data-newsid="{{item.id}}"
bindtap="navigatetoNewsDetail"
wx:for="{{newsList}}"
wx:for-item="item"
wx:for-index="index"
wx:key="index">
<view class="left">
<image src="{{item.newsImageUrl}}" />
</view>
<view class="right">
<view class="title">{{item.newsTitle}}</view>
<view class="bottom">
<view class="category">{{item.deptName}}-{{item.newsCategoryName}}</view>
<view class="time">{{filters.formatTimestamp(item.newsStartTime)}}</view>
</view>
</view>
</view>
</view>

70
epdc-resident-mp-yushan/subpages/safety/components/precautionList/precautionList.wxss

@ -0,0 +1,70 @@
.news-list {
width: 100%;
background: #fff;
box-sizing: border-box;
padding: 0 35rpx;
margin-top: 20rpx;
}
.news-list .list-item {
width: 100%;
height: 205rpx;
box-sizing: border-box;
padding: 30rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
}
.news-list .list-item .right {
width: calc(100% - 50rpx - 220rpx);
height: 146rpx;
}
.news-list .list-item .right .title {
color: #3f3f3f;
font-size: 30rpx;
line-height: 45rpx;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.news-list .list-item .right .bottom {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 20rpx;
}
.news-list .list-item .right .bottom .category {
color: #aaa;
font-size: 22rpx;
line-height: 48rpx;
width: calc(100% - 150rpx);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.news-list .list-item .right .bottom .time {
color: #aaa;
font-size: 22rpx;
line-height: 48rpx;
width: 150rpx;
text-align: right;
}
.news-list .list-item .left {
width: 250rpx;
height: 146rpx;
border-radius: 12rpx;
overflow: hidden;
}
.news-list .list-item .left image {
width: 100%;
height:100%;
}
.news-list .list-item + .list-item {
border-top: 1rpx solid #ece9ec;
}
.news-list .hover-sudoku {
background: rgba(0,0,0,0.1);
}

72
epdc-resident-mp-yushan/subpages/safety/components/pullingRefresh/pullingRefresh.js

@ -0,0 +1,72 @@
let lastY = 0 // 上一次滚动的位置
let scale = 750 / wx.getSystemInfoSync().windowWidth // rpx转化比例
Component({
options: {
multipleSlots: true
},
data: {
scrollTop: 0,
translateHeight: 0, // 平移距离
state: -1,
lastY: 0,
enablePullDown: true
},
properties: {
// 触发下拉刷新的距离
upperDistance: {
type: Number,
value: 150
}
},
methods: {
// 监听滚动,获取scrollTop
onPageScroll (e) {
this.data.scrollTop = e.scrollTop
},
touchStart (e) {
this.data.lastY = e.touches[0].clientY
if (this.data.scrollTop === 0) {
this.data.enablePullDown = true
} else {
this.data.enablePullDown = false
}
},
touchMove (e) {
let clientY = e.touches[0].clientY
let offset = clientY - this.data.lastY
if (this.data.scrollTop > 0 || offset < 0) return
this.data.translateHeight += offset
this.data.state = 0
this.data.lastY = e.touches[0].clientY
if (this.data.enablePullDown) {
if (this.data.translateHeight - this.data.scrollTop * scale > this.data.upperDistance) {
this.data.state = 1
}
this.setData({
translateHeight: this.data.translateHeight > 80 ? 80 : this.data.translateHeight,
state: this.data.state
})
}
},
touchEnd (e) {
if (this.data.translateHeight - this.data.scrollTop * scale > this.data.upperDistance) {
if (this.data.enablePullDown) {
this.setData({
translateHeight: 80,
state: 2
})
this.triggerEvent('scrolltoupper')
}
} else if (this.data.scrollTop <= 0) {
this.stopRefresh()
}
},
// 停止刷新
stopRefresh () {
this.setData({
translateHeight: 0,
state: -1
})
}
}
})

3
epdc-resident-mp-yushan/subpages/safety/components/pullingRefresh/pullingRefresh.json

@ -0,0 +1,3 @@
{
"component": true
}

9
epdc-resident-mp-yushan/subpages/safety/components/pullingRefresh/pullingRefresh.wxml

@ -0,0 +1,9 @@
<view class="scroll" bindtouchstart="touchStart" bindtouchmove="touchMove" bindtouchend="touchEnd">
<view class="animation">
<image class="loading" src="../../images/loading.gif" />
<text class="tip">{{state === 0 ? '下拉刷新' : state === 1? '松开刷新' : '刷新中...'}}</text>
</view>
<view style="transform: translateY({{translateHeight}}rpx)">
<slot name="content"></slot>
</view>
</view>

30
epdc-resident-mp-yushan/subpages/safety/components/pullingRefresh/pullingRefresh.wxss

@ -0,0 +1,30 @@
.scroll {
width: 100%;
margin-top: 94rpx;
margin-bottom: 98rpx;
}
.animation {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 80rpx;
background-color: #f7f7f7;
margin-bottom: -80rpx;
}
.loading {
width: 30rpx;
height: 30rpx;
object-fit: cover;
}
.loading image {
width: 100%;
height: 100%;
object-fit: cover;
}
.tip {
margin-left: 10rpx;
color: #999;
font-size: 26rpx;
}

24
epdc-resident-mp-yushan/subpages/safety/components/sudoku/sudoku.js

@ -0,0 +1,24 @@
Component({
properties: {
sudokuState: {
type: Object,
value: {
consultAvailable: '0',
appraiseAvailable: '0'
}
},
},
data:{
},
methods: {
showMyPolice(){
this.triggerEvent('showMyPolice')
},
showPrecaution(){
this.triggerEvent('showPrecaution')
},
showAnnouncement(){
this.triggerEvent('showAnnouncement')
}
}
})

3
epdc-resident-mp-yushan/subpages/safety/components/sudoku/sudoku.json

@ -0,0 +1,3 @@
{
"component": true
}

14
epdc-resident-mp-yushan/subpages/safety/components/sudoku/sudoku.wxml

@ -0,0 +1,14 @@
<wxs src="../../../../utils/filter.wxs" module="filters"></wxs>
<view class="sudoku">
<view class="content">
<view class="item" hover-stay-time="150" hover-class="hover-sudoku" bindtap="showMyPolice">
<image src="../../images/minjing.png" />
</view>
<view class="item" hover-stay-time="150" hover-class="hover-sudoku" bindtap="showPrecaution">
<image src="../../images/pingan.png" />
</view>
<view class="item" hover-stay-time="150" hover-class="hover-sudoku" bindtap="showAnnouncement">
<image src="../../images/tongbao.png" />
</view>
</view>
</view>

111
epdc-resident-mp-yushan/subpages/safety/components/sudoku/sudoku.wxss

@ -0,0 +1,111 @@
.sudoku {
background:#fff;
padding: 0 10rpx;
margin-top: 20rpx;
}
.content {
width: 100%;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 215rpx;
box-sizing: border-box;
}
.item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.item image {
width:220rpx;
height:130rpx;
}
.item .name {
font-size: 28rpx;
color: #3f3f3f;
}
.sudoku .hover-sudoku {
background: rgba(0,0,0,0.1);
}
.info-group{
width: 94%;
margin-left: 20rpx;
display: flex;
line-height: 100rpx;
padding-top: 20rpx;
}
.group-pic{
width: 120rpx;
height: 120rpx;
border-radius: 60px;
padding: 20rpx;
}
.group-detail{
width: 50%;
display: inline-block;
padding-left: 40rpx;
height: 120rpx;
}
.group-name{
font-size: 30rpx;
font-weight: bold;
height: 75rpx;
word-break: break-all;
line-height: 50rpx;
}
.group-number{
font-size: 25rpx;
color: #999;
height: 30rpx;
}
.group-join{
display: inline-block;
margin:0 auto;
}
.join-button{
height: 55rpx;
width: 110rpx;
border-radius: 60rpx;
background: #F82424;
color: white;
font-size: 30rpx;
text-align: center;
line-height: 50rpx;
margin-top: 50rpx;
}
.join-text{
font-size: 30rpx;
position: relative;
color: #fff;
margin-top: -120rpx;
margin-left: 20rpx;
}
.info-police{
width: 94%;
margin-left: 20rpx;
display: flex;
line-height: 100rpx;
padding-top: 20rpx;
}
.group-pic{
width: 120rpx;
height: 120rpx;
border-radius: 60px;
padding: 20rpx;
}
.police-detail{
width: 50%;
display: inline-block;
padding-left: 40rpx;
height: 120rpx;
}
.police-name{
font-size: 30rpx;
height: 75rpx;
word-break: break-all;
line-height: 50rpx;
}
.no-police-data{
margin-top: 200rpx;
text-align: center;
}

BIN
epdc-resident-mp-yushan/subpages/safety/images/back.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

BIN
epdc-resident-mp-yushan/subpages/safety/images/loading.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
epdc-resident-mp-yushan/subpages/safety/images/minjing.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
epdc-resident-mp-yushan/subpages/safety/images/name.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 876 B

BIN
epdc-resident-mp-yushan/subpages/safety/images/pingan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
epdc-resident-mp-yushan/subpages/safety/images/tel.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
epdc-resident-mp-yushan/subpages/safety/images/temp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 KiB

BIN
epdc-resident-mp-yushan/subpages/safety/images/tongbao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

233
epdc-resident-mp-yushan/subpages/safety/pages/index/index.js

@ -0,0 +1,233 @@
const api = require('../../utils/api')
const config = require('../../../../utils/config')
import { getTimestamp } from '../../../../utils/common'
const app = getApp()
Page({
data: {
statusHeight: 0, // 自定义头部状态栏高度
navigationHeight: 0, // 自定义头部导航栏高度
sudokuHeight:0,
bannerList: [], // banner列表,
policeInfo:{},
precautionList:[],
announcementList:[],
showMyPoliceFlag:false,
showAnnouncementFlag:false,
showPrecautionFlag:false,
loadMoreType:'more',
loadMoreVisible:true,
pageNo:1,
pageSize:10,
loading:false,
timestamp:'',
completeInfoDialogVisible:false
},
onShow () {
},
onLoad (options) {
this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight,
sudokuHeight:app.globalData.deviceInfo.statusHeight+app.globalData.deviceInfo.navigationHeight,
timestamp:getTimestamp()
})
this.getBannerList();
this.getPoliceInfo();
},
naviBack(){
wx.navigateBack({
delta:1,
complete: (res) => {},
})
},
// 获取banner列表
getBannerList () {
api.getBannerList().then(res => {
console.log('首页banner列表', res)
this.setData({
bannerList: res.data
})
}).catch(() => {
console.log('获取banner列表失败')
this.setData({
bannerList: [{'imgUrl':'../../images/temp.png','title':'防范火灾 平安假日'}]
})
})
},
getPoliceInfo(){
api.getPoliceInfo().then(res=>{
this.setData({
policeInfo:res.data
})
}).catch(err=>{
this.setData({
policeInfo:{}
})
})
},
joinGroup(e){
if (app.globalData.infoCompleted == 0) {
this.setData({
completeInfoDialogVisible: !this.data.completeInfoDialogVisible
})
return false
}
const { groupMemberFlag, groupId, groupName,groupState } = this.data.policeInfo
if(groupMemberFlag == '0'){
wx.showModal({
title:'提示',
content:'尚未加入群组,是否申请加入?',
confirmText:'申请',
cancelColor: 'cancelColor',
success:(res)=>{
if(res.cancel){
}else{
api.applyForGroup(groupId).then(res=>{
if(res.code == '0'){
wx.showToast({
title: '申请成功'
})
let info = this.data.policeInfo;
info.groupMemberFlag = '1';
this.setData({
policeInfo:info
})
}else{
wx.showToast({
title: '申请失败',
icon:"none"
})
}
}).catch(err=>{
})
}
}
})
}else if(groupMemberFlag == '1'){
wx.showToast({
title: '您已申请过加入该社群,请等待群主审核',
icon:"none"
})
}else if(groupMemberFlag == '2'){
wx.navigateTo({
url: `/subpages/property/pages/topicList/topicList?groupId=${groupId}&groupName=${groupName}&state=${groupState}`
})
}
},
navigateToPrecaution(){
wx.navigateTo({
url: '/subpages/safety/pages/precaution/precaution'
})
},
showMyPolice(){
this.setData({
showMyPoliceFlag:true,
showPrecautionFlag:false,
showAnnouncementFlag:false
})
},
showPrecaution(){
this.setData({
showMyPoliceFlag:false,
showPrecautionFlag:true,
showAnnouncementFlag:false,
loadMoreType:'loading',
pageNo:1,
loading:true,
precautionList:[],
timestamp:getTimestamp()
})
this.getPrecautionList();
},
showAnnouncement(){
this.setData({
showMyPoliceFlag:false,
showPrecautionFlag:false,
showAnnouncementFlag:true,
pageNo:1,
loadMoreType:'loading',
loading:true,
announcementList:[],
timestamp:getTimestamp()
})
this.getAnnouncementList()
},
// 获取平安防范列表
getPrecautionList () {
let para = {
pageIndex: this.data.pageNo,
pageSize: this.data.pageSize,
timestamp: this.data.timestamp
}
api.getPrecautionList(para).then((res) => {
this.setData({
loadMoreType: res.data.length === this.data.pageSize ? 'more': 'none',
precautionList: this.data.precautionList.concat(res.data),
loading:false
})
}).catch(() => {
this.setData({
loadMoreType: 'none',
precautionList: [],
loading:false
})
})
},
// 获取警情通报列表
getAnnouncementList () {
let para = {
pageIndex: this.data.pageNo,
pageSize: this.data.pageSize,
timestamp: this.data.timestamp
}
api.getAnnouncementList(para).then((res) => {
this.setData({
loadMoreType: res.data.length === this.data.pageSize ? 'more': 'none',
announcementList: this.data.announcementList.concat(res.data),
loading:false
})
}).catch(() => {
this.setData({
loadMoreType: 'none',
announcementList: [],
loading:false
})
})
},
onReachBottom () {
if(!this.data.showMyPoliceFlag && !this.data.loading){
this.setData({
loadMoreVisible: true,
loading:true
})
if (this.data.loadMoreType === 'more') {
this.setData({
loadMoreType:'loading'
})
this.data.pageNo += 1
if(this.data.showPrecautionFlag){
this.getPrecautionList();
}
else if(this.data.showAnnouncementFlag){
this.getAnnouncementList();
}
}
}
},
// 跳转到banner详情
navigatetoBannerDetail (e) {
const { id, url, newsFlag } = e.detail
if (newsFlag == '0') {
wx.navigateTo({
url: `/subpages/home/pages/webview/webview?url=${url}`
})
} else if (newsFlag == '1') {
wx.navigateTo({
url: `/subpages/home/pages/newsDetail/newsDetail?id=${id}`
})
}
}
})

13
epdc-resident-mp-yushan/subpages/safety/pages/index/index.json

@ -0,0 +1,13 @@
{
"usingComponents": {
"banner":"../../components/banner/banner",
"sudoku":"../../components/sudoku/sudoku",
"policeInfo":"../../components/policeInfo/policeInfo",
"announcementList":"../../components/announcementList/announcementList",
"precautionList":"../../components/precautionList/precautionList",
"load-more":"../../components/loadMore/loadMore",
"complete-info-dialog": "../../../../components/completeInfoDialog/completeInfoDialog"
},
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}

35
epdc-resident-mp-yushan/subpages/safety/pages/index/index.wxml

@ -0,0 +1,35 @@
<view class="header" style="height: {{statusHeight + navigationHeight}}px;">
<image class="header-bg" src="../../../../images/home/home-status.png" />
<image class="header-back" bindtap="naviBack" style="margin-top:{{statusHeight+navigationHeight/3}}px" src="../../images/back.png"></image>
<view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;">
平安榆山
</view>
</view>
<view class="home" style="margin-top: {{statusHeight + navigationHeight}}px">
<!-- banner列表 -->
<banner
bind:navigatetoBannerDetail="navigatetoBannerDetail"
bannerList="{{bannerList}}">
</banner>
<sudoku
bind:showMyPolice="showMyPolice"
bind:showPrecaution="showPrecaution"
bind:showAnnouncement="showAnnouncement">
</sudoku>
<policeInfo
bind:joinGroup='joinGroup'
policeInfo='{{policeInfo}}'
wx:if='{{showMyPoliceFlag}}'>
</policeInfo>
<precautionList
newsList='{{precautionList}}'
wx:if='{{showPrecautionFlag}}'
bind:navigatetoNewsDetail="navigateToPrecautionDetail"></precautionList>
<announcementList
newsList='{{announcementList}}'
wx:if='{{showAnnouncementFlag}}'
bind:navigatetoNewsDetail="navigateToAnnouncementDetail"></announcementList>
<!--加载更多提示-->
<load-more wx:if="{{showAnnouncementFlag || showPrecautionFlag}}" loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more>
</view>
<complete-info-dialog completeInfoDialogVisible="{{completeInfoDialogVisible}}"></complete-info-dialog>

42
epdc-resident-mp-yushan/subpages/safety/pages/index/index.wxss

@ -0,0 +1,42 @@
page {
width: 100%;
height: auto;
overflow-y: auto;
background: #f7f7f7;
}
.header {
position: fixed;
width: 100%;
top: 0;
left: 0;
z-index: 1000;
}
.header .header-bg {
width: 100%;
height: 100%;
position: absolute;
z-index: 10;
left: 0;
top: 0;
}
.header .navigation {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
color: rgba(255,255,255, 0.9);
font-size: 32rpx;
position: relative;
z-index: 100;
}
.home {
width: 100%;
}
.header-back{
height: 33rpx;
width: 18rpx;
position: fixed;
margin-left: 30rpx;
z-index: 101;
}

249
epdc-resident-mp-yushan/subpages/safety/utils/api.js

@ -0,0 +1,249 @@
const request = require('../../../utils/request')
/**
* banner
*/
export function getBannerList () {
return request.get('property/safety/bannerList',{
"position":'2'
})
}
/**
* 平安防范
*/
export function getPrecautionList (param) {
return request.get('property/safety/newsList/safety_precautions',param)
}
/**
* 警情通报
*/
export function getAnnouncementList (param) {
return request.get('property/safety/newsList/police_notice',param)
}
/**
* 民警信息及警民群信息
*/
export function getPoliceInfo () {
return request.get('property/safety/policeGroupInfo')
}
/********警民群-申请入群 ********/
export function applyForGroup(groupId){
return request.post('property/group/applyForGroup',{
groupId:groupId
})
}
/**
* 社群详情
*/
export function getAssociationDetail (id) {
return request.get(`property/group/detail/${id}`)
}
/**
* 修改群头像
*/
export function modifyAvatar ({id, groupAvatar}) {
return request.post('property/group/modifyAvatar', {
id,
groupAvatar
})
}
/**
* 加入社群
*/
export function joinAssociation (groupId) {
return request.post('property/group/applyForGroup', {
groupId
})
}
/**
* 修改群介绍
*/
export function changeIntroduce ({id, groupIntroduction}) {
return request.post('property/group/modifyIntroduction', {
id,
groupIntroduction
})
}
/**
* 群成员列表 审核通过/待审核
*/
export function getAssociationMember ({groupId, state}) {
return request.get('property/group/listOfMember', {
groupId,
state
})
}
/**
* 删除群成员
*/
export function deleteMember ({groupId, userId}) {
return request.post('property/group/removeMember', {
groupId,
userId
})
}
/**
* 审核入群成员
*/
export function incomingVerify ({ groupId, members }) {
return request.post('property/group/reviewApply', {
groupId,
members
})
}
/**
* 添加好友列表
*/
export function getInviteList ({groupId, mobile, road, lastName}) {
return request.get('property/group/getInviteList', {
groupId,
mobile,
road,
lastName
})
}
/**
* 添加好友
*/
export function addMember ({ groupId, members}) {
return request.post('property/group/addMember', {
groupId,
members
})
}
/**
* 发布话题
*/
export function addTopic ({topicContent, topicAddress, topicLatitude, topicLongitude, groupId, groupName, images}) {
return request.post('property/topic/submit', {
topicContent,
topicAddress,
topicLatitude,
topicLongitude,
groupId,
groupName,
images
})
}
/**
* 话题列表
*/
export function getTopicList ({ pageIndex, pageSize, timestamp, groupId, topicId }) {
return request.get('property/topic/list', {
pageIndex,
pageSize,
timestamp,
groupId,
topicId
})
}
/**
* 话题详情
*/
export function getTopicDetail (id) {
return request.get(`property/topic/detail/${id}`)
}
/**
* 退群
* @param groupId
*/
export function withdrawGroup (groupId) {
return request.post('property/group/quitGroup', {
groupId
})
}
/**
* 评论最新最热列表
*/
export function getRemarkList({ pageIndex, pageSize, timestamp, orderType, topicId }) {
return request.get('property/comment/list', {
pageIndex,
pageSize,
timestamp,
orderType,
topicId
})
}
/**
* 评论或者回复
*/
export function remarkOrReply ({ topicId, faCommentId, content }) {
return request.post('property/comment/submit', {
topicId,
faCommentId,
content
})
}
/**
* 关闭话题
*/
export function closeTopic ({ id, processingOpinions }) {
return request.post('property/topic/close', {
id,
processingOpinions
})
}
/**
* 分类列表
*/
export function getClassifyList () {
return request.get('events/issue/category/list')
}
/**
* 话题转议题
*/
export function changeToIssue ({ id, categoryId, advice }) {
return request.post('property/topic/changeToIssue', {
id,
categoryId,
advice
})
}
/**
* 支持/反对 表态
*/
export function publishStatement ({ attitude, commentId, topicId }) {
return request.post('property/comment/statement', {
attitude,
commentId,
topicId
})
}
/**
* 生成网格小程序码
*/
export function createQRCode ({ gridId, inviteUserId }) {
return request.get('app-user/user/createQRCode', {
gridId,
inviteUserId
})
}
/**
* 我的话题列表
*/
export function getMyTopicList ({ pageIndex , pageSize , groupId}) {
return request.get('property/topic/listOfMine', {
pageIndex,
pageSize,
groupId
})
}

11
epdc-resident-mp-yushan/subpages/safety/utils/common.js

@ -0,0 +1,11 @@
export function getTimestamp () {
const date = new Date()
const year = date.getFullYear()
const month = date.getMonth() + 1 > 9 ? date.getMonth() + 1 : `0${date.getMonth() + 1}`
const day = date.getDate() > 9 ? date.getDate() : `0${date.getDate()}`
const hour = date.getHours() > 9 ? date.getHours() : `0${date.getHours()}`
const minute = date.getMinutes() > 9 ? date.getMinutes() : `0${date.getMinutes()}`
const second = date.getSeconds() > 9 ? date.getSeconds() : `0${date.getSeconds()}`
return `${year}-${month}-${day} ${hour}:${minute}:${second}`
}

10
epdc-resident-mp-yushan/utils/api.js

@ -51,7 +51,8 @@ module.exports = {
getWxPhone: getWxPhone,
getPropertyProjectList:getPropertyProjectList,
getPropertyProjectDetail:getPropertyProjectDetail,
applyForGroup:applyForGroup
applyForGroup:applyForGroup,
submitScore:submitScore
}
function getToken(wxCode) {
@ -426,7 +427,7 @@ function getPropertyProjectList(){
/********物业项目-物业项目详情 ********/
function getPropertyProjectDetail(propertyProjectId){
return fly.get(`property/projectDetail/${propertyProjectId}`)
return fly.get(`property/v2/projectDetail/${propertyProjectId}`)
}
/********物业群-申请入群 ********/
@ -435,5 +436,8 @@ function applyForGroup(groupId){
groupId:groupId
})
}
/********物业-打分*******/
function submitScore(param){
return fly.get('property/projectScore',param)
}

Loading…
Cancel
Save