class.vue 29 KB

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