evaluateDetail.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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 v-if="evaluateInfo.evaluateDetailResult.length==0" style="padding-bottom: 20rpx;">
  9. 暂无数据
  10. </view>
  11. <view class="evaluate-list" v-for="(item, index) in evaluateInfo.evaluateDetailResult" :key="index">
  12. <view class="evaluate-info">
  13. <view class="evaluate-name">{{item.name}}</view>
  14. <view>{{item.userRemarkTime}}</view>
  15. </view>
  16. <u-rate :count="10" v-model="item.level" :active-color="mainColor" isClick></u-rate>
  17. <view style="padding: 10px 0;">{{item.content}}</view>
  18. <template v-if="item.coachRemark">
  19. <view class="evaluate-info">
  20. <view class="evaluate-name">{{item.coachRemark}}</view>
  21. <view>{{item.coachRemarkTime}}</view>
  22. </view>
  23. </template>
  24. <template v-else>
  25. <view style="display: flex;justify-content: flex-end;">
  26. <u-button type="warning" :custom-style="{background: mainColor}" size="mini" shape="circle" :ripple="true" @click="handleReplayclick(item.id)">回复</u-button>
  27. </view>
  28. </template>
  29. </view>
  30. </view>
  31. </u-card>
  32. <u-top-tips ref="uTips"></u-top-tips>
  33. </view>
  34. </template>
  35. <script>
  36. import {
  37. mapGetters
  38. } from 'vuex'
  39. const NET = require('@/utils/request')
  40. const API = require('@/config/api')
  41. export default {
  42. computed: {
  43. ...mapGetters([
  44. 'mainColor'
  45. ])
  46. },
  47. data() {
  48. return {
  49. classId: '',
  50. evaluateInfo: {
  51. evaluateDetailResult: [],
  52. name: ''
  53. },
  54. }
  55. },
  56. onLoad(options) {
  57. this.classId = options.id
  58. },
  59. onShow() {
  60. this.getData()
  61. },
  62. onReady() {},
  63. onPullDownRefresh() {
  64. this.getData()
  65. },
  66. methods: {
  67. // 获取数据
  68. getData() {
  69. NET.request(API.getEvaluateInfo, {
  70. id: this.classId,
  71. }, 'POST').then(res => {
  72. this.evaluateInfo = res.data
  73. uni.stopPullDownRefresh();
  74. }).catch(error => {
  75. this.$refs.uTips.show({
  76. title: error.message,
  77. type: 'warning',
  78. })
  79. })
  80. },
  81. handleReplayclick(id) {
  82. uni.navigateTo({
  83. url: `/pagesMain/coachReply?id=${id}&classId=${this.classId}`
  84. })
  85. }
  86. },
  87. }
  88. </script>
  89. <style>
  90. page {
  91. width: 100%;
  92. height: 100%;
  93. background-color: #f7f7f7;
  94. }
  95. </style>
  96. <style lang="scss" scoped>
  97. @import "@/static/css/themes.scss";
  98. .content {
  99. width: 100%;
  100. float: left;
  101. .card-box {
  102. width: 100%;
  103. height: 100vh;
  104. .card-content {
  105. padding: 5px 15px;
  106. }
  107. .card-title {
  108. height: 20px;
  109. display: inline-block;
  110. font-weight: bold;
  111. font-size: 14px;
  112. line-height: 20px;
  113. }
  114. .evaluate-list {
  115. width: 100%;
  116. padding: 10px 0;
  117. border-bottom: 1px solid #e4e7ed;
  118. color: #999999;
  119. .evaluate-info {
  120. display: flex;
  121. justify-content: space-between;
  122. padding-bottom: 5px;
  123. .evaluate-name {
  124. font-size: 14px;
  125. }
  126. }
  127. }
  128. .evaluate-list:last-child {
  129. border-bottom: none;
  130. }
  131. }
  132. }
  133. </style>