123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <template>
- <zj-page-layout
- :hasFooter="false"
- :isScroll="true"
- :refresherTriggered="refresherTriggered"
- @refresherrefresh="refresherrefresh"
- @scrolltolower="scrolltolower">
- <view class="list-container">
- <view class="item">
- <view class="top">
- <image src="@/static/common/logo.png"></image>
- <view class="user">
- <view class="name">张三</view>
- <view class="time">23小时前发布</view>
- </view>
- <view class="price">¥1888.00</view>
- </view>
- <view class="title">商品名称</view>
- <view class="des">商品描述</view>
- <view class="imgs">
- <image src="@/static/user/other_speech.png"></image>
- <image src="@/static/user/other_speech.png"></image>
- <image src="@/static/user/other_speech.png"></image>
- </view>
- <view class="bottom">
- <view class="location">天河区棠下</view>
- <view class="right">
- <u-button text="取消点赞" shape="circle"></u-button>
- </view>
- </view>
- </view>
- </view>
- </zj-page-layout>
- </template>
- <script>
- export default {
- data() {
- return {
- imgUrl: this.$imageUrl,
- dataList: [],
- pageNum: 1,
- refresherTriggered: false,
- }
- },
- async onLoad() {
- // await this.getList()
- },
- methods: {
- //获取列表数据
- async getList() {
- this.$api.post('/xxx/xxxlist', {
- pageNum: this.pageNum,
- pageSize: 10,
- }).then(res => {
- this.loadStatus = 0;
- let list = res.data.records;
- if(list.length < 10){
- this.loadStatus = 2;
- }
- this.dataList = this.dataList.concat(list);
- }).catch(() => {
- this.loadStatus = 2;
- }).finally(res => {
- this.refresherTriggered = false;
- })
- },
- // 滚动到底部
- scrolltolower(e) {
- if (this.loadStatus === 0) {
- this.pageNum++;
- this.getList();
- }
- },
- // 触发下拉刷新
- refresherrefresh(e) {
- this.refresherTriggered = true;
- this.dataList = [];
- this.pageNum = 1;
- this.getList();
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .list-container {
- .item {
- margin-top: 30rpx;
- background: #ffffff;
- padding: 20rpx 30rpx;
- .top {
- display: flex;
- align-items: center;
- image {
- width: 88rpx;
- height: 88rpx;
- border-radius: 50%;
- flex-shrink: 0;
- }
- .user {
- margin-left: 20rpx;
- flex: 1;
- .name {
- }
- .time {
- color: $sec-font;
- font-size: 24rpx;
- margin-top: 8rpx;
- }
- }
- .price {
- color: $assist-color;
- }
- }
- .title {
- margin-top: 20rpx;
- }
- .des {
- margin-top: 20rpx;
- }
- .imgs {
- display: flex;
- flex-wrap: wrap;
- image {
- width: 140rpx;
- height: 140rpx;
- margin-right: 20rpx;
- margin-top: 20rpx;
- }
- }
- .bottom {
- border-top: 1px solid #eaeaea;
- margin-top: 20rpx;
- padding-top: 20rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .location {
- font-size: 24rpx;
- color: $sec-font;
- }
- .u-button {
- height: 60rpx;
- }
- }
- }
- }
- </style>
|