notice-coupon.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="container cart clearfix">
  3. <tui-skeleton v-if="isRequest" :loadingType="3" :isLoading="true" />
  4. <view class="container-main" v-else>
  5. <view class="clearfix">
  6. <!-- 空白页 -->
  7. <view class="empty-container" v-if="isEmpty">
  8. <image mode="aspectFill" class="empty_notice" src="@/static/tabBar/emtry_notice.png"></image>
  9. <text class="error-text">暂无任何消息~</text>
  10. </view>
  11. <!-- 列表 -->
  12. <view
  13. class="tui-notice"
  14. v-else
  15. v-for="(cell, index) in dataValue"
  16. :key="index"
  17. @click.stop="handleOrderClick(cell)"
  18. >
  19. <tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
  20. <template v-slot:content>
  21. <notice-cell :cellType="4" :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. <image src="@/static/tabBar/delete_notice.png" class="deleteImage" mode="aspectFill"></image>
  27. </view>
  28. </view>
  29. </template>
  30. </tui-swipe-action>
  31. </view>
  32. <!--加载loadding-->
  33. <view v-if="showLoading">
  34. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  35. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
  36. </view>
  37. <!--加载loadding-->
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import { mapState, mapMutations } from 'vuex'
  44. import noticeMixins from './mixins/notice_mixins.js'
  45. import noticeCell from './components/notice-cell.vue'
  46. export default {
  47. mixins: [noticeMixins],
  48. components: {
  49. noticeCell
  50. },
  51. data() {
  52. return {
  53. }
  54. },
  55. onLoad(option) {
  56. this.initData(option)
  57. },
  58. methods: {
  59. async initData(option) {
  60. this.params.messageType = option.messageType
  61. this.getUserAuthClubMessageList()
  62. },
  63. handleOrderClick(cell) {
  64. const linkJumpMap = {
  65. 1: '/pages/views/coupon/coupon-receive',
  66. 2: '/pages/views/coupon/coupon-user',
  67. }
  68. uni.navigateTo({
  69. url: linkJumpMap[cell.couponMessageType]
  70. })
  71. this.clearCellNew(cell.id)
  72. }
  73. },
  74. onReachBottom() {
  75. if (this.hasNextPage) {
  76. this.loadding = true
  77. this.pullUpOn = true
  78. this.getUserAuthClubMessageList()
  79. }
  80. },
  81. onPullDownRefresh() {
  82. //下拉刷新
  83. this.listQuery.pageNum = 1
  84. this.getUserAuthClubMessageList()
  85. uni.stopPullDownRefresh()
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. page {
  91. background-color: #f7f7f7;
  92. }
  93. .container-main {
  94. width: 100%;
  95. box-sizing: border-box;
  96. padding: 24rpx 0;
  97. .empty-container {
  98. display: flex;
  99. flex-direction: column;
  100. align-items: center;
  101. justify-content: center;
  102. height: 60vh;
  103. }
  104. .empty_notice {
  105. width: 290rpx;
  106. height: 230rpx;
  107. }
  108. .error-text{
  109. color: #999999;
  110. font-size: 26rpx;
  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. }
  157. }
  158. .tui-custom-btn_box {
  159. width: 80px;
  160. height: 100%;
  161. padding: 0 20rpx;
  162. box-sizing: border-box;
  163. display: flex;
  164. align-items: center;
  165. justify-content: center;
  166. background-color: #f7f7f7;
  167. }
  168. .tui-custom-btn {
  169. width: 56rpx;
  170. height: 56rpx;
  171. border-radius: 50%;
  172. background-color: #f94b4b;
  173. color: #ffffff;
  174. display: flex;
  175. align-items: center;
  176. justify-content: center;
  177. flex-shrink: 0;
  178. .deleteImage{
  179. width: 56rpx;
  180. height: 56rpx;
  181. }
  182. }
  183. </style>