class.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004
  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. // /course/goodsList 查询用户拥有的商品
  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. uni.navigateTo({
  512. url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&isOther=1`
  513. })
  514. return;
  515. // uni.navigateTo({
  516. // url:'/pages/webview/index?url='+item.officialLearningUrl
  517. // })
  518. // return;
  519. } else {
  520. uni.showModal({
  521. showCancel: false,
  522. content: '您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!'
  523. });
  524. return;
  525. }
  526. return;
  527. }
  528. if (item.serviceStartTime && (this.sysTime <= item.serviceStartTime || this.sysTime >= item.serviceEndTime)) {
  529. uni.showToast({
  530. icon: 'none',
  531. title: '不在学习服务期,不能进入学习'
  532. })
  533. return;
  534. }
  535. if ((item.classStartTime && this.sysTime <= item.classStartTime) || (item.classEndTime && this
  536. .sysTime >= item.classEndTime)) {
  537. uni.showToast({
  538. icon: 'none',
  539. title: '不在班级有效期,不能进入学习'
  540. })
  541. return
  542. }
  543. if (item.learningStatus == 2) {
  544. uni.showToast({
  545. icon: 'none',
  546. title: '开放学习时间待定,不能进入学习'
  547. })
  548. return
  549. }
  550. if (item.classStatus == 0) {
  551. uni.showToast({
  552. icon: 'none',
  553. title: '尚未开班,不能进入学习'
  554. })
  555. return
  556. }
  557. console.log(this.sysTime, item.learningTimeStart)
  558. console.log(this.sysTime < item.learningTimeStart)
  559. if (item.learningStatus == 3 && (this.sysTime < item.learningTimeStart)) {
  560. uni.showToast({
  561. icon: 'none',
  562. title: '不在开放学习时间,不能进入学习'
  563. })
  564. return;
  565. }
  566. var confirmDetail = true;
  567. if (item.educationName == '继续教育') {
  568. if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  569. confirmDetail = await this.userConfirmInfoDetail()
  570. }
  571. }
  572. if(!confirmDetail) {
  573. return;
  574. }
  575. // //内部系统
  576. // if (item.interfacePushId > 0 && item.officialStatus != 1) {
  577. // uni.showModal({
  578. // showCancel: false,
  579. // content: '机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!'
  580. // });
  581. // return;
  582. // }
  583. this.itemIndex = index;
  584. if (item.gradeStatus == 1 && item.status == 1 && (item.serviceEndTime > this.sysTime) && (item
  585. .classEndTime && (item.classEndTime < this.sysTime)) && (item.periodStatus == 0 || item
  586. .periodStatus == -1) && item.studyCount > 0) {
  587. this.selectClass(item, index);
  588. return;
  589. }
  590. let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId, item.gradeId)
  591. if (rebuildStatus == 0) {
  592. this.$navTo.togo('/pages2/learn/details', {
  593. gradeId: item.gradeId,
  594. goodsId: item.goodsId,
  595. orderGoodsId: item.orderGoodsId,
  596. });
  597. return;
  598. }
  599. // if (item.educationName == '继续教育') {
  600. this.$api.lockLockStatus({
  601. action: 'jxjy',
  602. uuid:this.$method.getUuid()
  603. }).then(res => {
  604. if (res.data.code == 200) { //有其他端在操作,不能学习
  605. uni.showToast({
  606. icon: 'none',
  607. title: res.data.msg,
  608. mask: true,
  609. duration: 3000
  610. })
  611. } else if (res.data.code == 500) { //可以学习
  612. if (item.courseNum == 1) {
  613. this.$api.courseCourseList({
  614. pageNum: 1,
  615. pageSize: 1,
  616. goodsId: item.goodsId,
  617. gradeId: item.gradeId,
  618. orderGoodsId: item.orderGoodsId,
  619. }).then(res => {
  620. if (res.data.code == 200) {
  621. // if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  622. // this.userConfirmInfoDetail().then(() => {
  623. // uni.navigateTo({
  624. // url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  625. // })
  626. // })
  627. // } else {
  628. uni.navigateTo({
  629. url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  630. })
  631. // }
  632. }
  633. });
  634. return;
  635. }
  636. // if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  637. // // this.userConfirmInfoDetail().then(() => {
  638. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  639. // // })
  640. // } else {
  641. this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  642. // }
  643. }
  644. })
  645. // } else {
  646. // if (item.courseNum == 1) {
  647. // this.$api.courseCourseList({
  648. // pageNum: 1,
  649. // pageSize: 1,
  650. // goodsId: item.goodsId,
  651. // gradeId: item.gradeId,
  652. // orderGoodsId: item.orderGoodsId,
  653. // }).then(res => {
  654. // if (res.data.code == 200) {
  655. // uni.navigateTo({
  656. // url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  657. // })
  658. // }
  659. // });
  660. // return;
  661. // }
  662. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  663. // }
  664. },
  665. /**
  666. * @param {Object} goodsId 商品id
  667. * 查询商品重修状态
  668. */
  669. courseGoodsRebuildStatus(goodsId, gradeId) {
  670. return new Promise(resolve => {
  671. this.$api.courseGoodsRebuildStatus({
  672. goodsId: goodsId,
  673. gradeId: gradeId
  674. }).then(res => {
  675. resolve(res.data.data)
  676. })
  677. })
  678. },
  679. appointment(item,appoint) {
  680. var data = {
  681. goodsId: item.goodsId,
  682. gradeId: item.gradeId,
  683. applyId:appoint.applyId,
  684. orderGoodsId:item.orderGoodsId
  685. };
  686. this.$api.getApplysubscribe(data).then(res => {
  687. if (res.data.code === 500) {
  688. uni.showModal({
  689. showCancel: false,
  690. content: res.data.msg
  691. });
  692. }
  693. if (res.data.code === 200) {
  694. this.$navTo.togo('/pages2/appointment/index', {
  695. goodsId: item.goodsId,
  696. gradeId: item.gradeId,
  697. orderGoodsId: item.orderGoodsId,
  698. applyId:appoint.applyId
  699. });
  700. }
  701. });
  702. },
  703. okPopup() {
  704. if (this.gradeValue == -1) {
  705. uni.showToast({
  706. icon: 'none',
  707. title: '请选择班级'
  708. })
  709. return;
  710. }
  711. this.$api.changeGrade({
  712. goodsId: this.selectItem.goodsId,
  713. gradeId: this.gradeValue,
  714. oldGradeId: this.selectItem.gradeId,
  715. orderGoodsId: this.selectItem.orderGoodsId,
  716. userId: this.selectItem.userId
  717. }).then(res => {
  718. if (res.data.code == 200) {
  719. if (this.itemIndex !== '') {
  720. this.refreshByIndex();
  721. }
  722. this.selectClassModal = false;
  723. uni.showToast({
  724. title: '选班成功'
  725. })
  726. } else {
  727. uni.showToast({
  728. icon: 'none',
  729. title: res.data.msg
  730. })
  731. }
  732. })
  733. },
  734. call() {
  735. uni.makePhoneCall({
  736. phoneNumber: '020-87085982' //仅为示例
  737. })
  738. }
  739. }
  740. };
  741. </script>
  742. <style>
  743. page {
  744. background: #eaeef1;
  745. }
  746. </style>
  747. <style scope lang="scss">
  748. .box_progress {
  749. display: flex;
  750. justify-content: space-between;
  751. align-items: center;
  752. margin-top: 20rpx;
  753. .disabled {
  754. opacity: 0.6;
  755. }
  756. }
  757. .bottomBox {
  758. background: #ffffff;
  759. width: 94%;
  760. border-bottom-left-radius: 24rpx;
  761. border-bottom-right-radius: 24rpx;
  762. margin: 0 auto;
  763. padding: 20rpx;
  764. .restart {
  765. margin: 0 auto;
  766. text-align: center;
  767. line-height: 80rpx;
  768. color: #fff;
  769. font-size: 30rpx;
  770. width: 440rpx;
  771. height: 80rpx;
  772. background: #FF0000;
  773. border-radius: 40rpx 40rpx 40rpx 40rpx;
  774. }
  775. }
  776. .content_box {
  777. font-size: 24rpx;
  778. display: flex;
  779. align-items: center;
  780. color: #999999;
  781. margin-top: 8rpx;
  782. }
  783. .content {
  784. color: #000000;
  785. margin: 0 8rpx;
  786. }
  787. .wk_icon {
  788. width: 24rpx;
  789. height: 24rpx;
  790. margin-right: 8rpx;
  791. }
  792. .class {
  793. margin-bottom: 30rpx;
  794. .class_item {
  795. width: 100%;
  796. background: #ffffff;
  797. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  798. border-radius: 24rpx;
  799. padding: 20rpx;
  800. z-index: 999;
  801. position: relative;
  802. .class_img {
  803. height: 367rpx;
  804. width: 100%;
  805. border-radius: 24rpx;
  806. }
  807. .class_text {
  808. padding: 0 20rpx;
  809. .class_title {
  810. color: #333333;
  811. font-weight: bold;
  812. font-size: 32rpx;
  813. }
  814. }
  815. .class-warm {
  816. padding: 10rpx 20rpx;
  817. display: flex;
  818. align-items: flex-start;
  819. &__icon {
  820. margin-right: 10rpx;
  821. }
  822. &__text {
  823. .date {
  824. font-size: 24rpx;
  825. font-weight: bold;
  826. color: #FF3B30;
  827. }
  828. .state {
  829. margin-top: 15rpx;
  830. font-size: 24rpx;
  831. font-weight: bold;
  832. color: #FF3B30;
  833. }
  834. }
  835. }
  836. }
  837. }
  838. .popup_box {
  839. height: 700rpx;
  840. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  841. border-radius: 32rpx 32rpx 0rpx 0rpx;
  842. .line1 {
  843. width: 80rpx;
  844. height: 8rpx;
  845. background: #999999;
  846. border-radius: 4rpx;
  847. margin: 0 auto;
  848. margin-top: 15rpx;
  849. }
  850. .grade {
  851. height: 23rpx;
  852. font-size: 24rpx;
  853. color: #999999;
  854. margin: 0 auto;
  855. margin-top: 15rpx;
  856. text-align: center;
  857. }
  858. .confrim-btn {
  859. height: 98rpx;
  860. width: 100%;
  861. display: flex;
  862. align-items: center;
  863. justify-content: center;
  864. .okBtn {
  865. width: 200rpx;
  866. height: 64rpx;
  867. background: linear-gradient(0deg, #015EEA, #00C0FA);
  868. border-radius: 32rpx;
  869. color: #FFFFFF;
  870. text-align: center;
  871. line-height: 64rpx;
  872. }
  873. }
  874. }
  875. .slot-content {
  876. padding: 0 20rpx;
  877. }
  878. .confirm-modal {
  879. .slot-content {
  880. padding:0 20rpx;
  881. .content {
  882. color:red;
  883. .msg-list {
  884. .item {
  885. padding:20rpx 0;
  886. &__left {
  887. color:#666;
  888. margin-right:20rpx;
  889. }
  890. &__right {
  891. color:#333;
  892. }
  893. }
  894. }
  895. }
  896. }
  897. }
  898. </style>