notice-activity.vue 4.9 KB

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