notice-activity.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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. uni.navigateTo({
  87. url: `/pages/h5/article/path?link=${cell.appLink}`
  88. })
  89. },
  90. },
  91. onReachBottom() {
  92. if (this.hasNextPage) {
  93. this.loadding = true
  94. this.pullUpOn = true
  95. this.getReachBottomData()
  96. }
  97. },
  98. onPullDownRefresh() {
  99. //下拉刷新
  100. this.listQuery.pageNum = 1
  101. this.getUserAuthClubMessageList()
  102. uni.stopPullDownRefresh()
  103. },
  104. onShow() {}
  105. }
  106. </script>
  107. <style lang="scss">
  108. page {
  109. background-color: #f7f7f7;
  110. }
  111. .container-main {
  112. width: 100%;
  113. box-sizing: border-box;
  114. padding: 24rpx 0;
  115. .empty-container-image {
  116. width: 260rpx;
  117. height: 260rpx;
  118. margin-top: -300rpx;
  119. }
  120. }
  121. .tui-notice {
  122. margin-bottom: 24rpx;
  123. }
  124. .tui-notice-cell {
  125. width: 702rpx;
  126. height: auto;
  127. background-color: #ffffff;
  128. border-radius: 16rpx;
  129. box-sizing: border-box;
  130. padding: 16rpx 24rpx;
  131. margin: 0 auto;
  132. .tui-cell-top {
  133. width: 100%;
  134. height: 88rpx;
  135. line-height: 88rpx;
  136. .cell-title {
  137. font-size: 32rpx;
  138. color: #333333;
  139. float: left;
  140. font-weight: bold;
  141. }
  142. .cell-time {
  143. font-size: 24rpx;
  144. color: #999999;
  145. float: right;
  146. }
  147. }
  148. .tui-cell-content {
  149. width: 100%;
  150. height: 160rpx;
  151. box-sizing: border-box;
  152. padding: 16rpx;
  153. border-radius: 8rpx;
  154. background-color: #f7f7f7;
  155. .cell-image {
  156. width: 128rpx;
  157. height: 128rpx;
  158. border-radius: 8rpx;
  159. float: left;
  160. image {
  161. width: 128rpx;
  162. height: 128rpx;
  163. display: block;
  164. border-radius: 8rpx;
  165. }
  166. }
  167. .cell-content {
  168. width: 490rpx;
  169. height: 100%;
  170. box-sizing: border-box;
  171. padding: 0 20rpx;
  172. line-height: 42rpx;
  173. font-size: 28rpx;
  174. color: #666666;
  175. text-align: justify;
  176. float: left;
  177. text-overflow: ellipsis;
  178. display: -webkit-box;
  179. word-break: break-all;
  180. -webkit-box-orient: vertical;
  181. -webkit-line-clamp: 3;
  182. overflow: hidden;
  183. }
  184. }
  185. .tui-cell-bot {
  186. width: 100%;
  187. height: 80rpx;
  188. box-sizing: border-box;
  189. padding: 16rpx 0 0 0;
  190. .tui-cell-btn {
  191. width: 160rpx;
  192. height: 64rpx;
  193. border-radius: 35rpx;
  194. box-sizing: border-box;
  195. border: 1px solid #999999;
  196. text-align: center;
  197. line-height: 64rpx;
  198. font-size: 26rpx;
  199. color: #333333;
  200. float: right;
  201. margin-left: 24rpx;
  202. }
  203. }
  204. }
  205. .tui-custom-btn_box {
  206. width: 80px;
  207. height: 100%;
  208. padding: 0 20rpx;
  209. box-sizing: border-box;
  210. display: flex;
  211. align-items: center;
  212. justify-content: center;
  213. background-color: #f7f7f7;
  214. }
  215. .tui-custom-btn {
  216. width: 56rpx;
  217. height: 56rpx;
  218. border-radius: 50%;
  219. background-color: #f94b4b;
  220. color: #ffffff;
  221. display: flex;
  222. align-items: center;
  223. justify-content: center;
  224. flex-shrink: 0;
  225. .icon-shanchu3 {
  226. font-size: 32rpx;
  227. }
  228. }
  229. </style>