index.vue 38 KB

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