questions.nvue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. <list class="ques-list">
  13. <cell>
  14. <text class="ques-section-title">常见问题</text>
  15. </cell>
  16. <cell v-for="(itm, index) in list" :key="index">
  17. <view class="ques-item" @click="toDetail(itm)">
  18. <text class="ques-item-text">{{index + 1}}、{{itm.title}}</text>
  19. <image class="ques-arrow" src="/static/my/arrowright.png" mode="aspectFill"></image>
  20. </view>
  21. </cell>
  22. </list>
  23. <!-- 空状态 -->
  24. <view class="empty-wrap" v-if="list.length === 0">
  25. <text class="empty-text">暂无问题</text>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. statusBarHeight: 44,
  34. list: []
  35. }
  36. },
  37. onLoad() {
  38. const sysInfo = uni.getSystemInfoSync()
  39. this.statusBarHeight = sysInfo.statusBarHeight || 44
  40. this.init()
  41. },
  42. methods: {
  43. goBack() {
  44. uni.navigateBack()
  45. },
  46. toDetail(itm) {
  47. uni.navigateTo({
  48. url: '/pages/my/questions/quesinfo?id=' + itm.id + '&title=' + encodeURIComponent(itm.title || '')
  49. })
  50. },
  51. init() {
  52. // TODO: 后续对接后台接口获取问题列表
  53. }
  54. }
  55. }
  56. </script>
  57. <style>
  58. .page {
  59. flex: 1;
  60. background-color: #FFFFFF;
  61. }
  62. .status-bar {
  63. background-color: #FFFFFF;
  64. }
  65. .nav-bar {
  66. flex-direction: row;
  67. align-items: center;
  68. justify-content: space-between;
  69. height: 88rpx;
  70. padding-left: 54rpx;
  71. padding-right: 54rpx;
  72. background-color: #FFFFFF;
  73. }
  74. .back-img {
  75. width: 50rpx;
  76. height: 50rpx;
  77. }
  78. .nav-title {
  79. font-weight: bold;
  80. font-size: 32rpx;
  81. color: #545F71;
  82. }
  83. .nav-right {
  84. width: 50rpx;
  85. height: 50rpx;
  86. }
  87. /* 问题列表 */
  88. .ques-list {
  89. flex: 1;
  90. padding-left: 48rpx;
  91. padding-right: 48rpx;
  92. }
  93. .ques-section-title {
  94. font-size: 28rpx;
  95. color: #9BA5B7;
  96. margin-top: 48rpx;
  97. margin-bottom: 10rpx;
  98. }
  99. .ques-item {
  100. flex-direction: row;
  101. align-items: center;
  102. justify-content: space-between;
  103. height: 108rpx;
  104. border-bottom-width: 1px;
  105. border-bottom-color: #EEF1F4;
  106. border-bottom-style: solid;
  107. }
  108. .ques-item-text {
  109. flex: 1;
  110. font-size: 32rpx;
  111. color: #545F71;
  112. }
  113. .ques-arrow {
  114. width: 40rpx;
  115. height: 40rpx;
  116. }
  117. /* 空状态 */
  118. .empty-wrap {
  119. align-items: center;
  120. padding-top: 200rpx;
  121. }
  122. .empty-text {
  123. font-size: 28rpx;
  124. color: #9BA5B7;
  125. }
  126. </style>