notice-coupon.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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-for="(cell, index) in list" :key="index">
  19. <tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
  20. <template v-slot:content>
  21. <view class="tui-notice-cell clearfix">
  22. <view class="tui-cell-top">
  23. <view class="cell-title"> {{ cell.text }} </view>
  24. <view class="cell-time"> {{ cell.time }} </view>
  25. </view>
  26. <view class="tui-cell-content">
  27. <text>{{ cell.content }}</text>
  28. </view>
  29. </view>
  30. </template>
  31. <template v-slot:button>
  32. <view class="tui-custom-btn_box">
  33. <view class="tui-custom-btn" @tap="deleteBtn(cell.id)">
  34. <text class="iconfont icon-shanchu3"></text>
  35. </view>
  36. </view>
  37. </template>
  38. </tui-swipe-action>
  39. </view>
  40. <!--加载loadding-->
  41. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  42. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
  43. <!--加载loadding-->
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import { mapState, mapMutations } from 'vuex'
  50. export default {
  51. data() {
  52. return {
  53. skeletonShow: true,
  54. listQuery: {
  55. userId: 0,
  56. pageNum: 1,
  57. pageSize: 10
  58. },
  59. list: [
  60. {
  61. text: '优惠券待领取通知',
  62. time: '2022-07-05 16:51:20',
  63. image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
  64. orderId: 1234,
  65. content:'采美平台送您10000元优惠券,众多大牌正品等着您,赶快去领取下单吧 >>'
  66. },
  67. {
  68. text: '优惠券过期通知',
  69. time: '2022-07-05 16:51:20',
  70. image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
  71. orderId: 1234,
  72. content:'您有100元优惠券今日即将过期,赶快去查看使用吧 >>'
  73. }
  74. ],
  75. isEmpty: false,
  76. loadding: false,
  77. pullUpOn: true,
  78. pullFlag: true,
  79. hasNextPage: false,
  80. nomoreText: '上拉显示更多'
  81. }
  82. },
  83. onLoad() {
  84. this.initData()
  85. },
  86. computed: {
  87. ...mapState(['hasLogin', 'userInfo'])
  88. },
  89. methods: {
  90. async initData() {
  91. const userInfo = await this.$api.getStorage()
  92. this.skeletonShow = false //预加载圆圈
  93. this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
  94. this.initGetCartGoodsList()
  95. },
  96. initGetCartGoodsList() {
  97. console.log('获取消息通知数据')
  98. },
  99. initLogin() {
  100. this.$api.redirectTo('/pages/login/login')
  101. }
  102. },
  103. onPullDownRefresh() {
  104. //下拉刷新
  105. uni.stopPullDownRefresh()
  106. },
  107. onShow() {}
  108. }
  109. </script>
  110. <style lang="scss">
  111. page {
  112. background-color: #f7f7f7;
  113. }
  114. .container-main {
  115. width: 100%;
  116. box-sizing: border-box;
  117. padding: 24rpx;
  118. .empty-container-image {
  119. width: 260rpx;
  120. height: 260rpx;
  121. margin-top: -300rpx;
  122. }
  123. }
  124. .tui-swipeout-content{
  125. white-space:normal !important;
  126. }
  127. .tui-notice{
  128. margin-bottom: 24rpx;
  129. }
  130. .tui-notice-cell {
  131. width: 100%;
  132. height: auto;
  133. background-color: #ffffff;
  134. border-radius: 16rpx;
  135. box-sizing: border-box;
  136. padding:16rpx 24rpx;
  137. float: left;
  138. .tui-cell-top{
  139. width: 100%;
  140. height: 88rpx;
  141. line-height: 88rpx;
  142. float: left;
  143. .cell-title{
  144. font-size: 32rpx;
  145. color: #333333;
  146. float: left;
  147. }
  148. .cell-time{
  149. font-size: 24rpx;
  150. color: #999999;
  151. float: right;
  152. }
  153. }
  154. .tui-cell-content{
  155. width: 100%;
  156. height: auto;
  157. float: left;
  158. box-sizing: border-box;
  159. line-height: 44rpx;
  160. padding: 24rpx;
  161. background-color: #F7F7F7;
  162. font-size: 28rpx;
  163. color: #666666;
  164. text-align: justify;
  165. }
  166. }
  167. .tui-custom-btn_box {
  168. width: 80px;
  169. height: 100%;
  170. padding: 0 20rpx;
  171. box-sizing: border-box;
  172. display: flex;
  173. align-items: center;
  174. justify-content: center;
  175. background-color: #f7f7f7;
  176. }
  177. .tui-custom-btn {
  178. width: 56rpx;
  179. height: 56rpx;
  180. border-radius: 50%;
  181. background-color: #f94b4b;
  182. color: #ffffff;
  183. display: flex;
  184. align-items: center;
  185. justify-content: center;
  186. flex-shrink: 0;
  187. .icon-shanchu3 {
  188. font-size: 32rpx;
  189. }
  190. }
  191. </style>