mark-score-list.vue 3.0 KB

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