index.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <view class="px32rpx py20rpx bg-white h-screen overflow-y-scroll" v-if="data">
  3. <view class="text-32rpx">{{ data.titile }}</view>
  4. <view class="text-[rgb(0,0,0,0.3)] text-24rpx mt24rpx mb24rpx">
  5. {{ data.sender }} {{ dayjs(data.sendTime).format("MM-DD ss:mm") }}</view
  6. >
  7. <view class="text-28rpx">
  8. <rich-text :nodes="text"></rich-text>
  9. </view>
  10. <view class="h112rpx"></view>
  11. </view>
  12. </template>
  13. <script setup lang="ts">
  14. import dayjs from "dayjs";
  15. const { data, send: getData } = useRequest(
  16. (id) => Apis.app.getMsgInfo({ params: { id } }),
  17. { immediate: false },
  18. );
  19. const text = computed(() => {
  20. if (data.value) {
  21. return data.value.msgContent.replace(
  22. /\<img/gi,
  23. '<img style="max-width:100%;height:auto" ',
  24. );
  25. }
  26. });
  27. onLoad(async (query: any) => {
  28. await getData(query.id);
  29. });
  30. </script>
  31. <style scoped lang="scss"></style>
  32. <route lang="json">
  33. {
  34. "name": "notificationDetailes",
  35. "style": {
  36. "navigationBarTitleText": "消息通知"
  37. }
  38. }
  39. </route>