123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <template>
- <view class="">
- <view class="navbar">
- <view class="back">
- <text class="iconfont icon-fanhui " @click="backLast()"></text>
- </view>
- <text>通知公告</text>
- </view>
- <view class="message-list">
- <view class="item" v-for="(item,index) in list" :key="index">
- <view class="message-time">
- {{item.created_at}}
- </view>
- <view class="list">
- <view class="title">
- {{item.title}}
- </view>
- <view class="content">
- {{item.body}}
- </view>
- </view>
- </view>
- <view class="kong" v-show="isShow">
- <image src="../../static/images/kong.png" mode=""></image>
- <view class="text">
- 暂无通知公告~
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import navBar from '../../components/navBar/navbar.vue';
- var app = getApp()
- export default {
- components:{
- navBar
- },
- data() {
- return {
- list: [],
- page:1,
- isShow:false
- }
- },
- onReachBottom() {
- console.log('触底时间')
- uni.showLoading()
- this.page++;
- let params = {
- id: uni.getStorageSync('userInfo').id,
- page: this.page
- }
- app.request('/messages', params, 'get').then(res => {
- let data = res.data.data.data
- this.list = this.list.concat(data)
- uni.hideLoading()
- if (data.length == 0) {
- uni.showToast({
- title: '到底了~',
- icon: 'none'
- })
- }
- })
-
- },
- created() {
- let params = {
- id: uni.getStorageSync('userInfo').id,
- }
- app.request('/messages', params, 'get').then(res => {
- console.log(res)
- this.list = res.data.data.data
- if(this.list.length==0){
- this.isShow=true
- }
- })
- },
- methods:{
- backLast:function(){
- console.log(this.url)
- uni.reLaunch({
- url:'./index'
- })
- },
- }
- }
- </script>
- <style lang="scss">
- .navbar {
- font-size: 32upx;
- height: 100upx;
- line-height: 100upx;
- color: #888888;
- position: relative;
- position: fixed;
- top: 0;
- z-index: 9999999;
- width: 100%;
- background-color: #FFFFFF;
- text-align: center;
- border-bottom: solid 2upx #EFF1F6;
-
- .back {
- height: 100upx;
- width: 100upx;
- text-align: center;
- // background-color: #007AFF;
- position: absolute;
- float: left;
- left: 0upx;
- font-size: 32upx;
- }
- }
- page {
- background-color: #f4f4f4;
- .message-list {
- width: 90%;
- margin: 0 auto;
- padding-top: 100upx;
- .item {
- margin-top: 70upx;
- }
- .message-time {
- font-size: 26upx;
- height: 50upx;
- width: 300upx;
- text-align: center;
- margin: 0 auto;
- border-radius: 30upx;
- margin-bottom: 30upx;
- line-height: 50upx;
- color: #FFFFFF;
- background-color: #c8c8c8;
- }
- .list {
- font-size: 28upx;
- background-color: #FFFFFF;
- padding: 30upx;
- border-radius: 10upx;
- margin-top: 20upx;
- margin-bottom: 50upx;
- .title {
- font-weight: bold;
- margin-bottom: 20upx;
- }
- .content {
- color: #afafaf;
- }
- }
- }
- .kong {
- margin-top: 30%;
- text-align: center;
-
- image {
- width: 300upx;
- height: 300upx;
- }
-
- .text {
- font-size: 34upx;
- margin-top: 30upx;
- color: #e61916;
- }
- }
-
- }
- </style>
|