notice-users.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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 clearfix"
  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="2" :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"></tui-loadmore>
  40. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
  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. listQuery: {
  59. source: 2,
  60. commonId: 0,
  61. messageType: 0,
  62. pageNum: 1,
  63. pageSize: 10
  64. },
  65. list: [],
  66. isEmpty: false,
  67. loadding: false,
  68. pullUpOn: true,
  69. pullFlag: true,
  70. hasNextPage: false,
  71. nomoreText: '上拉显示更多'
  72. }
  73. },
  74. onLoad(option) {
  75. this.initData(option)
  76. },
  77. methods: {
  78. async initData(option) {
  79. const userInfo = await this.$api.getStorage()
  80. this.listQuery.messageType = option.messageType
  81. this.listQuery.commonId = userInfo.clubId ? userInfo.clubId : 0
  82. this.getUserAuthClubMessageList()
  83. },
  84. handleOrderClick(cell) {
  85. const linkJumpMap = {
  86. 2: `/pages/user/member/member`,
  87. 3: `/pages/user/member/member`,
  88. 4: `/pages/user/member/member`,
  89. 6: `/pages/login/apply`
  90. }
  91. this.$api.navigateTo(linkJumpMap[cell.accountType])
  92. }
  93. },
  94. onReachBottom() {
  95. if (this.hasNextPage) {
  96. this.loadding = true
  97. this.pullUpOn = true
  98. this.getReachBottomData()
  99. }
  100. },
  101. onPullDownRefresh() {
  102. //下拉刷新
  103. this.listQuery.pageNum = 1
  104. this.getUserAuthClubMessageList()
  105. uni.stopPullDownRefresh()
  106. },
  107. onShow() {}
  108. }
  109. </script>
  110. <style lang="scss">
  111. page {
  112. background-color: #f7f7f7;
  113. }
  114. .container-main {
  115. width: 100%;
  116. box-sizing: border-box;
  117. padding: 24rpx 0;
  118. .empty-container-image {
  119. width: 260rpx;
  120. height: 260rpx;
  121. margin-top: -300rpx;
  122. }
  123. }
  124. .tui-swipeout-content {
  125. white-space: normal !important;
  126. }
  127. .tui-notice {
  128. margin-bottom: 24rpx;
  129. }
  130. .tui-notice-cell {
  131. width: 702rpx;
  132. height: auto;
  133. background-color: #ffffff;
  134. border-radius: 16rpx;
  135. box-sizing: border-box;
  136. padding: 16rpx 24rpx;
  137. margin: 0 auto;
  138. .tui-cell-top {
  139. width: 100%;
  140. height: 88rpx;
  141. line-height: 88rpx;
  142. float: left;
  143. .cell-title {
  144. font-size: 32rpx;
  145. color: #333333;
  146. float: left;
  147. font-weight: bold;
  148. }
  149. .cell-time {
  150. font-size: 24rpx;
  151. color: #999999;
  152. float: right;
  153. }
  154. }
  155. .tui-cell-content {
  156. width: 100%;
  157. height: auto;
  158. float: left;
  159. box-sizing: border-box;
  160. border-radius: 8rpx;
  161. line-height: 44rpx;
  162. padding: 24rpx;
  163. background-color: #f7f7f7;
  164. font-size: 28rpx;
  165. color: #666666;
  166. text-align: justify;
  167. }
  168. }
  169. .tui-custom-btn_box {
  170. width: 80px;
  171. height: 100%;
  172. padding: 0 20rpx;
  173. box-sizing: border-box;
  174. display: flex;
  175. align-items: center;
  176. justify-content: center;
  177. background-color: #f7f7f7;
  178. }
  179. .tui-custom-btn {
  180. width: 56rpx;
  181. height: 56rpx;
  182. border-radius: 50%;
  183. background-color: #f94b4b;
  184. color: #ffffff;
  185. display: flex;
  186. align-items: center;
  187. justify-content: center;
  188. flex-shrink: 0;
  189. .icon-shanchu3 {
  190. font-size: 32rpx;
  191. }
  192. }
  193. </style>