index.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108
  1. <template>
  2. <view class="learnings">
  3. <u-navbar :is-back="false" title="学习中心" :border-bottom="false" title-color="#333333" back-icon-color="#ffffff">
  4. <view class="slot-wrap">
  5. <image src="/static/logo2.png" style="width: 178rpx;height: 31rpx;margin-left: 30rpx;"></image>
  6. </view>
  7. </u-navbar>
  8. <u-line color="#D6D6DB" />
  9. <view class="contents">
  10. <view class="diatance">
  11. <image class="clock" src="/static/learn/clock.png" mode=""></image>
  12. <text>
  13. 一级建造师,距离考试还有
  14. </text>
  15. <u-count-down :timestamp="leftDays" :show-days="true" separator="zh"
  16. :show-hours="false" :show-minutes="false" :show-seconds="false" font-size="28"
  17. bg-color="#007AFF" separator-color="#fff" color="#fff" separator-size="28">
  18. </u-count-down>
  19. </view>
  20. <!-- 有学习的课程 -->
  21. <view v-if="allCourse" class="had_courses">
  22. <!-- 直播 -->
  23. <view v-if="livingLists.length" class="lives">
  24. <view v-for="(live, l_index) in livingLists" :key="l_index" class="live_item" @click="toLiveLook(live)">
  25. <view class="live_con">
  26. <view class="live_status">
  27. <image v-if="bgShow(live.liveStartTime, live.watchStatus)" src="/static/learn/living.png" class="liv_icon"></image>
  28. <image v-else src="/static/learn/wlive.png" class="liv_icon"></image>
  29. <text class="status_s">{{ live.liveStartTime | liveStatus(live.watchStatus)}}</text>
  30. <view class="look_bt"
  31. :class="{'living': lookTimeStatus(live.liveStartTime, live.watchStatus) == 1,
  32. 'futuring': lookTimeStatus(live.liveStartTime, live.watchStatus) == 4,
  33. 'curring': [2,3].includes(lookTimeStatus(live.liveStartTime, live.watchStatus))}"
  34. >
  35. <text v-if="lookTimeStatus(live.liveStartTime, live.watchStatus) == 1">点击观看</text>
  36. <text v-if="lookTimeStatus(live.liveStartTime, live.watchStatus) == 2">即将开播</text>
  37. <template v-if="lookTimeStatus(live.liveStartTime, live.watchStatus) == 3">
  38. 剩余:
  39. <u-count-down :timestamp="curTimeTamp(live.liveStartTime)" :show-days="false"
  40. color="#fff" separator-color="#fff" font-size="24" separator-size="24" bg-color="#FFB102">
  41. </u-count-down>
  42. </template>
  43. <template v-if="lookTimeStatus(live.liveStartTime, live.watchStatus) == 4">
  44. 剩余:
  45. <u-count-down :timestamp="curTimeTamp(live.liveStartTime)" :show-days="true" separator="zh"
  46. color="#fff" separator-color="#fff" bg-color="#007AFF"
  47. :show-hours="false" :show-minutes="false" :show-seconds="false" font-size="24" separator-size="24">
  48. </u-count-down>
  49. <u-count-down :timestamp="curTimeTamp(live.liveStartTime)" :show-days="false"
  50. color="#fff" separator-color="#fff" bg-color="#007AFF"
  51. font-size="24" separator-size="24">
  52. </u-count-down>
  53. </template>
  54. </view>
  55. </view>
  56. <view class="liv_time">
  57. <text class="timeR">{{ live.liveStartTime | formate('mm月dd日')}}</text>
  58. <text>{{ live.liveStartTime | formate('hh:mm')}}</text>
  59. </view>
  60. <view class="liv_title">{{ live.name }}</view>
  61. </view>
  62. <image v-if="bgShow(live.liveStartTime, live.watchStatus)" src="/static/learn/living_bg.png" class="my_bg"></image>
  63. <image v-else src="/static/learn/wlive_bg.png" class="my_bg"></image>
  64. </view>
  65. </view>
  66. <!-- 我的课程 -->
  67. <view v-if="courseLists.length" class="my_courses">
  68. <text class="titles">我的课程</text>
  69. <view v-for="(item, index) in courseLists" :key="index" class="course_item">
  70. <view @click="studyIn(item.goodsId,item.gradeId,item,index)">
  71. <view class="cou_titles">{{ item.goodsName }}</view>
  72. <view v-if="item.serviceStartTime && item.serviceEndTime" class="learn_ranges">
  73. <image class="l_range" src="/static/learn/learn_range.png"></image>
  74. 学习周期:
  75. <text class="l_time">{{ item.serviceStartTime | formate('yyyy.mm.dd') }} - {{ item.serviceEndTime | formate('yyyy.mm.dd') }}</text>
  76. </view>
  77. </view>
  78. <view class="c_downs" @click="studyIn(item.goodsId,item.gradeId,item,index)">
  79. <view class="lefts">
  80. <image class="lefet_img" :src="$method.splitImgHost(item.coverUrl, true)" mode=""></image>
  81. <view v-if="item.goodsType == 6" class="live_icon">直播</view>
  82. </view>
  83. <view class="rights">
  84. <template
  85. 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">
  86. <view class="enter_into" @click.stop="selectClass(item,index)">
  87. 选班重学
  88. </view>
  89. </template>
  90. <view v-else class="learn_progress">
  91. <view class="progress_up">
  92. <!-- <image src="/static/icon/wk_icon3.png" class="wk_icon"></image> -->
  93. <!-- 学习进度 (已做试卷+已做节)/(试卷数+节数) -->
  94. <view>
  95. 学习进度:{{ item.stuAllNum+item.recordNum }}/{{ item.secAllNum+item.examNum }}
  96. </view>
  97. <view class="progress_bar" style="width: 100%;">
  98. <u-line-progress :showText="false" height="22" active-color="#ff9900" :show-percent="false"
  99. :percent="((item.stuAllNum+item.recordNum) / (item.secAllNum+item.examNum)) * 100"></u-line-progress>
  100. </view>
  101. </view>
  102. <!-- <view class="progress_down">
  103. <view class="enter_into" @click.stop="studyIn(item.goodsId,item.gradeId,item,index)">进入学习</view>
  104. </view> -->
  105. </view>
  106. </view>
  107. </view>
  108. <view class="study_btns">
  109. <template
  110. 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">
  111. </template>
  112. <view v-else class="exam_btns">
  113. <view class="box_appoint" v-if="item.applyStatus === 1 && !( sysTime <= item.serviceStartTime || sysTime >= item.serviceEndTime
  114. || (item.classStartTime && sysTime <= item.classStartTime) || (item.classEndTime && sysTime >= item.classEndTime) ||
  115. item.learningStatus == 2 || item.classStatus == 0 || (item.learningStatus == 3 && sysTime < item.learningTimeStart))"
  116. @click="appointment(item,appoint)">
  117. <image class="img" src="/static/learn/icon_apoint.png"></image>
  118. <text class="exam_word">预约考试</text>
  119. </view>
  120. <view class="box_appoint" v-if="item.beforeStatus === 1 && !( sysTime <= item.serviceStartTime || sysTime >= item.serviceEndTime
  121. || (item.classStartTime && sysTime <= item.classStartTime) || (item.classEndTime && sysTime >= item.classEndTime) ||
  122. item.learningStatus == 2 || item.classStatus == 0 || (item.learningStatus == 3 && sysTime < item.learningTimeStart))"
  123. @click="appBeforeAddress(item.goodsId,item)">
  124. <image class="img" src="/static/learn/icon_study.png"></image>
  125. <text class="exam_word">进入刷题</text>
  126. </view>
  127. </view>
  128. <view class="box_appoint" @click="studyIn(item.goodsId,item.gradeId,item,index)">
  129. <image class="img" src="/static/learn/icon_learn.png"></image>
  130. <text class="exam_word">进入学习</text>
  131. </view>
  132. </view>
  133. <!-- 不在学习服务期 -->
  134. <template v-if="item.serviceStartTime && (sysTime < item.serviceStartTime || sysTime > item.serviceEndTime)">
  135. <view class="class-warm" v-if="item.gradeId != 0 && item.gradeStatus == 1">
  136. <view class="class-warm__text">
  137. <view class="date">
  138. 不在学习服务期,不可以学习了哦
  139. </view>
  140. </view>
  141. </view>
  142. </template>
  143. <template v-else>
  144. <!-- 班级有效期过了 -->
  145. <template v-if="item.classEndTime && (item.classEndTime < sysTime) ">
  146. <view class="class-warm">
  147. <u-icon class="class-warm__icon" size="30" color="#FF3B30" name="error-circle-fill">
  148. </u-icon>
  149. <view class="class-warm__text">
  150. <view class="date">班级有效期:{{$method.timestampToTime(item.classStartTime,true,true)}} - {{$method.timestampToTime(item.classEndTime,true,true)}}</view>
  151. <view class="state">班级状态:已过期,有疑问请联系 <text @click="call()">020-87085982</text></view>
  152. </view>
  153. </view>
  154. </template>
  155. <!-- 班级有效期之前 -->
  156. <template v-else-if="item.classStartTime && (item.classStartTime > sysTime) ">
  157. <view class="class-warm">
  158. <u-icon class="class-warm__icon" size="30" color="#FF3B30" name="error-circle-fill">
  159. </u-icon>
  160. <view class="class-warm__text">
  161. <view class="date">班级有效期:{{$method.timestampToTime(item.classStartTime,true,true)}} -
  162. {{$method.timestampToTime(item.classEndTime,true,true)}}</view>
  163. <view class="state">班级状态:未到学习时间,有疑问请联系 <text @click="call()">020-87085982</text></view>
  164. </view>
  165. </view>
  166. </template>
  167. <!-- 在班级有效期之间或者没有班级有效期 -->
  168. <template v-else>
  169. <view class="class-warm"
  170. v-if="item.gradeId != 0 && item.gradeStatus == 1 && item.classStatus != null">
  171. <view class="class-warm__text">
  172. <view class="date">
  173. 班级状态:
  174. <text v-if="item.classStatus == 1">已开班</text>
  175. <text v-if="item.classStatus == 0">未开班</text>
  176. </view>
  177. <view class="state" v-if="item.classStatus == 0">教务处正在为您开通班级,请耐心等待</view>
  178. <view class="state"
  179. v-if="item.classStatus == 1 && item.classStartTime && item.classEndTime">
  180. 班级有效期:{{$method.timestampToTime(item.classStartTime,true,true)}}-{{$method.timestampToTime(item.classEndTime,true,true)}}
  181. </view>
  182. </view>
  183. </view>
  184. <!-- 学时审核状态不可审核 -->
  185. <template v-if="item.periodStatus == -1 || item.periodStatus == 2">
  186. <view class="class-warm" v-if="item.classStatus == 1 || item.classStatus === null">
  187. <view class="class-warm__text">
  188. <view class="date">
  189. <template
  190. v-if="sysTime >= item.serviceStartTime && sysTime <= item.serviceEndTime">
  191. 学习状态:
  192. <text v-if="item.stuAllNum+item.recordNum == 0">未学习</text>
  193. <text
  194. v-else-if="item.stuAllNum+item.recordNum > 0 && item.stuAllNum+item.recordNum < item.secAllNum+item.examNum">学习中</text>
  195. <text v-else-if="item.stuAllNum+item.recordNum >= item.secAllNum+item.examNum">已学完</text>
  196. </template>
  197. <template v-else>
  198. <template v-if="item.serviceStartTime">已过学习服务期,不可以学习了哦!</template>
  199. </template>
  200. </view>
  201. </view>
  202. </view>
  203. </template>
  204. <!-- 学时审核状态可以审核 -->
  205. <template v-if="item.periodStatus != -1">
  206. <view class="class-warm">
  207. <view class="class-warm__text">
  208. <view class="date">
  209. <text v-if="item.periodStatus == 0">机构审核:学时审核不通过</text>
  210. <!-- <text v-else-if="item.periodStatus == 2">学时待审核</text> -->
  211. <text v-else-if="item.periodStatus == 3">学时审核中</text>
  212. <text v-else-if="item.periodStatus == 1">
  213. <text v-if="item.periodPlush > 0">学时已上报注册中心</text>
  214. <text v-else>机构审核:学时审核通过</text>
  215. </text>
  216. </view>
  217. </view>
  218. </view>
  219. <view class="class-warm" v-if="item.subscribeId != null && item.periodStatus == 1">
  220. <view class="class-warm__text">
  221. <view class="date">
  222. <view v-if="item.subExamStatus === null">待预约考试</view>
  223. <view
  224. v-else-if="item.subExamStatus === 0 && sysTime < $method.TimeTotimestamp(
  225. $method.timestampToTime(item.subApplySiteExamTime, true) +
  226. ' ' +
  227. item.subApplySiteStartTime
  228. )">
  229. 待考试,考试时间:
  230. {{
  231. $method.timestampToTime(item.subApplySiteExamTime, true) +
  232. " " +
  233. item.subApplySiteStartTime
  234. }}
  235. -
  236. {{
  237. $method.timestampToTime(item.subApplySiteExamTime, true) +
  238. " " +
  239. item.subApplySiteEndTime
  240. }}
  241. </view>
  242. <view v-else-if="item.subExamStatus === 0">待出考试结果</view>
  243. <view v-else-if="item.subExamStatus === 1">
  244. <text v-if="item.subResult === null">待出考试结果</text>
  245. <text v-if="item.subResult === 0">考试结果:不通过,需补考</text>
  246. <text
  247. v-else-if="item.subResult === 1">考试结果:通过,考试成绩为{{item.subPerformance}}</text>
  248. </view>
  249. <view v-else-if="item.subExamStatus === 2">缺考,无成绩,需补考</view>
  250. <view v-else-if="item.subExamStatus === 3">作弊,无成绩,需补考</view>
  251. <view v-else-if="item.subExamStatus === 4">替考,无成绩,需补考</view>
  252. </view>
  253. </view>
  254. </view>
  255. </template>
  256. </template>
  257. </template>
  258. <!-- 预约考试 进入刷题-->
  259. <!-- <template
  260. 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">
  261. </template>
  262. <template v-else>
  263. <template v-for="(appoint,appointIndex) in item.examApplyGoodsList">
  264. <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))">
  265. <view style="flex:1;margin-right:10rpx;">
  266. <text style="color: #333333;">{{ appoint.applyName }}</text>
  267. </view>
  268. <view>
  269. <u-button :plain="true" type="primary" size="mini" @click.stop="appointment(item,appoint)">预约考试
  270. </u-button>
  271. </view>
  272. </view>
  273. </template>
  274. <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))">
  275. <view style="flex:1;margin-right:10rpx;">
  276. <text style="color: #2979ff;">{{ item.beforeName }}</text>
  277. </view>
  278. <view>
  279. <u-button type="primary" size="mini" @click="appBeforeAddress(item.goodsId,item)">进入刷题</u-button>
  280. </view>
  281. </view>
  282. </template> -->
  283. </view>
  284. </view>
  285. <!-- 我的题库 -->
  286. <view class="my_courses">
  287. <text class="titles">我的题库</text>
  288. <view class="bottoms">
  289. <navigator hover-class="none" url="/pages2/subject/collect">
  290. <view class="item collect">
  291. <view class="text">收藏集<u-icon name="arrow-right"></u-icon></view>
  292. <image class="img" src="/static/questionBank_collect.png"></image>
  293. </view>
  294. </navigator>
  295. <view class="item list">
  296. <navigator hover-class="none" url="/pages2/bank/question_record">
  297. <view class="list-in">
  298. <image class="img" src="/static/questionBank_record.png" ></image>
  299. <view class="text">
  300. 做题记录 <u-icon name="arrow-right"></u-icon>
  301. </view>
  302. </view>
  303. </navigator>
  304. <navigator hover-class="none" url="/pages2/subject/wrong">
  305. <view class="list-in">
  306. <image class="img" src="/static/questionBank_wrong.png"></image>
  307. <view class="text">
  308. 错题集 <u-icon name="arrow-right"></u-icon>
  309. </view>
  310. </view>
  311. </navigator>
  312. </view>
  313. </view>
  314. <template v-if="questionLists.length">
  315. <view v-for="(item, indexq) in questionLists" :key="indexq" class="course_item">
  316. <view>
  317. <view class="cou_titles">{{ item.goodsName }}</view>
  318. <view v-if="item.serviceStartTime && item.serviceEndTime" class="learn_ranges">
  319. <image class="l_range" src="/static/learn/learn_range.png"></image>
  320. 学习周期:
  321. <text class="l_time">{{ item.serviceStartTime | formate('yyyy.mm.dd') }} - {{ item.serviceEndTime | formate('yyyy.mm.dd') }}</text>
  322. </view>
  323. </view>
  324. <view class="c_downs">
  325. <view class="lefts">
  326. <image class="lefet_img" :src="$method.splitImgHost(item.coverUrl, true)" mode=""></image>
  327. </view>
  328. <view class="rights">
  329. <view class="learn_progress">
  330. <view class="progress_up">
  331. <!-- <image src="/static/icon/wk_icon3.png" class="wk_icon"></image>
  332. 学习进度:{{item.doNum}}/{{item.totalNum}} -->
  333. <view>
  334. 学习进度:{{item.doNum}}/{{item.totalNum}}
  335. </view>
  336. <view class="progress_bar" style="width: 100%;">
  337. <u-line-progress :show-percent="false" height="22" active-color="#007AFF" :percent="(item.doNum/item.totalNum)*100"></u-line-progress>
  338. </view>
  339. </view>
  340. <view class="progress_down">
  341. <view class="enter_into" @click="studyques(item,index)">进入练习</view>
  342. </view>
  343. </view>
  344. </view>
  345. </view>
  346. </view>
  347. </template>
  348. </view>
  349. </view>
  350. <!-- 没有学习的课程 -->
  351. <view v-if="!allLoading && !allCourse" class="no_datas">
  352. <image class="courses" src="/static/learn/no_course.png" mode=""></image>
  353. <view class="no_learns">您目前没有可学习的课程</view>
  354. <view class="choose" @click="toChoose()">立即去选购</view>
  355. </view>
  356. </view>
  357. <!-- 弹窗 -->
  358. <u-popup v-model="selectClassModal" @close="gradeValue = -1" mode="bottom" border-radius="40">
  359. <view class="popup_box">
  360. <view style="margin-bottom: 20rpx;">
  361. <view class="line1"></view>
  362. <view class="grade">选择班级</view>
  363. </view>
  364. <u-line color="#D6D6DB" />
  365. <view>
  366. <scroll-view scroll-y="true" style="height: 500rpx;">
  367. <view>
  368. <u-radio-group v-model="gradeValue" @change="radioGroupChange">
  369. <view v-for="(item, index) in gradeList" :key="index">
  370. <view style="display: flex;align-items: center;padding: 20rpx;">
  371. <view>
  372. <u-radio shape="circle" :name="index"
  373. :disabled="item.studentNum > 0 && item.studentNum == item.studentUpper">
  374. <view :class="item.checked?'white-box blue-box':'white-box'">
  375. <view>
  376. <view class="blackTxt">{{item.className}}</view>
  377. <view class="redTxt" v-if="item.classEndTime">
  378. 有效期至:{{$method.timestampToTime(item.classEndTime,true,true)}}
  379. </view>
  380. <view class="redTxt" v-if="item.classEndTime">
  381. 本班还剩{{$method.GetRTime(item.classEndTime)}}天将结束学习</view>
  382. </view>
  383. </view>
  384. </u-radio>
  385. </view>
  386. </view>
  387. </view>
  388. </u-radio-group>
  389. </view>
  390. </scroll-view>
  391. </view>
  392. <view class="confrim-btn">
  393. <view class="okBtn" @click="okPopup()">确定</view>
  394. </view>
  395. </view>
  396. </u-popup>
  397. <!-- <select-class :selectClassModal.sync="selectClassModal" :gradeList="gradeList" @okPopup="okPopup()" @closeModal="closeModal()"></select-class> -->
  398. <u-modal v-model="showUserConfirmInfo" @confirm="confirmUserConfirm" ref="uModal" :async-close="true"
  399. @cancel="cancelUserConfirm" :confirm-text="'确认' + (confirmCount > 0 ? '('+confirmCount+')' : '')"
  400. :confirm-color="confirmCount > 0 ? '#999' : '#2979ff'" class="confirm-modal" title="实名验证确认"
  401. cancel="取消" :show-cancel-button="true">
  402. <view class="slot-content">
  403. <view class="content">
  404. 为避免个人信息不正确导致您的学习时长无效,请认真核对以下信息是否正确,如信息有误请取消当前操作,立刻联系020-38946666
  405. <view class="msg-list">
  406. <view class="item">
  407. <text class="item__left">姓名:</text>
  408. <text class="item__right">{{userInfo.realname}}</text>
  409. </view>
  410. <view class="item">
  411. <text class="item__left">手机号:</text>
  412. <text class="item__right">{{userInfo.telphone}}</text>
  413. </view>
  414. <view class="item">
  415. <text class="item__left">身份号:</text>
  416. <text class="item__right">{{userInfo.idCard}}</text>
  417. </view>
  418. <view class="item">
  419. <u-checkbox v-model="confirmChecked" :label-disabled="false">确认个人信息无误</u-checkbox>
  420. </view>
  421. </view>
  422. </view>
  423. </view>
  424. </u-modal>
  425. <!-- 多个预约考试时的弹窗 -->
  426. <u-popup v-model="appointTestShow" mode="bottom" border-radius="40">
  427. <view class="popuptest_box">
  428. <view class="check_head">
  429. <view class="headers">
  430. <view class="grade">切换课程</view>
  431. <u-icon name="close" color="#9C9C9C" size="40" @click="closePop()"></u-icon>
  432. </view>
  433. </view>
  434. <view class="check_con">
  435. <scroll-view scroll-y="true" style="height: 700rpx;">
  436. <view class="course_items" v-for="(appoint, index) in appointTestList" :key="index">
  437. <view class="course_lefts">
  438. <view class="course_title">{{ appoint.applyName }}</view>
  439. </view>
  440. <view class="course_rights" @click="jumpTest(appointItemIndex, appoint)">
  441. <view class="intoStudy">预约</view>
  442. </view>
  443. </view>
  444. </scroll-view>
  445. </view>
  446. </view>
  447. </u-popup>
  448. <!-- <tab-bar v-model="current" :list="tabbarlist" :mid-button="true" :mid-button-size="50" class="tab_items"></tab-bar> -->
  449. </view>
  450. </template>
  451. <script>
  452. var curTime = new Date().getTime() // 当前时间的时间戳
  453. import {mapGetters,mapActions} from 'vuex'
  454. import { WEBVIEW_URL } from '@/common/request.js'
  455. // import TabBar from '@/components/u-tabbar/u-tabbar.vue';
  456. export default {
  457. // components: { TabBar },
  458. data() {
  459. return {
  460. leftDays: 0,
  461. paramC: {
  462. pageNum: 1,
  463. pageSize: 50
  464. },
  465. activeItem: {},
  466. itemIndex: '',
  467. confirmTimer:null,
  468. confirmCount:10,
  469. confirmChecked:false,
  470. showUserConfirmInfo:false,
  471. selectItem: {},
  472. selectClassModal: false,
  473. gradeList: [],
  474. gradeValue: -1,
  475. sysTime: 0,
  476. courseLists: [], // 课程列表
  477. questionLists: [], // 题库列表
  478. paramQ: {
  479. pageNum: 1,
  480. pageSize: 50
  481. },
  482. queitemIndex:'',
  483. livingLists: [], // 直播列表
  484. allLoading: false, // 加载样式
  485. current: 2,
  486. appointTestShow: false, //预约考试弹窗
  487. appointTestList: [],
  488. appointItemIndex: {}, // 点击了哪项课程
  489. }
  490. },
  491. filters: {
  492. liveStatus(liveTime, watchStatus) {
  493. let value = liveTime * 1000
  494. if (curTime < value) { // 判断当前时间和直播开始时间
  495. return ' 未开播'
  496. } else {
  497. return watchStatus == 'live' ? '正在直播中' : '即将开播'
  498. }
  499. }
  500. },
  501. computed: {
  502. ...mapGetters(['userInfo']),
  503. allCourse() {
  504. return this.courseLists.length || this.questionLists.length || this.livingLists.length ? true : false
  505. }
  506. },
  507. onLoad() {
  508. // 1668873600 ,2022.11.20的时间戳
  509. this.leftDays = 1668873600 - parseInt(curTime/1000)
  510. // this.getCourseLiveQues()
  511. },
  512. async onShow() {
  513. this.getCourseLiveQues()
  514. await this.commonSystemTime()
  515. this.sysTime = +this.$method.timest()
  516. },
  517. onPullDownRefresh() {
  518. this.getCourseLiveQues()
  519. },
  520. methods: {
  521. ...mapActions(['getUserInfo']),
  522. bgShow(liveTime, watchStatus) {
  523. let value = liveTime * 1000
  524. if (curTime > value) { // 判断当前时间和直播开始时间
  525. return watchStatus == 'live' ? true : false
  526. }
  527. },
  528. lookTimeStatus(liveTime, watchStatus) {
  529. if (liveTime) {
  530. let value = new Date(liveTime * 1000)
  531. var Y = value.getFullYear()
  532. var M = value.getMonth() + 1 < 10 ? '0' + (value.getMonth() + 1) : value.getMonth() + 1
  533. var D = value.getDate() < 10 ? '0' + value.getDate() : value.getDate()
  534. var valZ = Y + '/' + M + '/' + D
  535. let curZeroTime = new Date(valZ).getTime() // 获取开始直播时间当天的零点时间戳
  536. if (curTime > value) { // 判断当前时间和直播开始时间
  537. if (watchStatus == 'live') { //
  538. return 1
  539. } else {
  540. return 2
  541. }
  542. } else {
  543. if (curZeroTime <= curTime && curTime <= value) { //当天
  544. return 3
  545. } else {
  546. return 4
  547. }
  548. }
  549. }
  550. },
  551. curTimeTamp(liveTime) {
  552. let min = liveTime - parseInt(curTime / 1000)
  553. return min
  554. },
  555. toChoose() {
  556. uni.switchTab({
  557. url:'/pages/course/index'
  558. })
  559. },
  560. // 查询直播课
  561. getCourseLiveQues() {
  562. this.allLoading = true
  563. let arrs = [
  564. this.$api.listUserVideoLive(this.paramC), // 查询用户拥有视频+直播商品 /goods/listUserVideoLive
  565. this.$api.listUserFreeUnionBuyGoodsList(this.paramQ), // 查询用户拥有免费+自购题库商品 /bank/question/listUserFreeUnionBuyGoodsList
  566. this.$api.getgoodsLiveList({
  567. pageNum: 1,
  568. pageSize: 3 // 默认3条
  569. })
  570. ]
  571. Promise.all(arrs).then((res) => {
  572. // if (res.data.code == 200) {
  573. const [{ data: res1}, { data: res2}, {data: res3}] = res
  574. if (res1.code == 200) {
  575. this.courseLists = res1.rows || []
  576. }
  577. if (res2.code == 200) {
  578. this.questionLists = res2.rows || []
  579. }
  580. if (res3.code == 200) {
  581. this.livingLists = res3.rows || []
  582. } else {
  583. this.$u.toast(res3.msg)
  584. }
  585. this.allLoading = false
  586. // }
  587. wx.stopPullDownRefresh()
  588. }).catch(err => {
  589. this.allLoading = false
  590. wx.stopPullDownRefresh()
  591. // this.$u.toast('请重新刷新请求')
  592. })
  593. },
  594. commonSystemTime() {
  595. return new Promise(resolve => {
  596. this.$api.commonSystemTime().then(res => {
  597. this.sysTime = res.data.data;
  598. })
  599. })
  600. },
  601. // 看直播
  602. toLiveLook(item) {
  603. let moduleId = item.moduleId || 0
  604. let chapterId = item.chapterId || 0
  605. let sectionId = item.sectionId || item.menuId
  606. let uuid = new Date().valueOf() + ""
  607. // buyCourse 是否购买课程:1是 0否
  608. let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
  609. +item.liveUrl+'&gradeId='+0+'&courseId='+item.courseId+'&goodsId='+item.goodsId+'&orderGoodsId='+item.orderGoodsId+'&sectionId='+sectionId+'&chapterId='
  610. +chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid+'&sectionType=2')
  611. uni.navigateTo({
  612. url:`../../pages/webview/index?url=`+encode
  613. })
  614. },
  615. toLive(item) {
  616. this.$api.courseCourseList({
  617. pageNum: 1,
  618. pageSize: 1,
  619. goodsId: item.goodsId,
  620. gradeId: 0,
  621. orderGoodsId: item.orderGoodsId,
  622. }).then(res => {
  623. if (res.data.code == 200) {
  624. if(res.data.total > 1) {
  625. // uni.navigateTo({
  626. // url:'/pages5/liveDetail/course?orderGoodsId='+item.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0'
  627. // })
  628. uni.navigateTo({
  629. url:'/pages3/live/detail?orderGoodsId='+item.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0&courseId=""'
  630. })
  631. } else if(res.data.total == 1) {
  632. uni.navigateTo({
  633. url:'/pages3/live/detail?orderGoodsId='+item.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0&courseId='+ res.data.rows[0].courseId
  634. })
  635. } else {
  636. uni.showToast({
  637. icon:'none',
  638. title:'暂无可观看的直播课程'
  639. })
  640. }
  641. }
  642. })
  643. },
  644. async studyIn(v, i, item, index) {
  645. if (item.goodsType == 6) { // 进入直播课
  646. this.toLive(item)
  647. return
  648. }
  649. // 进入视频课
  650. this.activeItem = item
  651. if (item.interfaceAccountId > 0) { //学习账号已开通
  652. if (item.learnStatus == 1) { //跳转第三方h5
  653. uni.navigateTo({
  654. url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&isOther=1`
  655. })
  656. return;
  657. } else {
  658. uni.showModal({
  659. showCancel: false,
  660. content: '您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!'
  661. });
  662. return;
  663. }
  664. return;
  665. }
  666. if (item.serviceStartTime && (this.sysTime <= item.serviceStartTime || this.sysTime >= item.serviceEndTime)) {
  667. uni.showToast({
  668. icon: 'none',
  669. title: '不在学习服务期,不能进入学习'
  670. })
  671. return;
  672. }
  673. if ((item.classStartTime && this.sysTime <= item.classStartTime) || (item.classEndTime && this
  674. .sysTime >= item.classEndTime)) {
  675. uni.showToast({
  676. icon: 'none',
  677. title: '不在班级有效期,不能进入学习'
  678. })
  679. return
  680. }
  681. if (item.learningStatus == 2) {
  682. uni.showToast({
  683. icon: 'none',
  684. title: '开放学习时间待定,不能进入学习'
  685. })
  686. return
  687. }
  688. if (item.classStatus == 0) {
  689. uni.showToast({
  690. icon: 'none',
  691. title: '尚未开班,不能进入学习'
  692. })
  693. return
  694. }
  695. if (item.learningStatus == 3 && (this.sysTime < item.learningTimeStart)) {
  696. uni.showToast({
  697. icon: 'none',
  698. title: '不在开放学习时间,不能进入学习'
  699. })
  700. return;
  701. }
  702. uni.showLoading({
  703. title: '拼命加载中...',
  704. mask:true,
  705. })
  706. var confirmDetail = true;
  707. if (item.educationName == '继续教育') {
  708. if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  709. confirmDetail = await this.userConfirmInfoDetail()
  710. }
  711. }
  712. if(!confirmDetail) {
  713. return;
  714. }
  715. this.itemIndex = index
  716. if (item.gradeStatus == 1 && item.status == 1 && (item.serviceEndTime > this.sysTime) && (item
  717. .classEndTime && (item.classEndTime < this.sysTime)) && (item.periodStatus == 0 || item
  718. .periodStatus == -1) && item.studyCount > 0) {
  719. this.selectClass(item, index, 'loading')
  720. return
  721. }
  722. // /course/goodsRebuildStatus查询用户商品重修状态
  723. let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId, item.gradeId)
  724. if (rebuildStatus == 0) {
  725. uni.hideLoading()
  726. this.$navTo.togo('/pages2/learn/details', {
  727. gradeId: item.gradeId,
  728. goodsId: item.goodsId,
  729. orderGoodsId: item.orderGoodsId,
  730. });
  731. return;
  732. }
  733. // /lock/lockStatus
  734. this.$api.lockLockStatus({
  735. action: 'jxjy',
  736. uuid:this.$method.getUuid()
  737. }).then(res => {
  738. if (res.data.code == 200) { //有其他端在操作,不能学习
  739. uni.showToast({
  740. icon: 'none',
  741. title: res.data.msg,
  742. mask: true,
  743. duration: 3000
  744. })
  745. } else if (res.data.code == 500) { //可以学习
  746. this.$http({
  747. url: '/course/courseList',
  748. method: 'get',
  749. data: {
  750. pageNum: 1,
  751. pageSize: 100,
  752. goodsId: item.goodsId,
  753. gradeId: item.gradeId,
  754. orderGoodsId: item.orderGoodsId,
  755. },
  756. noLoading: true
  757. })
  758. .then(res => {
  759. if (res.data.code == 200) {
  760. if(res.data.total > 1) {
  761. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  762. uni.navigateTo({
  763. url: `/pages3/polyv/detail?id=''&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`
  764. })
  765. } else if(res.data.total == 1) {
  766. uni.navigateTo({
  767. url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`
  768. })
  769. } else {
  770. uni.showToast({
  771. icon:'none',
  772. title:'暂无可观看的视频课程'
  773. })
  774. }
  775. }
  776. });
  777. return;
  778. }
  779. })
  780. },
  781. /**
  782. * @param {Object} goodsId 商品id
  783. * 查询商品重修状态
  784. */
  785. courseGoodsRebuildStatus(goodsId, gradeId) {
  786. return new Promise(resolve => {
  787. this.$http({
  788. url: '/course/goodsRebuildStatus',
  789. method: 'get',
  790. data: {
  791. goodsId: goodsId,
  792. gradeId: gradeId
  793. },
  794. noLoading: true,
  795. compleLoading: true, // 请求成功是否还要继续显示加载中
  796. })
  797. .then(res => {
  798. resolve(res.data.data)
  799. })
  800. })
  801. },
  802. userConfirmInfoDetail(){
  803. return new Promise(resolve => {
  804. this.$http({
  805. url: '/user/confirm/info/detail',
  806. method: 'GET',
  807. data: { orderGoodsId:this.activeItem.orderGoodsId },
  808. noLoading:true,
  809. })
  810. .then(res => {
  811. if(!res.data.data) {
  812. clearInterval(this.confirmTimer);
  813. this.confirmCount = 10;
  814. this.showUserConfirmInfo = true;
  815. this.confirmTimer = setInterval(() => {
  816. if(this.confirmCount > 0) {
  817. this.confirmCount--
  818. } else {
  819. clearInterval(this.confirmTimer);
  820. }
  821. },1000)
  822. } else {
  823. if(res.data.data.pushInfo) {
  824. resolve(true)
  825. } else {
  826. uni.showModal({
  827. showCancel:false,
  828. title:'提示',
  829. content:'开通信息推送不成功,无法进入学习,请联系020-87085982!'
  830. })
  831. resolve(false)
  832. }
  833. }
  834. })
  835. })
  836. },
  837. selectClass(item, index, load) {
  838. this.itemIndex = index;
  839. this.selectItem = item;
  840. this.selectClassModal = true;
  841. this.goodsGradeList(item.goodsId, load);
  842. },
  843. goodsGradeList(id, load) {
  844. this.$http({
  845. url: '/grade/grade/list',
  846. method: 'get',
  847. data: { goodsId: id },
  848. noLoading: load ? true : false,
  849. })
  850. .then(res => {
  851. if (res.data.code == 200) {
  852. this.gradeList = res.data.rows
  853. if (this.gradeList.length == 0) {
  854. let item = {
  855. className: '系统分班',
  856. gradeId: 0
  857. }
  858. this.gradeList.push(item)
  859. } else {
  860. let isGradeFull = this.gradeList.every(item => (item.studentNum > 0 && item
  861. .studentNum == item.studentUpper))
  862. //所有班级都满了
  863. if (isGradeFull) {
  864. let item = {
  865. className: '系统分班',
  866. gradeId: 0
  867. }
  868. this.gradeList.unshift(item)
  869. }
  870. }
  871. }
  872. });
  873. },
  874. // 进入练习
  875. studyques(item,index){
  876. this.queitemIndex = index;
  877. let sysTime = this.$method.timest()
  878. if (item.serviceStartTime && item.serviceEndTime && (sysTime <= item.serviceStartTime || sysTime >= item.serviceEndTime)) {
  879. uni.showToast({
  880. icon: 'none',
  881. title: '不在学习服务期,不能进入学习'
  882. })
  883. return;
  884. }
  885. uni.navigateTo({
  886. url:'/pages2/bank/question_detail?id='+item.goodsId+'&orderGoodsId='+item.orderGoodsId
  887. })
  888. },
  889. radioGroupChange(e) {
  890. // console.log(e)
  891. },
  892. okPopup() {
  893. if (this.gradeValue == -1) {
  894. uni.showToast({
  895. icon: 'none',
  896. title: '请选择班级'
  897. })
  898. return;
  899. }
  900. this.$api.changeGrade({
  901. goodsId: this.selectItem.goodsId,
  902. gradeId: this.gradeValue,
  903. oldGradeId: this.selectItem.gradeId,
  904. orderGoodsId: this.selectItem.orderGoodsId,
  905. userId: this.selectItem.userId
  906. }).then(res => {
  907. if (res.data.code == 200) {
  908. if (this.itemIndex !== '') {
  909. this.refreshByIndex();
  910. }
  911. this.selectClassModal = false;
  912. uni.showToast({
  913. title: '选班成功'
  914. })
  915. } else {
  916. uni.showToast({
  917. icon: 'none',
  918. title: res.data.msg
  919. })
  920. }
  921. })
  922. },
  923. /**
  924. * 返回刷新之前进入的课程数据
  925. */
  926. refreshByIndex() {
  927. this.$api.listUserVideoLive({
  928. pageNum: this.itemIndex + 1,
  929. pageSize: 1
  930. }).then(res => {
  931. if (res.data.code == 200) {
  932. this.$set(this.courseLists, this.itemIndex, res.data.rows[0])
  933. }
  934. });
  935. },
  936. confirmUserConfirm() {
  937. this.$refs.uModal.clearLoading();
  938. if(this.confirmCount <= 0) {
  939. if(this.confirmChecked) {
  940. let infoJson = {
  941. realname:this.userInfo.realname,
  942. idCard:this.userInfo.idCard,
  943. telphone:this.userInfo.telphone
  944. }
  945. this.$api.userConfirminfo({
  946. orderGoodsId:this.activeItem.orderGoodsId,
  947. infoJson:JSON.stringify(infoJson)
  948. }).then(res => {
  949. if(res.data.data.pushInfo) {
  950. uni.showToast({
  951. icon:'none',
  952. title:'提交成功'
  953. })
  954. } else {
  955. uni.showModal({
  956. showCancel:false,
  957. title:'提示',
  958. content:'开通信息推送不成功,无法进入学习,请联系020-87085982!'
  959. })
  960. }
  961. this.showUserConfirmInfo = false;
  962. })
  963. } else {
  964. uni.showToast({
  965. icon:'none',
  966. title:'请勾选确认个人信息无误'
  967. })
  968. }
  969. } else {
  970. return;
  971. }
  972. },
  973. cancelUserConfirm() {
  974. clearInterval(this.confirmTimer)
  975. },
  976. call() {
  977. uni.makePhoneCall({
  978. phoneNumber: '020-87085982' //仅为示例
  979. })
  980. },
  981. closePop() {
  982. this.appointTestShow = false
  983. },
  984. jumpTest(item, appoint) {
  985. this.appoint_an(item, appoint)
  986. this.appointTestShow = false
  987. },
  988. appointment(item, appoint) {
  989. console.log('====', item.examApplyGoodsList)
  990. this.appointItemIndex = item
  991. if (item.examApplyGoodsList.length > 1) { // 多个考试预约
  992. this.appointTestList = item.examApplyGoodsList
  993. this.appointTestShow = true
  994. return
  995. }
  996. let appoint_item = item.examApplyGoodsList[0]
  997. this.appoint_an(item, appoint_item)
  998. },
  999. appoint_an(item, appoint) {
  1000. console.log('==appoint=', appoint)
  1001. var data = {
  1002. goodsId: item.goodsId,
  1003. gradeId: item.gradeId,
  1004. applyId:appoint.applyId,
  1005. orderGoodsId:item.orderGoodsId
  1006. };
  1007. this.$api.getApplysubscribe(data).then(res => {
  1008. if (res.data.code === 500) {
  1009. uni.showModal({
  1010. showCancel: false,
  1011. content: res.data.msg
  1012. });
  1013. }
  1014. if (res.data.code === 200) {
  1015. this.$navTo.togo('/pages2/appointment/index', {
  1016. goodsId: item.goodsId,
  1017. gradeId: item.gradeId,
  1018. orderGoodsId: item.orderGoodsId,
  1019. applyId:appoint.applyId
  1020. });
  1021. }
  1022. });
  1023. },
  1024. // 进入刷题,调整小程序
  1025. appBeforeAddress(goodsId,item) {
  1026. this.$api.appBeforeAddress({
  1027. orderGoodsId:item.orderGoodsId
  1028. }).then(res => {
  1029. if (res.data.code == 200) {
  1030. uni.navigateToMiniProgram({
  1031. appId: res.data.data.url,
  1032. success(res) {
  1033. // 打开成功
  1034. }
  1035. })
  1036. } else {
  1037. uni.showModal({
  1038. title:'提示',
  1039. content:res.data.msg,
  1040. showCancel:false,
  1041. })
  1042. }
  1043. })
  1044. },
  1045. }
  1046. }
  1047. </script>
  1048. <style>
  1049. page {
  1050. background: #eaeef1;
  1051. }
  1052. </style>
  1053. <style lang="scss" scoped>
  1054. @import './index.scss';
  1055. </style>