chatDetail.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view class="container">
  3. <view class="chat-box">
  4. <view class="header-box">
  5. <view class="icon-box">
  6. <cover-image class="icon" :src="`https://sylwt.top/api/visitor/resources/image?name=/ydl/menber-center/chat-icon/${chat.type}.png`"></cover-image>
  7. </view>
  8. <view class="title-box">
  9. {{chat.title}}
  10. </view>
  11. </view>
  12. <view class="main-box">
  13. {{chat.content}}
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script setup>
  19. import { ref } from 'vue'
  20. import { onLoad } from '@dcloudio/uni-app'
  21. import { detail } from '@/api/chat.js'
  22. const chatId = ref()
  23. const chatTitle = ref('')
  24. const chat = ref({
  25. id: '1',
  26. title: '课程提醒',
  27. content: '尊敬的用户,您预约2023年8月16日《广州市存量房网……》直播课堂已经开始,请及时观看!',
  28. createTime: '8/16',
  29. })
  30. onLoad((load) => {
  31. chatId.value = load.id
  32. detail(chatId.value).then(res => {
  33. if (res && res.message === 'success') {
  34. chat.value = res.data
  35. }
  36. })
  37. chatTitle.value = load.title
  38. uni.setNavigationBarTitle({
  39. title: chatTitle.value
  40. })
  41. })
  42. </script>
  43. <style lang="scss" scoped>
  44. .container {
  45. height: 100vh;
  46. width: 100vw;
  47. background-color: $uni-bg-color;
  48. padding: 0 40rpx;
  49. .chat-box {
  50. padding: 20rpx;
  51. background-color: $uni-text-color-inverse;
  52. margin-bottom: 30rpx;
  53. border-radius: $uni-card-border-radius;
  54. &:active {
  55. background-color: $uni-bg-color-hover;
  56. }
  57. .header-box {
  58. display: flex;
  59. align-items: center;
  60. margin-bottom: 10rpx;
  61. .icon-box {
  62. width: 50rpx;
  63. .icon {
  64. width: 35rpx;
  65. height: 35rpx;
  66. }
  67. }
  68. .title-box {
  69. font-size: $uni-title-font-size-2;
  70. font-weight: bolder;
  71. }
  72. }
  73. .main-box {
  74. padding: 10rpx;
  75. padding-bottom: 0;
  76. font-size: $uni-font-size-1;
  77. font-weight: bold;
  78. line-height: 40rpx;
  79. }
  80. }
  81. }
  82. </style>