class.vue 30 KB

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