notice-serve.vue 3.9 KB

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