index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="share">
  3. <zs-list mt="0" @load="loadShareMore" :status="shareStatus">
  4. <view class="share-item" v-for="item in shareList" :key="item.id">
  5. <view class="header">
  6. <view class="avatar">
  7. <u-avatar class="img" size="60" :src="item.imgPath"></u-avatar>
  8. <view class="nickname">
  9. {{ item.nickname }}
  10. </view>
  11. </view>
  12. <view class="date">
  13. {{ item.showTime }}
  14. </view>
  15. </view>
  16. <view class=content>
  17. {{ item.communityDetail }}
  18. </view>
  19. <view class="pics">
  20. <u-album :urls="item.urls" :multipleSize="232"></u-album>
  21. </view>
  22. </view>
  23. </zs-list>
  24. </view>
  25. </template>
  26. <script>
  27. import { goodsSharePage } from '@/api/study'
  28. export default {
  29. data() {
  30. return {
  31. shareStatus: 'more',
  32. shareList: [],
  33. shareQuery: {
  34. currentPage: 1,
  35. pageSize: 10,
  36. goodsId: 0,
  37. state: 2
  38. },
  39. loading: true,
  40. };
  41. },
  42. methods: {
  43. loadShareMore() {
  44. this.getshareList()
  45. },
  46. getshareList() {
  47. this.shareStatus = 'loading'
  48. goodsSharePage(this.shareQuery).then(res => {
  49. if (res.state == 'Success') {
  50. this.shareList = this.shareList.concat(res.content.records)
  51. if (this.shareList.length >= res.content.total) {
  52. this.shareStatus = 'noMore'
  53. } else {
  54. this.shareStatus = 'more'
  55. this.shareQuery.pageCurrent++
  56. }
  57. }
  58. })
  59. },
  60. },
  61. onLoad({ goodsId }) {
  62. this.shareQuery.goodsId = goodsId
  63. this.getshareList()
  64. }
  65. };
  66. </script>
  67. <style lang="scss" scoped>
  68. .share {
  69. border-top: 1px solid #F0F0F0;
  70. min-height: 100vh;
  71. background-color: #F9F9F9;
  72. .share-item {
  73. padding: 20rpx;
  74. margin-bottom: 20rpx;
  75. background: #FFFFFF;
  76. .header {
  77. display: flex;
  78. justify-content: space-between;
  79. align-items: center;
  80. margin-bottom: 24rpx;
  81. .avatar {
  82. display: flex;
  83. align-items: center;
  84. .nickname {
  85. font-size: 28rpx;
  86. color: #222222;
  87. margin-left: 16rpx;
  88. }
  89. }
  90. .date {
  91. font-size: 24rpx;
  92. color: #AAAAAA;
  93. }
  94. }
  95. .content {
  96. font-size: 28rpx;
  97. color: #222222;
  98. margin-bottom: 24rpx;
  99. }
  100. .pics{
  101. border-radius: 16rpx;
  102. overflow: hidden;
  103. // background-color: red;
  104. }
  105. }
  106. margin-bottom: 20rpx;
  107. }
  108. </style>