chat.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view class="container">
  3. <view class="search-box">
  4. <u-search
  5. v-model="searchForm.keyword"
  6. :clearabled="true"
  7. bg-color="#E5E5E5"
  8. :input-style="searchInputStyle"
  9. placeholder="请输入搜索内容"
  10. ></u-search>
  11. </view>
  12. <view class="list-box">
  13. <view class="list-item-box">
  14. <view class="main-box">
  15. <view class="icon-box">
  16. </view>
  17. <view class="content-box">
  18. <view class="title">
  19. XXXX通知
  20. </view>
  21. <view class="text">
  22. 尊敬的用户,您在2025年01月10日09:00收到了一条通知
  23. </view>
  24. </view>
  25. <view class="other-box">
  26. <view class="date">
  27. 8/16
  28. </view>
  29. <view class="tag">
  30. 1
  31. </view>
  32. </view>
  33. </view>
  34. <view class="line-box"></view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script setup>
  40. import { ref } from 'vue'
  41. import { onLoad } from '@dcloudio/uni-app'
  42. const searchInputStyle = {
  43. backgroundColor: '#E5E5E5'
  44. }
  45. const searchForm = ref({
  46. keyword: ''
  47. })
  48. onLoad(() => {
  49. uni.setTabBarBadge({ //显示数字
  50. index: 1, //tabbar下标
  51. text: '999' //数字
  52. })
  53. })
  54. </script>
  55. <style lang="scss" scoped>
  56. .container {
  57. height: 100vh;
  58. width: 100vw;
  59. background-color: $uni-bg-color;
  60. padding: 0 20rpx;
  61. .search-box {
  62. margin-bottom: 20rpx;
  63. ::v-deep(.u-search) {
  64. background-color: #e5e5e5;
  65. border-radius: 50rpx;
  66. .u-action {
  67. width: 18%;
  68. background-color: $uni-color-primary;
  69. border-radius: 50rpx;
  70. color: $uni-text-color-inverse;
  71. margin-right: 8rpx;
  72. font-size: 28rpx;
  73. line-height: 50rpx;
  74. letter-spacing: 3rpx;
  75. text-align: center;
  76. }
  77. }
  78. }
  79. .list-box {
  80. padding: 0 20rpx;
  81. .list-item-box {
  82. .main-box {
  83. display: flex;
  84. justify-content: space-between;
  85. align-items: center;
  86. padding: 20rpx 0;
  87. .icon-box {
  88. width: 15%;
  89. display: flex;
  90. justify-content: center;
  91. align-items: center;
  92. }
  93. .content-box {
  94. width: 67%;
  95. display: flex;
  96. flex-direction: column;
  97. justify-content: space-around;
  98. gap: 10rpx;
  99. .title {
  100. height: calc(70% - 5rpx);
  101. font-size: $uni-title-font-size-2;
  102. font-weight: bold;
  103. }
  104. .text {
  105. height: calc(30% - 5rpx);
  106. font-size: $uni-font-size-3;
  107. color: $uni-text-color-grey;
  108. @include text-overflow();
  109. }
  110. }
  111. .other-box {
  112. width: 18%;
  113. display: flex;
  114. flex-direction: column;
  115. justify-content: space-around;
  116. align-items: center;
  117. gap: 10rpx;
  118. .date {
  119. font-size: $uni-font-size-3;
  120. color: $uni-text-color-grey;
  121. }
  122. .tag {
  123. font-size: $uni-font-size-3;
  124. width: 42rpx;
  125. background-color: $uni-color-error;
  126. color: $uni-text-color-inverse;
  127. border-radius: 20rpx;
  128. text-align: center;
  129. }
  130. }
  131. }
  132. .line-box {
  133. height: 1rpx;
  134. width: 80%;
  135. background-color: #E5E5E5;
  136. margin: 0 auto;
  137. }
  138. }
  139. }
  140. }
  141. </style>