contactUs.vue 1.3 KB

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