class.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248
  1. <template>
  2. <view style="padding: 0 30rpx 30rpx">
  3. <nav-bar title="我的网课"></nav-bar>
  4. <view class="class" v-for="(item, index) in goodsList" :key="index">
  5. <view
  6. class="class_item"
  7. @click.stop="studyIn(item.goodsId, item.gradeId, item, index)"
  8. >
  9. <image
  10. :src="$method.splitImgHost(item.coverUrl, true)"
  11. class="class_img"
  12. ></image>
  13. <view class="class_text">
  14. <view class="class_title">{{ item.goodsName }}</view>
  15. <view class="content_box">
  16. <image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
  17. <text class="content">{{ item.courseNum }}</text>
  18. 课程
  19. <text class="content">{{ item.secAllNum + item.examNum }}</text>
  20. <text class="content">{{ item.classHours || "-" }}</text>
  21. 学时
  22. </view>
  23. <view
  24. class="content_box"
  25. v-if="item.serviceStartTime && item.serviceEndTime"
  26. >
  27. <image src="/static/icon/wk_icon2.png" class="wk_icon"></image>
  28. 学习服务期:
  29. <text class="content"
  30. >{{ $method.timestampToTime(item.serviceStartTime, true, true) }}
  31. -
  32. {{
  33. $method.timestampToTime(item.serviceEndTime, true, true)
  34. }}</text
  35. >
  36. </view>
  37. </view>
  38. <!-- 不在学习服务期 -->
  39. <template
  40. v-if="
  41. item.serviceStartTime &&
  42. (sysTime < item.serviceStartTime || sysTime > item.serviceEndTime)
  43. "
  44. >
  45. <view
  46. class="class-warm"
  47. v-if="item.gradeId != 0 && item.gradeStatus == 1"
  48. >
  49. <view class="class-warm__text">
  50. <view class="date"> 不在学习服务期,不可以学习了哦 </view>
  51. </view>
  52. </view>
  53. </template>
  54. <template v-else>
  55. <!-- 班级有效期过了 -->
  56. <template v-if="item.classEndTime && item.classEndTime < sysTime">
  57. <view class="class-warm">
  58. <u-icon
  59. class="class-warm__icon"
  60. size="30"
  61. color="#FF3B30"
  62. name="error-circle-fill"
  63. >
  64. </u-icon>
  65. <view class="class-warm__text">
  66. <view class="date"
  67. >班级有效期:{{
  68. $method.timestampToTime(item.classStartTime, true, true)
  69. }}
  70. -
  71. {{
  72. $method.timestampToTime(item.classEndTime, true, true)
  73. }}</view
  74. >
  75. <view class="state"
  76. >班级状态:已过期,有疑问请联系
  77. <text @click="call">020-87085982</text></view
  78. >
  79. </view>
  80. </view>
  81. </template>
  82. <!-- 班级有效期之前 -->
  83. <template
  84. v-else-if="item.classStartTime && item.classStartTime > sysTime"
  85. >
  86. <view class="class-warm">
  87. <u-icon
  88. class="class-warm__icon"
  89. size="30"
  90. color="#FF3B30"
  91. name="error-circle-fill"
  92. >
  93. </u-icon>
  94. <view class="class-warm__text">
  95. <view class="date"
  96. >班级有效期:{{
  97. $method.timestampToTime(item.classStartTime, true, true)
  98. }}
  99. -
  100. {{
  101. $method.timestampToTime(item.classEndTime, true, true)
  102. }}</view
  103. >
  104. <view class="state"
  105. >班级状态:未到学习时间,有疑问请联系
  106. <text @click="call">020-87085982</text></view
  107. >
  108. </view>
  109. </view>
  110. </template>
  111. <!-- 在班级有效期之间或者没有班级有效期 -->
  112. <template v-else>
  113. <view
  114. class="class-warm"
  115. v-if="
  116. item.gradeId != 0 &&
  117. item.gradeStatus == 1 &&
  118. item.classStatus != null
  119. "
  120. >
  121. <view class="class-warm__text">
  122. <view class="date">
  123. 班级状态:
  124. <text v-if="item.classStatus == 1">已开班</text>
  125. <text v-if="item.classStatus == 0">未开班</text>
  126. </view>
  127. <view class="state" v-if="item.classStatus == 0"
  128. >教务处正在为您开通班级,请耐心等待</view
  129. >
  130. <view
  131. class="state"
  132. v-if="
  133. item.classStatus == 1 &&
  134. item.classStartTime &&
  135. item.classEndTime
  136. "
  137. >
  138. 班级有效期:{{
  139. $method.timestampToTime(item.classStartTime, true, true)
  140. }}-{{
  141. $method.timestampToTime(item.classEndTime, true, true)
  142. }}
  143. </view>
  144. </view>
  145. </view>
  146. <!-- 学时审核状态不可审核 -->
  147. <template v-if="item.periodStatus == -1 || item.periodStatus == 2">
  148. <view
  149. class="class-warm"
  150. v-if="item.classStatus == 1 || item.classStatus === null"
  151. >
  152. <view class="class-warm__text">
  153. <view class="date">
  154. <template
  155. v-if="
  156. sysTime >= item.serviceStartTime &&
  157. sysTime <= item.serviceEndTime
  158. "
  159. >
  160. 学习状态:
  161. <text v-if="item.stuAllNum + item.recordNum == 0"
  162. >未学习</text
  163. >
  164. <text
  165. v-else-if="
  166. item.stuAllNum + item.recordNum > 0 &&
  167. item.stuAllNum + item.recordNum <
  168. item.secAllNum + item.examNum
  169. "
  170. >学习中</text
  171. >
  172. <text
  173. v-else-if="
  174. item.stuAllNum + item.recordNum >=
  175. item.secAllNum + item.examNum
  176. "
  177. >已学完</text
  178. >
  179. </template>
  180. <template v-else>
  181. <template v-if="item.serviceStartTime"
  182. >已过学习服务期,不可以学习了哦!</template
  183. >
  184. </template>
  185. </view>
  186. </view>
  187. </view>
  188. <!-- <view class="class-warm" v-if="item.profileTpStatus == 1">
  189. <view class="class-warm__text">
  190. <view class="date">
  191. 资料审核状态:
  192. <text v-if="item.profileStatus == null">未提交资料</text>
  193. <text v-else-if="item.profileStatus == 1">已通过</text>
  194. <text v-else-if="item.profileStatus == 2">审核中</text>
  195. <text v-else-if="item.profileStatus == 3">待完善</text>
  196. </view>
  197. </view>
  198. </view> -->
  199. </template>
  200. <!-- 学时审核状态可以审核 -->
  201. <template v-if="item.periodStatus != -1">
  202. <view class="class-warm">
  203. <view class="class-warm__text">
  204. <view class="date">
  205. <text v-if="item.periodStatus == 0"
  206. >机构审核:学时审核不通过</text
  207. >
  208. <!-- <text v-else-if="item.periodStatus == 2">学时待审核</text> -->
  209. <text v-else-if="item.periodStatus == 3">学时审核中</text>
  210. <text v-else-if="item.periodStatus == 1">
  211. <text v-if="item.periodPlush > 0"
  212. >学时已上报注册中心</text
  213. >
  214. <text v-else>机构审核:学时审核通过</text>
  215. </text>
  216. </view>
  217. </view>
  218. </view>
  219. <view
  220. class="class-warm"
  221. v-if="item.subscribeId != null && item.periodStatus == 1"
  222. >
  223. <view class="class-warm__text">
  224. <view class="date">
  225. <view v-if="item.subExamStatus === null">待预约考试</view>
  226. <view
  227. v-else-if="
  228. item.subExamStatus === 0 &&
  229. sysTime <
  230. $method.TimeTotimestamp(
  231. $method.timestampToTime(
  232. item.subApplySiteExamTime,
  233. true
  234. ) +
  235. ' ' +
  236. item.subApplySiteStartTime
  237. )
  238. "
  239. >
  240. 待考试,考试时间:
  241. {{
  242. $method.timestampToTime(
  243. item.subApplySiteExamTime,
  244. true
  245. ) +
  246. " " +
  247. item.subApplySiteStartTime
  248. }}
  249. -
  250. {{
  251. $method.timestampToTime(
  252. item.subApplySiteExamTime,
  253. true
  254. ) +
  255. " " +
  256. item.subApplySiteEndTime
  257. }}
  258. </view>
  259. <view v-else-if="item.subExamStatus === 0"
  260. >待出考试结果</view
  261. >
  262. <view v-else-if="item.subExamStatus === 1">
  263. <text v-if="item.subResult === null">待出考试结果</text>
  264. <text v-if="item.subResult === 0"
  265. >考试结果:不通过,需补考</text
  266. >
  267. <text v-else-if="item.subResult === 1"
  268. >考试结果:通过,考试成绩为{{
  269. item.subPerformance
  270. }}</text
  271. >
  272. </view>
  273. <view v-else-if="item.subExamStatus === 2"
  274. >缺考,无成绩,需补考</view
  275. >
  276. <view v-else-if="item.subExamStatus === 3"
  277. >作弊,无成绩,需补考</view
  278. >
  279. <view v-else-if="item.subExamStatus === 4"
  280. >替考,无成绩,需补考</view
  281. >
  282. </view>
  283. </view>
  284. </view>
  285. </template>
  286. </template>
  287. </template>
  288. </view>
  289. <view class="bottomBox">
  290. <template
  291. v-if="
  292. item.gradeStatus == 1 &&
  293. item.status == 1 &&
  294. item.serviceEndTime > sysTime &&
  295. item.serviceStartTime < sysTime &&
  296. item.classEndTime &&
  297. item.classEndTime < sysTime &&
  298. (item.periodStatus == 0 || item.periodStatus == -1) &&
  299. item.studyCount > 0
  300. "
  301. >
  302. <view class="restart" @click.stop="selectClass(item, index)">
  303. 选班重学
  304. </view>
  305. </template>
  306. <template v-else>
  307. <view class="content_box">
  308. <image src="/static/icon/wk_icon3.png" class="wk_icon"></image>
  309. 学习进度:{{ item.stuAllNum + item.recordNum }}/{{
  310. item.secAllNum + item.examNum
  311. }}
  312. </view>
  313. <view class="box_progress">
  314. <view style="width: 60%">
  315. <u-line-progress
  316. :showText="false"
  317. height="22"
  318. active-color="#ff9900"
  319. :show-percent="false"
  320. :percent="
  321. ((item.stuAllNum + item.recordNum) /
  322. (item.secAllNum + item.examNum)) *
  323. 100
  324. "
  325. ></u-line-progress>
  326. </view>
  327. <view>
  328. <u-button
  329. :class="{
  330. disabled:
  331. (item.serviceStartTime &&
  332. (sysTime <= item.serviceStartTime ||
  333. sysTime >= item.serviceEndTime)) ||
  334. (item.classStartTime && sysTime <= item.classStartTime) ||
  335. (item.classEndTime && sysTime >= item.classEndTime) ||
  336. item.learningStatus == 2 ||
  337. item.classStatus == 0 ||
  338. (item.learningStatus == 3 &&
  339. sysTime < item.learningTimeStart),
  340. }"
  341. type="warning"
  342. size="mini"
  343. @click.stop="studyIn(item.goodsId, item.gradeId, item, index)"
  344. >
  345. 进入学习</u-button
  346. >
  347. </view>
  348. </view>
  349. <template v-for="(appoint, appointIndex) in item.examApplyGoodsList">
  350. <view
  351. class="box_progress"
  352. :key="appointIndex"
  353. v-if="
  354. item.applyStatus === 1 &&
  355. !(
  356. sysTime <= item.serviceStartTime ||
  357. sysTime >= item.serviceEndTime ||
  358. (item.classStartTime && sysTime <= item.classStartTime) ||
  359. (item.classEndTime && sysTime >= item.classEndTime) ||
  360. item.learningStatus == 2 ||
  361. item.classStatus == 0 ||
  362. (item.learningStatus == 3 && sysTime < item.learningTimeStart)
  363. )
  364. "
  365. >
  366. <view style="flex: 1; margin-right: 10rpx">
  367. <text style="color: #333333">{{ appoint.applyName }}</text>
  368. </view>
  369. <view>
  370. <u-button
  371. :plain="true"
  372. type="primary"
  373. size="mini"
  374. @click.stop="appointment(item, appoint)"
  375. >预约考试
  376. </u-button>
  377. </view>
  378. </view>
  379. </template>
  380. <view
  381. class="box_progress"
  382. v-if="
  383. item.beforeStatus === 1 &&
  384. !(
  385. sysTime <= item.serviceStartTime ||
  386. sysTime >= item.serviceEndTime ||
  387. (item.classStartTime && sysTime <= item.classStartTime) ||
  388. (item.classEndTime && sysTime >= item.classEndTime) ||
  389. item.learningStatus == 2 ||
  390. item.classStatus == 0 ||
  391. (item.learningStatus == 3 && sysTime < item.learningTimeStart)
  392. )
  393. "
  394. >
  395. <view style="flex: 1; margin-right: 10rpx">
  396. <text style="color: #2979ff">{{ item.beforeName }}</text>
  397. </view>
  398. <view>
  399. <u-button
  400. type="primary"
  401. size="mini"
  402. @click="appBeforeAddress(item.goodsId, item)"
  403. >进入刷题</u-button
  404. >
  405. </view>
  406. </view>
  407. </template>
  408. </view>
  409. </view>
  410. <view v-if="goodsList.length == 0">
  411. <u-empty text="暂无网课" margin-top="500" mode="list"></u-empty>
  412. </view>
  413. <u-popup
  414. v-model="selectClassModal"
  415. @close="gradeValue = -1"
  416. mode="bottom"
  417. border-radius="40"
  418. >
  419. <view class="popup_box">
  420. <view style="margin-bottom: 20rpx">
  421. <view class="line1"></view>
  422. <view class="grade">选择班级1</view>
  423. </view>
  424. <u-line color="#D6D6DB" />
  425. <view>
  426. <scroll-view scroll-y="true" style="height: 500rpx">
  427. <view>
  428. <u-radio-group v-model="gradeValue" @change="radioGroupChange">
  429. <view v-for="(item, index) in gradeList" :key="index">
  430. <view
  431. style="display: flex; align-items: center; padding: 20rpx"
  432. >
  433. <view>
  434. <u-radio
  435. shape="circle"
  436. :name="index"
  437. :disabled="
  438. item.studentNum > 0 &&
  439. item.studentNum == item.studentUpper
  440. "
  441. >
  442. <view
  443. :class="
  444. item.checked ? 'white-box blue-box' : 'white-box'
  445. "
  446. >
  447. <view>
  448. <view class="blackTxt">{{ item.className }}</view>
  449. <Class-time-tip :classInfo="item"></Class-time-tip>
  450. </view>
  451. </view>
  452. </u-radio>
  453. </view>
  454. </view>
  455. </view>
  456. </u-radio-group>
  457. </view>
  458. </scroll-view>
  459. </view>
  460. <view class="confrim-btn">
  461. <view class="okBtn" @click="okPopup()">确定</view>
  462. </view>
  463. </view>
  464. </u-popup>
  465. <u-modal
  466. v-model="showMark"
  467. title="提示"
  468. @confirm="markConfirm"
  469. confirm-text="复制学习网址"
  470. :show-cancel-button="true"
  471. cancel-text="关闭"
  472. >
  473. <view class="slot-content">
  474. <view>您的学习账号已经开通,请按照步骤操作,进行学习。</view>
  475. <view>1.复制学习地址:{{ markContent }}</view>
  476. <view>2.在【浏览器中】打开复制的学习网址</view>
  477. <view>3.打开学习网址后,选择【个人用户】进行登录</view>
  478. <view>(1)账号:您个人的身份证号码</view>
  479. <view>(2)密码:身份证号码,再加111111</view>
  480. </view>
  481. </u-modal>
  482. <u-modal
  483. v-model="showUserConfirmInfo"
  484. @confirm="confirmUserConfirm"
  485. ref="uModal"
  486. :async-close="true"
  487. @cancel="cancelUserConfirm"
  488. :confirm-text="
  489. '确认' + (confirmCount > 0 ? '(' + confirmCount + ')' : '')
  490. "
  491. :confirm-color="confirmCount > 0 ? '#999' : '#2979ff'"
  492. class="confirm-modal"
  493. title="实名验证确认"
  494. cancel="取消"
  495. :show-cancel-button="true"
  496. >
  497. <view class="slot-content">
  498. <view class="content">
  499. 为避免个人信息不正确导致您的学习时长无效,请认真核对以下信息是否正确,如信息有误请取消当前操作,立刻联系020-38946666
  500. <view class="msg-list">
  501. <view class="item">
  502. <text class="item__left">姓名:</text>
  503. <text class="item__right">{{ userInfo.realname }}</text>
  504. </view>
  505. <view class="item">
  506. <text class="item__left">手机号:</text>
  507. <text class="item__right">{{ userInfo.telphone }}</text>
  508. </view>
  509. <view class="item">
  510. <text class="item__left">身份号:</text>
  511. <text class="item__right">{{ userInfo.idCard }}</text>
  512. </view>
  513. <view class="item">
  514. <u-checkbox v-model="confirmChecked" :label-disabled="false"
  515. >确认个人信息无误</u-checkbox
  516. >
  517. </view>
  518. </view>
  519. </view>
  520. </view>
  521. </u-modal>
  522. </view>
  523. </template>
  524. <script>
  525. import { mapGetters, mapActions } from "vuex";
  526. import ClassTimeTip from "../../components/common/ClassTimeTip.vue";
  527. export default {
  528. computed: {
  529. ...mapGetters(["userInfo"]),
  530. },
  531. data() {
  532. return {
  533. activeItem: {},
  534. confirmTimer: null,
  535. confirmCount: 10,
  536. confirmChecked: false,
  537. showUserConfirmInfo: false,
  538. showMark: false,
  539. list: [1, 2, 3],
  540. goodsList: [],
  541. selectClassModal: false,
  542. gradeList: [],
  543. gradeValue: -1,
  544. param: {
  545. pageNum: 1,
  546. pageSize: 10,
  547. },
  548. total: 0,
  549. sysTime: 0,
  550. itemIndex: "",
  551. selectItem: {},
  552. };
  553. },
  554. onLoad(option) {
  555. // this.sysTime = +this.$method.timest();
  556. this.courseGoodsList();
  557. },
  558. async onShow() {
  559. this.getUserInfo();
  560. if (this.itemIndex !== "") {
  561. this.refreshByIndex();
  562. }
  563. await this.commonSystemTime();
  564. this.sysTime = +this.$method.timest();
  565. },
  566. onReachBottom() {
  567. if (this.goodsList.length < this.total) {
  568. this.param.pageNum++;
  569. this.courseGoodsList();
  570. }
  571. },
  572. methods: {
  573. ...mapActions(["getUserInfo"]),
  574. /**
  575. * 复制网址
  576. */
  577. markConfirm() {
  578. uni.setClipboardData({
  579. data: this.markContent,
  580. success: function () {
  581. console.log("success");
  582. },
  583. });
  584. },
  585. /**
  586. * 返回刷新之前进入的课程数据
  587. */
  588. refreshByIndex() {
  589. let self = this;
  590. this.$api
  591. .courseGoodsList({
  592. pageNum: this.itemIndex + 1,
  593. pageSize: 1,
  594. })
  595. .then((res) => {
  596. if (res.data.code == 200) {
  597. this.$set(this.goodsList, this.itemIndex, res.data.rows[0]);
  598. }
  599. });
  600. },
  601. commonSystemTime() {
  602. return new Promise((resolve) => {
  603. this.$api.commonSystemTime().then((res) => {
  604. this.sysTime = res.data.data;
  605. });
  606. });
  607. },
  608. selectClass(item, index) {
  609. console.log(item);
  610. this.itemIndex = index;
  611. this.selectItem = item;
  612. this.selectClassModal = true;
  613. this.goodsGradeList(item.goodsId);
  614. },
  615. radioGroupChange(e) {
  616. console.log(e);
  617. },
  618. userConfirmInfoDetail() {
  619. return new Promise((resolve) => {
  620. this.$api
  621. .userConfirmInfoDetail({
  622. orderGoodsId: this.activeItem.orderGoodsId,
  623. })
  624. .then((res) => {
  625. if (!res.data.data) {
  626. clearInterval(this.confirmTimer);
  627. this.confirmCount = 10;
  628. this.showUserConfirmInfo = true;
  629. this.confirmTimer = setInterval(() => {
  630. if (this.confirmCount > 0) {
  631. this.confirmCount--;
  632. } else {
  633. clearInterval(this.confirmTimer);
  634. }
  635. }, 1000);
  636. } else {
  637. if (res.data.data.pushInfo) {
  638. resolve(true);
  639. } else {
  640. uni.showModal({
  641. showCancel: false,
  642. title: "提示",
  643. content:
  644. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  645. });
  646. resolve(false);
  647. }
  648. }
  649. });
  650. });
  651. },
  652. confirmUserConfirm() {
  653. this.$refs.uModal.clearLoading();
  654. if (this.confirmCount <= 0) {
  655. if (this.confirmChecked) {
  656. let infoJson = {
  657. realname: this.userInfo.realname,
  658. idCard: this.userInfo.idCard,
  659. telphone: this.userInfo.telphone,
  660. };
  661. this.$api
  662. .userConfirminfo({
  663. orderGoodsId: this.activeItem.orderGoodsId,
  664. infoJson: JSON.stringify(infoJson),
  665. })
  666. .then((res) => {
  667. if (res.data.data.pushInfo) {
  668. uni.showToast({
  669. icon: "none",
  670. title: "提交成功",
  671. });
  672. } else {
  673. uni.showModal({
  674. showCancel: false,
  675. title: "提示",
  676. content:
  677. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  678. });
  679. }
  680. this.showUserConfirmInfo = false;
  681. });
  682. } else {
  683. uni.showToast({
  684. icon: "none",
  685. title: "请勾选确认个人信息无误",
  686. });
  687. }
  688. } else {
  689. return;
  690. }
  691. },
  692. cancelUserConfirm() {
  693. clearInterval(this.confirmTimer);
  694. },
  695. goodsGradeList(id) {
  696. let self = this;
  697. this.$api
  698. .goodsGradeList({
  699. goodsId: id,
  700. })
  701. .then((res) => {
  702. if (res.data.code == 200) {
  703. self.gradeList = res.data.rows;
  704. if (self.gradeList.length == 0) {
  705. let item = {
  706. className: "系统分班",
  707. gradeId: 0,
  708. };
  709. self.gradeList.push(item);
  710. } else {
  711. let isGradeFull = self.gradeList.every(
  712. (item) =>
  713. item.studentNum > 0 && item.studentNum == item.studentUpper
  714. );
  715. //所有班级都满了
  716. if (isGradeFull) {
  717. let item = {
  718. className: "系统分班",
  719. gradeId: 0,
  720. };
  721. self.gradeList.unshift(item);
  722. }
  723. }
  724. }
  725. });
  726. },
  727. appBeforeAddress(goodsId, item) {
  728. this.$api
  729. .appBeforeAddress({
  730. // goodsId,
  731. orderGoodsId: item.orderGoodsId,
  732. })
  733. .then((res) => {
  734. if (res.data.code == 200) {
  735. uni.navigateToMiniProgram({
  736. appId: res.data.data.url,
  737. success(res) {
  738. // 打开成功
  739. },
  740. });
  741. } else {
  742. uni.showModal({
  743. title: "提示",
  744. content: res.data.msg,
  745. showCancel: false,
  746. });
  747. }
  748. });
  749. },
  750. courseGoodsList() {
  751. let self = this;
  752. // /course/goodsList 查询用户拥有的商品
  753. this.$api.courseGoodsList(this.param).then((res) => {
  754. if (res.data.code == 200) {
  755. self.goodsList.push.apply(self.goodsList, res.data.rows);
  756. self.total = res.data.total;
  757. }
  758. });
  759. },
  760. async studyIn(v, i, item, index) {
  761. this.activeItem = item;
  762. if (item.interfaceAccountId > 0) {
  763. //学习账号已开通
  764. if (item.learnStatus > 0) {
  765. //跳转第三方h5
  766. // this.showMark = true;
  767. uni.navigateTo({
  768. url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&isOther=1`,
  769. });
  770. return;
  771. // uni.navigateTo({
  772. // url:'/pages/webview/index?url='+item.officialLearningUrl
  773. // })
  774. // return;
  775. } else {
  776. uni.showModal({
  777. showCancel: false,
  778. content:
  779. "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
  780. });
  781. return;
  782. }
  783. return;
  784. }
  785. if (
  786. item.serviceStartTime &&
  787. (this.sysTime <= item.serviceStartTime ||
  788. this.sysTime >= item.serviceEndTime)
  789. ) {
  790. uni.showToast({
  791. icon: "none",
  792. title: "不在学习服务期,不能进入学习",
  793. });
  794. return;
  795. }
  796. if (
  797. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  798. (item.classEndTime && this.sysTime >= item.classEndTime)
  799. ) {
  800. uni.showToast({
  801. icon: "none",
  802. title: "不在班级有效期,不能进入学习",
  803. });
  804. return;
  805. }
  806. if (item.learningStatus == 2) {
  807. uni.showToast({
  808. icon: "none",
  809. title: "开放学习时间待定,不能进入学习",
  810. });
  811. return;
  812. }
  813. if (item.classStatus == 0) {
  814. uni.showToast({
  815. icon: "none",
  816. title: "尚未开班,不能进入学习",
  817. });
  818. return;
  819. }
  820. console.log(this.sysTime, item.learningTimeStart);
  821. console.log(this.sysTime < item.learningTimeStart);
  822. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  823. uni.showToast({
  824. icon: "none",
  825. title: "不在开放学习时间,不能进入学习",
  826. });
  827. return;
  828. }
  829. var confirmDetail = true;
  830. if (item.educationName == "继续教育") {
  831. if (
  832. item.officialName &&
  833. item.businessName == "二级" &&
  834. item.projectName == "建造师"
  835. ) {
  836. confirmDetail = await this.userConfirmInfoDetail();
  837. }
  838. }
  839. if (!confirmDetail) {
  840. return;
  841. }
  842. // //内部系统
  843. // if (item.interfacePushId > 0 && item.officialStatus != 1) {
  844. // uni.showModal({
  845. // showCancel: false,
  846. // content: '机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!'
  847. // });
  848. // return;
  849. // }
  850. this.itemIndex = index;
  851. if (
  852. item.gradeStatus == 1 &&
  853. item.status == 1 &&
  854. item.serviceEndTime > this.sysTime &&
  855. item.classEndTime &&
  856. item.classEndTime < this.sysTime &&
  857. (item.periodStatus == 0 || item.periodStatus == -1) &&
  858. item.studyCount > 0
  859. ) {
  860. this.selectClass(item, index);
  861. return;
  862. }
  863. let rebuildStatus = await this.courseGoodsRebuildStatus(
  864. item.goodsId,
  865. item.gradeId
  866. );
  867. if (rebuildStatus == 0) {
  868. this.$navTo.togo("/pages2/learn/details", {
  869. gradeId: item.gradeId,
  870. goodsId: item.goodsId,
  871. orderGoodsId: item.orderGoodsId,
  872. });
  873. return;
  874. }
  875. // if (item.educationName == '继续教育') {
  876. this.$api
  877. .lockLockStatus({
  878. action: "jxjy",
  879. uuid: this.$method.getUuid(),
  880. })
  881. .then((res) => {
  882. if (res.data.code == 200) {
  883. //有其他端在操作,不能学习
  884. uni.showToast({
  885. icon: "none",
  886. title: res.data.msg,
  887. mask: true,
  888. duration: 3000,
  889. });
  890. } else if (res.data.code == 500) {
  891. //可以学习
  892. if (item.courseNum == 1) {
  893. this.$api
  894. .courseCourseList({
  895. pageNum: 1,
  896. pageSize: 1,
  897. goodsId: item.goodsId,
  898. gradeId: item.gradeId,
  899. orderGoodsId: item.orderGoodsId,
  900. })
  901. .then((res) => {
  902. if (res.data.code == 200) {
  903. // if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  904. // this.userConfirmInfoDetail().then(() => {
  905. // uni.navigateTo({
  906. // url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  907. // })
  908. // })
  909. // } else {
  910. uni.navigateTo({
  911. url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`,
  912. });
  913. // }
  914. }
  915. });
  916. return;
  917. }
  918. // if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  919. // // this.userConfirmInfoDetail().then(() => {
  920. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  921. // // })
  922. // } else {
  923. this.$navTo.togo(
  924. `/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`
  925. );
  926. // }
  927. }
  928. });
  929. // } else {
  930. // if (item.courseNum == 1) {
  931. // this.$api.courseCourseList({
  932. // pageNum: 1,
  933. // pageSize: 1,
  934. // goodsId: item.goodsId,
  935. // gradeId: item.gradeId,
  936. // orderGoodsId: item.orderGoodsId,
  937. // }).then(res => {
  938. // if (res.data.code == 200) {
  939. // uni.navigateTo({
  940. // url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  941. // })
  942. // }
  943. // });
  944. // return;
  945. // }
  946. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  947. // }
  948. },
  949. /**
  950. * @param {Object} goodsId 商品id
  951. * 查询商品重修状态
  952. */
  953. courseGoodsRebuildStatus(goodsId, gradeId) {
  954. return new Promise((resolve) => {
  955. this.$api
  956. .courseGoodsRebuildStatus({
  957. goodsId: goodsId,
  958. gradeId: gradeId,
  959. })
  960. .then((res) => {
  961. resolve(res.data.data);
  962. });
  963. });
  964. },
  965. appointment(item, appoint) {
  966. var data = {
  967. goodsId: item.goodsId,
  968. gradeId: item.gradeId,
  969. applyId: appoint.applyId,
  970. orderGoodsId: item.orderGoodsId,
  971. };
  972. this.$api.getApplysubscribe(data).then((res) => {
  973. if (res.data.code === 500) {
  974. uni.showModal({
  975. showCancel: false,
  976. content: res.data.msg,
  977. });
  978. }
  979. if (res.data.code === 200) {
  980. this.$navTo.togo("/pages2/appointment/index", {
  981. goodsId: item.goodsId,
  982. gradeId: item.gradeId,
  983. orderGoodsId: item.orderGoodsId,
  984. applyId: appoint.applyId,
  985. });
  986. }
  987. });
  988. },
  989. okPopup() {
  990. if (this.gradeValue == -1) {
  991. uni.showToast({
  992. icon: "none",
  993. title: "请选择班级",
  994. });
  995. return;
  996. }
  997. this.$api
  998. .changeGrade({
  999. goodsId: this.selectItem.goodsId,
  1000. gradeId: this.gradeValue,
  1001. oldGradeId: this.selectItem.gradeId,
  1002. orderGoodsId: this.selectItem.orderGoodsId,
  1003. userId: this.selectItem.userId,
  1004. })
  1005. .then((res) => {
  1006. if (res.data.code == 200) {
  1007. if (this.itemIndex !== "") {
  1008. this.refreshByIndex();
  1009. }
  1010. this.selectClassModal = false;
  1011. uni.showToast({
  1012. title: "选班成功",
  1013. });
  1014. } else {
  1015. uni.showToast({
  1016. icon: "none",
  1017. title: res.data.msg,
  1018. });
  1019. }
  1020. });
  1021. },
  1022. call() {
  1023. uni.makePhoneCall({
  1024. phoneNumber: "020-87085982", //仅为示例
  1025. });
  1026. },
  1027. },
  1028. components: { ClassTimeTip },
  1029. };
  1030. </script>
  1031. <style>
  1032. page {
  1033. background: #eaeef1;
  1034. }
  1035. </style>
  1036. <style scope lang="scss">
  1037. .box_progress {
  1038. display: flex;
  1039. justify-content: space-between;
  1040. align-items: center;
  1041. margin-top: 20rpx;
  1042. .disabled {
  1043. opacity: 0.6;
  1044. }
  1045. }
  1046. .bottomBox {
  1047. background: #ffffff;
  1048. width: 94%;
  1049. border-bottom-left-radius: 24rpx;
  1050. border-bottom-right-radius: 24rpx;
  1051. margin: 0 auto;
  1052. padding: 20rpx;
  1053. .restart {
  1054. margin: 0 auto;
  1055. text-align: center;
  1056. line-height: 80rpx;
  1057. color: #fff;
  1058. font-size: 30rpx;
  1059. width: 440rpx;
  1060. height: 80rpx;
  1061. background: #ff0000;
  1062. border-radius: 40rpx 40rpx 40rpx 40rpx;
  1063. }
  1064. }
  1065. .content_box {
  1066. font-size: 24rpx;
  1067. display: flex;
  1068. align-items: center;
  1069. color: #999999;
  1070. margin-top: 8rpx;
  1071. }
  1072. .content {
  1073. color: #000000;
  1074. margin: 0 8rpx;
  1075. }
  1076. .wk_icon {
  1077. width: 24rpx;
  1078. height: 24rpx;
  1079. margin-right: 8rpx;
  1080. }
  1081. .class {
  1082. margin-bottom: 30rpx;
  1083. .class_item {
  1084. width: 100%;
  1085. background: #ffffff;
  1086. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  1087. border-radius: 24rpx;
  1088. padding: 20rpx;
  1089. z-index: 999;
  1090. position: relative;
  1091. .class_img {
  1092. height: 367rpx;
  1093. width: 100%;
  1094. border-radius: 24rpx;
  1095. }
  1096. .class_text {
  1097. padding: 0 20rpx;
  1098. .class_title {
  1099. color: #333333;
  1100. font-weight: bold;
  1101. font-size: 32rpx;
  1102. }
  1103. }
  1104. .class-warm {
  1105. padding: 10rpx 20rpx;
  1106. display: flex;
  1107. align-items: flex-start;
  1108. &__icon {
  1109. margin-right: 10rpx;
  1110. }
  1111. &__text {
  1112. .date {
  1113. font-size: 24rpx;
  1114. font-weight: bold;
  1115. color: #ff3b30;
  1116. }
  1117. .state {
  1118. margin-top: 15rpx;
  1119. font-size: 24rpx;
  1120. font-weight: bold;
  1121. color: #ff3b30;
  1122. }
  1123. }
  1124. }
  1125. }
  1126. }
  1127. .popup_box {
  1128. height: 700rpx;
  1129. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1130. border-radius: 32rpx 32rpx 0rpx 0rpx;
  1131. .line1 {
  1132. width: 80rpx;
  1133. height: 8rpx;
  1134. background: #999999;
  1135. border-radius: 4rpx;
  1136. margin: 0 auto;
  1137. margin-top: 15rpx;
  1138. }
  1139. .grade {
  1140. height: 23rpx;
  1141. font-size: 24rpx;
  1142. color: #999999;
  1143. margin: 0 auto;
  1144. margin-top: 15rpx;
  1145. text-align: center;
  1146. }
  1147. .confrim-btn {
  1148. height: 98rpx;
  1149. width: 100%;
  1150. display: flex;
  1151. align-items: center;
  1152. justify-content: center;
  1153. .okBtn {
  1154. width: 200rpx;
  1155. height: 64rpx;
  1156. background: linear-gradient(0deg, #015eea, #00c0fa);
  1157. border-radius: 32rpx;
  1158. color: #ffffff;
  1159. text-align: center;
  1160. line-height: 64rpx;
  1161. }
  1162. }
  1163. }
  1164. .slot-content {
  1165. padding: 0 20rpx;
  1166. }
  1167. .confirm-modal {
  1168. .slot-content {
  1169. padding: 0 20rpx;
  1170. .content {
  1171. color: red;
  1172. .msg-list {
  1173. .item {
  1174. padding: 20rpx 0;
  1175. &__left {
  1176. color: #666;
  1177. margin-right: 20rpx;
  1178. }
  1179. &__right {
  1180. color: #333;
  1181. }
  1182. }
  1183. }
  1184. }
  1185. }
  1186. }
  1187. </style>