message.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view class="message-page custom_status_bar">
  3. <view class="nav">
  4. <view class="back" @click="back">
  5. <uni-icons type="back" size="20"></uni-icons>
  6. </view>
  7. <view class="title">消息</view>
  8. <template>
  9. <view @click="clickRight" class="nav-right" v-if="status===0">
  10. <image class="icon" src="/static/message/nav1.png" mode="widthFix"></image>
  11. <text>清除未读</text>
  12. </view>
  13. <view @click="clickRight" class="nav-right read" v-else>
  14. <image class="icon" src="/static/message/nav2.png" mode="widthFix"></image>
  15. <text>全部已读</text>
  16. </view>
  17. </template>
  18. </view>
  19. <view class="container">
  20. <uni-list-chat
  21. v-for="(item,index) in items"
  22. :key="index"
  23. :avatar-circle="true"
  24. title="uni-app"
  25. avatar="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png"
  26. note="您收到一条新的消息" >
  27. <view class="chat-custom-right">
  28. <text class="chat-custom-text">20:20</text>
  29. <view >
  30. <uni-badge class="uni-badge-left-margin" text="112" />
  31. </view>
  32. </view>
  33. </uni-list-chat>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. status:0,
  42. items:[]
  43. }
  44. },
  45. onShow() {
  46. this.getData()
  47. },
  48. methods: {
  49. back(){
  50. uni.navigateBack()
  51. },
  52. clickRight(){
  53. this.status=1
  54. },
  55. getData(){
  56. this.items=10
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss" scoped>
  62. .message-page{
  63. /* #ifdef MP-WEIXIN */
  64. padding-top: 30px;
  65. /* #endif */
  66. background-color: rgba(243, 244, 247, 1);
  67. box-sizing: border-box;
  68. min-height: 100vh;
  69. .nav{
  70. height: 44px;
  71. display: flex;
  72. align-items: center;
  73. padding: 0 10px;
  74. height: 44px;
  75. font-size: 12px;
  76. color: rgb(51, 51, 51);
  77. background-color: rgb(255, 255, 255);
  78. .back{
  79. width: 140rpx;
  80. }
  81. .title{
  82. flex: 1;
  83. text-align: center;
  84. font-size: 14px;
  85. overflow: hidden;
  86. white-space: nowrap;
  87. text-overflow: ellipsis;
  88. }
  89. .nav-right{
  90. display: flex;
  91. justify-items: center;
  92. align-items: center;
  93. color: rgba(151, 151, 151, 1);
  94. &.read{
  95. color: rgba(42, 91, 238, 1);
  96. }
  97. .icon{
  98. width: 44rpx;
  99. }
  100. }
  101. }
  102. .container{
  103. margin-top: 16rpx;
  104. .chat-custom-text{
  105. font-size: 28rpx;
  106. color: rgba(151, 151, 151, 1);
  107. }
  108. }
  109. }
  110. </style>