notice-activity.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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
  19. class="tui-notice"
  20. v-else
  21. v-for="(cell, index) in list"
  22. :key="index"
  23. @click.stop="handleOrderClick(cell)"
  24. >
  25. <tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
  26. <template v-slot:content>
  27. <notice-cell :cellType="6" :cell="cell"></notice-cell>
  28. </template>
  29. <template v-slot:button>
  30. <view class="tui-custom-btn_box">
  31. <view class="tui-custom-btn" @click.stop="deleteBtn(cell.id, index)">
  32. <text class="iconfont icon-shanchu3"></text>
  33. </view>
  34. </view>
  35. </template>
  36. </tui-swipe-action>
  37. </view>
  38. <!--加载loadding-->
  39. <tui-loadmore :visible="loadding" :index="3" type="black" />
  40. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText" />
  41. <!--加载loadding-->
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. import { mapState, mapMutations } from 'vuex'
  48. import noticeMixins from './mixins/notice.mixins.js'
  49. import noticeCell from './components/notice-cell.vue'
  50. export default {
  51. mixins: [noticeMixins],
  52. components: {
  53. noticeCell
  54. },
  55. data() {
  56. return {
  57. skeletonShow: true,
  58. StaticUrl: this.$Static,
  59. listQuery: {
  60. source: 2,
  61. commonId: 0,
  62. messageType: 0,
  63. pageNum: 1,
  64. pageSize: 10
  65. },
  66. list: [],
  67. isEmpty: false,
  68. loadding: false,
  69. pullUpOn: true,
  70. pullFlag: true,
  71. hasNextPage: false,
  72. nomoreText: '上拉显示更多'
  73. }
  74. },
  75. onLoad(option) {
  76. this.initData(option)
  77. },
  78. methods: {
  79. async initData(option) {
  80. const userInfo = await this.$api.getStorage()
  81. this.listQuery.messageType = option.messageType
  82. this.listQuery.commonId = userInfo.clubId ? userInfo.clubId : 0
  83. this.getUserAuthClubMessageList()
  84. },
  85. handleOrderClick(cell) {
  86. console.log(cell)
  87. this.$api.navigateTo()
  88. },
  89. },
  90. onReachBottom() {
  91. if (this.hasNextPage) {
  92. this.loadding = true
  93. this.pullUpOn = true
  94. this.getReachBottomData()
  95. }
  96. },
  97. onPullDownRefresh() {
  98. //下拉刷新
  99. this.listQuery.pageNum = 1
  100. this.getUserAuthClubMessageList()
  101. uni.stopPullDownRefresh()
  102. },
  103. onShow() {}
  104. }
  105. </script>
  106. <style lang="scss">
  107. page {
  108. background-color: #f7f7f7;
  109. }
  110. .container-main {
  111. width: 100%;
  112. box-sizing: border-box;
  113. padding: 24rpx 0;
  114. .empty-container-image {
  115. width: 260rpx;
  116. height: 260rpx;
  117. margin-top: -300rpx;
  118. }
  119. }
  120. .tui-notice {
  121. margin-bottom: 24rpx;
  122. }
  123. .tui-notice-cell {
  124. width: 702rpx;
  125. height: auto;
  126. background-color: #ffffff;
  127. border-radius: 16rpx;
  128. box-sizing: border-box;
  129. padding: 16rpx 24rpx;
  130. margin: 0 auto;
  131. .tui-cell-top {
  132. width: 100%;
  133. height: 88rpx;
  134. line-height: 88rpx;
  135. .cell-title {
  136. font-size: 32rpx;
  137. color: #333333;
  138. float: left;
  139. font-weight: bold;
  140. }
  141. .cell-time {
  142. font-size: 24rpx;
  143. color: #999999;
  144. float: right;
  145. }
  146. }
  147. .tui-cell-content {
  148. width: 100%;
  149. height: 160rpx;
  150. box-sizing: border-box;
  151. padding: 16rpx;
  152. border-radius: 8rpx;
  153. background-color: #f7f7f7;
  154. .cell-image {
  155. width: 128rpx;
  156. height: 128rpx;
  157. border-radius: 8rpx;
  158. float: left;
  159. image {
  160. width: 128rpx;
  161. height: 128rpx;
  162. display: block;
  163. border-radius: 8rpx;
  164. }
  165. }
  166. .cell-content {
  167. width: 490rpx;
  168. height: 100%;
  169. box-sizing: border-box;
  170. padding: 0 20rpx;
  171. line-height: 40rpx;
  172. font-size: 28rpx;
  173. color: #666666;
  174. text-align: justify;
  175. float: left;
  176. }
  177. }
  178. .tui-cell-bot {
  179. width: 100%;
  180. height: 80rpx;
  181. box-sizing: border-box;
  182. padding: 16rpx 0 0 0;
  183. .tui-cell-btn {
  184. width: 160rpx;
  185. height: 64rpx;
  186. border-radius: 35rpx;
  187. box-sizing: border-box;
  188. border: 1px solid #999999;
  189. text-align: center;
  190. line-height: 64rpx;
  191. font-size: 26rpx;
  192. color: #333333;
  193. float: right;
  194. margin-left: 24rpx;
  195. }
  196. }
  197. }
  198. .tui-custom-btn_box {
  199. width: 80px;
  200. height: 100%;
  201. padding: 0 20rpx;
  202. box-sizing: border-box;
  203. display: flex;
  204. align-items: center;
  205. justify-content: center;
  206. background-color: #f7f7f7;
  207. }
  208. .tui-custom-btn {
  209. width: 56rpx;
  210. height: 56rpx;
  211. border-radius: 50%;
  212. background-color: #f94b4b;
  213. color: #ffffff;
  214. display: flex;
  215. align-items: center;
  216. justify-content: center;
  217. flex-shrink: 0;
  218. .icon-shanchu3 {
  219. font-size: 32rpx;
  220. }
  221. }
  222. </style>