<template> <view> <view class="list"> <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)"> <view class="top"> <view class="icon"></view> <view class="title">交易消息</view> <view class="date">2023-8-310:50</view> <view class="clear"></view> </view> <view class="content">订单20210803172489305已支付,请尽快与对方联系!</view> <view class="clear"></view> </view> </view> </view> </template> <script> export default { data() { return { list: [], param: { pageNum: 1, pageSize: 10, orderByColumn: 'createTime', isAsc: 'desc' }, loadMore: true }; }, onLoad(e) { this.getData(); }, methods: { getData() { this.http.request({ url: '/level-one-server/app/TbPortNews/getPortNewsList', data: this.param, loading: 'false', success: res => { this.list.push(...res.data.data); } }); }, detail(item) { uni.navigateTo({ url: '/pages/news/detail?id=' + item.id }); }, //刷新数据 refresh() { this.loadMore = true; this.param.pageNum = 1; this.list = []; this.getData(); } }, //下拉刷新 onPullDownRefresh() { setTimeout(() => { this.refresh(); uni.stopPullDownRefresh(); }, 1000); }, //上拉加载 onReachBottom() { if (this.loadMore) { this.param.pageNum++; this.getData(); } } }; </script> <style lang="scss"> page { background-color: #f5f5f5; } .list { padding: 12px; .item { background-color: white; border-bottom: 1px solid #f0f2f7; padding: 14px; margin-bottom: 10px; border-radius: 10px; .top { color: $font-c; border-bottom: 1px solid $line; padding-bottom: 13px; .icon { float: left; width: 17px; height: 17px; border-radius: 50%; background-color: $main-color; padding: 5px; text-align: center; line-height: 19px; color: white; } .title { float: left; font-weight: bold; padding-left: 7px; color: #192B20; } .date { float: right; color: #A0A2A6; } } .content { padding-top: 15px; color: #666666; } } } </style>