zhiyin.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view class="container">
  3. <web-view :src="pdfUrl" v-if="pdfUrl"></web-view>
  4. </view>
  5. </template>
  6. <script setup>
  7. import { ref } from 'vue'
  8. import { onLoad } from '@dcloudio/uni-app'
  9. // import { query } from '@/api/contactUs.js'
  10. const pageTitle = ref('')
  11. const pdfUrl = ref(null)
  12. onLoad((load) => {
  13. pageTitle.value = load.title
  14. uni.setNavigationBarTitle({
  15. title: pageTitle.value
  16. })
  17. pdfUrl.value = load.pdfUrl
  18. // query().then(res => {
  19. // if (res && res.code === 0) {
  20. // data.value = res.data
  21. // }
  22. // })
  23. })
  24. </script>
  25. <style lang="scss" scoped>
  26. .container {
  27. padding: 20px;
  28. background-color: #ffffff;
  29. display: flex;
  30. flex-direction: column;
  31. justify-content: space-between;
  32. /* height: 100vh; */
  33. /* 让页面高度撑满 */
  34. margin-bottom: env(safe-area-inset-bottom, 0);
  35. .title {
  36. font-size: 24px;
  37. font-weight: bold;
  38. color: #333;
  39. text-align: center;
  40. /* 标题居中 */
  41. margin-bottom: 15px;
  42. }
  43. .content {
  44. flex: 1;
  45. /* 占据剩余空间 */
  46. display: flex;
  47. flex-direction: column;
  48. align-items: flex-start;
  49. /* 内容左对齐 */
  50. }
  51. .body {
  52. font-size: 16px;
  53. color: #555;
  54. text-align: left;
  55. /* 内容左对齐 */
  56. }
  57. .body img {
  58. width: 50%;
  59. height: auto;
  60. }
  61. .date {
  62. font-size: 14px;
  63. color: #999;
  64. text-align: right;
  65. /* 时间右对齐 */
  66. margin-top: 10px;
  67. /* 与内容分离 */
  68. }
  69. }
  70. </style>