notice-serve.vue 4.2 KB

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