index.vue 37 KB

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