index.vue 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607
  1. <template>
  2. <view class="learnings">
  3. <nav-logo title="学习中心"></nav-logo>
  4. <u-line color="#D6D6DB" />
  5. <view class="contents">
  6. <!-- <view class="diatance">
  7. <image class="clock" src="/static/learn/clock.png" mode=""></image>
  8. <text>
  9. 一级建造师,距离考试还有
  10. </text>
  11. <u-count-down :timestamp="leftDays" :show-days="true" separator="zh"
  12. :show-hours="false" :show-minutes="false" :show-seconds="false" font-size="28"
  13. bg-color="#007AFF" separator-color="#fff" color="#fff" separator-size="28">
  14. </u-count-down>
  15. </view> -->
  16. <!-- 有旧系统课程 -->
  17. <view v-if="tenantId == '867735392558919680' && oldPageJumpData && oldPageJumpData.goodsNames.length > 0"
  18. class="oldPageJump">
  19. <template>
  20. <h4>因系统升级,您的部分课程:</h4>
  21. <ul>
  22. <li v-for="(items, indexs) in oldPageJumpData.goodsNames" :key="indexs">
  23. {{ items }}
  24. </li>
  25. </ul>
  26. <p>
  27. 需进入旧系统学习,给您带来不便敬请谅解!我们正在加快完成系统升级合并中!
  28. </p>
  29. </template>
  30. <!-- #ifdef H5 -->
  31. <p style="font-weight:bold;color:#409eff;">
  32. 请问是否现在进入旧系统学习:
  33. </p>
  34. <u-button type="primary" @click="goPage(oldPageJumpData.pcUrl,1)">点击进入</u-button>
  35. <!-- #endif -->
  36. <!-- #ifdef MP-WEIXIN -->
  37. <p style="font-weight:bold;color:#409eff;">
  38. 进入浏览器粘贴登录
  39. </p>
  40. <u-button type="primary" @click="goPage(oldPageJumpData.pcUrl,2)">点击复制</u-button>
  41. <!-- #endif -->
  42. </view>
  43. <!-- 有学习的课程 -->
  44. <view v-if="allCourse" class="had_courses">
  45. <!-- 直播 -->
  46. <view v-if="livingLists.length" class="lives">
  47. <view v-for="(live, l_index) in livingLists" :key="l_index" class="live_item"
  48. @click="toLiveLook(live)">
  49. <view class="live_con">
  50. <view class="live_status">
  51. <image v-if="bgShow(live.liveStartTime, live.watchStatus)"
  52. src="/static/learn/living.png" class="liv_icon"></image>
  53. <image v-else src="/static/learn/wlive.png" class="liv_icon"></image>
  54. <text class="status_s">{{
  55. live.liveStartTime | liveStatus(live.watchStatus)
  56. }}</text>
  57. <view class="look_bt" :class="{
  58. living:
  59. lookTimeStatus(live.liveStartTime, live.watchStatus) == 1,
  60. futuring:
  61. lookTimeStatus(live.liveStartTime, live.watchStatus) == 4,
  62. curring: [2, 3].includes(
  63. lookTimeStatus(live.liveStartTime, live.watchStatus)
  64. ),
  65. }">
  66. <text v-if="
  67. lookTimeStatus(live.liveStartTime, live.watchStatus) == 1
  68. ">点击观看</text>
  69. <text v-if="
  70. lookTimeStatus(live.liveStartTime, live.watchStatus) == 2
  71. ">即将开播</text>
  72. <template v-if="
  73. lookTimeStatus(live.liveStartTime, live.watchStatus) == 3
  74. ">
  75. 剩余:
  76. <u-count-down :timestamp="curTimeTamp(live.liveStartTime)" :show-days="false"
  77. color="#fff" separator-color="#fff" font-size="24" separator-size="24"
  78. bg-color="#FFB102">
  79. </u-count-down>
  80. </template>
  81. <template v-if="
  82. lookTimeStatus(live.liveStartTime, live.watchStatus) == 4
  83. ">
  84. 剩余:
  85. <u-count-down :timestamp="curTimeTamp(live.liveStartTime)" :show-days="true"
  86. separator="zh" color="#fff" separator-color="#fff" bg-color="#007AFF"
  87. :show-hours="false" :show-minutes="false" :show-seconds="false"
  88. font-size="24" separator-size="24">
  89. </u-count-down>
  90. <u-count-down :timestamp="curTimeTamp(live.liveStartTime)" :show-days="false"
  91. color="#fff" separator-color="#fff" bg-color="#007AFF" font-size="24"
  92. separator-size="24">
  93. </u-count-down>
  94. </template>
  95. </view>
  96. </view>
  97. <view class="liv_time">
  98. <text class="timeR">{{
  99. live.liveStartTime | formate("mm月dd日")
  100. }}</text>
  101. <text>{{ live.liveStartTime | formate("hh:mm") }}</text>
  102. </view>
  103. <view class="liv_title">{{ live.name }}</view>
  104. </view>
  105. <image v-if="bgShow(live.liveStartTime, live.watchStatus)" src="/static/learn/living_bg.png"
  106. class="my_bg">
  107. </image>
  108. <image v-else src="/static/learn/wlive_bg.png" class="my_bg"></image>
  109. </view>
  110. </view>
  111. <!-- 我的课程 -->
  112. <view v-if="courseLists.length" class="my_courses">
  113. <text class="titles">我的课程</text>
  114. <view v-for="(item, index) in courseLists" :key="index" class="course_item">
  115. <view class="c_downs" @click="studyIn(item.goodsId, item.gradeId, item, index)">
  116. <view class="lefts">
  117. <image class="lefet_img" :src="$method.splitImgHost(item.coverUrl, true)" mode="">
  118. </image>
  119. <view v-if="item.goodsType == 6" class="live_icon">直播</view>
  120. </view>
  121. <view class="rights">
  122. <view class="learn_progress">
  123. <view class="progress_up">
  124. <view class="cou_titles line2">{{ item.goodsName }}</view>
  125. <view class="classHour">
  126. <text>{{
  127. item.courseNum || item.courseNum == 0
  128. ? item.courseNum
  129. : "-"
  130. }}课程/</text>
  131. <text>{{
  132. item.classHours || item.classHours == 0
  133. ? item.classHours
  134. : "-"
  135. }}学时/</text>
  136. <text>{{ item.secAllNum + item.examNum || "-" }}节</text>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. <view class="course_item_info" v-if="item.goodsType !== 6">
  143. <view v-if="item.orderYear"><text>课程年份:</text><text>{{ item.orderYear }}</text></view>
  144. <view>
  145. <text>学习状态:</text>
  146. <view style="display: inline-block; font-size: 24rpx" v-html="backLearStatusText(item)">
  147. </view>
  148. </view>
  149. <view>
  150. <text>学习进度:</text>
  151. <text>
  152. {{ item.stuAllNum + item.recordNum }}/{{
  153. item.secAllNum + item.examNum
  154. }}
  155. </text>
  156. </view>
  157. <view>
  158. <text>学习服务:</text>
  159. <text>
  160. {{
  161. $method.formDate(item.serviceStartTime, "yyyy/mm/dd")
  162. }}至{{
  163. $method.formDate(item.serviceEndTime, "yyyy/mm/dd")
  164. }}</text>
  165. </view>
  166. <view>
  167. <text>班级状态:</text>
  168. <text>
  169. {{ classStatusCompt(item, sysTime) }}
  170. </text>
  171. </view>
  172. <view>
  173. <text>班级有效:</text>
  174. <template v-if="item.classEndTime">
  175. <text>
  176. {{ $method.formDate(item.classEndTime, "yyyy/mm/dd") }}
  177. </text>
  178. <text class="eb">(剩余{{
  179. $method.GetRTime(item.classEndTime) > 0
  180. ? $method.GetRTime(item.classEndTime)
  181. : 0
  182. }}天)</text>
  183. </template>
  184. <text v-else>——</text>
  185. </view>
  186. <view class="class-warm" v-if="item.subscribeId != null && item.periodStatus == 1">
  187. <view class="class-warm__text">
  188. <view class="date">
  189. <view v-if="item.subExamStatus === null">待预约考试</view>
  190. <view v-else-if="
  191. item.subExamStatus === 0 &&
  192. sysTime <
  193. $method.TimeTotimestamp(
  194. $method.timestampToTime(
  195. item.subApplySiteExamTime,
  196. true
  197. ) +
  198. ' ' +
  199. item.subApplySiteStartTime
  200. )
  201. ">
  202. 待考试,考试时间:
  203. {{
  204. $method.timestampToTime(
  205. item.subApplySiteExamTime,
  206. true
  207. ) +
  208. " " +
  209. item.subApplySiteStartTime
  210. }}
  211. -
  212. {{
  213. $method.timestampToTime(
  214. item.subApplySiteExamTime,
  215. true
  216. ) +
  217. " " +
  218. item.subApplySiteEndTime
  219. }}
  220. </view>
  221. <view v-else-if="item.subExamStatus === 0">待出考试结果</view>
  222. <view v-else-if="item.subExamStatus === 1">
  223. <text v-if="item.subResult === null">待出考试结果</text>
  224. <text v-if="item.subResult === 0">考试结果:不通过,需补考</text>
  225. <text v-else-if="item.subResult === 1">考试结果:通过,考试成绩为{{
  226. item.subPerformance
  227. }}</text>
  228. </view>
  229. <view v-else-if="item.subExamStatus === 2">缺考,无成绩,需补考</view>
  230. <view v-else-if="item.subExamStatus === 3">作弊,无成绩,需补考</view>
  231. <view v-else-if="item.subExamStatus === 4">替考,无成绩,需补考</view>
  232. </view>
  233. </view>
  234. </view>
  235. </view>
  236. <view class="study_tips">
  237. <div v-if="
  238. (item.erJianErZao || sevenFunc(item)) && !item.classEndTime && !item.classStartTime
  239. ">
  240. 温馨提示:当前班级正在申请中,正式开班后方可进行学习,请耐心等待
  241. </div>
  242. <div v-if="item.officialStatus != 1 && false
  243. ">
  244. 推送失败原因:{{item.pushFailReason || '请先完善个人信息'}}
  245. </div>
  246. <div v-if="
  247. (item.periodStatus == 0 || item.periodStatus == -1)
  248. ">
  249. <span v-if="$method.GetRTime(item.classEndTime) >= 0">
  250. 温馨提示:当前学习有效期至{{
  251. $method.timestampToTime(item.classEndTime)
  252. }},超期学时无效,为防审核异常请于{{
  253. $method.timestampToTime(item.classEndTime - 864000, false)
  254. }}
  255. 前完成学习,当前剩余有效学习时间为{{
  256. $method.GetRTime(item.classEndTime) < 0
  257. ? 0
  258. : $method.GetRTime(item.classEndTime)
  259. }}天。
  260. </span>
  261. <span v-else-if="$method.GetRTime(item.serviceEndTime) >= 0">
  262. 温馨提示:当前学习有效期至{{
  263. $method.timestampToTime(item.serviceEndTime)
  264. }},超期学时无效,为防审核异常请于{{
  265. $method.timestampToTime(item.serviceEndTime - 864000, false)
  266. }}
  267. 前完成学习,当前剩余有效学习时间为{{
  268. $method.GetRTime(item.serviceEndTime) < 0
  269. ? 0
  270. : $method.GetRTime(item.serviceEndTime)
  271. }}天。
  272. </span>
  273. </div>
  274. <div v-if="
  275. item.gradeStatus == 1 &&
  276. item.status == 1 &&
  277. item.serviceEndTime > sysTime &&
  278. item.serviceStartTime < sysTime &&
  279. item.classEndTime &&
  280. item.classEndTime < sysTime &&
  281. (item.periodStatus == 0 || item.periodStatus == -1)
  282. ">
  283. <span v-if="item.studyCount > 0">温馨提示:班级已过期,如需重新学习,请点击右侧“选班重学”按钮。</span>
  284. <span v-else>温馨提示:班级已过期,您的重学次数已用完,如有疑问请联系{{
  285. eduPhone
  286. }}</span>
  287. </div>
  288. <div v-if="item.serviceEndTime && item.serviceEndTime < sysTime">
  289. 温馨提示:学习服务期已截至,如有疑问请联系:{{ eduPhone }}
  290. </div>
  291. <div v-if="item.periodStatus === 2 && !sevenFunc(item)">
  292. 温馨提示:您已完成本课程所有学时学习,我校将对学时进行审核,审核及推送时长预估15个工作日,如有疑问请联系:{{
  293. eduPhone
  294. }},学时查询网址:http://gdzczx.gdcic.net
  295. </div>
  296. <!-- <div v-if="item.periodStatus === 1 && !sevenFunc(item)">
  297. 温馨提示:您的班级学习初审已通过,待广东省建设信息中心归集学时,归集完成即为完成本次继续教育学习。归集学时需约10-15个工作日,具体以广东省建设执业资格注册服务平台的“继续教育学时查询”公布学时记录为准,学时查询网址:http://gdzczx.gdcic.net
  298. </div> -->
  299. </view>
  300. <!-- 按钮 -->
  301. <view class="study_btns">
  302. <view v-if="
  303. ((item.profileChangeStatus == 1 &&
  304. (item.profileStatus == 1 || item.profileStatus == 2)) ||
  305. (item.profileChangeStatus == 2 &&
  306. item.profileStatus != -1)) && item.educationName == '考前培训' &&
  307. item.projectName == '施工现场专业人员'" class="box_appoint" @click="toInput(item)">
  308. <view class="exam_word intos">学习资料</view>
  309. </view>
  310. <template v-if="
  311. item.gradeStatus == 1 &&
  312. item.status == 1 &&
  313. item.serviceEndTime > sysTime &&
  314. item.serviceStartTime < sysTime &&
  315. item.classEndTime &&
  316. item.classEndTime < sysTime &&
  317. (item.periodStatus == 0 || item.periodStatus == -1) &&
  318. item.userStudyCount > 0
  319. ">
  320. <view class="exam_word ones" @click.stop="selectClass(item, index)">
  321. 选班重学
  322. </view>
  323. </template>
  324. <view v-else class="exam_btns">
  325. <view class="box_appoint" v-if="item.openQuestion === 1 && false"
  326. @click="toBuyQuestionBank(item)">
  327. <view class="exam_word ones">购买题库</view>
  328. </view>
  329. <view class="box_appoint" v-if="item.examApplyGoodsList" @click="appointment(item)">
  330. <view class="exam_word ones">{{
  331. item.subscribeSign == 4 ? "预约记录" : "预约考试"
  332. }}</view>
  333. </view>
  334. <view class="box_appoint" v-if="
  335. item.beforeStatus === 1 &&
  336. !(
  337. sysTime <= item.serviceStartTime ||
  338. sysTime >= item.serviceEndTime ||
  339. (item.classStartTime && sysTime <= item.classStartTime) ||
  340. (item.classEndTime && sysTime >= item.classEndTime) ||
  341. item.learningStatus == 2 ||
  342. item.classStatus == 0 ||
  343. (item.learningStatus == 3 &&
  344. sysTime < item.learningTimeStart)
  345. )
  346. " @click="appBeforeAddress(item.goodsId, item)">
  347. <view class="exam_word ones">进入刷题</view>
  348. </view>
  349. </view>
  350. <view v-if="item.periodStatus == 1 && !(item.periodPlush > 0) &&
  351. item.educationName == '继续教育' &&
  352. item.projectName == '专业技术人员' &&
  353. item.businessName == '职称继续教育'" class="box_appoint" @click="toSeeClassHours">
  354. <view class="exam_word intos">学习凭证</view>
  355. </view>
  356. <view class="box_appoint" @click="studyIn(item.goodsId, item.gradeId, item, index)">
  357. <view class="exam_word intos">进入学习</view>
  358. </view>
  359. </view>
  360. </view>
  361. </view>
  362. </view>
  363. <!-- 没有学习的课程 -->
  364. <view v-if="!allLoading && !allCourse" class="no_datas">
  365. <image class="courses" src="/static/learn/no_course.png" mode=""></image>
  366. <view class="no_learns">您目前没有可学习的课程</view>
  367. <view class="choose" @click="toChoose()">立即去选购</view>
  368. </view>
  369. </view>
  370. <!-- 弹窗 -->
  371. <u-popup v-model="selectClassModal" @close="gradeValue = -1" mode="bottom" border-radius="40">
  372. <view class="popup_box">
  373. <view style="margin-bottom: 20rpx">
  374. <view class="line1"></view>
  375. <view class="grade">选择班级</view>
  376. </view>
  377. <u-line color="#D6D6DB" />
  378. <view>
  379. <scroll-view scroll-y="true" style="height: 500rpx">
  380. <view>
  381. <u-radio-group v-model="gradeValue" @change="radioGroupChange">
  382. <view v-for="(item, index) in gradeList" :key="index">
  383. <view style="display: flex; align-items: center; padding: 20rpx">
  384. <view>
  385. <u-radio shape="circle" :name="index" :disabled="
  386. item.studentNumAll > 0 &&
  387. item.studentNumAll == item.studentUpper
  388. ">
  389. <view :class="
  390. item.checked ? 'white-box blue-box' : 'white-box'
  391. ">
  392. <view>
  393. <view class="blackTxt">{{ item.className }}</view>
  394. <view class="redTxt" v-if="item.classEndTime">
  395. 有效期至:{{
  396. $method.timestampToTime(
  397. item.classEndTime,
  398. true,
  399. true
  400. )
  401. }}
  402. </view>
  403. <view class="redTxt" v-if="item.classEndTime">
  404. 本班还剩{{
  405. $method.GetRTime(item.classEndTime)
  406. }}天将结束学习</view>
  407. </view>
  408. </view>
  409. </u-radio>
  410. </view>
  411. </view>
  412. </view>
  413. </u-radio-group>
  414. </view>
  415. </scroll-view>
  416. </view>
  417. <view class="confrim-btn">
  418. <view class="okBtn" @click="okPopup()">确定</view>
  419. </view>
  420. </view>
  421. </u-popup>
  422. <u-modal v-model="showUserConfirmInfo" @confirm="confirmUserConfirm" ref="uModal" :async-close="true"
  423. @cancel="cancelUserConfirm" :confirm-text="
  424. '确认' + (confirmCount > 0 ? '(' + confirmCount + ')' : '')
  425. " :confirm-color="confirmCount > 0 ? '#999' : '#2979ff'" class="confirm-modal" title="实名验证确认" cancel="取消"
  426. :show-cancel-button="true">
  427. <view class="slot-content">
  428. <view class="content">
  429. <!-- ,立刻联系020-38946666 -->
  430. 为避免个人信息不正确导致您的学习时长无效,请认真核对以下信息是否正确,如信息有误请取消当前操作。
  431. <view class="msg-list" v-if="userInfo">
  432. <view class="item">
  433. <text class="item__left">姓名:</text>
  434. <text class="item__right">{{ userInfo.realname }}</text>
  435. </view>
  436. <view class="item">
  437. <text class="item__left">手机号:</text>
  438. <text class="item__right">{{ userInfo.telphone }}</text>
  439. </view>
  440. <view class="item">
  441. <text class="item__left">身份号:</text>
  442. <text class="item__right">{{ userInfo.idCard }}</text>
  443. </view>
  444. <view class="item">
  445. <u-checkbox v-model="confirmChecked" :label-disabled="false">确认个人信息无误</u-checkbox>
  446. </view>
  447. </view>
  448. </view>
  449. </view>
  450. </u-modal>
  451. <!-- 多个预约考试时的弹窗 -->
  452. <u-popup v-model="appointTestShow" mode="bottom" border-radius="40">
  453. <view class="popuptest_box">
  454. <view class="check_head">
  455. <view class="headers">
  456. <view class="grade">预约考试</view>
  457. <u-icon name="close" color="#9C9C9C" size="40" @click="closePop()"></u-icon>
  458. </view>
  459. </view>
  460. <view class="check_con">
  461. <scroll-view scroll-y="true" style="height: 700rpx">
  462. <view class="course_items" v-for="(appoint, index) in appointTestList" :key="index">
  463. <view class="course_lefts">
  464. <view class="course_title">{{ appoint.applyName }}</view>
  465. <view style="color: #999999; margin-top: 10rpx; font-size: 24rpx">
  466. <text style="margin-right: 8rpx">预约人数</text>
  467. {{ appoint.subscribeNum }}/{{ appoint.applyNum }}
  468. </view>
  469. </view>
  470. <view class="course_rights" @click="jumpTest(appoint)">
  471. <view class="intoStudy" v-if="appointItemIndex.subscribeSign !== 2">预约</view>
  472. </view>
  473. </view>
  474. </scroll-view>
  475. </view>
  476. </view>
  477. </u-popup>
  478. <!-- 考前须知 -->
  479. <u-modal v-model="showTip" title="考前须知" :show-cancel-button="true" @confirm="confirmTip">
  480. <view class="slot-content ql-editor" style="white-space: pre-wrap">
  481. <rich-text :nodes="nodesCcontent | formatRichText"></rich-text>
  482. </view>
  483. </u-modal>
  484. <!-- tabbar -->
  485. <myTabbar :backTopBtn="backTopBtn"></myTabbar>
  486. </view>
  487. </template>
  488. <script>
  489. var curTime = new Date().getTime(); // 当前时间的时间戳
  490. import {
  491. mapGetters,
  492. mapActions
  493. } from "vuex";
  494. import {
  495. tenantId
  496. } from "../../common/request.js"
  497. import filters from "../../filters/index";
  498. export default {
  499. data() {
  500. return {
  501. backTopBtn: false,
  502. leftDays: 0,
  503. paramC: {
  504. pageNum: 1,
  505. pageSize: 5,
  506. },
  507. activeItem: {},
  508. itemIndex: "",
  509. confirmTimer: null,
  510. confirmCount: 10,
  511. confirmChecked: false,
  512. showUserConfirmInfo: false,
  513. selectItem: {},
  514. selectClassModal: false,
  515. gradeList: [],
  516. gradeValue: -1,
  517. sysTime: 0,
  518. courseLists: [], // 课程列表
  519. total: 0,
  520. livingLists: [], // 直播列表
  521. allLoading: false, // 加载样式
  522. current: 2,
  523. appointTestShow: false, //预约考试弹窗
  524. appointTestList: [],
  525. appointItemIndex: {}, // 点击了哪项课程
  526. appoint: {},
  527. imgwidth: 0,
  528. imgheight: 0,
  529. showTip: false,
  530. nodesCcontent: "",
  531. oldPageJumpData: null,
  532. tenantId: tenantId
  533. };
  534. },
  535. filters: {
  536. liveStatus(liveTime, watchStatus) {
  537. let value = liveTime * 1000;
  538. if (curTime < value) {
  539. // 判断当前时间和直播开始时间
  540. return " 未开播";
  541. } else {
  542. return watchStatus == "live" ? "正在直播中" : "即将开播";
  543. }
  544. },
  545. formatRichText: filters.formatRichText,
  546. },
  547. computed: {
  548. ...mapGetters(["userInfo", "other"]),
  549. allCourse() {
  550. return this.courseLists.length || this.livingLists.length ? true : false;
  551. },
  552. eduPhone() {
  553. return this.userInfo.eduPhone;
  554. },
  555. backLearStatusText() {
  556. return ({
  557. periodStatus,
  558. stuAllNum,
  559. recordNum,
  560. secAllNum,
  561. examNum,
  562. periodPlush,
  563. studyStatus,
  564. }) => {
  565. let text = "";
  566. let color = "";
  567. if (periodStatus === -1) {
  568. let index = 0;
  569. if (studyStatus == 1) {
  570. index = 0;
  571. } else if (stuAllNum + recordNum < secAllNum + examNum) {
  572. index = 1;
  573. } else {
  574. index = 2;
  575. }
  576. text = ["未开始", "学习中", "已学完"][index];
  577. color = ["#EB5757", "#498AFE", "#498AFE"][index];
  578. } else {
  579. text = [
  580. "审核不通过",
  581. periodPlush > 0 ? "初审完成" : "学时审核通过",
  582. "待审核",
  583. "初审完成",
  584. ][periodStatus];
  585. color = ["#EB5757", "#F67205", "#F67205", "#F67205"][periodStatus];
  586. }
  587. return `<span style='color: ${color}'>${text}</span>`;
  588. };
  589. },
  590. classStatusCompt: function() {
  591. return function(item, sysTime) {
  592. var str = "未开班";
  593. if (item.classEndTime && item.classEndTime < sysTime) {
  594. str = "已过期";
  595. } else if (item.classStartTime && item.classStartTime > sysTime) {
  596. str = "未开始";
  597. } else if (
  598. item.gradeId &&
  599. item.gradeStatus == 1 &&
  600. item.classStatus === 1
  601. ) {
  602. str = "已开班";
  603. } else if (
  604. item.gradeId &&
  605. item.gradeStatus == 1 &&
  606. item.classStatus === 0
  607. ) {
  608. str = "未开班";
  609. }
  610. return str;
  611. };
  612. },
  613. },
  614. async onLoad(options) {
  615. uni.hideTabBar();
  616. this.leftDays = 1668873600 - parseInt(curTime / 1000);
  617. this.sysTime = +this.$method.timest();
  618. if (options.skipPort) {
  619. await this.$method.skipLogin(options.skipPort);
  620. }
  621. if (this.$method.isLogin()) {
  622. !this.userInfo && this.$api.refreshUserInfo();
  623. }
  624. },
  625. onShow() {
  626. uni.pageScrollTo({
  627. duration: 0,
  628. scrollTop: 0, // number number number!
  629. });
  630. // #ifdef H5
  631. this.getCourseoldgoodslist()
  632. // #endif
  633. this.getCourseLiveQues();
  634. },
  635. onPullDownRefresh() {
  636. this.getCourseLiveQues();
  637. },
  638. onPageScroll(e) {
  639. if (e.scrollTop > 100) {
  640. this.backTopBtn = true
  641. } else {
  642. this.backTopBtn = false
  643. }
  644. },
  645. onReachBottom() {
  646. if (this.courseLists.length < this.total) {
  647. this.paramC.pageNum++;
  648. this.getCourseList();
  649. }
  650. },
  651. methods: {
  652. ...mapActions(["getUserInfo"]),
  653. sevenFunc(item) {
  654. return (
  655. item.educationName == "继续教育" &&
  656. item.projectName == "施工现场专业人员"
  657. );
  658. },
  659. goPage(url, type) {
  660. if (type == 1) {
  661. window.location.href = url
  662. }
  663. if (type == 2) {
  664. uni.setClipboardData({
  665. data: url,
  666. success: function() {
  667. console.log('复制成功');
  668. }
  669. })
  670. }
  671. },
  672. getCourseoldgoodslist() {
  673. if (!this.$method.isLogin()) {
  674. return;
  675. }
  676. this.$api.courseoldgoodslist().then(res => {
  677. if (res.data.data && res.data.data.goodsNames.length > 3) {
  678. res.data.data.goodsNames.splice(3, res.data.data.goodsNames.length, "...");
  679. }
  680. this.oldPageJumpData = res.data.data || null
  681. })
  682. },
  683. bgShow(liveTime, watchStatus) {
  684. let value = liveTime * 1000;
  685. if (curTime > value) {
  686. // 判断当前时间和直播开始时间
  687. return watchStatus == "live" ? true : false;
  688. }
  689. },
  690. lookTimeStatus(liveTime, watchStatus) {
  691. if (liveTime) {
  692. let value = new Date(liveTime * 1000);
  693. var Y = value.getFullYear();
  694. var M =
  695. value.getMonth() + 1 < 10 ?
  696. "0" + (value.getMonth() + 1) :
  697. value.getMonth() + 1;
  698. var D = value.getDate() < 10 ? "0" + value.getDate() : value.getDate();
  699. var valZ = Y + "/" + M + "/" + D;
  700. let curZeroTime = new Date(valZ).getTime(); // 获取开始直播时间当天的零点时间戳
  701. if (curTime > value) {
  702. // 判断当前时间和直播开始时间
  703. if (watchStatus == "live") {
  704. //
  705. return 1;
  706. } else {
  707. return 2;
  708. }
  709. } else {
  710. if (curZeroTime <= curTime && curTime <= value) {
  711. //当天
  712. return 3;
  713. } else {
  714. return 4;
  715. }
  716. }
  717. }
  718. },
  719. curTimeTamp(liveTime) {
  720. let min = liveTime - parseInt(curTime / 1000);
  721. return min;
  722. },
  723. toSeeClassHours() {
  724. uni.navigateTo({
  725. url: "/pages2/learn/my_learn",
  726. });
  727. },
  728. toChoose() {
  729. this.$store.state.current = 0
  730. uni.switchTab({
  731. url: '/pages/course/index'
  732. });
  733. },
  734. // 查询直播课
  735. getCourseLiveQues() {
  736. if (!this.$method.isLogin()) {
  737. return;
  738. }
  739. this.allLoading = true;
  740. this.paramC.pageNum = 1;
  741. let arrs = [
  742. this.$api.listUserVideoLive(this.paramC), // 查询用户拥有视频+直播商品 /goods/listUserVideoLive
  743. this.$api.getgoodsLiveList({
  744. pageNum: 1,
  745. pageSize: 3, // 默认3条
  746. }),
  747. ];
  748. wx.stopPullDownRefresh();
  749. Promise.all(arrs)
  750. .then((res) => {
  751. // if (res.data.code == 200) {
  752. const [{
  753. data: res1
  754. }, {
  755. data: res2
  756. }] = res;
  757. if (res1.code == 200) {
  758. this.total = res1.total;
  759. this.courseLists = res1.rows || [];
  760. const goods = this.courseLists.find(
  761. (e) => e.subscribeSign == 1 || e.subscribeSign == 3
  762. );
  763. if (goods) {
  764. let {
  765. goodsName,
  766. subscribeSign
  767. } = goods;
  768. console.log(goods, 'goods')
  769. let text =
  770. `您七大员新考【${goodsName}】课程` +
  771. (subscribeSign == 1 ?
  772. "已学完,可以预约考试了!" :
  773. "课程考试未通过,请重新预约考试!");
  774. uni.showModal({
  775. title: "提示",
  776. content: text,
  777. success: (res) => {
  778. if (res.confirm) {
  779. this.appointment(goods);
  780. }
  781. },
  782. });
  783. }
  784. }
  785. if (res2.code == 200) {
  786. this.livingLists = res2.rows || [];
  787. } else {
  788. this.$u.toast(res2.msg);
  789. }
  790. this.allLoading = false;
  791. this.sysTime = +this.$method.timest();
  792. // }
  793. uni.hideLoading();
  794. })
  795. .catch((err) => {
  796. uni.hideLoading();
  797. this.allLoading = false;
  798. });
  799. },
  800. getCourseList() {
  801. this.$api
  802. .listUserVideoLive(this.paramC)
  803. .then((res) => {
  804. this.courseLists.push(...res.data.rows);
  805. })
  806. .finally((e) => {
  807. uni.hideLoading();
  808. });
  809. },
  810. // 看直播
  811. toLiveLook(item) {
  812. let moduleId = item.moduleId || 0;
  813. let chapterId = item.chapterId || 0;
  814. let sectionId = item.sectionId || item.menuId;
  815. let uuid = new Date().valueOf() + "";
  816. // buyCourse 是否购买课程:1是 0否
  817. let encode = encodeURIComponent(
  818. this.other.hostLive +
  819. "/pages/live/index?token=" +
  820. uni.getStorageSync("token") +
  821. "&userInfo=" +
  822. (JSON.stringify(this.userInfo) || "") +
  823. "&channelId=" +
  824. item.liveUrl +
  825. "&gradeId=" +
  826. 0 +
  827. "&courseId=" +
  828. item.courseId +
  829. "&goodsId=" +
  830. item.goodsId +
  831. "&orderGoodsId=" +
  832. item.orderGoodsId +
  833. "&sectionId=" +
  834. sectionId +
  835. "&chapterId=" +
  836. chapterId +
  837. "&moduleId=" +
  838. moduleId +
  839. "&buyCourse=1" +
  840. "&ident=" +
  841. uuid +
  842. "&sectionType=2"
  843. );
  844. uni.navigateTo({
  845. url: `/pages5/webview/index?url=` + encode,
  846. });
  847. },
  848. toLive(item) {
  849. this.$api
  850. .courseCourseList({
  851. pageNum: 1,
  852. pageSize: 1,
  853. goodsId: item.goodsId,
  854. gradeId: 0,
  855. orderGoodsId: item.orderGoodsId,
  856. })
  857. .then((res) => {
  858. if (res.data.code == 200) {
  859. if (res.data.total > 1) {
  860. // uni.navigateTo({
  861. // url:'/pages5/liveDetail/course?orderGoodsId='+item.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0'
  862. // })
  863. uni.navigateTo({
  864. url: "/pages3/live/detail?orderGoodsId=" +
  865. item.orderGoodsId +
  866. "&goodsId=" +
  867. item.goodsId +
  868. '&gradeId=0&courseId=""',
  869. });
  870. } else if (res.data.total == 1) {
  871. uni.navigateTo({
  872. url: "/pages3/live/detail?orderGoodsId=" +
  873. item.orderGoodsId +
  874. "&goodsId=" +
  875. item.goodsId +
  876. "&gradeId=0&courseId=" +
  877. res.data.rows[0].courseId,
  878. });
  879. } else {
  880. uni.showToast({
  881. icon: "none",
  882. title: "暂无可观看的直播课程",
  883. });
  884. }
  885. }
  886. });
  887. },
  888. async studyIn(v, i, item, index) {
  889. if (item.externalLinkStatus) {
  890. this.$method.toLink(item.externalLink);
  891. return;
  892. }
  893. if (item.goodsType == 6) {
  894. // 进入直播课
  895. this.toLive(item);
  896. return;
  897. }
  898. // 进入视频课
  899. this.activeItem = item;
  900. // let playSource = 1;
  901. // this.$api
  902. // .orderGetViewSign(item.orderGoodsId)
  903. // .then((res) => {
  904. // console.log('学习中心请求的viewSign', res.data.data.viewSign)
  905. // playSource = res.data.data.viewSign;
  906. // })
  907. if (item.interfaceAccountId > 0) {
  908. //学习账号已开通
  909. if (item.learnStatus > 0) {
  910. //跳转第三方h5
  911. // if (playSource == 2) {
  912. // // #ifdef H5
  913. // uni.navigateTo({
  914. // url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&isOther=1`,
  915. // });
  916. // // #endif
  917. // // #ifdef MP-WEIXIN
  918. // this.$api
  919. // .courseSkipPort()
  920. // .then((res) => {
  921. // console.log("请求的域名", res.data.data.domain)
  922. // let obj = {
  923. // goodsId: item.goodsId,
  924. // orderGoodsId: item.orderGoodsId,
  925. // gradeId: item.gradeId,
  926. // isOther: 1,
  927. // skipPort: res.data.data.skipPort,
  928. // }
  929. // let webViewUrl = encodeURIComponent(res.data.data.domain +
  930. // '/pages3/polyv/detail?obj=' +
  931. // JSON.stringify(obj))
  932. // uni.navigateTo({
  933. // url: `/pages5/webview/detaillink?url=${webViewUrl}`
  934. // })
  935. // })
  936. // // #endif
  937. // } else {
  938. // uni.navigateTo({
  939. // url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&isOther=1`,
  940. // });
  941. // }
  942. uni.navigateTo({
  943. url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&isOther=1`,
  944. });
  945. return;
  946. } else {
  947. const text = this.eduPhone ? ",有疑问,请联系" + this.eduPhone : "";
  948. uni.showModal({
  949. showCancel: false,
  950. content: "您的学习账号未开通,请稍后再尝试" + text,
  951. });
  952. return;
  953. }
  954. return;
  955. }
  956. if (
  957. item.serviceStartTime &&
  958. (this.sysTime <= item.serviceStartTime ||
  959. this.sysTime >= item.serviceEndTime)
  960. ) {
  961. uni.showToast({
  962. icon: "none",
  963. title: "不在学习服务期,不能进入学习",
  964. });
  965. return;
  966. }
  967. if (
  968. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  969. (item.classEndTime && this.sysTime >= item.classEndTime)
  970. ) {
  971. uni.showToast({
  972. icon: "none",
  973. title: "不在班级有效期,不能进入学习",
  974. });
  975. return;
  976. }
  977. // learningStatus: 1即刻,2待定,3不在日期内
  978. if (item.learningStatus == 2) {
  979. uni.showToast({
  980. icon: "none",
  981. title: "开放学习时间待定,不能进入学习",
  982. });
  983. return;
  984. }
  985. if (item.classStatus == 0) {
  986. uni.showToast({
  987. icon: "none",
  988. title: "尚未开班,不能进入学习",
  989. });
  990. return;
  991. }
  992. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  993. uni.showToast({
  994. icon: "none",
  995. title: "不在开放学习时间,不能进入学习",
  996. });
  997. return;
  998. }
  999. uni.showLoading({
  1000. title: "拼命加载中...",
  1001. mask: true,
  1002. });
  1003. // var confirmDetail = true;
  1004. // if (item.educationName == "继续教育") {
  1005. // if (
  1006. // item.officialName &&
  1007. // item.businessName == "二级" &&
  1008. // item.projectName == "建造师"
  1009. // ) {
  1010. // confirmDetail = await this.userConfirmInfoDetail();
  1011. // }
  1012. // }
  1013. // if (!confirmDetail) {
  1014. // return;
  1015. // }
  1016. this.itemIndex = index;
  1017. if (
  1018. item.gradeStatus == 1 &&
  1019. item.status == 1 &&
  1020. item.serviceEndTime > this.sysTime &&
  1021. item.classEndTime &&
  1022. item.classEndTime < this.sysTime &&
  1023. (item.periodStatus == 0 || item.periodStatus == -1) &&
  1024. item.studyCount > 0
  1025. ) {
  1026. this.selectClass(item, index, "loading");
  1027. return;
  1028. }
  1029. // /course/goodsRebuildStatus查询用户商品重修状态
  1030. let rebuildStatus = await this.courseGoodsRebuildStatus(
  1031. item.goodsId,
  1032. item.gradeId
  1033. );
  1034. if (rebuildStatus == 0) {
  1035. uni.hideLoading();
  1036. this.$navTo.togo("/pages2/learn/details", {
  1037. gradeId: item.gradeId,
  1038. goodsId: item.goodsId,
  1039. orderGoodsId: item.orderGoodsId,
  1040. });
  1041. return;
  1042. }
  1043. this.$method.checkLock().then(() => {
  1044. this.$http({
  1045. url: "/course/courseList",
  1046. method: "get",
  1047. data: {
  1048. pageNum: 1,
  1049. pageSize: 100,
  1050. goodsId: item.goodsId,
  1051. gradeId: item.gradeId,
  1052. orderGoodsId: item.orderGoodsId,
  1053. },
  1054. noLoading: true,
  1055. }).then((res) => {
  1056. if (res.data.code == 200) {
  1057. if (res.data.total > 1) {
  1058. // if (playSource == 2) {
  1059. // // #ifdef H5
  1060. // uni.navigateTo({
  1061. // url: `/pages3/polyv/detail?id=''&goodsId=${
  1062. // item.goodsId
  1063. // }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1064. // item.gradeId
  1065. // }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
  1066. // item.orderYear ? 1 : ""
  1067. // }`,
  1068. // });
  1069. // // #endif
  1070. // // #ifdef MP-WEIXIN
  1071. // this.$api
  1072. // .courseSkipPort()
  1073. // .then((res) => {
  1074. // console.log("请求的域名", res.data.data.domain)
  1075. // let obj = {
  1076. // id: '',
  1077. // goodsId: item.goodsId,
  1078. // orderGoodsId: item.orderGoodsId,
  1079. // gradeId: item.gradeId,
  1080. // periodWaitTime: item.periodWaitTime ? 1 : "",
  1081. // isQ: item.orderYear ? 1 : "",
  1082. // skipPort: res.data.data.skipPort
  1083. // }
  1084. // let webViewUrl = encodeURIComponent(
  1085. // res.data.data.domain +
  1086. // '/pages3/polyv/detail?obj=' +
  1087. // JSON.stringify(obj))
  1088. // uni.navigateTo({
  1089. // url: `/pages5/webview/detaillink?url=${webViewUrl}`
  1090. // })
  1091. // })
  1092. // // #endif
  1093. // } else {
  1094. // uni.navigateTo({
  1095. // url: `/pages3/polyv/detail?id=''&goodsId=${
  1096. // item.goodsId
  1097. // }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1098. // item.gradeId
  1099. // }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
  1100. // item.orderYear ? 1 : ""
  1101. // }`,
  1102. // });
  1103. // }
  1104. uni.navigateTo({
  1105. url: `/pages3/polyv/detail?id=''&goodsId=${
  1106. item.goodsId
  1107. }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1108. item.gradeId
  1109. }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
  1110. });
  1111. } else if (res.data.total == 1) {
  1112. // if (playSource == 2) {
  1113. // // #ifdef H5
  1114. // uni.navigateTo({
  1115. // url: ` / pages3 / polyv / detail ? id = $ {
  1116. // res.data.rows[0].courseId
  1117. // }&goodsId=${item.goodsId}&orderGoodsId=${
  1118. // item.orderGoodsId
  1119. // }&gradeId=${item.gradeId}&periodWaitTime=${
  1120. // item.periodWaitTime ? "" : 1
  1121. // }&isQ=${item.orderYear ? 1 : ""}`,
  1122. // });
  1123. // // #endif
  1124. // // #ifdef MP-WEIXIN
  1125. // this.$api
  1126. // .courseSkipPort()
  1127. // .then((resForDetail) => {
  1128. // console.log("请求的域名", resForDetail.data.data.domain)
  1129. // let obj = {
  1130. // id: res.data.rows[0].courseId,
  1131. // goodsId: item.goodsId,
  1132. // orderGoodsId: item.orderGoodsId,
  1133. // gradeId: item.gradeId,
  1134. // periodWaitTime: item.periodWaitTime ? "" : 1,
  1135. // isQ: item.orderYear ? 1 : "",
  1136. // skipPort: resForDetail.data.data.skipPort
  1137. // }
  1138. // let webViewUrl = encodeURIComponent(
  1139. // resForDetail.data.data.domain +
  1140. // '/pages3/polyv/detail?obj=' +
  1141. // JSON.stringify(obj))
  1142. // uni.navigateTo({
  1143. // url: `/pages5/webview/detaillink?url=${webViewUrl}`
  1144. // })
  1145. // })
  1146. // // #endif
  1147. // } else {
  1148. // uni.navigateTo({
  1149. // url: `/pages3/polyv/detail?id=${
  1150. // res.data.rows[0].courseId
  1151. // }&goodsId=${item.goodsId}&orderGoodsId=${
  1152. // item.orderGoodsId
  1153. // }&gradeId=${item.gradeId}&periodWaitTime=${
  1154. // item.periodWaitTime ? "" : 1
  1155. // }&isQ=${item.orderYear ? 1 : ""}`,
  1156. // });
  1157. // }
  1158. uni.navigateTo({
  1159. url: `/pages3/polyv/detail?id=${
  1160. res.data.rows[0].courseId
  1161. }&goodsId=${item.goodsId}&orderGoodsId=${
  1162. item.orderGoodsId
  1163. }&gradeId=${item.gradeId}&periodWaitTime=${
  1164. item.periodWaitTime ? "" : 1
  1165. }`,
  1166. });
  1167. } else {
  1168. uni.showToast({
  1169. icon: "none",
  1170. title: "暂无可观看的视频课程",
  1171. });
  1172. }
  1173. }
  1174. });
  1175. });
  1176. },
  1177. toDetail() {
  1178. this.$http({
  1179. url: "/course/courseList",
  1180. method: "get",
  1181. data: {
  1182. pageNum: 1,
  1183. pageSize: 100,
  1184. goodsId: item.goodsId,
  1185. gradeId: item.gradeId,
  1186. orderGoodsId: item.orderGoodsId,
  1187. },
  1188. noLoading: true,
  1189. }).then((res) => {
  1190. if (res.data.code == 200) {
  1191. if (res.data.total > 1) {
  1192. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  1193. uni.navigateTo({
  1194. url: `/pages3/polyv/detail?id=''&goodsId=${
  1195. item.goodsId
  1196. }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1197. item.gradeId
  1198. }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
  1199. });
  1200. } else if (res.data.total == 1) {
  1201. uni.navigateTo({
  1202. url: `/pages3/polyv/detail?id=${
  1203. res.data.rows[0].courseId
  1204. }&goodsId=${item.goodsId}&orderGoodsId=${
  1205. item.orderGoodsId
  1206. }&gradeId=${item.gradeId}&periodWaitTime=${
  1207. item.periodWaitTime ? "" : 1
  1208. }`,
  1209. });
  1210. } else {
  1211. uni.showToast({
  1212. icon: "none",
  1213. title: "暂无可观看的视频课程",
  1214. });
  1215. }
  1216. }
  1217. });
  1218. },
  1219. toInput(item) {
  1220. this.$navTo.togo("/pages2/verify/input", {
  1221. id: item.goodsId,
  1222. orderGoodsId: item.orderGoodsId,
  1223. gradeId: item.gradeId,
  1224. type: 1,
  1225. });
  1226. },
  1227. /**
  1228. * @param {Object} goodsId 商品id
  1229. * 查询商品重修状态
  1230. */
  1231. courseGoodsRebuildStatus(goodsId, gradeId) {
  1232. return new Promise((resolve) => {
  1233. this.$http({
  1234. url: "/course/goodsRebuildStatus",
  1235. method: "get",
  1236. data: {
  1237. goodsId: goodsId,
  1238. gradeId: gradeId,
  1239. },
  1240. noLoading: true,
  1241. compleLoading: true, // 请求成功是否还要继续显示加载中
  1242. }).then((res) => {
  1243. resolve(res.data.data);
  1244. });
  1245. });
  1246. },
  1247. userConfirmInfoDetail() {
  1248. return new Promise((resolve) => {
  1249. this.$http({
  1250. url: "/user/confirm/info/detail",
  1251. method: "get",
  1252. data: {
  1253. orderGoodsId: this.activeItem.orderGoodsId
  1254. },
  1255. noLoading: true,
  1256. }).then((res) => {
  1257. if (!res.data.data) {
  1258. clearInterval(this.confirmTimer);
  1259. this.confirmCount = 10;
  1260. this.showUserConfirmInfo = true;
  1261. this.confirmTimer = setInterval(() => {
  1262. if (this.confirmCount > 0) {
  1263. this.confirmCount--;
  1264. } else {
  1265. clearInterval(this.confirmTimer);
  1266. }
  1267. }, 1000);
  1268. } else {
  1269. if (res.data.data.pushInfo) {
  1270. resolve(true);
  1271. } else {
  1272. const text = this.eduPhone ?
  1273. ",有疑问,请联系" + this.eduPhone :
  1274. "";
  1275. uni.showModal({
  1276. showCancel: false,
  1277. title: "提示",
  1278. content: "开通信息推送不成功,无法进入学习" + text,
  1279. });
  1280. resolve(false);
  1281. }
  1282. }
  1283. });
  1284. });
  1285. },
  1286. selectClass(item, index, load) {
  1287. this.itemIndex = index;
  1288. this.selectItem = item;
  1289. this.selectClassModal = true;
  1290. this.goodsGradeList(item.goodsId, load);
  1291. },
  1292. goodsGradeList(id, load) {
  1293. this.$http({
  1294. url: "/grade/grade/list",
  1295. method: "get",
  1296. data: {
  1297. goodsId: id
  1298. },
  1299. noLoading: load ? true : false,
  1300. }).then((res) => {
  1301. if (res.data.code == 200) {
  1302. if (res.data.rows && res.data.rows.length > 0) {
  1303. res.data.rows = res.data.rows.filter(i => {
  1304. return !(i.studentNumAll > 0 && i.studentNumAll == i
  1305. .studentUpper)
  1306. })
  1307. }
  1308. this.gradeList = res.data.rows;
  1309. if (this.gradeList.length == 0) {
  1310. let item = {
  1311. className: "系统分班",
  1312. gradeId: 0,
  1313. };
  1314. this.gradeList.push(item);
  1315. } else {
  1316. let isGradeFull = this.gradeList.every(
  1317. (item) =>
  1318. item.studentNumAll > 0 && item.studentNumAll == item
  1319. .studentUpper
  1320. );
  1321. //所有班级都满了
  1322. if (isGradeFull) {
  1323. let item = {
  1324. className: "系统分班",
  1325. gradeId: 0,
  1326. };
  1327. this.gradeList.unshift(item);
  1328. }
  1329. }
  1330. }
  1331. });
  1332. },
  1333. radioGroupChange(e) {
  1334. // console.log(e)
  1335. },
  1336. okPopup() {
  1337. if (this.gradeValue == -1) {
  1338. uni.showToast({
  1339. icon: "none",
  1340. title: "请选择班级",
  1341. });
  1342. return;
  1343. }
  1344. this.$api
  1345. .changeGrade({
  1346. goodsId: this.selectItem.goodsId,
  1347. gradeId: this.gradeValue,
  1348. oldGradeId: this.selectItem.gradeId,
  1349. orderGoodsId: this.selectItem.orderGoodsId,
  1350. userId: this.selectItem.userId,
  1351. })
  1352. .then((res) => {
  1353. if (res.data.code == 200) {
  1354. if (this.itemIndex !== "") {
  1355. this.refreshByIndex();
  1356. }
  1357. this.selectClassModal = false;
  1358. uni.showToast({
  1359. title: "选班成功",
  1360. });
  1361. } else {
  1362. uni.showToast({
  1363. icon: "none",
  1364. title: res.data.msg,
  1365. });
  1366. }
  1367. });
  1368. },
  1369. /**
  1370. * 返回刷新之前进入的课程数据
  1371. */
  1372. refreshByIndex() {
  1373. this.$api
  1374. .listUserVideoLive({
  1375. pageNum: this.itemIndex + 1,
  1376. pageSize: 1,
  1377. })
  1378. .then((res) => {
  1379. if (res.data.code == 200) {
  1380. this.$set(this.courseLists, this.itemIndex, res.data.rows[0]);
  1381. }
  1382. });
  1383. },
  1384. confirmUserConfirm() {
  1385. this.$refs.uModal.clearLoading();
  1386. if (this.confirmCount <= 0) {
  1387. if (this.confirmChecked) {
  1388. let infoJson = {
  1389. realname: this.userInfo.realname,
  1390. idCard: this.userInfo.idCard,
  1391. telphone: this.userInfo.telphone,
  1392. };
  1393. this.$api
  1394. .userConfirminfo({
  1395. orderGoodsId: this.activeItem.orderGoodsId,
  1396. infoJson: JSON.stringify(infoJson),
  1397. })
  1398. .then((res) => {
  1399. if (res.data.code != 200) {
  1400. this.showUserConfirmInfo = false;
  1401. uni.showToast({
  1402. icon: "none",
  1403. title: res.data.msg,
  1404. });
  1405. return;
  1406. }
  1407. if (res.data.data.pushInfo) {
  1408. uni.showToast({
  1409. icon: "none",
  1410. title: "提交成功",
  1411. });
  1412. } else {
  1413. const text = this.eduPhone ?
  1414. ",有疑问,请联系" + this.eduPhone :
  1415. "";
  1416. uni.showModal({
  1417. showCancel: false,
  1418. title: "提示",
  1419. content: "开通信息推送不成功,无法进入学!" + text,
  1420. });
  1421. }
  1422. this.showUserConfirmInfo = false;
  1423. });
  1424. } else {
  1425. uni.showToast({
  1426. icon: "none",
  1427. title: "请勾选确认个人信息无误",
  1428. });
  1429. }
  1430. } else {
  1431. return;
  1432. }
  1433. },
  1434. cancelUserConfirm() {
  1435. clearInterval(this.confirmTimer);
  1436. },
  1437. call() {
  1438. // #ifdef MP-WEIXIN
  1439. uni.makePhoneCall({
  1440. phoneNumber: "020-87085982", //仅为示例
  1441. });
  1442. // #endif
  1443. },
  1444. closePop() {
  1445. this.appointTestShow = false;
  1446. },
  1447. jumpTest(appoint) {
  1448. this.$api
  1449. .getExamTip()
  1450. .then((res) => {
  1451. this.nodesCcontent = res.data.data.value;
  1452. this.appoint = appoint;
  1453. this.showTip = true;
  1454. })
  1455. .catch(() => {
  1456. this.appoint_an(appoint);
  1457. this.appointTestShow = false;
  1458. });
  1459. },
  1460. confirmTip() {
  1461. this.showTip = false;
  1462. this.appointTestShow = false;
  1463. this.appoint_an(this.appoint);
  1464. },
  1465. toBuyQuestionBank(item) {
  1466. this.$api.goodsDetail(item.questionGoodsId).then((res) => {
  1467. this.$store.commit("setShoppingCartList", {
  1468. shoppingCartList: [{
  1469. relevanceId: item.orderGoodsId,
  1470. ...res.data.data
  1471. }, ],
  1472. });
  1473. this.$navTo.togo("/pages2/order/confirm_pay");
  1474. });
  1475. },
  1476. async appointment(item) {
  1477. // #ifdef H5
  1478. const {
  1479. data
  1480. } = await this.$api.courseoldgoodsredirect()
  1481. if (data.data) {
  1482. window.location.href = data.data.h5Url
  1483. return
  1484. }
  1485. // #endif
  1486. if (item.subscribeSign == 4) {
  1487. this.$navTo.togo("/pages2/exam/exam_appointment");
  1488. return;
  1489. }
  1490. this.appointItemIndex = item;
  1491. this.appointTestList = item.examApplyGoodsList;
  1492. this.appointTestShow = true;
  1493. if (item.examApplyGoodsList.length >= 1) {
  1494. // 多个考试预约
  1495. this.appointTestList = item.examApplyGoodsList;
  1496. this.appointTestShow = true;
  1497. return;
  1498. }
  1499. // let appoint_item = item.examApplyGoodsList[0];
  1500. // this.appoint_an(appoint_item);
  1501. },
  1502. appoint_an(appoint) {
  1503. const {
  1504. goodsId,
  1505. gradeId,
  1506. orderGoodsId
  1507. } = this.appointItemIndex;
  1508. var data = {
  1509. goodsId,
  1510. gradeId,
  1511. applyId: appoint.applyId,
  1512. orderGoodsId,
  1513. };
  1514. this.$api.getApplysubscribe(data).then((res) => {
  1515. if (res.data.code === 500) {
  1516. uni.showModal({
  1517. showCancel: false,
  1518. content: res.data.msg,
  1519. });
  1520. }
  1521. if (res.data.code === 200) {
  1522. this.$navTo.togo("/pages2/appointment/index", {
  1523. goodsId,
  1524. gradeId,
  1525. orderGoodsId,
  1526. applyId: appoint.applyId,
  1527. });
  1528. }
  1529. });
  1530. },
  1531. // 进入刷题,调整小程序
  1532. appBeforeAddress(goodsId, item) {
  1533. this.$api
  1534. .appBeforeAddress({
  1535. orderGoodsId: item.orderGoodsId,
  1536. })
  1537. .then((res) => {
  1538. if (res.data.code == 200) {
  1539. uni.navigateToMiniProgram({
  1540. appId: res.data.data.url,
  1541. success(res) {
  1542. // 打开成功
  1543. },
  1544. });
  1545. } else {
  1546. uni.showModal({
  1547. title: "提示",
  1548. content: res.data.msg,
  1549. showCancel: false,
  1550. });
  1551. }
  1552. });
  1553. },
  1554. },
  1555. };
  1556. </script>
  1557. <style>
  1558. page {
  1559. background: #eaeef1;
  1560. }
  1561. </style>
  1562. <style lang="scss" scoped>
  1563. @import "./index.scss";
  1564. @import "./quill.core";
  1565. .oldPageJump {
  1566. margin-top: 20rpx;
  1567. border: 1rpx solid #eee;
  1568. border-left: none;
  1569. border-right: none;
  1570. padding: 20rpx 24rpx;
  1571. &>h4 {
  1572. margin-bottom: 10rpx;
  1573. font-weight: 400;
  1574. }
  1575. ul {
  1576. padding-left: 0rpx;
  1577. li {
  1578. list-style: none;
  1579. margin-bottom: 10rpx;
  1580. font-weight: bold;
  1581. }
  1582. }
  1583. p {
  1584. margin-bottom: 10rpx;
  1585. }
  1586. }
  1587. </style>