evaluateDetail.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="content">
  3. <u-card :foot-border-top="false" padding="0px" margin="10px" borderRadius="40" class="card-box" box-shadow="0 0 5px 0 rgba(0, 0, 0, 0.2)">
  4. <view class="card-content" slot="head" style="padding: 10px 15px;">
  5. <view class="card-title">{{evaluateInfo.name}}</view>
  6. </view>
  7. <view class="card-content" slot="body">
  8. <view class="evaluate-list" v-for="(item, index) in evaluateInfo.evaluateDetailResult" :key="index">
  9. <view class="evaluate-info">
  10. <view class="evaluate-name">{{item.name}}</view>
  11. <view>{{item.time}}</view>
  12. </view>
  13. <u-rate :count="5" v-model="item.level" :active-color="mainColor" disabled></u-rate>
  14. <view style="padding-top: 10px;">{{item.content}}</view>
  15. </view>
  16. </view>
  17. </u-card>
  18. <u-top-tips ref="uTips"></u-top-tips>
  19. </view>
  20. </template>
  21. <script>
  22. import {
  23. mapGetters
  24. } from 'vuex'
  25. const NET = require('@/utils/request')
  26. const API = require('@/config/api')
  27. export default {
  28. computed: {
  29. ...mapGetters([
  30. 'mainColor'
  31. ])
  32. },
  33. data() {
  34. return {
  35. classId: '',
  36. evaluateInfo: {
  37. evaluateDetailResult: [],
  38. name: ''
  39. },
  40. }
  41. },
  42. onLoad(options) {
  43. this.classId = options.id
  44. this.getData()
  45. },
  46. onReady() {},
  47. onPullDownRefresh() {
  48. this.getData()
  49. },
  50. methods: {
  51. // 获取数据
  52. getData() {
  53. NET.request(API.getEvaluateInfo, {
  54. id: this.classId,
  55. }, 'POST').then(res => {
  56. this.evaluateInfo = res.data
  57. uni.stopPullDownRefresh();
  58. }).catch(error => {
  59. this.$refs.uTips.show({
  60. title: error.message,
  61. type: 'warning',
  62. })
  63. })
  64. }
  65. },
  66. }
  67. </script>
  68. <style>
  69. page {
  70. width: 100%;
  71. height: 100%;
  72. background-color: #f7f7f7;
  73. }
  74. </style>
  75. <style lang="scss" scoped>
  76. @import "@/static/css/themes.scss";
  77. .content {
  78. width: 100%;
  79. float: left;
  80. .card-box {
  81. width: 100%;
  82. height: 100vh;
  83. .card-content {
  84. padding: 5px 15px;
  85. }
  86. .card-title {
  87. height: 20px;
  88. display: inline-block;
  89. font-weight: bold;
  90. font-size: 14px;
  91. line-height: 20px;
  92. }
  93. .evaluate-list {
  94. width: 100%;
  95. padding: 10px 0;
  96. border-bottom: 1px solid #e4e7ed;
  97. color: #999999;
  98. .evaluate-info {
  99. display: flex;
  100. justify-content: space-between;
  101. padding-bottom: 5px;
  102. .evaluate-name {
  103. font-size: 14px;
  104. }
  105. }
  106. }
  107. .evaluate-list:last-child {
  108. border-bottom: none;
  109. }
  110. }
  111. }
  112. </style>