index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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.$request
  139. .courseperiodrebuild({
  140. goodsId: this.rebuildItem.goodsId,
  141. gradeId: this.rebuildItem.gradeId,
  142. })
  143. .then((res) => {
  144. this.showRebuildDetailModal = false;
  145. this.$emit("rebuildSubmit", this.rebuildItem);
  146. // this.$router.push({
  147. // path: `/my-course-detail/${this.rebuildItem.goodsId}`,
  148. // query: {
  149. // gradeId: this.rebuildItem.gradeId,
  150. // orderGoodsId: this.rebuildItem.orderGoodsId,
  151. // },
  152. // });
  153. });
  154. // this.$confirm(
  155. // "如对审核结果有异议,请勿点击确认重学。致电020-87085982咨询",
  156. // "注意",
  157. // {
  158. // confirmButtonText: "确认重学",
  159. // cancelButtonText: "取消",
  160. // closeOnClickModal: false,
  161. // closeOnPressEscape: false,
  162. // distinguishCancelAndClose: false,
  163. // showClose: false,
  164. // }
  165. // )
  166. // .then((_) => {
  167. // this.$request
  168. // .courseperiodrebuild({
  169. // goodsId: this.rebuildItem.goodsId,
  170. // gradeId: this.rebuildItem.gradeId,
  171. // })
  172. // .then((res) => {
  173. // this.showRebuildDetailModal = false;
  174. // this.$emit("rebuildSubmit", this.rebuildItem);
  175. // // this.$router.push({
  176. // // path: `/my-course-detail/${this.rebuildItem.goodsId}`,
  177. // // query: {
  178. // // gradeId: this.rebuildItem.gradeId,
  179. // // orderGoodsId: this.rebuildItem.orderGoodsId,
  180. // // },
  181. // // });
  182. // });
  183. // })
  184. // .catch((_) => {});
  185. },
  186. },
  187. };
  188. </script>
  189. <!-- Add "scoped" attribute to limit CSS to this component only -->
  190. <style scoped lang="scss">
  191. .rebuild {
  192. /deep/ .el-dialog__header {
  193. display: none;
  194. }
  195. /deep/ .el-dialog__body {
  196. padding: 0;
  197. overflow: unset;
  198. }
  199. &__close {
  200. cursor: pointer;
  201. position: absolute;
  202. right: 0;
  203. top: -28px;
  204. width: 24px;
  205. height: 24px;
  206. line-height: 24px;
  207. text-align: center;
  208. color: #eee;
  209. border: 1px solid #eee;
  210. border-radius: 50%;
  211. }
  212. &__header {
  213. height: 40px;
  214. border-bottom: 1px solid #eee;
  215. line-height: 40px;
  216. font-size: 16px;
  217. font-family: Microsoft YaHei;
  218. font-weight: bold;
  219. color: #333333;
  220. padding-left: 24px;
  221. }
  222. &__body {
  223. height: 400px;
  224. padding: 0 24px;
  225. .content {
  226. height: 100%;
  227. overflow-y: auto;
  228. &__header {
  229. padding: 16px 0;
  230. border-bottom: 1px solid #eee;
  231. .title {
  232. font-size: 16px;
  233. font-family: Microsoft YaHei;
  234. font-weight: bold;
  235. color: #ff3b30;
  236. line-height: 24px;
  237. }
  238. .desc {
  239. margin-top: 10px;
  240. font-size: 16px;
  241. font-family: Microsoft YaHei;
  242. font-weight: 400;
  243. color: #ff3b30;
  244. line-height: 24px;
  245. }
  246. }
  247. &__body {
  248. .list {
  249. &__item {
  250. padding: 16px 0;
  251. border-bottom: 1px solid #eee;
  252. .title {
  253. font-size: 14px;
  254. font-family: Microsoft YaHei;
  255. font-weight: 400;
  256. color: #333333;
  257. .note {
  258. display: inline-block;
  259. text-align: center;
  260. line-height: 18px;
  261. width: 32px;
  262. height: 20px;
  263. border: 1px solid #3f8dfd;
  264. border-radius: 4px;
  265. color: #3f8dfd;
  266. font-size: 12px;
  267. &--yellow {
  268. border: 1px solid #ff9500;
  269. color: #ff9500;
  270. }
  271. }
  272. }
  273. .desc {
  274. margin-top: 10px;
  275. font-size: 14px;
  276. font-family: Microsoft YaHei;
  277. font-weight: 400;
  278. color: #333333;
  279. .note {
  280. color: #ff3b30;
  281. line-height: 20px;
  282. }
  283. .img {
  284. width: 100px;
  285. height: 100px;
  286. display: inline-block;
  287. text-align: center;
  288. img {
  289. max-width: 100%;
  290. max-height: 100%;
  291. }
  292. }
  293. }
  294. }
  295. }
  296. }
  297. }
  298. }
  299. &__footer {
  300. height: 90px;
  301. border-top: 1px solid #eee;
  302. text-align: center;
  303. .confirm {
  304. width: 200px;
  305. height: 40px;
  306. padding: 0;
  307. border-radius: 20px;
  308. text-align: center;
  309. line-height: 40px;
  310. color: #fff;
  311. margin: 24px auto;
  312. }
  313. }
  314. }
  315. </style>