index.vue 9.3 KB

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