notice-users.vue 4.3 KB

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