notice-users.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. StaticUrl: this.$Static,
  55. listQuery: {
  56. userId: 0,
  57. pageNum: 1,
  58. pageSize: 10
  59. },
  60. list: [
  61. {
  62. text: '注册成功通知',
  63. time: '2022-07-05 16:51:20',
  64. image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
  65. orderId: 1234,
  66. content:'欢迎成为采美机构用户,祝您开启愉快的采购之旅。'
  67. },
  68. {
  69. text: '购买超级会员成功',
  70. time: '2022-07-05 16:51:20',
  71. image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
  72. orderId: 1234,
  73. content:'您已成功购买3个月采美平台超级会员服务,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,快去看看吧 >>'
  74. }
  75. ],
  76. isEmpty: false,
  77. loadding: false,
  78. pullUpOn: true,
  79. pullFlag: true,
  80. hasNextPage: false,
  81. nomoreText: '上拉显示更多'
  82. }
  83. },
  84. onLoad() {
  85. this.initData()
  86. },
  87. computed: {
  88. ...mapState(['hasLogin', 'userInfo'])
  89. },
  90. methods: {
  91. async initData() {
  92. const userInfo = await this.$api.getStorage()
  93. this.skeletonShow = false //预加载圆圈
  94. this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
  95. this.initGetCartGoodsList()
  96. },
  97. initGetCartGoodsList() {
  98. console.log('获取消息通知数据')
  99. },
  100. initLogin() {
  101. this.$api.redirectTo('/pages/login/login')
  102. }
  103. },
  104. onPullDownRefresh() {
  105. //下拉刷新
  106. uni.stopPullDownRefresh()
  107. },
  108. onShow() {}
  109. }
  110. </script>
  111. <style lang="scss">
  112. page {
  113. background-color: #f7f7f7;
  114. }
  115. .container-main {
  116. width: 100%;
  117. box-sizing: border-box;
  118. padding: 24rpx;
  119. .empty-container-image {
  120. width: 260rpx;
  121. height: 260rpx;
  122. margin-top: -300rpx;
  123. }
  124. }
  125. .tui-swipeout-content{
  126. white-space:normal !important;
  127. }
  128. .tui-notice{
  129. margin-bottom: 24rpx;
  130. }
  131. .tui-notice-cell {
  132. width: 100%;
  133. height: auto;
  134. background-color: #ffffff;
  135. border-radius: 16rpx;
  136. box-sizing: border-box;
  137. padding:16rpx 24rpx;
  138. float: left;
  139. .tui-cell-top{
  140. width: 100%;
  141. height: 88rpx;
  142. line-height: 88rpx;
  143. float: left;
  144. .cell-title{
  145. font-size: 32rpx;
  146. color: #333333;
  147. float: left;
  148. }
  149. .cell-time{
  150. font-size: 24rpx;
  151. color: #999999;
  152. float: right;
  153. }
  154. }
  155. .tui-cell-content{
  156. width: 100%;
  157. height: auto;
  158. float: left;
  159. box-sizing: border-box;
  160. line-height: 44rpx;
  161. padding: 24rpx;
  162. background-color: #F7F7F7;
  163. font-size: 28rpx;
  164. color: #666666;
  165. text-align: justify;
  166. }
  167. }
  168. .tui-custom-btn_box {
  169. width: 80px;
  170. height: 100%;
  171. padding: 0 20rpx;
  172. box-sizing: border-box;
  173. display: flex;
  174. align-items: center;
  175. justify-content: center;
  176. background-color: #f7f7f7;
  177. }
  178. .tui-custom-btn {
  179. width: 56rpx;
  180. height: 56rpx;
  181. border-radius: 50%;
  182. background-color: #f94b4b;
  183. color: #ffffff;
  184. display: flex;
  185. align-items: center;
  186. justify-content: center;
  187. flex-shrink: 0;
  188. .icon-shanchu3 {
  189. font-size: 32rpx;
  190. }
  191. }
  192. </style>