66 lines
2.0 KiB
Vue
66 lines
2.0 KiB
Vue
|
<template>
|
||
|
<view class="">
|
||
|
<!-- 使用标题栏 -->
|
||
|
<status-nav :statusBackw="true" :whereCome="whereCome*1" :statusTitle="true" :title-val="'公告'" :tabcolor="'#ffffff'"></status-nav>
|
||
|
<view :style="{paddingTop:statusHNH+'px'}">
|
||
|
<view class="fon28 dis margin20 borbot" v-for="(item,index) in dataArr" :key="index">
|
||
|
<view class="margin-y20 flexs noticesitem-img"></view>
|
||
|
<view @tap="choose(index)">
|
||
|
<view class="color33 clips2">{{item.title}}</view>
|
||
|
<view class="fon24 color9 margin-s10 margin-x20">{{$toolAll.tools.timestampToTime(item.update_time)}}</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
<view class="borbot"></view>
|
||
|
</view>
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
data() {
|
||
|
return {
|
||
|
whereCome:2,
|
||
|
dataArr:[],
|
||
|
statusHNH:uni.getStorageSync('statusHNH')
|
||
|
}
|
||
|
},
|
||
|
onShow() {
|
||
|
this.$toolAll.tools.guoq()
|
||
|
},
|
||
|
onLoad(options) {
|
||
|
if(uni.getStorageSync('token')==''){
|
||
|
uni.showToast({title:'您当前是游客,请授权登录',icon:'none',duration:2000})
|
||
|
setTimeout(function(){
|
||
|
uni.reLaunch({url:'/pages/login/login'})//跳转到授权登录页
|
||
|
},2000)
|
||
|
} else {
|
||
|
options.index !=undefined ? this.whereCome = options.index : ''
|
||
|
let noticeObj = {
|
||
|
page:1,
|
||
|
size:50
|
||
|
}
|
||
|
this.$requst.post('article/announcement/index',noticeObj).then(res=>{
|
||
|
if(res.data.list.length!=0){
|
||
|
this.dataArr = res.data.list
|
||
|
}
|
||
|
},error=>{})
|
||
|
}
|
||
|
},
|
||
|
methods: {
|
||
|
choose(index){
|
||
|
let dataInfo = this.dataArr[index]
|
||
|
if(uni.getStorageSync('noticeInfo')==''){
|
||
|
uni.setStorageSync('noticeInfo',dataInfo)
|
||
|
}
|
||
|
uni.navigateTo({
|
||
|
url:'/pagesB/noticesDetail/noticesDetail?index=0'
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style>
|
||
|
page{background-color: #FFFFFF;}
|
||
|
</style>
|