123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <template>
- <view class="content">
- <view class="main" v-for="(item, index) in list">
- <view class="main-title">{{ item.time }}</view>
- <view class="main-item" v-for="(itm, ind) in item.child">
- <view class="main-item-top flex">
- <view class="main-userinfo">
- <image class="avatar" :src="itm.avatar" mode=""></image>
- <view class="main-name">{{ itm.nickname }}</view>
- </view>
- <view class="main-time">{{ itm.time }}</view>
- </view>
- <view class="main-item-bottom flex">
- <view class="orderId">订单号:{{ itm.order_id }}</view>
- <view class="money">
- 支付金额:
- <text>¥{{ itm.number }}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { spreadOrder } from '@/api/user.js';
- export default {
- data() {
- return {
- list: [],
- loadingType: 'more',
- orderList: [],
- page: 1, //当前页数
- limit: 10 //每次信息条数
- };
- },
- onLoad() {},
- onShow() {
- this.loadData();
- },
- onReachBottom() {
- this.loadData();
- },
- onReady() {},
- methods: {
- loadData() {
- if (this.loadingType === 'loading' || this.loadingType === 'noMore') {
- //防止重复加载
- return;
- }
- this.loadingType = 'loading';
- spreadOrder({ page: this.page, limit: this.limit }).then(({ data }) => {
- this.list = this.list.concat(data.list);
- this.page++;
- if (this.limit == data.list.length) {
- this.loadingType = 'more';
- } else {
- this.loadingType = 'noMore';
- }
- });
- }
- }
- };
- </script>
- <style lang="scss">
- page,
- .content {
- min-height: 100%;
- height: auto;
- }
- .main {
- padding: 10rpx 20rpx 0;
- .main-title {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .main-item {
- background: #ffffff;
- margin: 20rpx auto 0;
- padding: 20rpx;
- border-radius: 10rpx;
- .main-userinfo {
- display: flex;
- align-items: center;
- .avatar {
- height: 60rpx;
- width: 60rpx;
- border-radius: 50%;
- }
- .main-name {
- margin-left: 10rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bolder;
- color: #333333;
- }
- }
- .main-time {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #929296;
- }
- .main-item-bottom {
- margin-top: 10rpx;
- .orderId {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #929296;
- }
- .money {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: bolder;
- color: #333333;
- text {
- color: #fd4c4d;
- }
- }
- }
- }
- }
- </style>
|