mark-score-list.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. },
  40. data() {
  41. return {
  42. show: false,
  43. current_page: 1,
  44. list: [],
  45. options1: [{
  46. text: '撤销',
  47. style: {
  48. backgroundColor: '#FF0C0C',
  49. }
  50. }],
  51. last_page: 10,
  52. msgType: 'center',
  53. itemInfo: {},
  54. index: 0
  55. }
  56. },
  57. computed: {
  58. showTitle() {
  59. if (this.current_page > this.last_page) {
  60. return '没有更多数据了。。。'
  61. } else {
  62. return '加载更多'
  63. }
  64. },
  65. },
  66. mounted() {
  67. },
  68. methods: {
  69. open() {
  70. this.show = true;
  71. this.list = []
  72. this.current_page = 1
  73. this.getList()
  74. },
  75. getList() {
  76. if (this.showTitle == "没有更多数据了。。。") {
  77. return
  78. }
  79. this.$api.sendRequest({
  80. url: `/mobile/studentTab/getstudentTabLog`,
  81. method: "post",
  82. data: {
  83. page: this.current_page,
  84. class_id: this.chooseClassId
  85. },
  86. success: res => {
  87. let arr = [...this.list, ...res.data.data]
  88. this.current_page++
  89. this.last_page = res.data.last_page
  90. this.list = [...this.list, ...res.data.data]
  91. }
  92. })
  93. },
  94. itemClick(item, index) {
  95. this.index = index
  96. this.itemInfo = item
  97. this.$refs.alertDialog.open('center')
  98. },
  99. dialogConfirm() {
  100. this.$api.sendRequest({
  101. url: `/mobile/studentTab/delstudentTabLog`,
  102. method: "post",
  103. data: {
  104. tab_log_id: this.itemInfo.id
  105. },
  106. success: res => {
  107. console.log("aaaaaaaaaaa");
  108. this.show = false
  109. this.$emit('delSuccess')
  110. },
  111. complete: res => {
  112. console.log(res, "resss");
  113. }
  114. })
  115. },
  116. dialogClose() {
  117. }
  118. },
  119. }
  120. </script>
  121. <style>
  122. </style>