notice-serve.vue 4.1 KB

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