class.vue 28 KB

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