<template>
|
<view class="officialNotice wrapperLayer">
|
<titleBar :titleText='"官方通知"' :pageForm='"officialNotice"'></titleBar>
|
<view class="pageContent-container colCen" v-if='noticeList.length>0'>
|
<block v-for="(items,index) in noticeList" :key="index">
|
<view class="notice-items-container rowSta">
|
<view class="leftsettingbox defIcon">
|
<image src="../../static/images/home/setting.png" mode="aspectFill"></image>
|
</view>
|
<view class="rightcontentbox colCen">
|
<view class="titlebar">
|
{{items.title}}
|
</view>
|
<view class="time">
|
{{items.create_time}}
|
</view>
|
|
<view class="content-box" @click="goUrl(items)">
|
<view class="box" v-html="items.content">
|
|
</view>
|
</view>
|
</view>
|
</view>
|
</block>
|
|
<aLoadMore :status="loadstatus" mode="loading3" :showTitle='true' color="#999999" ></aLoadMore>
|
</view>
|
<view v-else>
|
暂无通知
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import indexPage from '../../components/indexPage.vue';
|
import titleBar from '../../components/backTitlebar.vue';
|
export default {
|
components: {
|
titleBar,
|
indexPage
|
},
|
data(){
|
return{
|
noticeList:[],
|
pageCurrent:'0',
|
canloadmore:false,
|
loadstatus: 'loading',
|
}
|
},
|
onLoad() {
|
this.getList()
|
},
|
onReachBottom(){
|
if(this.canloadmore){
|
this.getList()
|
}
|
},
|
methods:{
|
goUrl(item){
|
if(item.type == 1){
|
uni.navigateTo({
|
url: '/pages/webView/webView?url=' + item.murl
|
})
|
}else if(item.type == 2){
|
uni.navigateTo({
|
url:item.murl
|
})
|
}
|
},
|
getList(){
|
var that = this;
|
this.$u.api.getMessageList({
|
limit: 20,
|
offset: this.pageCurrent
|
}).then(e => {
|
if(e.code != 0) return that.$alert(e.msg)
|
var res = e.data.list;
|
if(that.pageCurrent == 0 && res.length > 0){
|
uni.setStorageSync('topMessageId',res[0].id);
|
}
|
if(res.length > 0){
|
if(res.length<20){
|
that.canloadmore = false
|
that.loadstatus = 'nomal'
|
}else{
|
that.canloadmore = true
|
that.loadstatus = 'loading'
|
}
|
that.pageCurrent += 20;
|
this.noticeList = this.noticeList.concat(res)
|
}
|
}).catch(function (err) {
|
})
|
}
|
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
.officialNotice{
|
width: 100%;
|
.pageContent-container{
|
width: 100%;
|
margin-top: 20rpx;
|
background-color: #FFFFFF;
|
padding: 40rpx 32rpx;
|
.notice-items-container{
|
width: 100%;
|
margin-bottom: 20rpx;
|
.leftsettingbox{
|
width: 60rpx;
|
height: 60rpx;
|
}
|
.rightcontentbox{
|
width: 605rpx;
|
margin-left: 20rpx;
|
.titlebar{
|
width: 100%;
|
font-size: 28rpx;
|
font-weight: 500;
|
color: #444444;
|
line-height: 34rpx;
|
}
|
.time{
|
width: 100%;
|
font-size: 28rpx;
|
font-weight: 400;
|
color: #999999;
|
line-height: 34rpx;
|
margin-top: 5rpx;
|
}
|
|
.content-box{
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
box-sizing: border-box;
|
border-bottom: 1rpx solid #E6E7ED;
|
/deep/.box{
|
width: 100%;
|
padding: 18rpx 20rpx;
|
box-sizing: border-box;
|
background: #F0F1F7;
|
border-radius: 10rpx;
|
margin: 30rpx;
|
display: flex;
|
flex-direction: column;
|
justify-content: center;
|
align-items: center;
|
p{
|
width: 100%;
|
word-wrap: break-word;
|
word-break: break-all;
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
|
p{
|
display: inline;
|
}
|
</style>
|