index.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view>
  3. <uni-card class="view-title" :title="data?.infoTitle || ''">
  4. <view class="uni-body view-content">{{ data?.infoContent || ''}}</view>
  5. <text class="uni-body view-time">{{ data?.createTime ? data.createTime.replace("T", " ") : ''}}</text>
  6. </uni-card>
  7. </view>
  8. </template>
  9. <script setup>
  10. import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
  11. import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance, toRefs } from "vue";
  12. import { getMceList } from "@/api/mine/info.js";
  13. const { proxy } = getCurrentInstance();
  14. const id = ref()//消息id
  15. const data = ref({});
  16. function init(){
  17. getMceList({
  18. current: 1,
  19. size: 10,
  20. id:id.value
  21. }).then((requset) => {
  22. data.value = requset.data.records[0]
  23. })
  24. }
  25. onLoad((options) => {
  26. id.value = options.id
  27. init()
  28. });
  29. onShow(() => {
  30. //调用系统主题颜色
  31. proxy.$settingStore.systemThemeColor([1]);
  32. });
  33. </script>
  34. <style scoped>
  35. .view-title {
  36. font-weight: bold;
  37. }
  38. .view-content {
  39. font-size: 26rpx;
  40. padding: 12px 0 0;
  41. color: #333;
  42. line-height: 24px;
  43. font-weight: normal;
  44. text-indent: 20px;
  45. }
  46. .view-time {
  47. margin:30px 0 10px;
  48. font-size: 24rpx;
  49. float: right;
  50. }
  51. </style>