class.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
  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="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. 已过学习服务期,不可以学习了哦!
  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: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. markContent: 'http://admin.zhujianpeixun.com/',
  299. showMark: false,
  300. list: [1, 2, 3],
  301. goodsList: [],
  302. selectClassModal: false,
  303. gradeList: [],
  304. gradeValue: -1,
  305. param: {
  306. pageNum: 1,
  307. pageSize: 10
  308. },
  309. total: 0,
  310. sysTime: 0,
  311. itemIndex: '',
  312. selectItem: {}
  313. };
  314. },
  315. onLoad(option) {
  316. // this.sysTime = +this.$method.timest();
  317. this.courseGoodsList();
  318. },
  319. async onShow() {
  320. this.getUserInfo()
  321. if (this.itemIndex !== '') {
  322. this.refreshByIndex();
  323. }
  324. await this.commonSystemTime()
  325. this.sysTime = +this.$method.timest();
  326. },
  327. onReachBottom() {
  328. if (this.goodsList.length < this.total) {
  329. this.param.pageNum++;
  330. this.courseGoodsList();
  331. }
  332. },
  333. methods: {
  334. ...mapActions(['getUserInfo']),
  335. /**
  336. * 复制网址
  337. */
  338. markConfirm() {
  339. uni.setClipboardData({
  340. data: this.markContent,
  341. success: function() {
  342. console.log('success');
  343. }
  344. });
  345. },
  346. /**
  347. * 返回刷新之前进入的课程数据
  348. */
  349. refreshByIndex() {
  350. let self = this;
  351. this.$api.courseGoodsList({
  352. pageNum: this.itemIndex + 1,
  353. pageSize: 1
  354. }).then(res => {
  355. if (res.data.code == 200) {
  356. this.$set(this.goodsList, this.itemIndex, res.data.rows[0])
  357. }
  358. });
  359. },
  360. commonSystemTime() {
  361. return new Promise(resolve => {
  362. this.$api.commonSystemTime().then(res => {
  363. this.sysTime = res.data.data;
  364. })
  365. })
  366. },
  367. selectClass(item, index) {
  368. console.log(item)
  369. this.itemIndex = index;
  370. this.selectItem = item;
  371. this.selectClassModal = true;
  372. this.goodsGradeList(item.goodsId);
  373. },
  374. radioGroupChange(e) {
  375. console.log(e)
  376. },
  377. userConfirmInfoDetail(){
  378. return new Promise(resolve => {
  379. this.$api.userConfirmInfoDetail({
  380. orderGoodsId:this.activeItem.orderGoodsId,
  381. }).then(res => {
  382. if(!res.data.data) {
  383. clearInterval(this.confirmTimer);
  384. this.confirmCount = 10;
  385. this.showUserConfirmInfo = true;
  386. this.confirmTimer = setInterval(() => {
  387. if(this.confirmCount > 0) {
  388. this.confirmCount--
  389. } else {
  390. clearInterval(this.confirmTimer);
  391. }
  392. },1000)
  393. } else {
  394. if(res.data.data.pushInfo) {
  395. resolve(true)
  396. } else {
  397. uni.showModal({
  398. showCancel:false,
  399. title:'提示',
  400. content:'开通信息推送不成功,无法进入学习,请联系020-87085982!'
  401. })
  402. resolve(false)
  403. }
  404. }
  405. })
  406. })
  407. },
  408. confirmUserConfirm() {
  409. this.$refs.uModal.clearLoading();
  410. if(this.confirmCount <= 0) {
  411. if(this.confirmChecked) {
  412. let infoJson = {
  413. realname:this.userInfo.realname,
  414. idCard:this.userInfo.idCard,
  415. telphone:this.userInfo.telphone
  416. }
  417. this.$api.userConfirminfo({
  418. orderGoodsId:this.activeItem.orderGoodsId,
  419. infoJson:JSON.stringify(infoJson)
  420. }).then(res => {
  421. if(res.data.data.pushInfo) {
  422. uni.showToast({
  423. icon:'none',
  424. title:'提交成功'
  425. })
  426. } else {
  427. uni.showModal({
  428. showCancel:false,
  429. title:'提示',
  430. content:'开通信息推送不成功,无法进入学习,请联系020-87085982!'
  431. })
  432. }
  433. this.showUserConfirmInfo = false;
  434. })
  435. } else {
  436. uni.showToast({
  437. icon:'none',
  438. title:'请勾选确认个人信息无误'
  439. })
  440. }
  441. } else {
  442. return;
  443. }
  444. },
  445. cancelUserConfirm() {
  446. clearInterval(this.confirmTimer)
  447. },
  448. goodsGradeList(id) {
  449. let self = this
  450. this.$api.goodsGradeList({
  451. goodsId: id
  452. }).then(res => {
  453. if (res.data.code == 200) {
  454. self.gradeList = res.data.rows
  455. if (self.gradeList.length == 0) {
  456. let item = {
  457. className: '系统分班',
  458. gradeId: 0
  459. }
  460. self.gradeList.push(item)
  461. } else {
  462. let isGradeFull = self.gradeList.every(item => (item.studentNum > 0 && item
  463. .studentNum == item.studentUpper))
  464. //所有班级都满了
  465. if (isGradeFull) {
  466. let item = {
  467. className: '系统分班',
  468. gradeId: 0
  469. }
  470. self.gradeList.unshift(item)
  471. }
  472. }
  473. }
  474. });
  475. },
  476. appBeforeAddress(goodsId,item) {
  477. this.$api.appBeforeAddress({
  478. // goodsId,
  479. orderGoodsId:item.orderGoodsId
  480. }).then(res => {
  481. if (res.data.code == 200) {
  482. uni.navigateToMiniProgram({
  483. appId: res.data.data.url,
  484. success(res) {
  485. // 打开成功
  486. }
  487. })
  488. } else {
  489. uni.showModal({
  490. title:'提示',
  491. content:res.data.msg,
  492. showCancel:false,
  493. })
  494. }
  495. })
  496. },
  497. courseGoodsList() {
  498. let self = this;
  499. this.$api.courseGoodsList(this.param).then(res => {
  500. if (res.data.code == 200) {
  501. self.goodsList.push.apply(self.goodsList, res.data.rows);
  502. self.total = res.data.total;
  503. }
  504. });
  505. },
  506. async studyIn(v, i, item, index) {
  507. this.activeItem = item;
  508. if (item.interfaceAccountId > 0) { //学习账号已开通
  509. if (item.learnStatus == 1) { //跳转第三方h5
  510. this.showMark = true;
  511. return;
  512. // uni.navigateTo({
  513. // url:'/pages/webview/index?url='+item.officialLearningUrl
  514. // })
  515. // return;
  516. } else {
  517. uni.showModal({
  518. showCancel: false,
  519. content: '您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!'
  520. });
  521. return;
  522. }
  523. return;
  524. }
  525. if (this.sysTime <= item.serviceStartTime || this.sysTime >= item.serviceEndTime) {
  526. uni.showToast({
  527. icon: 'none',
  528. title: '不在学习服务期,不能进入学习'
  529. })
  530. return;
  531. }
  532. if ((item.classStartTime && this.sysTime <= item.classStartTime) || (item.classEndTime && this
  533. .sysTime >= item.classEndTime)) {
  534. uni.showToast({
  535. icon: 'none',
  536. title: '不在班级有效期,不能进入学习'
  537. })
  538. return
  539. }
  540. if (item.learningStatus == 2) {
  541. uni.showToast({
  542. icon: 'none',
  543. title: '开放学习时间待定,不能进入学习'
  544. })
  545. return
  546. }
  547. if (item.classStatus == 0) {
  548. uni.showToast({
  549. icon: 'none',
  550. title: '尚未开班,不能进入学习'
  551. })
  552. return
  553. }
  554. console.log(this.sysTime, item.learningTimeStart)
  555. console.log(this.sysTime < item.learningTimeStart)
  556. if (item.learningStatus == 3 && (this.sysTime < item.learningTimeStart)) {
  557. uni.showToast({
  558. icon: 'none',
  559. title: '不在开放学习时间,不能进入学习'
  560. })
  561. return;
  562. }
  563. var confirmDetail = true;
  564. if (item.educationName == '继续教育') {
  565. if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  566. confirmDetail = await this.userConfirmInfoDetail()
  567. }
  568. }
  569. if(!confirmDetail) {
  570. return;
  571. }
  572. // //内部系统
  573. // if (item.interfacePushId > 0 && item.officialStatus != 1) {
  574. // uni.showModal({
  575. // showCancel: false,
  576. // content: '机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!'
  577. // });
  578. // return;
  579. // }
  580. this.itemIndex = index;
  581. if (item.gradeStatus == 1 && item.status == 1 && (item.serviceEndTime > this.sysTime) && (item
  582. .classEndTime && (item.classEndTime < this.sysTime)) && (item.periodStatus == 0 || item
  583. .periodStatus == -1) && item.studyCount > 0) {
  584. this.selectClass(item, index);
  585. return;
  586. }
  587. let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId, item.gradeId)
  588. if (rebuildStatus == 0) {
  589. this.$navTo.togo('/pages2/learn/details', {
  590. gradeId: item.gradeId,
  591. goodsId: item.goodsId,
  592. orderGoodsId: item.orderGoodsId,
  593. });
  594. return;
  595. }
  596. // if (item.educationName == '继续教育') {
  597. this.$api.lockLockStatus({
  598. action: 'jxjy',
  599. uuid:this.$method.getUuid()
  600. }).then(res => {
  601. if (res.data.code == 200) { //有其他端在操作,不能学习
  602. uni.showToast({
  603. icon: 'none',
  604. title: res.data.msg,
  605. mask: true,
  606. duration: 3000
  607. })
  608. } else if (res.data.code == 500) { //可以学习
  609. if (item.courseNum == 1) {
  610. this.$api.courseCourseList({
  611. pageNum: 1,
  612. pageSize: 1,
  613. goodsId: item.goodsId,
  614. gradeId: item.gradeId,
  615. orderGoodsId: item.orderGoodsId,
  616. }).then(res => {
  617. if (res.data.code == 200) {
  618. // if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  619. // this.userConfirmInfoDetail().then(() => {
  620. // uni.navigateTo({
  621. // url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  622. // })
  623. // })
  624. // } else {
  625. uni.navigateTo({
  626. url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  627. })
  628. // }
  629. }
  630. });
  631. return;
  632. }
  633. // if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  634. // // this.userConfirmInfoDetail().then(() => {
  635. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  636. // // })
  637. // } else {
  638. this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  639. // }
  640. }
  641. })
  642. // } else {
  643. // if (item.courseNum == 1) {
  644. // this.$api.courseCourseList({
  645. // pageNum: 1,
  646. // pageSize: 1,
  647. // goodsId: item.goodsId,
  648. // gradeId: item.gradeId,
  649. // orderGoodsId: item.orderGoodsId,
  650. // }).then(res => {
  651. // if (res.data.code == 200) {
  652. // uni.navigateTo({
  653. // url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  654. // })
  655. // }
  656. // });
  657. // return;
  658. // }
  659. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  660. // }
  661. },
  662. /**
  663. * @param {Object} goodsId 商品id
  664. * 查询商品重修状态
  665. */
  666. courseGoodsRebuildStatus(goodsId, gradeId) {
  667. return new Promise(resolve => {
  668. this.$api.courseGoodsRebuildStatus({
  669. goodsId: goodsId,
  670. gradeId: gradeId
  671. }).then(res => {
  672. resolve(res.data.data)
  673. })
  674. })
  675. },
  676. appointment(item,appoint) {
  677. var data = {
  678. goodsId: item.goodsId,
  679. gradeId: item.gradeId,
  680. applyId:appoint.applyId,
  681. orderGoodsId:item.orderGoodsId
  682. };
  683. this.$api.getApplysubscribe(data).then(res => {
  684. if (res.data.code === 500) {
  685. uni.showModal({
  686. showCancel: false,
  687. content: res.data.msg
  688. });
  689. }
  690. if (res.data.code === 200) {
  691. this.$navTo.togo('/pages2/appointment/index', {
  692. goodsId: item.goodsId,
  693. gradeId: item.gradeId,
  694. orderGoodsId: item.orderGoodsId,
  695. applyId:appoint.applyId
  696. });
  697. }
  698. });
  699. },
  700. okPopup() {
  701. if (this.gradeValue == -1) {
  702. uni.showToast({
  703. icon: 'none',
  704. title: '请选择班级'
  705. })
  706. return;
  707. }
  708. this.$api.changeGrade({
  709. goodsId: this.selectItem.goodsId,
  710. gradeId: this.gradeValue,
  711. oldGradeId: this.selectItem.gradeId,
  712. orderGoodsId: this.selectItem.orderGoodsId,
  713. userId: this.selectItem.userId
  714. }).then(res => {
  715. if (res.data.code == 200) {
  716. if (this.itemIndex !== '') {
  717. this.refreshByIndex();
  718. }
  719. this.selectClassModal = false;
  720. uni.showToast({
  721. title: '选班成功'
  722. })
  723. } else {
  724. uni.showToast({
  725. icon: 'none',
  726. title: res.data.msg
  727. })
  728. }
  729. })
  730. },
  731. call() {
  732. uni.makePhoneCall({
  733. phoneNumber: '020-87085982' //仅为示例
  734. })
  735. }
  736. }
  737. };
  738. </script>
  739. <style>
  740. page {
  741. background: #eaeef1;
  742. }
  743. </style>
  744. <style scope lang="scss">
  745. .box_progress {
  746. display: flex;
  747. justify-content: space-between;
  748. align-items: center;
  749. margin-top: 20rpx;
  750. .disabled {
  751. opacity: 0.6;
  752. }
  753. }
  754. .bottomBox {
  755. background: #ffffff;
  756. width: 94%;
  757. border-bottom-left-radius: 24rpx;
  758. border-bottom-right-radius: 24rpx;
  759. margin: 0 auto;
  760. padding: 20rpx;
  761. .restart {
  762. margin: 0 auto;
  763. text-align: center;
  764. line-height: 80rpx;
  765. color: #fff;
  766. font-size: 30rpx;
  767. width: 440rpx;
  768. height: 80rpx;
  769. background: #FF0000;
  770. border-radius: 40rpx 40rpx 40rpx 40rpx;
  771. }
  772. }
  773. .content_box {
  774. font-size: 24rpx;
  775. display: flex;
  776. align-items: center;
  777. color: #999999;
  778. margin-top: 8rpx;
  779. }
  780. .content {
  781. color: #000000;
  782. margin: 0 8rpx;
  783. }
  784. .wk_icon {
  785. width: 24rpx;
  786. height: 24rpx;
  787. margin-right: 8rpx;
  788. }
  789. .class {
  790. margin-bottom: 30rpx;
  791. .class_item {
  792. width: 100%;
  793. background: #ffffff;
  794. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  795. border-radius: 24rpx;
  796. padding: 20rpx;
  797. z-index: 999;
  798. position: relative;
  799. .class_img {
  800. height: 367rpx;
  801. width: 100%;
  802. border-radius: 24rpx;
  803. }
  804. .class_text {
  805. padding: 0 20rpx;
  806. .class_title {
  807. color: #333333;
  808. font-weight: bold;
  809. font-size: 32rpx;
  810. }
  811. }
  812. .class-warm {
  813. padding: 10rpx 20rpx;
  814. display: flex;
  815. align-items: flex-start;
  816. &__icon {
  817. margin-right: 10rpx;
  818. }
  819. &__text {
  820. .date {
  821. font-size: 24rpx;
  822. font-weight: bold;
  823. color: #FF3B30;
  824. }
  825. .state {
  826. margin-top: 15rpx;
  827. font-size: 24rpx;
  828. font-weight: bold;
  829. color: #FF3B30;
  830. }
  831. }
  832. }
  833. }
  834. }
  835. .popup_box {
  836. height: 700rpx;
  837. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  838. border-radius: 32rpx 32rpx 0rpx 0rpx;
  839. .line1 {
  840. width: 80rpx;
  841. height: 8rpx;
  842. background: #999999;
  843. border-radius: 4rpx;
  844. margin: 0 auto;
  845. margin-top: 15rpx;
  846. }
  847. .grade {
  848. height: 23rpx;
  849. font-size: 24rpx;
  850. color: #999999;
  851. margin: 0 auto;
  852. margin-top: 15rpx;
  853. text-align: center;
  854. }
  855. .confrim-btn {
  856. height: 98rpx;
  857. width: 100%;
  858. display: flex;
  859. align-items: center;
  860. justify-content: center;
  861. .okBtn {
  862. width: 200rpx;
  863. height: 64rpx;
  864. background: linear-gradient(0deg, #015EEA, #00C0FA);
  865. border-radius: 32rpx;
  866. color: #FFFFFF;
  867. text-align: center;
  868. line-height: 64rpx;
  869. }
  870. }
  871. }
  872. .slot-content {
  873. padding: 0 20rpx;
  874. }
  875. .confirm-modal {
  876. .slot-content {
  877. padding:0 20rpx;
  878. .content {
  879. color:red;
  880. .msg-list {
  881. .item {
  882. padding:20rpx 0;
  883. &__left {
  884. color:#666;
  885. margin-right:20rpx;
  886. }
  887. &__right {
  888. color:#333;
  889. }
  890. }
  891. }
  892. }
  893. }
  894. }
  895. </style>