123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <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>
|