123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <template>
- <view class="main">
- <view class="tour_item" @click="toInfo(item.id)" v-for="(item,index) in list" :key="index">
- <view class="titleStyle">
- {{item.title}}
- </view>
- <view class="tour_time">
- 丹棱检察 {{$u.timeFormat(item.created_at, 'yyyy/mm/dd')}}
- </view>
- <view class="content_tour">
- {{item.desc}}
- </view>
- </view>
- <uni-load-more :loadingType="loadingType" :contentText="contentText" />
- </view>
- </template>
- <script>
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- export default {
- components: {
- uniLoadMore
- },
- data() {
- return {
- loadingType: 0,
- contentText: {
- contentdown: '上拉显示更多',
- contentrefresh: '正在加载...',
- contentnomore: '没有更多数据了'
- },
- indexPage: 1,
- list: [],
- }
- },
- onLoad() {
- this.getTourList()
- },
- methods: {
- async getTourList() {
- let res = await this.$u.get("/home/notice", {
- page: this.indexPage,
- })
- this.list = this.list.concat(res.data)
- this.indexPage++
- if (res.current_page == res.last_page) {
- this.loadingType = 2;
- } else {
- this.loadingType = 0;
- }
- },
- toInfo(id) {
- uni.navigateTo({
- url: '../news/newsInfo?id=' + id + '&type=4'+'&title=丹棱公告'
- })
- }
- }
- }
- </script>
- <style>
- .main {
- min-height: 100vh;
- padding: 30rpx 28rpx;
- }
- .tour_item {
- margin-bottom: 20rpx;
- padding: 30rpx;
- background: #fff;
- border-radius: 10rpx;
- }
- .titleStyle {
- font-size: 34rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: bold;
- color: #333333;
- }
- .tour_time {
- margin-top: 30rpx;
- font-size: 24rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: 500;
- color: #999;
- }
- .content_tour {
- margin-top: 16rpx;
- font-size: 28rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: 500;
- color: #555;
- }
- </style>
|