details.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. <baPing />
  8. </view>
  9. </template>
  10. <script setup>
  11. /*----------------------------------依赖引入-----------------------------------*/
  12. import { onReady, onLoad, onShow, onNavigationBarButtonTap, onBackPress } from "@dcloudio/uni-app";
  13. import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance, toRefs } from "vue";
  14. /*----------------------------------接口引入-----------------------------------*/
  15. import { getMceList } from "@/api/mine/info.js";
  16. /*----------------------------------组件引入-----------------------------------*/
  17. /*----------------------------------store引入-----------------------------------*/
  18. /*----------------------------------公共方法引入-----------------------------------*/
  19. /*----------------------------------公共变量-----------------------------------*/
  20. const { proxy } = getCurrentInstance();
  21. /*----------------------------------变量声明-----------------------------------*/
  22. const data = ref();
  23. function init(options) {
  24. getMceList({
  25. current: 1,
  26. size: 10,
  27. id: options?.contentId,
  28. }).then((requset) => {
  29. data.value = requset.data.records[0];
  30. });
  31. }
  32. onBackPress((event) => {
  33. console.log("backbutton",new Date().getTime())
  34. uni.setStorageSync("backbutton", "top");
  35. })
  36. onLoad((options) => {
  37. init(options);
  38. });
  39. onShow(() => {
  40. //调用系统主题颜色
  41. proxy.$settingStore.systemThemeColor([1]);
  42. });
  43. </script>
  44. <style scoped>
  45. .view-title {
  46. font-weight: bold;
  47. }
  48. .view-content {
  49. font-size: 12px;
  50. padding: 12px 0 0;
  51. color: #333;
  52. line-height: 24px;
  53. font-weight: normal;
  54. text-indent: 20px;
  55. }
  56. .view-time {
  57. margin: 30px 0 10px;
  58. font-size: 12px;
  59. float: right;
  60. }
  61. </style>