contactUs.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
  11. import { query } from '@/api/contactUs.js'
  12. const data = ref({
  13. content: ''
  14. })
  15. onShareAppMessage(async (res) => {
  16. return {
  17. title: '联系我们',
  18. path: '/pages/contactUs/contactUs'
  19. };
  20. })
  21. onShareTimeline(async () => {
  22. // console.log(imgurl.value)
  23. return {
  24. title: '联系我们',
  25. query: ''
  26. };
  27. })
  28. onLoad(() => {
  29. query().then(res => {
  30. if (res && res.message === 'success') {
  31. data.value = res.data
  32. }
  33. })
  34. })
  35. </script>
  36. <style lang="scss" scoped>
  37. .container {
  38. padding: 20px;
  39. background-color: #ffffff;
  40. display: flex;
  41. flex-direction: column;
  42. justify-content: space-between;
  43. /* height: 100vh; */
  44. /* 让页面高度撑满 */
  45. margin-bottom: env(safe-area-inset-bottom, 0);
  46. .title {
  47. font-size: 24px;
  48. font-weight: bold;
  49. color: #333;
  50. text-align: center;
  51. /* 标题居中 */
  52. margin-bottom: 15px;
  53. }
  54. .content {
  55. flex: 1;
  56. /* 占据剩余空间 */
  57. display: flex;
  58. flex-direction: column;
  59. align-items: flex-start;
  60. /* 内容左对齐 */
  61. }
  62. .body {
  63. font-size: 16px;
  64. color: #555;
  65. text-align: left;
  66. /* 内容左对齐 */
  67. }
  68. .body img {
  69. width: 50%;
  70. height: auto;
  71. }
  72. .date {
  73. font-size: 14px;
  74. color: #999;
  75. text-align: right;
  76. /* 时间右对齐 */
  77. margin-top: 10px;
  78. /* 与内容分离 */
  79. }
  80. }
  81. </style>