mark-score.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <el-dialog :visible.sync="show" :title="`标记点评给 ${title}`" custom-class="content"
  3. style="background-color: #00142f63;backdrop-filter: blur(4px);" width="600px">
  4. <view class="ui-flex-column">
  5. <!-- <view class="ui-p" style="background: #022c5a80;border-bottom: 2px solid #051d37;">
  6. <text class="txt-white"> </text>
  7. </view> -->
  8. <view class="ui-flex-row">
  9. <view class="ui-flex-1 ui-flex-align-center ui-flex-row">
  10. <view class="ui-pl20">
  11. <view class="ui-flex-row ui-border-radius-20" @click="showType=true"
  12. style="background-color: #1C63A8;padding: 4px 8px;">
  13. <text class="txt-white f26 ui-mr10">全部类型</text>
  14. <u-icon color="#fff" name="list-dot"></u-icon>
  15. </view>
  16. </view>
  17. </view>
  18. <view style="width: 220px;" class="ui-p">
  19. <u-subsection :list="['表扬', '需改进']" mode="button" bgColor="#1b63a8" inactiveColor="#aec3ee"
  20. :current="curIndex" @change="change"></u-subsection>
  21. </view>
  22. <view class="ui-flex-1"></view>
  23. </view>
  24. <view style="background: #0000003b;">
  25. <u-tabs :list="list1" :scrollable="false" :activeStyle="{
  26. color: '#fff',
  27. fontWeight: 'bold',
  28. transform: 'scale(1.2)'
  29. }" :inactiveStyle="{
  30. color: '#959595',
  31. transform: 'scale(1)'
  32. }"></u-tabs>
  33. </view>
  34. <scroll-view scroll-y style="height: 400px;" show-scrollbar>
  35. <u-grid :col="6" :border="false">
  36. <u-grid-item @click="toActive(index,item)" v-for="(item, index) in list" :key="index" class="ui-p"
  37. :class="{'no-select' : activeId >= 0 && activeId != index}">
  38. <u--image :src="item.img" width="46px" height="46px"></u--image>
  39. <view class="ui-pt10">
  40. <text class="grid-text txt-white f28">{{item.tab_name}}</text>
  41. </view>
  42. <u-badge v-if="activeId == index" absolute :offset="[0,10]" :value="score"></u-badge>
  43. </u-grid-item>
  44. </u-grid>
  45. </scroll-view>
  46. <view class="ui-p ui-flex" style="background-color: #1b63a870;justify-content: end;">
  47. <view class="ui-flex" style="width: 250px;">
  48. <u-button size="small" plain :text="score ? '取消选择' : '关闭点评'" @click="cancelAct"
  49. style="background-color: #0d4980;" class="ui-mr10"></u-button>
  50. <u-button size="small" :disabled="!score" type="primary" @click="submit" text="提交点评"></u-button>
  51. </view>
  52. </view>
  53. </view>
  54. <el-drawer append-to-body :visible.sync="showType" direction="ltr">
  55. <view class="ui-p" style="width: 400px;">
  56. <text>这里展示学生标签记录、以及类型切换</text>
  57. </view>
  58. <u-cell-group>
  59. <u-cell icon="setting-fill" isLink title="个人设置"></u-cell>
  60. <u-cell icon="integral-fill" isLink title="会员等级" value="新版本"></u-cell>
  61. </u-cell-group>
  62. </el-drawer>
  63. </el-dialog>
  64. </template>
  65. <script>
  66. import {
  67. getStudentTabs
  68. } from "@/common/api/studentTab.js"
  69. export default {
  70. props: {
  71. list: {
  72. type: Array,
  73. default: () => []
  74. },
  75. stuList: {
  76. type: Array,
  77. default: () => []
  78. },
  79. title:{
  80. type: String,
  81. default: () => ''
  82. },
  83. },
  84. data() {
  85. return {
  86. show: false,
  87. curIndex: 0,
  88. type: 0,
  89. score: 0, //加扣分分数
  90. activeId: -1, //选中项
  91. itemTab: '',
  92. showType: false,
  93. stuName:'',
  94. list1: [{
  95. name: '全部',
  96. }, {
  97. name: '语文',
  98. }, {
  99. name: '数学'
  100. }, {
  101. name: '科技'
  102. }, {
  103. name: '音乐'
  104. }, {
  105. name: '美术'
  106. }, {
  107. name: '体育'
  108. }, {
  109. name: '思想'
  110. }, {
  111. name: '劳动'
  112. }],
  113. }
  114. },
  115. watch: {
  116. show() {
  117. if (!this.show) {
  118. this.activeId = -1;
  119. this.score = 0;
  120. this.$emit('close')
  121. }
  122. }
  123. },
  124. mounted() {
  125. },
  126. methods: {
  127. change(e){
  128. this.curIndex = e
  129. this.$emit('change',e)
  130. },
  131. getStudentTabs() {
  132. this.$api.sendRequest({
  133. url: getStudentTabs,
  134. method: "post",
  135. data: {
  136. type: this.type
  137. },
  138. success: res => {
  139. console.log(res, "res");
  140. }
  141. })
  142. },
  143. // 外部访问使用
  144. open(id) {
  145. this.show = true;
  146. },
  147. toActive(index, item) {
  148. // 是否旧的选中项
  149. let always = this.activeId >= 0 && this.activeId == index;
  150. this.activeId = index;
  151. if (always) {
  152. this.score++;
  153. } else {
  154. this.score = 1;
  155. }
  156. this.itemTab = item
  157. },
  158. cancelAct() {
  159. if (this.score) {
  160. this.activeId = -1;
  161. this.score = 0;
  162. } else {
  163. this.show = false;
  164. this.$emit('close')
  165. }
  166. },
  167. submit() {
  168. let obj = {
  169. teacher_id: this.$store.state.teacher_id,
  170. stu_school_ids: this.stuList,
  171. tab_id: this.itemTab.tab_id,
  172. score: this.score
  173. }
  174. this.$api.sendRequest({
  175. url: '/mobile/studentTab/geiXueshengTianjiaBiaoqian',
  176. method: "post",
  177. data: obj,
  178. success: res => {
  179. if (res.code == 200) {
  180. uni.showToast({
  181. title: res.msg,
  182. 'icon': 'none',
  183. });
  184. this.show = false;
  185. this.activeId = -1;
  186. this.score = 0;
  187. this.$emit('close')
  188. }
  189. }
  190. })
  191. },
  192. }
  193. }
  194. </script>
  195. <style>
  196. /deep/ .content {
  197. background-image: url('https://zhxy.obs.cn-hz1.ctyun.cn:443/static/desk_bg/class_bj.jpg');
  198. background-size: auto;
  199. border: 1px solid #0d5396;
  200. }
  201. /deep/ .el-dialog__header {
  202. background: #022c5a80;
  203. border-bottom: 2px solid #051d37;
  204. }
  205. /deep/ .el-dialog__title {
  206. color: #fff;
  207. }
  208. /deep/ .el-dialog__body {
  209. padding: 0;
  210. }
  211. .no-select {
  212. opacity: .5;
  213. }
  214. </style>