mark-score-list.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <el-drawer append-to-body title="点评记录" :visible.sync="show" size="400px" direction="ltr"
  3. style="backdrop-filter: blur(4px);">
  4. <u-cell-group v-for="(item,index) in list" :key="index">
  5. <u-cell @click="itemClick(item,index)" class="ui-hover" clickable :title="item.student.student_name">
  6. <view slot="icon" class="ui-mr10">
  7. <image :src="item.stuSchool.student_photo" style="width: 40px;height: 40px;border-radius: 20px;">
  8. </image>
  9. </view>
  10. <text slot="label" class="txt-muted">{{item.created_at}} </text>
  11. <el-tag v-if="item.studentTab.type_text == '好评'" slot="value"
  12. plain>{{item.studentTab.tab_name}}{{item.score}}</el-tag>
  13. <el-tag slot="value" v-else plain type="danger">{{item.studentTab.tab_name}}{{item.score}}</el-tag>
  14. <!-- <u-badge slot="value" value="+1" plain size="mini" type="success"></u-badge> -->
  15. </u-cell>
  16. </u-cell-group>
  17. <view @click="addTab" class="text-center ui-m ui-p" style="width: 100%;cursor: pointer;">
  18. {{ showTitle }}
  19. </view>
  20. <uni-popup ref="alertDialog" type="dialog">
  21. <uni-popup-dialog type="center" cancelText="关闭" confirmText="确认" title="确认撤销?" content="您确认撤销该条点评记录?"
  22. @confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
  23. </uni-popup>
  24. </el-drawer>
  25. </template>
  26. <script>
  27. export default {
  28. props: {
  29. chooseClassId :{
  30. type : Number|String,
  31. default : ""
  32. },
  33. },
  34. data() {
  35. return {
  36. show: false,
  37. current_page : 1,
  38. list : [],
  39. last_page : 10,
  40. showTitle : '加载更多',
  41. msgType: 'center',
  42. itemInfo: {},
  43. index:0
  44. }
  45. },
  46. mounted() {
  47. },
  48. methods: {
  49. open() {
  50. this.show = true
  51. },
  52. addTab() {
  53. if(this.showTitle=="没有更多数据了。。。"){
  54. return
  55. }
  56. this.$api.sendRequest({
  57. url: `/mobile/studentTab/getstudentTabLog`,
  58. method: "post",
  59. data: {
  60. page: this.current_page,
  61. class_id: this.chooseClassId
  62. },
  63. success: res => {
  64. let arr = [...this.list, ...res.data.data]
  65. this.current_page++
  66. this.list =[...this.list,...res.data.data]
  67. if (this.current_page >= res.data.last_page) {
  68. this.showTitle='没有更多数据了。。。'
  69. }
  70. }
  71. })
  72. },
  73. itemClick(item,index) {
  74. this.index = index
  75. this.itemInfo = item
  76. this.$refs.alertDialog.open('center')
  77. },
  78. dialogConfirm() {
  79. this.$api.sendRequest({
  80. url: `/mobile/studentTab/delstudentTabLog`,
  81. method: "post",
  82. data: {
  83. tab_log_id: this.itemInfo.tab_id
  84. },
  85. success: res => {
  86. uni.showToast({
  87. title: res.msg,
  88. })
  89. this.$emit('success',this.index)
  90. }
  91. })
  92. },
  93. dialogClose() {
  94. }
  95. },
  96. }
  97. </script>
  98. <style>
  99. </style>