evaluateList.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view class="content">
  3. <scroll-view scroll-y class="scroll-box" @scrolltolower="handleLoadMore" :refresher-enabled="true"
  4. :refresher-triggered="triggered" :refresher-threshold="100" refresher-background="white" @refresherrefresh="onRefresh"
  5. @refresherrestore="onRestore">
  6. <u-card :head-border-bottom="false" padding="0px" margin="10px" borderRadius="40" v-for="(item, index) in tableList"
  7. :key="index" class="class-card">
  8. <view class="class-content" slot="head" style="padding-top: 10px;">
  9. <view class="student-name">{{item.studentName}}</view>
  10. <view class="class-name">{{item.courseName}}</view>
  11. </view>
  12. <view class="class-content" slot="body">
  13. <view class="class-info-text">
  14. <u-icon name="clock"></u-icon>
  15. {{item.remarkDate}}
  16. </view>
  17. <view class="class-info-text">
  18. <u-icon name="map"></u-icon>
  19. {{item.location}}
  20. </view>
  21. </view>
  22. <view class="class-content" slot="foot" style="display: flex;">
  23. <view class="class-foot-label">评价信息:</view>
  24. <view class="class-foot-content">
  25. <u-rate :count="10" v-model="item.star" :active-color="mainColor" disabled></u-rate>
  26. <view class="class-foot-text">{{item.remark}}</view>
  27. <view class="class-foot-text" v-if="item.coachRemark!=null">教练回复:{{item.coachRemark}}</view>
  28. </view>
  29. </view>
  30. </u-card>
  31. <u-divider v-if="isOver" bg-color="transparent">没有更多了</u-divider>
  32. </scroll-view>
  33. <u-top-tips ref="uTips"></u-top-tips>
  34. </view>
  35. </template>
  36. <script>
  37. import {
  38. mapGetters
  39. } from 'vuex'
  40. const NET = require('@/utils/request')
  41. const API = require('@/config/api')
  42. export default {
  43. computed: {
  44. ...mapGetters([
  45. 'mainColor'
  46. ])
  47. },
  48. data() {
  49. return {
  50. triggered: false,
  51. isOver: false,
  52. pageIndex: 1,
  53. tableList: [],
  54. }
  55. },
  56. onLoad() {
  57. this.getTableList()
  58. },
  59. onReady() {},
  60. methods: {
  61. // 下拉刷新
  62. onRefresh() {
  63. this.triggered = true
  64. this.isOver = false
  65. this.pageIndex = 1
  66. this.tableList = []
  67. this.getTableList()
  68. },
  69. // 重置下拉刷新状态
  70. onRestore() {
  71. this.triggered = 'restore'
  72. this.triggered = false
  73. },
  74. // 懒加载
  75. handleLoadMore() {
  76. if (!this.isOver) {
  77. this.pageIndex++
  78. this.getTableList()
  79. }
  80. },
  81. // 获取列表数据
  82. getTableList() {
  83. NET.request(API.findSignEvaluate, {
  84. page: this.pageIndex,
  85. size: 10,
  86. }, 'POST').then(res => {
  87. this.triggered = false
  88. this.tableList = this.tableList.concat(res.data.row)
  89. this.isOver = res.data.row.length != 10
  90. }).catch(error => {
  91. this.triggered = false
  92. this.$refs.uTips.show({
  93. title: error.message,
  94. type: 'warning',
  95. })
  96. })
  97. }
  98. },
  99. }
  100. </script>
  101. <style>
  102. page {
  103. width: 100%;
  104. height: 100%;
  105. background-color: #f7f7f7;
  106. }
  107. </style>
  108. <style lang="scss" scoped>
  109. @import "@/static/css/themes.scss";
  110. .content {
  111. width: 100%;
  112. float: left;
  113. .scroll-box {
  114. width: 100%;
  115. height: 100vh;
  116. padding-bottom: 10px;
  117. box-sizing: border-box;
  118. .class-card {
  119. .class-content {
  120. padding: 5px 15px;
  121. }
  122. .student-name {
  123. height: 20px;
  124. display: inline-block;
  125. padding: 0 10px;
  126. margin-right: 5px;
  127. background-color: $mainColor;
  128. border-radius: 10px;
  129. line-height: 20px;
  130. color: #FFFFFF;
  131. }
  132. .class-name {
  133. height: 20px;
  134. display: inline-block;
  135. font-weight: bold;
  136. font-size: 14px;
  137. line-height: 20px;
  138. }
  139. .class-info-text {
  140. color: #999999;
  141. margin-bottom: 5px;
  142. /deep/.u-icon {
  143. margin-right: 5px;
  144. font-size: 14px;
  145. color: #000000;
  146. }
  147. }
  148. .class-foot-label {
  149. width: 70px;
  150. color: #999999;
  151. }
  152. .class-foot-content {
  153. flex: 1;
  154. .class-foot-text {
  155. width: 100%;
  156. margin: 5px 0;
  157. float: left;
  158. color: #666666;
  159. }
  160. }
  161. }
  162. }
  163. }
  164. </style>