mark-score-list.vue 4.7 KB

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