index.vue 48 KB

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