messageList.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="message-list">
  3. <view class="tab-list">
  4. <span class="tab-item" v-for="(item,index) in list" :key="index" @click="curNow = index" :class="curNow == index ? 'active' :''">{{item}}</span>
  5. </view>
  6. <view class="swiper-box">
  7. <template v-if="messageList.length">
  8. <u-list @scrolltolower="scrolltolower" :preLoadScreen="1.5" v-show="curNow == 0">
  9. <u-list-item v-for="(item, index) in messageList" :key="index">
  10. <view class="message-card">
  11. <view class="card-title">
  12. <uni-icons custom-prefix="elicon" type="el-icon-s-promotion" size="16" color="#4680F9"></uni-icons>
  13. 价格申请
  14. </view>
  15. <p class="card-info">
  16. 善良的咖啡机提交了关于什么什么价格申请......善良的 咖啡机提交了关于什么什么价格申请......
  17. </p>
  18. </view>
  19. </u-list-item>
  20. </u-list>
  21. <u-list @scrolltolower="scrolltolower" :preLoadScreen="1.5" v-show="curNow == 1">
  22. <u-list-item v-for="(item, index) in messageList" :key="index">
  23. <view class="message-card">
  24. <view class="card-title">
  25. <uni-icons custom-prefix="elicon" type="el-icon-s-promotion" size="16" color="#4680F9"></uni-icons>
  26. 授信申请
  27. </view>
  28. <p class="card-info">
  29. 善良的咖啡机提交了关于什么什么授信申请......善良的 咖啡机提交了关于什么什么授信申请......
  30. </p>
  31. </view>
  32. </u-list-item>
  33. </u-list>
  34. <u-list @scrolltolower="scrolltolower" :preLoadScreen="1.5" v-show="curNow == 2">
  35. <u-list-item v-for="(item, index) in messageList" :key="index">
  36. <view class="message-card">
  37. <view class="card-title">
  38. <uni-icons custom-prefix="elicon" type="el-icon-s-promotion" size="16" color="#4680F9"></uni-icons>
  39. 采购申请
  40. </view>
  41. <p class="card-info">
  42. 善良的咖啡机提交了关于什么什么采购申请......善良的 咖啡机提交了关于什么什么采购申请......
  43. </p>
  44. </view>
  45. </u-list-item>
  46. </u-list>
  47. </template>
  48. <template v-else>
  49. <u-empty mode="orderTypeList" icon="https://cdn.uviewui.com/uview/empty/list.png">
  50. </u-empty>
  51. </template>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. export default {
  57. data(){
  58. return {
  59. list: ['提醒消息', '催办消息', '其他消息'],
  60. curNow:0,
  61. messageList:[
  62. {
  63. }
  64. ],
  65. }
  66. },
  67. methods:{
  68. sectionChange(e){
  69. this.curNow = e
  70. }
  71. }
  72. }
  73. </script>
  74. <style scoped>
  75. /* #ifndef APP-NVUE */
  76. view {
  77. display: flex;
  78. box-sizing: border-box;
  79. flex-direction: column;
  80. }
  81. page {
  82. background-color: #f5f7fa;
  83. }
  84. /* #endif */
  85. </style>
  86. <style lang="scss" scoped>
  87. .message-list{
  88. flex: 1;
  89. .tab-list{
  90. background-color: #fff;
  91. flex-direction: row;
  92. justify-content: space-evenly;
  93. .tab-item{
  94. width: 140rpx;
  95. line-height: 110rpx;
  96. }
  97. .active{
  98. position: relative;
  99. &::after{
  100. content: '';
  101. width: 80rpx;
  102. height: 5rpx;
  103. background-color: #4680f9;
  104. position: absolute;
  105. bottom: 0;
  106. left: 30rpx;
  107. }
  108. }
  109. }
  110. .swiper-box{
  111. padding:30rpx 30rpx;
  112. .message-card{
  113. padding:0 30rpx;
  114. background-color: #fff;
  115. border-radius: 10rpx;
  116. margin-bottom: 30rpx;
  117. .card-title{
  118. display: flex;
  119. flex-direction: row;
  120. font-size: 30rpx;
  121. line-height: 108rpx;
  122. border-bottom: 1px solid #F2F2F2;
  123. }
  124. .card-info{
  125. color: #222;
  126. font-size: 24rpx;
  127. padding: 30rpx 0;
  128. overflow: hidden;
  129. text-overflow: ellipsis;
  130. white-space: nowrap;
  131. }
  132. }
  133. }
  134. }
  135. </style>