class.vue 35 KB

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