notice-serve.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view class="container cart clearfix">
  3. <tui-skeleton
  4. v-if="skeletonShow"
  5. backgroundColor="#fafafa"
  6. borderRadius="10rpx"
  7. :isLoading="true"
  8. :loadingType="5"
  9. ></tui-skeleton>
  10. <view class="container-main" v-else>
  11. <view class="clearfix">
  12. <!-- 空白页 -->
  13. <view class="empty-container" v-if="isEmpty">
  14. <image class="empty-container-image" :src="staticUrl + '/icon/icon-notice-empty@2x.png'"></image>
  15. <text class="error-text">暂无任何消息~</text>
  16. </view>
  17. <!-- 列表 -->
  18. <view class="tui-notice clearfix" v-else v-for="(cell, index) in list" :key="index">
  19. <tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
  20. <template v-slot:content>
  21. <notice-cell :cellType="3" :cell="cell"></notice-cell>
  22. </template>
  23. <template v-slot:button>
  24. <view class="tui-custom-btn_box">
  25. <view class="tui-custom-btn" @click.stop="deleteBtn(cell.id,index)">
  26. <text class="iconfont icon-shanchu3"></text>
  27. </view>
  28. </view>
  29. </template>
  30. </tui-swipe-action>
  31. </view>
  32. <!--加载loadding-->
  33. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  34. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
  35. <!--加载loadding-->
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import { mapState, mapMutations } from 'vuex'
  42. import noticeMixins from './mixins/notice.mixins.js'
  43. import noticeCell from './components/notice-cell.vue'
  44. export default {
  45. mixins: [noticeMixins],
  46. components:{
  47. noticeCell
  48. },
  49. data() {
  50. return {
  51. skeletonShow: true,
  52. listQuery: {
  53. source: 2,
  54. commonId: 0,
  55. messageType: 0,
  56. pageNum: 1,
  57. pageSize: 10
  58. },
  59. list: [],
  60. isEmpty: false,
  61. loadding: false,
  62. pullUpOn: true,
  63. pullFlag: true,
  64. hasNextPage: false,
  65. nomoreText: '上拉显示更多'
  66. }
  67. },
  68. onLoad(option) {
  69. this.initData(option)
  70. },
  71. methods: {
  72. async initData(option) {
  73. const userInfo = await this.$api.getStorage()
  74. this.listQuery.messageType = option.messageType
  75. this.listQuery.commonId = userInfo.clubId ? userInfo.clubId : 0
  76. this.getUserAuthClubMessageList()
  77. }
  78. },
  79. onReachBottom() {
  80. if (this.hasNextPage) {
  81. this.loadding = true
  82. this.pullUpOn = true
  83. this.getReachBottomData()
  84. }
  85. },
  86. onPullDownRefresh() {
  87. //下拉刷新
  88. this.listQuery.pageNum = 1
  89. this.getUserAuthClubMessageList()
  90. uni.stopPullDownRefresh()
  91. },
  92. onShow() {}
  93. }
  94. </script>
  95. <style lang="scss">
  96. page {
  97. background-color: #f7f7f7;
  98. }
  99. .container-main {
  100. width: 100%;
  101. box-sizing: border-box;
  102. padding: 24rpx 0;
  103. .empty-container-image {
  104. width: 260rpx;
  105. height: 260rpx;
  106. margin-top: -300rpx;
  107. }
  108. }
  109. .tui-swipeout-content{
  110. white-space:normal !important;
  111. }
  112. .tui-notice{
  113. margin-bottom: 24rpx;
  114. }
  115. .tui-notice-cell {
  116. width: 702rpx;
  117. height: auto;
  118. background-color: #ffffff;
  119. border-radius: 16rpx;
  120. box-sizing: border-box;
  121. padding:16rpx 24rpx;
  122. margin: 0 auto;
  123. .tui-cell-top{
  124. width: 100%;
  125. height: 88rpx;
  126. line-height: 88rpx;
  127. float: left;
  128. .cell-title{
  129. font-size: 32rpx;
  130. color: #333333;
  131. float: left;
  132. font-weight: bold;
  133. }
  134. .cell-time{
  135. font-size: 24rpx;
  136. color: #999999;
  137. float: right;
  138. }
  139. }
  140. .tui-cell-content{
  141. width: 100%;
  142. height: auto;
  143. float: left;
  144. box-sizing: border-box;
  145. border-radius: 8rpx;
  146. line-height: 44rpx;
  147. padding: 24rpx;
  148. background-color: #F7F7F7;
  149. font-size: 28rpx;
  150. color: #666666;
  151. text-align: justify;
  152. }
  153. }
  154. .tui-custom-btn_box {
  155. width: 80px;
  156. height: 100%;
  157. padding: 0 20rpx;
  158. box-sizing: border-box;
  159. display: flex;
  160. align-items: center;
  161. justify-content: center;
  162. background-color: #f7f7f7;
  163. }
  164. .tui-custom-btn {
  165. width: 56rpx;
  166. height: 56rpx;
  167. border-radius: 50%;
  168. background-color: #f94b4b;
  169. color: #ffffff;
  170. display: flex;
  171. align-items: center;
  172. justify-content: center;
  173. flex-shrink: 0;
  174. .icon-shanchu3 {
  175. font-size: 32rpx;
  176. }
  177. }
  178. </style>