123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <template>
- <view class="content">
- <empty v-if="loaded && list.length == 0"></empty>
- <view class="action" v-for="item in list" >
- <image :src="item.article.image_input[0]" mode="" class="action-img"></image>
- <view class="action-tit">
- <!-- {{item.status == 1 ? '已通过': (item.status == -1 ? '未通过': '待审核')}} -->
- {{item.article.title}}
- </view>
- <view class=" time">
- <view class="">
- 赠送:{{item.article.give_certificate}}骑行券
- </view>
- <view class="">
- 审核结果:{{item.status == 1 ? '已通过': (item.status == -1 ? '未通过': '待审核')}}
- </view>
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- </view>
- </template>
- <script>
- import {
- articleList,
- record,
- } from '@/api/index.js'
- export default {
- data() {
- return {
- page: 1,
- limit: 10,
- list: [],
- loadingType: 'more',
- loaded: false,
- type: 0,
- };
- },
- onLoad(opt) {
- if(opt.type) {
- this.type = opt.type
- }
- },
- onShow() {
- this.getActionList()
- },
- onReachBottom() {
- this.getActionList()
- },
- methods: {
- goAction(item) {
- if(this.type == 0) {
- uni.navigateTo({
- url: '/pages/shop/action?id=' + item.id
- })
- }
-
- },
- getActionList() {
- if (this.loadingType == 'loading' || this.loadingType == 'noMore') {
- return
- }
- this.loadingType = 'loading'
- record({
- page: this.page,
- limit: this.limit
- }).then(res => {
- this.list = this.list.concat(res.data.data)
- console.log(res.data.data);
- this.page++
- try{
- if (res.data.data.length == this.limit) {
- this.loadingType = 'more'
- } else {
- this.loadingType = 'noMore'
- }
- }catch(e){
- console.log(e);
- //TODO handle the exception
- }
-
- this.loaded = true
- })
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- page {
- background-color: #f2f2f2;
- height: auto;
- min-height: 100%;
- }
- .action {
- width: 700rpx;
- margin: 25rpx auto;
- border-radius: 35rpx;
- overflow: hidden;
- background-color: #fff;
- .action-img {
- width: 700rpx;
- height: 300rpx;
- background-color: #333;
- }
- .action-tit {
- min-height: 100rpx;
- font-size: 34rpx;
- font-weight: 500;
- color: #0E0E0E;
- display: flex;
- align-items: center;
- padding: 15rpx;
- padding-left: 30rpx;
- }
- }
- .time {
- font-size: 12rpx;
- padding: 20rpx;
- padding-top: 0;
- }
- </style>
|