notice-users.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. 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. const linkJumpMap = {
  89. 2: `/pages/user/member/member`,
  90. 3: `/pages/user/member/member`,
  91. 4: `/pages/user/member/member`,
  92. 6: `/pages/login/apply`
  93. }
  94. this.userClubBehaviorInfo(linkJumpMap[cell.accountType])
  95. this.$api.navigateTo(linkJumpMap[cell.accountType])
  96. }
  97. },
  98. onReachBottom() {
  99. if (this.hasNextPage) {
  100. this.loadding = true
  101. this.pullUpOn = true
  102. this.getReachBottomData()
  103. }
  104. },
  105. onPullDownRefresh() {
  106. //下拉刷新
  107. this.listQuery.pageNum = 1
  108. this.getUserAuthClubMessageList()
  109. uni.stopPullDownRefresh()
  110. },
  111. onShow() {}
  112. }
  113. </script>
  114. <style lang="scss">
  115. page {
  116. background-color: #f7f7f7;
  117. }
  118. .container-main {
  119. width: 100%;
  120. box-sizing: border-box;
  121. padding: 24rpx 0;
  122. .empty-container-image {
  123. width: 260rpx;
  124. height: 260rpx;
  125. margin-top: -300rpx;
  126. }
  127. }
  128. .tui-swipeout-content {
  129. white-space: normal !important;
  130. }
  131. .tui-notice {
  132. margin-bottom: 24rpx;
  133. }
  134. .tui-notice-cell {
  135. width: 702rpx;
  136. height: auto;
  137. background-color: #ffffff;
  138. border-radius: 16rpx;
  139. box-sizing: border-box;
  140. padding: 16rpx 24rpx;
  141. margin: 0 auto;
  142. .tui-cell-top {
  143. width: 100%;
  144. height: 88rpx;
  145. line-height: 88rpx;
  146. float: left;
  147. .cell-title {
  148. font-size: 32rpx;
  149. color: #333333;
  150. float: left;
  151. font-weight: bold;
  152. }
  153. .cell-time {
  154. font-size: 24rpx;
  155. color: #999999;
  156. float: right;
  157. }
  158. }
  159. .tui-cell-content {
  160. width: 100%;
  161. height: auto;
  162. float: left;
  163. box-sizing: border-box;
  164. border-radius: 8rpx;
  165. line-height: 44rpx;
  166. padding: 24rpx;
  167. background-color: #f7f7f7;
  168. font-size: 28rpx;
  169. color: #666666;
  170. text-align: justify;
  171. }
  172. }
  173. .tui-custom-btn_box {
  174. width: 80px;
  175. height: 100%;
  176. padding: 0 20rpx;
  177. box-sizing: border-box;
  178. display: flex;
  179. align-items: center;
  180. justify-content: center;
  181. background-color: #f7f7f7;
  182. }
  183. .tui-custom-btn {
  184. width: 56rpx;
  185. height: 56rpx;
  186. border-radius: 50%;
  187. background-color: #f94b4b;
  188. color: #ffffff;
  189. display: flex;
  190. align-items: center;
  191. justify-content: center;
  192. flex-shrink: 0;
  193. .icon-shanchu3 {
  194. font-size: 32rpx;
  195. }
  196. }
  197. </style>