|
After Width: | Height: | Size: 1.3 KiB |
@ -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() |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,4 @@ |
|||||
|
{ |
||||
|
"navigationBarTitleText": "欢迎页", |
||||
|
"navigationStyle": "custom" |
||||
|
} |
||||
@ -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> |
||||
@ -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; |
||||
|
} |
||||
@ -1,5 +1,5 @@ |
|||||
{ |
{ |
||||
"usingComponents": { |
"usingComponents": { |
||||
}, |
}, |
||||
"navigationBarTitleText": "通知" |
"navigationBarTitleText": "政策法规" |
||||
} |
} |
||||
@ -1,5 +1,5 @@ |
|||||
{ |
{ |
||||
"usingComponents": { |
"usingComponents": { |
||||
}, |
}, |
||||
"navigationBarTitleText": "通知详情" |
"navigationBarTitleText": "政策法规详情" |
||||
} |
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
Component({ |
||||
|
properties: { |
||||
|
newsList: { |
||||
|
type: Array, |
||||
|
value: [] |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
navigatetoNewsDetail (e) { |
||||
|
this.triggerEvent('navigatetoNewsDetail', {newsId: e.currentTarget.dataset.newsid}) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"component": true |
||||
|
} |
||||
@ -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> |
||||
@ -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); |
||||
|
} |
||||
@ -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} ) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"component": true |
||||
|
} |
||||
@ -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> |
||||
@ -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; |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
Component({ |
||||
|
data: { |
||||
|
}, |
||||
|
properties: { |
||||
|
loadMoreVisible: { |
||||
|
type: Boolean, |
||||
|
value: false |
||||
|
}, |
||||
|
loadMoreType: { |
||||
|
type: String, |
||||
|
value: 'loading' |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"component": true |
||||
|
} |
||||
@ -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> |
||||
@ -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; |
||||
|
} |
||||
@ -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); |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"component": true |
||||
|
} |
||||
@ -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> |
||||
@ -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; |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
Component({ |
||||
|
properties: { |
||||
|
newsList: { |
||||
|
type: Array, |
||||
|
value: [] |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
navigatetoNewsDetail (e) { |
||||
|
this.triggerEvent('navigatetoNewsDetail', {newsId: e.currentTarget.dataset.newsid}) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"component": true |
||||
|
} |
||||
@ -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> |
||||
@ -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); |
||||
|
} |
||||
@ -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 |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"component": true |
||||
|
} |
||||
@ -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> |
||||
@ -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; |
||||
|
} |
||||
@ -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') |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"component": true |
||||
|
} |
||||
@ -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> |
||||
@ -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; |
||||
|
} |
||||
|
After Width: | Height: | Size: 587 B |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 876 B |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 415 KiB |
|
After Width: | Height: | Size: 20 KiB |
@ -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}` |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
@ -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" |
||||
|
} |
||||
@ -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> |
||||
@ -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; |
||||
|
} |
||||
@ -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 |
||||
|
}) |
||||
|
} |
||||
@ -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}` |
||||
|
} |
||||