QuestionsAndAnswersList.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <div class="content">
  3. <view class="listBox">
  4. <view v-for="(problemItem, problemIndex) in problemsList" :key="problemIndex" class="itemBox">
  5. <view class="itemAsk">
  6. <i>问</i><span>{{ problemItem.problem }}</span>
  7. </view>
  8. <view v-if="problemItem.answers.length > 0">
  9. <view v-for="(answerItem, answerIndex) in (problemItem.answers.slice(0, 1))" :key="answerIndex" class="answer">
  10. <view class="answerBox">
  11. <i>答</i><span>{{ answerItem.answer }}</span>
  12. </view>
  13. <view
  14. v-if="problemItem.ifAnswer === 1" class="answerBtn"
  15. @click="go(`/another-tf/another-serve/qADetail/index?productId=${productInfo.productId}&problemId=${problemItem.problemId}`)"
  16. >
  17. 立即回答
  18. </view>
  19. </view>
  20. </view>
  21. <view v-else>
  22. <view class="answer">
  23. <view class="answerBox">
  24. <i>答</i><span>暂无答复</span>
  25. </view>
  26. <view
  27. v-if="problemItem.ifAnswer === 1" class="answerBtn"
  28. @click="go(`/another-tf/another-serve/qADetail/index?productId=${productInfo.productId}&problemId=${problemItem.problemId}`)"
  29. >
  30. 立即回答
  31. </view>
  32. </view>
  33. </view>
  34. <view
  35. v-if="problemItem.answers.length > 1" class="seeAll"
  36. @click="go(`/another-tf/another-serve/qADetail/index?productId=${productInfo.productId}&problemId=${problemItem.problemId}`)"
  37. >
  38. 查看全部答复
  39. </view>
  40. </view>
  41. </view>
  42. </div>
  43. </template>
  44. <script>
  45. export default {
  46. name: 'QuestionsAndAnswersList',
  47. props: {
  48. problemsList: {
  49. type: Array,
  50. default: () => []
  51. },
  52. productInfo: {
  53. type: Object,
  54. default: () => ({})
  55. }
  56. },
  57. data() {
  58. return {}
  59. },
  60. methods: {
  61. }
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. .listBox {
  66. padding: 0 30upx;
  67. .itemBox {
  68. padding-bottom: 30upx;
  69. border-bottom: 1upx solid #EEEEEE;
  70. margin-bottom: 30upx;
  71. &:last-child {
  72. border-bottom: none;
  73. }
  74. .itemAsk {
  75. display: flex;
  76. align-items: center;
  77. margin-bottom: 42upx;
  78. i {
  79. font-style: normal;
  80. width: 38upx;
  81. height: 38upx;
  82. line-height: 38upx;
  83. background: #C5AA7B;
  84. display: block;
  85. margin-right: 30upx;
  86. font-size: 24upx;
  87. color: #FFFFFF;
  88. text-align: center;
  89. }
  90. span {
  91. font-size: 28upx;
  92. color: #333333;
  93. }
  94. }
  95. .answer {
  96. display: flex;
  97. justify-content: space-between;
  98. align-items: center;
  99. margin-bottom: 30upx;
  100. .answerBox {
  101. display: flex;
  102. align-items: center;
  103. i {
  104. font-style: normal;
  105. width: 38upx;
  106. height: 38upx;
  107. line-height: 38upx;
  108. background: #C5AA7B;
  109. display: block;
  110. text-align: center;
  111. margin-right: 30upx;
  112. font-size: 24rpx;
  113. color: #FFFFFF;
  114. }
  115. span {
  116. font-size: 26upx;
  117. color: #666666;
  118. }
  119. }
  120. .answerBtn {
  121. width: 130upx;
  122. height: 50upx;
  123. line-height: 50upx;
  124. border: #333333 2rpx solid;
  125. text-align: center;
  126. color: #333;
  127. font-size: 24upx;
  128. }
  129. }
  130. .seeAll {
  131. margin-left: 68upx;
  132. font-size: 28upx;
  133. color: #C5AA7B;
  134. }
  135. }
  136. }
  137. </style>