actionDetail.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="content">
  3. <view class="" style="height: 1rpx;"></view>
  4. <empty v-if="loaded === true && list.length === 0"></empty>
  5. <view class="action-wrap" v-for="item in list">
  6. <image src="" mode=""></image>
  7. </view>
  8. <uni-load-more :status="loadingType"></uni-load-more>
  9. </view>
  10. </template>
  11. <script>
  12. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  13. import empty from '@/components/empty';
  14. export default {
  15. components: {
  16. uniLoadMore,
  17. empty
  18. },
  19. data() {
  20. return {
  21. page: 1,
  22. limit: 10,
  23. loadingType: 'more',
  24. loaded: false,
  25. list: []
  26. }
  27. },
  28. onLoad(opt) {
  29. },
  30. onShow() {
  31. },
  32. onReachBottom() {
  33. },
  34. onReady() {
  35. },
  36. methods: {
  37. getList() {
  38. let that = this
  39. if(that.loadingType == 'loading' || that.loadingType == 'noMore') {
  40. return
  41. }
  42. getActionList({
  43. page: that.page,
  44. limit: that.limit
  45. }).then(res => {
  46. let list = res.data.list
  47. that.list = that.list.concat(list)
  48. that.page++
  49. if(list.length == that.limit) {
  50. that.loadingType = 'more'
  51. }else {
  52. that.loadingType = 'noMore'
  53. }
  54. that.loaded = true
  55. })
  56. }
  57. }
  58. }
  59. </script>
  60. <style lang="scss">
  61. .action-wrap {
  62. width: 704rpx;
  63. height: 330rpx;
  64. margin:20rpx auto;
  65. image {
  66. width: 704rpx;
  67. height: 330rpx;
  68. border-radius: 20rpx;
  69. }
  70. }
  71. </style>