百富门答题小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

186 lines
3.5 KiB

2 months ago
3 weeks ago
2 months ago
  1. <template>
  2. <view class="home">
  3. <image src="/static/image/bg/1.png"
  4. class="page-bg"
  5. mode="aspectFill"></image>
  6. <!-- next1 -->
  7. <view class="content_now" v-if="stop == 1">
  8. <view class=""
  9. v-if="Answer[index]"
  10. v-html="$utils.stringFormatHtml(Answer[index].title)">
  11. </view>
  12. <!-- <view class="mian-btn"
  13. :class="{active:isActive === '是'}"
  14. @click="setActive('是')"></view>
  15. <view class="mian-btn"
  16. :class="{active:isActive === '否'}"
  17. @click="setActive('否')"></view> -->
  18. <view class="mian-btn"
  19. v-for="(item, index) in Answer[index] && Answer[index].answer && Answer[index].answer.split(',')"
  20. :class="{active:isActive === item}"
  21. :key="index"
  22. @click="setActive(item)">{{ item }}</view>
  23. </view>
  24. <view class="an">
  25. <!-- <view style="display: flex;width: 600rpx;"
  26. v-if="stop == 1">
  27. <view class="next-btn"
  28. v-if="index > 0"
  29. @click="index--">
  30. 上一题
  31. </view>
  32. <view class="next-btn"
  33. @click="next">
  34. 下一题
  35. </view>
  36. </view> -->
  37. <view class="next-btn"
  38. @click="next">
  39. 下一题
  40. </view>
  41. <text class="second-color">{{ configList.bg_title }}</text>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import { mapState } from 'vuex'
  47. export default {
  48. data() {
  49. return {
  50. isActive : null,
  51. stop : 1,
  52. index : 0,
  53. oId : 0,
  54. }
  55. },
  56. computed : {
  57. ...mapState(['reviewAnswerList', 'configList']),
  58. Answer(){
  59. // let ids = []
  60. // for(let i = 0;i < this.queryMyLog.length;i++){
  61. // ids.push(this.queryMyLog[i].topId)
  62. // }
  63. // return this.problemList.filter(n => {
  64. // return !ids.includes(n.id)
  65. // })
  66. return this.reviewAnswerList
  67. },
  68. },
  69. onLoad(args) {
  70. this.oId = args.oid
  71. },
  72. onShow() {
  73. },
  74. methods: {
  75. setActive(value){
  76. this.isActive = value
  77. },
  78. next(){
  79. this['next' + this.stop]()
  80. },
  81. next1(){
  82. if(this.isActive){
  83. this.$api('answerComment', {
  84. topId : this.Answer[this.index].id,
  85. context : this.isActive,
  86. answerId : this.oId,
  87. }, res => {
  88. this.isActive = null
  89. if(this.index == this.Answer.length - 1){
  90. // 评论完成,退出评论页面
  91. // uni.showToast({
  92. // title: '评价成功',
  93. // icon: 'none'
  94. // })
  95. uni.navigateTo({
  96. url: '/pages/index/cancelArticle?key=sucess'
  97. })
  98. }else{
  99. this.index++
  100. }
  101. })
  102. }else{
  103. uni.showToast({
  104. title:'请选择后进行下一题',
  105. icon: 'none'
  106. })
  107. }
  108. },
  109. }
  110. }
  111. </script>
  112. <style lang="scss" scoped>
  113. .region{
  114. display: flex;
  115. align-items: center;
  116. &>view{
  117. width: 140rpx;
  118. height: 50rpx;
  119. border-radius: 10rpx;
  120. border: 1px solid #e6bf7f;
  121. margin: 0 10rpx;
  122. line-height: 50rpx;
  123. text-align: center;
  124. }
  125. }
  126. .b-btn{
  127. width: 86%;
  128. display: flex;
  129. justify-content: center;
  130. padding-top: 130rpx;
  131. .pre-btn{
  132. border: 4rpx solid #f1e0c6;
  133. padding: 16rpx 90rpx;
  134. border-radius: 66rpx;
  135. color: #e6bf7f;
  136. }
  137. }
  138. .next-btn{
  139. // background-image: url('../../static/image/home/btn.png');
  140. background-size: contain;
  141. background-repeat: no-repeat;
  142. background-position: center;
  143. width: 280rpx;
  144. display: flex;
  145. align-items: center;
  146. justify-content: center;
  147. color: white;
  148. padding: 16rpx 90rpx;
  149. }
  150. .an{
  151. position: fixed;
  152. bottom: 300rpx;
  153. text-align: center;
  154. display: flex;
  155. flex-direction: column;
  156. align-items: center;
  157. justify-content: center;
  158. width: 100%;
  159. }
  160. </style>