index.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <u-navbar :titleStyle="{ color: '#fff' }" :autoBack="true" :title="state.title" :placeholder="true" :safeAreaInsetTop="true" :bgColor="proxy.$settingStore.themeColor.color">
  3. <template #left>
  4. <view class="u-navbar__content__left__item">
  5. <u-icon name="arrow-left" size="20" color="#fff"></u-icon>
  6. </view>
  7. </template>
  8. </u-navbar>
  9. <view class="view-text">
  10. <!-- <u-parse class="uni-body view-content" :content="content"></u-parse> -->
  11. <h3 style="text-align: center; line-height: 45px">{{ state.contentTitle }}</h3>
  12. <view>{{ state.content }}</view>
  13. </view>
  14. </template>
  15. <script setup>
  16. /*----------------------------------依赖引入-----------------------------------*/
  17. import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
  18. import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance, toRefs } from "vue";
  19. /*----------------------------------接口引入-----------------------------------*/
  20. /*----------------------------------组件引入-----------------------------------*/
  21. /*----------------------------------store引入-----------------------------------*/
  22. import { useStores, commonStores } from "@/store/modules/index";
  23. /*----------------------------------公共方法引入-----------------------------------*/
  24. /*----------------------------------公共变量-----------------------------------*/
  25. const { proxy } = getCurrentInstance();
  26. const useStore = useStores();
  27. /*----------------------------------变量声明-----------------------------------*/
  28. const state = reactive({
  29. title: "",
  30. content: "",
  31. contentTitle: "",
  32. });
  33. onLoad((options) => {
  34. state.title = options.title;
  35. state.content = options.content;
  36. state.contentTitle = options.contentTitle;
  37. });
  38. onShow(() => {
  39. //调用系统主题颜色
  40. proxy.$settingStore.systemThemeColor([1]);
  41. });
  42. </script>
  43. <style lang="scss" scoped>
  44. .view-text {
  45. padding: 5px;
  46. .view-content {
  47. font-size: 12px;
  48. color: #333;
  49. line-height: 24px;
  50. word-wrap: break-word;
  51. }
  52. }
  53. </style>