index.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <template>
  2. <div id="rebuild-modal">
  3. <el-dialog
  4. width="800px"
  5. class="rebuild"
  6. :visible.sync="showRebuildDetailModal"
  7. :close-on-click-modal="false"
  8. :close-on-press-escape="false"
  9. :show-close="false"
  10. >
  11. <div class="rebuild__content">
  12. <div class="rebuild__close" @click="showRebuildDetailModal = false">
  13. X
  14. </div>
  15. <div class="rebuild__header">审核详情</div>
  16. <div class="rebuild__body">
  17. <div class="content">
  18. <div class="content__header">
  19. <div class="title">重要提示:</div>
  20. <div class="desc">
  21. 您的学时审核不通过,不通过原因如下,请查阅,并重学不通过的课程内容。
  22. </div>
  23. </div>
  24. <div class="content__body">
  25. <div class="list">
  26. <div
  27. class="list__item"
  28. v-for="(item, index) in rebuildItems"
  29. :key="index"
  30. >
  31. <div class="title">
  32. <span class="note" v-if="item.type == 0"> 测试 </span>
  33. <span class="note note--yellow" v-if="item.type == 1"
  34. >录播</span
  35. >
  36. <span class="note note--yellow" v-if="item.type == 2"
  37. >直播</span
  38. >
  39. <span class="note note--yellow" v-if="item.type == 3"
  40. >回放</span
  41. >
  42. {{ index + 1 }}、{{ item.name }}
  43. </div>
  44. <div class="desc">
  45. <!-- <div class="imgs">
  46. <div
  47. class="img"
  48. v-for="(items, indexs) in item.userStudyRecordPhoto"
  49. :key="indexs"
  50. >
  51. <img :src="$tools.splitImgHost(items.photo)" />
  52. <div class="note">
  53. {{ $tools.timestampToTime(items.createTime, false) }}
  54. </div>
  55. </div>
  56. </div> -->
  57. </div>
  58. <div class="desc">
  59. 原因:
  60. <span class="note">{{ item.auditReason }}</span>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <div class="rebuild__footer" v-if="rebuildShow">
  68. <el-button class="confirm" @click="rebuildSubmit" type="primary"
  69. >确认已阅读</el-button
  70. >
  71. </div>
  72. </div>
  73. </el-dialog>
  74. </div>
  75. </template>
  76. <script>
  77. import { mapGetters } from "vuex";
  78. export default {
  79. name: "showRebuildDetailModal",
  80. computed: {
  81. ...mapGetters(["userInfo"]),
  82. },
  83. data() {
  84. return {
  85. showRebuildDetailModal: false,
  86. rebuildItem: {},
  87. rebuildItems: {},
  88. rebuildShow: false,
  89. };
  90. },
  91. mounted() {},
  92. methods: {
  93. showModal(item) {
  94. this.rebuildShow = false;
  95. this.rebuildItem = item;
  96. this.$request
  97. .getcourseperiodcheat({
  98. goodsId: item.goodsId,
  99. gradeId: item.gradeId,
  100. })
  101. .then((res) => {
  102. this.rebuildItems = res.rows;
  103. this.showRebuildDetailModal = true;
  104. let sysTime = this.$tools.timest();
  105. //学习服务期没过
  106. if (item.serviceEndTime && item.serviceEndTime > +sysTime) {
  107. console.log(1);
  108. this.rebuildShow = true;
  109. } else {
  110. //已过学习服务期
  111. console.log(2);
  112. this.rebuildShow = false;
  113. this.showRebuildDetailModal = true;
  114. return;
  115. }
  116. console.log(item.classEndTime, "item.classEndTime");
  117. console.log(sysTime, "sysTime");
  118. //有班级有效期
  119. if (item.classEndTime) {
  120. //班级有效期没过
  121. if (item.classEndTime > +sysTime) {
  122. console.log(3);
  123. this.rebuildShow = true;
  124. } else {
  125. //已过班级有效期
  126. this.rebuildShow = false;
  127. console.log(4);
  128. this.showRebuildDetailModal = true;
  129. return;
  130. }
  131. } else {
  132. }
  133. this.rebuildShow = true;
  134. this.showRebuildDetailModal = true;
  135. });
  136. },
  137. rebuildSubmit() {
  138. this.$confirm(
  139. "如对审核结果有异议,请勿点击确认重学。致电020-87085982咨询",
  140. "注意",
  141. {
  142. confirmButtonText: "确认重学",
  143. cancelButtonText: "取消",
  144. closeOnClickModal: false,
  145. closeOnPressEscape: false,
  146. distinguishCancelAndClose: false,
  147. showClose: false,
  148. }
  149. )
  150. .then((_) => {
  151. this.$request
  152. .courseperiodrebuild({
  153. goodsId: this.rebuildItem.goodsId,
  154. gradeId: this.rebuildItem.gradeId,
  155. })
  156. .then((res) => {
  157. this.showRebuildDetailModal = false;
  158. this.$emit("rebuildSubmit", this.rebuildItem);
  159. // this.$router.push({
  160. // path: `/my-course-detail/${this.rebuildItem.goodsId}`,
  161. // query: {
  162. // gradeId: this.rebuildItem.gradeId,
  163. // orderGoodsId: this.rebuildItem.orderGoodsId,
  164. // },
  165. // });
  166. });
  167. })
  168. .catch((_) => {});
  169. },
  170. },
  171. };
  172. </script>
  173. <!-- Add "scoped" attribute to limit CSS to this component only -->
  174. <style scoped lang="scss">
  175. .rebuild {
  176. /deep/ .el-dialog__header {
  177. display: none;
  178. }
  179. /deep/ .el-dialog__body {
  180. padding: 0;
  181. overflow: unset;
  182. }
  183. &__close {
  184. cursor: pointer;
  185. position: absolute;
  186. right: 0;
  187. top: -28px;
  188. width: 24px;
  189. height: 24px;
  190. line-height: 24px;
  191. text-align: center;
  192. color: #eee;
  193. border: 1px solid #eee;
  194. border-radius: 50%;
  195. }
  196. &__header {
  197. height: 40px;
  198. border-bottom: 1px solid #eee;
  199. line-height: 40px;
  200. font-size: 16px;
  201. font-family: Microsoft YaHei;
  202. font-weight: bold;
  203. color: #333333;
  204. padding-left: 24px;
  205. }
  206. &__body {
  207. height: 400px;
  208. padding: 0 24px;
  209. .content {
  210. height: 100%;
  211. overflow-y: auto;
  212. &__header {
  213. padding: 16px 0;
  214. border-bottom: 1px solid #eee;
  215. .title {
  216. font-size: 16px;
  217. font-family: Microsoft YaHei;
  218. font-weight: bold;
  219. color: #ff3b30;
  220. line-height: 24px;
  221. }
  222. .desc {
  223. margin-top: 10px;
  224. font-size: 16px;
  225. font-family: Microsoft YaHei;
  226. font-weight: 400;
  227. color: #ff3b30;
  228. line-height: 24px;
  229. }
  230. }
  231. &__body {
  232. .list {
  233. &__item {
  234. padding: 16px 0;
  235. border-bottom: 1px solid #eee;
  236. .title {
  237. font-size: 14px;
  238. font-family: Microsoft YaHei;
  239. font-weight: 400;
  240. color: #333333;
  241. .note {
  242. display: inline-block;
  243. text-align: center;
  244. line-height: 18px;
  245. width: 32px;
  246. height: 20px;
  247. border: 1px solid #3f8dfd;
  248. border-radius: 4px;
  249. color: #3f8dfd;
  250. font-size: 12px;
  251. &--yellow {
  252. border: 1px solid #ff9500;
  253. color: #ff9500;
  254. }
  255. }
  256. }
  257. .desc {
  258. margin-top: 10px;
  259. font-size: 14px;
  260. font-family: Microsoft YaHei;
  261. font-weight: 400;
  262. color: #333333;
  263. .note {
  264. color: #ff3b30;
  265. line-height: 20px;
  266. }
  267. .img {
  268. width: 100px;
  269. height: 100px;
  270. display: inline-block;
  271. text-align: center;
  272. img {
  273. max-width: 100%;
  274. max-height: 100%;
  275. }
  276. }
  277. }
  278. }
  279. }
  280. }
  281. }
  282. }
  283. &__footer {
  284. height: 90px;
  285. border-top: 1px solid #eee;
  286. text-align: center;
  287. .confirm {
  288. width: 200px;
  289. height: 40px;
  290. padding: 0;
  291. border-radius: 20px;
  292. text-align: center;
  293. line-height: 40px;
  294. color: #fff;
  295. margin: 24px auto;
  296. }
  297. }
  298. }
  299. </style>