quesinfo.nvue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view class="page">
  3. <!-- 状态栏占位 -->
  4. <view class="status-bar" :style="{height: statusBarHeight + 'px'}"></view>
  5. <!-- 自定义导航栏 -->
  6. <view class="nav-bar">
  7. <image src="/static/public/backBlack.png" mode="aspectFill" class="back-img" @click="goBack"></image>
  8. <text class="nav-title">问题解答</text>
  9. <view class="nav-right"></view>
  10. </view>
  11. <!-- 内容区域 -->
  12. <scroll-view class="content-scroll" scroll-y="true">
  13. <text class="ques-title">{{title}}</text>
  14. <rich-text class="rich-content" :nodes="detail"></rich-text>
  15. </scroll-view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. statusBarHeight: 44,
  23. id: '',
  24. title: '',
  25. detail: ''
  26. }
  27. },
  28. onLoad(options) {
  29. const sysInfo = uni.getSystemInfoSync()
  30. this.statusBarHeight = sysInfo.statusBarHeight || 44
  31. if (options && options.id) {
  32. this.id = options.id
  33. }
  34. if (options && options.title) {
  35. this.title = decodeURIComponent(options.title)
  36. }
  37. this.init()
  38. },
  39. methods: {
  40. goBack() {
  41. uni.navigateBack()
  42. },
  43. init() {
  44. // TODO: 后续对接后台接口获取问题详情
  45. }
  46. }
  47. }
  48. </script>
  49. <style>
  50. .page {
  51. flex: 1;
  52. background-color: #FFFFFF;
  53. }
  54. .status-bar {
  55. background-color: #FFFFFF;
  56. }
  57. .nav-bar {
  58. flex-direction: row;
  59. align-items: center;
  60. justify-content: space-between;
  61. height: 88rpx;
  62. padding-left: 54rpx;
  63. padding-right: 54rpx;
  64. background-color: #FFFFFF;
  65. }
  66. .back-img {
  67. width: 50rpx;
  68. height: 50rpx;
  69. }
  70. .nav-title {
  71. font-weight: bold;
  72. font-size: 32rpx;
  73. color: #545F71;
  74. }
  75. .nav-right {
  76. width: 50rpx;
  77. height: 50rpx;
  78. }
  79. /* 内容区域 */
  80. .content-scroll {
  81. flex: 1;
  82. padding-left: 38rpx;
  83. padding-right: 38rpx;
  84. padding-top: 20rpx;
  85. }
  86. .ques-title {
  87. font-weight: bold;
  88. font-size: 36rpx;
  89. color: #545F71;
  90. margin-bottom: 36rpx;
  91. }
  92. .rich-content {
  93. width: 650rpx;
  94. }
  95. </style>