index.vue 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694
  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 && false
  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="isMajorEducation(item)">
  302. <span v-if="item.sevenPushReason === '培训周期时间未到' && item.officialStatus != 1">
  303. 温馨提示:您{{item.orderYear}}年{{ item.majorName }}专业培训周期还没到,请在{{ trainDate(item.sevenPushDate) }}后再进行继教。
  304. </span>
  305. <span v-if="item.sevenPushReason === '无相关专业专书'">
  306. 温馨提示:您当前的课程{{item.orderYear}}年{{ item.majorName }}专业,未能匹配到可继教证书,可前往住建证书官网查询。
  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}}年{{ item.majorName }}专业已完成继教,无需重复继教,可前往住建证书官网查询。
  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 && item.examApplyGoodsList.length > 0 &&
  383. item.subscribeSign != 0" @click="appointment(item)">
  384. <view class="exam_word ones">{{
  385. item.subscribeSign == 1 ? "预约考试" : "预约记录"
  386. }}</view>
  387. </view>
  388. <view class="box_appoint" v-if="
  389. item.beforeStatus === 1 &&
  390. !(
  391. sysTime <= item.serviceStartTime ||
  392. sysTime >= item.serviceEndTime ||
  393. (item.classStartTime && sysTime <= item.classStartTime) ||
  394. (item.classEndTime && sysTime >= item.classEndTime) ||
  395. item.learningStatus == 2 ||
  396. item.classStatus == 0 ||
  397. (item.learningStatus == 3 &&
  398. sysTime < item.learningTimeStart)
  399. )
  400. " @click="appBeforeAddress(item.goodsId, item)">
  401. <view class="exam_word ones">进入刷题</view>
  402. </view>
  403. </view>
  404. <view v-if="item.periodStatus == 1 && !(item.periodPlush > 0) &&
  405. item.educationName == '继续教育' &&
  406. item.projectName == '专业技术人员' &&
  407. item.businessName == '职称继续教育'" class="box_appoint" @click="toSeeClassHours">
  408. <view class="exam_word intos">学习凭证</view>
  409. </view>
  410. <view class="box_appoint" @click="studyIn(item.goodsId, item.gradeId, item, index)">
  411. <view class="exam_word intos">进入学习</view>
  412. </view>
  413. </view>
  414. </view>
  415. </view>
  416. </view>
  417. <!-- 没有学习的课程 -->
  418. <view v-if="!allLoading && !allCourse" class="no_datas">
  419. <image class="courses" src="/static/learn/no_course.png" mode=""></image>
  420. <view class="no_learns">您目前没有可学习的课程</view>
  421. <view class="choose" @click="toChoose()">立即去选购</view>
  422. </view>
  423. </view>
  424. <!-- 弹窗 -->
  425. <u-popup v-model="selectClassModal" @close="gradeValue = -1" mode="bottom" border-radius="40">
  426. <view class="popup_box">
  427. <view style="margin-bottom: 20rpx">
  428. <view class="line1"></view>
  429. <view class="grade">选择班级</view>
  430. </view>
  431. <u-line color="#D6D6DB" />
  432. <view>
  433. <scroll-view scroll-y="true" style="height: 500rpx">
  434. <view>
  435. <u-radio-group v-model="gradeValue" @change="radioGroupChange">
  436. <view v-for="(item, index) in gradeList" :key="index">
  437. <view style="display: flex; align-items: center; padding: 20rpx">
  438. <view>
  439. <u-radio shape="circle" :name="index" :disabled="
  440. item.studentNumAll > 0 &&
  441. item.studentNumAll == item.studentUpper
  442. ">
  443. <view :class="
  444. item.checked ? 'white-box blue-box' : 'white-box'
  445. ">
  446. <view>
  447. <view class="blackTxt">{{ item.className }}</view>
  448. <view class="redTxt" v-if="item.classEndTime">
  449. 有效期至:{{
  450. $method.timestampToTime(
  451. item.classEndTime,
  452. true,
  453. true
  454. )
  455. }}
  456. </view>
  457. <view class="redTxt" v-if="item.classEndTime">
  458. 本班还剩{{
  459. $method.GetRTime(item.classEndTime)
  460. }}天将结束学习</view>
  461. </view>
  462. </view>
  463. </u-radio>
  464. </view>
  465. </view>
  466. </view>
  467. </u-radio-group>
  468. </view>
  469. </scroll-view>
  470. </view>
  471. <view class="confrim-btn">
  472. <view class="okBtn" @click="okPopup()">确定</view>
  473. </view>
  474. </view>
  475. </u-popup>
  476. <u-modal v-model="showUserConfirmInfo" @confirm="confirmUserConfirm" ref="uModal" :async-close="true"
  477. @cancel="cancelUserConfirm" :confirm-text="
  478. '确认' + (confirmCount > 0 ? '(' + confirmCount + ')' : '')
  479. " :confirm-color="confirmCount > 0 ? '#999' : '#2979ff'" class="confirm-modal" title="实名验证确认" cancel="取消"
  480. :show-cancel-button="true">
  481. <view class="slot-content">
  482. <view class="content">
  483. <!-- ,立刻联系020-38946666 -->
  484. 为避免个人信息不正确导致您的学习时长无效,请认真核对以下信息是否正确,如信息有误请取消当前操作。
  485. <view class="msg-list" v-if="userInfo">
  486. <view class="item">
  487. <text class="item__left">姓名:</text>
  488. <text class="item__right">{{ userInfo.realname }}</text>
  489. </view>
  490. <view class="item">
  491. <text class="item__left">手机号:</text>
  492. <text class="item__right">{{ userInfo.telphone }}</text>
  493. </view>
  494. <view class="item">
  495. <text class="item__left">身份号:</text>
  496. <text class="item__right">{{ userInfo.idCard }}</text>
  497. </view>
  498. <view class="item">
  499. <u-checkbox v-model="confirmChecked" :label-disabled="false">确认个人信息无误</u-checkbox>
  500. </view>
  501. </view>
  502. </view>
  503. </view>
  504. </u-modal>
  505. <!-- 多个预约考试时的弹窗 -->
  506. <u-popup v-model="appointTestShow" mode="bottom" border-radius="40">
  507. <view class="popuptest_box">
  508. <view class="check_head">
  509. <view class="headers">
  510. <view class="grade">预约考试</view>
  511. <u-icon name="close" color="#9C9C9C" size="40" @click="closePop()"></u-icon>
  512. </view>
  513. </view>
  514. <view class="check_con">
  515. <scroll-view scroll-y="true" style="height: 700rpx">
  516. <view class="course_items" v-for="(appoint, index) in appointTestList" :key="index">
  517. <view class="course_lefts">
  518. <view class="course_title">{{ appoint.applyName }}</view>
  519. <view style="color: #999999; margin-top: 10rpx; font-size: 24rpx">
  520. <text style="margin-right: 8rpx">预约人数</text>
  521. {{ appoint.subscribeNum }}/{{ appoint.applyNum }}
  522. </view>
  523. </view>
  524. <view class="course_rights" @click="jumpTest(appoint)">
  525. <view class="intoStudy" v-if="appointItemIndex.subscribeSign !== 2">预约</view>
  526. </view>
  527. </view>
  528. </scroll-view>
  529. </view>
  530. </view>
  531. </u-popup>
  532. <!-- 考前须知 -->
  533. <u-modal v-model="showTip" title="考前须知" :show-cancel-button="true" @confirm="confirmTip">
  534. <view class="slot-content ql-editor" style="white-space: pre-wrap">
  535. <rich-text :nodes="nodesCcontent | formatRichText"></rich-text>
  536. </view>
  537. </u-modal>
  538. <!-- tabbar -->
  539. <myTabbar :backTopBtn="backTopBtn"></myTabbar>
  540. </view>
  541. </template>
  542. <script>
  543. var curTime = new Date().getTime(); // 当前时间的时间戳
  544. import {
  545. mapGetters,
  546. mapActions
  547. } from "vuex";
  548. import {
  549. tenantId
  550. } from "../../common/request.js"
  551. import filters from "../../filters/index";
  552. export default {
  553. data() {
  554. return {
  555. backTopBtn: false,
  556. leftDays: 0,
  557. paramC: {
  558. pageNum: 1,
  559. pageSize: 5,
  560. },
  561. activeItem: {},
  562. itemIndex: "",
  563. confirmTimer: null,
  564. confirmCount: 10,
  565. confirmChecked: false,
  566. showUserConfirmInfo: false,
  567. selectItem: {},
  568. selectClassModal: false,
  569. gradeList: [],
  570. gradeValue: -1,
  571. sysTime: 0,
  572. courseLists: [], // 课程列表
  573. total: 0,
  574. livingLists: [], // 直播列表
  575. allLoading: false, // 加载样式
  576. current: 2,
  577. appointTestShow: false, //预约考试弹窗
  578. appointTestList: [],
  579. appointItemIndex: {}, // 点击了哪项课程
  580. appoint: {},
  581. imgwidth: 0,
  582. imgheight: 0,
  583. showTip: false,
  584. nodesCcontent: "",
  585. oldPageJumpData: null,
  586. tenantId: tenantId
  587. };
  588. },
  589. filters: {
  590. liveStatus(liveTime, watchStatus) {
  591. let value = liveTime * 1000;
  592. if (curTime < value) {
  593. // 判断当前时间和直播开始时间
  594. return " 未开播";
  595. } else {
  596. return watchStatus == "live" ? "正在直播中" : "即将开播";
  597. }
  598. },
  599. formatRichText: filters.formatRichText,
  600. },
  601. computed: {
  602. ...mapGetters(["userInfo", "other"]),
  603. allCourse() {
  604. return this.courseLists.length || this.livingLists.length ? true : false;
  605. },
  606. eduPhone() {
  607. return this.userInfo.eduPhone;
  608. },
  609. backLearStatusText() {
  610. return ({
  611. periodStatus,
  612. stuAllNum,
  613. recordNum,
  614. secAllNum,
  615. examNum,
  616. periodPlush,
  617. studyStatus,
  618. educationName
  619. }) => {
  620. let text = "";
  621. let color = "";
  622. if (periodStatus === -1) {
  623. let index = 0;
  624. if (!studyStatus) {
  625. index = 0;
  626. } else if (stuAllNum + recordNum < secAllNum + examNum) {
  627. index = 1;
  628. } else {
  629. index = 2;
  630. }
  631. text = ["未开始", "学习中", "已学完"][index];
  632. color = ["#EB5757", "#498AFE", "#498AFE"][index];
  633. } else if (educationName != '考前培训') {
  634. // "学时审核通过" ——> 初审通过
  635. text = [
  636. "审核不通过",
  637. periodPlush > 0 ? "初审完成" : "初审通过",
  638. "待审核",
  639. "初审完成",
  640. ][periodStatus];
  641. color = ["#EB5757", "#F67205", "#F67205", "#F67205"][periodStatus];
  642. }
  643. return `<span style='color: ${color}'>${text}</span>`;
  644. };
  645. },
  646. classStatusCompt: function() {
  647. return function(item, sysTime) {
  648. var str = "未开班";
  649. if (item.classEndTime && item.classEndTime < sysTime) {
  650. str = "已过期";
  651. } else if (item.classStartTime && item.classStartTime > sysTime) {
  652. str = "未开始";
  653. } else if (
  654. item.gradeId &&
  655. item.gradeStatus == 1 &&
  656. item.classStatus === 1
  657. ) {
  658. str = "已开班";
  659. } else if (
  660. item.gradeId &&
  661. item.gradeStatus == 1 &&
  662. item.classStatus === 0
  663. ) {
  664. str = "未开班";
  665. }
  666. return str;
  667. };
  668. },
  669. // 二建继教提示判断
  670. isTwoEducation() {
  671. return function(item) {
  672. return (
  673. item.educationName + item.businessName + item.projectName ===
  674. "继续教育二级建造师"
  675. );
  676. }
  677. },
  678. // 公路专业(施工现场专业人员——继续教育)
  679. isMajorEducation() {
  680. return function(item) {
  681. return (
  682. item.projectName + item.educationName ===
  683. "施工现场专业人员继续教育"
  684. );
  685. }
  686. },
  687. // 培训周期时间小于当前年份,进行年份替换
  688. trainDate() {
  689. return function(val) {
  690. const oldDate = val ? val.split("/") : []
  691. if (oldDate.length != 3) return
  692. const [oldYear, month, day] = oldDate
  693. let currentYear = new Date().getFullYear()
  694. if (oldYear < currentYear) {
  695. return `${currentYear}/${month}/${day}`
  696. }
  697. return val
  698. }
  699. }
  700. },
  701. async onLoad(options) {
  702. uni.hideTabBar();
  703. this.leftDays = 1668873600 - parseInt(curTime / 1000);
  704. this.sysTime = +this.$method.timest();
  705. if (options.skipPort) {
  706. await this.$method.skipLogin(options.skipPort);
  707. }
  708. if (this.$method.isLogin()) {
  709. !this.userInfo && this.$api.refreshUserInfo();
  710. }
  711. },
  712. onShow() {
  713. uni.pageScrollTo({
  714. duration: 0,
  715. scrollTop: 0, // number number number!
  716. });
  717. // #ifdef H5
  718. this.getCourseoldgoodslist()
  719. // #endif
  720. this.getCourseLiveQues();
  721. },
  722. onPullDownRefresh() {
  723. this.getCourseLiveQues();
  724. },
  725. onPageScroll(e) {
  726. if (e.scrollTop > 100) {
  727. this.backTopBtn = true
  728. } else {
  729. this.backTopBtn = false
  730. }
  731. },
  732. onReachBottom() {
  733. if (this.courseLists.length < this.total) {
  734. this.paramC.pageNum++;
  735. this.getCourseList();
  736. }
  737. },
  738. methods: {
  739. ...mapActions(["getUserInfo"]),
  740. sevenFunc(item) {
  741. return (
  742. item.educationName == "继续教育" &&
  743. item.projectName == "施工现场专业人员"
  744. );
  745. },
  746. goPage(url, type) {
  747. if (type == 1) {
  748. window.location.href = url
  749. }
  750. if (type == 2) {
  751. uni.setClipboardData({
  752. data: url,
  753. success: function() {
  754. console.log('复制成功');
  755. }
  756. })
  757. }
  758. },
  759. getCourseoldgoodslist() {
  760. if (!this.$method.isLogin()) {
  761. return;
  762. }
  763. this.$api.courseoldgoodslist().then(res => {
  764. if (res.data.data && res.data.data.goodsNames.length > 3) {
  765. res.data.data.goodsNames.splice(3, res.data.data.goodsNames.length, "...");
  766. }
  767. this.oldPageJumpData = res.data.data || null
  768. })
  769. },
  770. bgShow(liveTime, watchStatus) {
  771. let value = liveTime * 1000;
  772. if (curTime > value) {
  773. // 判断当前时间和直播开始时间
  774. return watchStatus == "live" ? true : false;
  775. }
  776. },
  777. lookTimeStatus(liveTime, watchStatus) {
  778. if (liveTime) {
  779. let value = new Date(liveTime * 1000);
  780. var Y = value.getFullYear();
  781. var M =
  782. value.getMonth() + 1 < 10 ?
  783. "0" + (value.getMonth() + 1) :
  784. value.getMonth() + 1;
  785. var D = value.getDate() < 10 ? "0" + value.getDate() : value.getDate();
  786. var valZ = Y + "/" + M + "/" + D;
  787. let curZeroTime = new Date(valZ).getTime(); // 获取开始直播时间当天的零点时间戳
  788. if (curTime > value) {
  789. // 判断当前时间和直播开始时间
  790. if (watchStatus == "live") {
  791. //
  792. return 1;
  793. } else {
  794. return 2;
  795. }
  796. } else {
  797. if (curZeroTime <= curTime && curTime <= value) {
  798. //当天
  799. return 3;
  800. } else {
  801. return 4;
  802. }
  803. }
  804. }
  805. },
  806. curTimeTamp(liveTime) {
  807. let min = liveTime - parseInt(curTime / 1000);
  808. return min;
  809. },
  810. toSeeClassHours() {
  811. uni.navigateTo({
  812. url: "/pages2/learn/my_learn",
  813. });
  814. },
  815. toChoose() {
  816. this.$store.state.current = 0
  817. uni.switchTab({
  818. url: '/pages/course/index'
  819. });
  820. },
  821. // 查询直播课
  822. getCourseLiveQues() {
  823. if (!this.$method.isLogin()) {
  824. return;
  825. }
  826. this.allLoading = true;
  827. this.paramC.pageNum = 1;
  828. let arrs = [
  829. this.$api.listUserVideoLive(this.paramC), // 查询用户拥有视频+直播商品 /goods/listUserVideoLive
  830. this.$api.getgoodsLiveList({
  831. pageNum: 1,
  832. pageSize: 3, // 默认3条
  833. }),
  834. ];
  835. wx.stopPullDownRefresh();
  836. Promise.all(arrs)
  837. .then((res) => {
  838. // if (res.data.code == 200) {
  839. const [{
  840. data: res1
  841. }, {
  842. data: res2
  843. }] = res;
  844. if (res1.code == 200) {
  845. this.total = res1.total;
  846. this.courseLists = res1.rows || [];
  847. const goods = this.courseLists.find(
  848. (e) => e.subscribeSign == 1 || e.subscribeSign == 3
  849. );
  850. if (goods) {
  851. let {
  852. goodsName,
  853. subscribeSign
  854. } = goods;
  855. console.log(goods, 'goods')
  856. let text =
  857. `您七大员新考【${goodsName}】课程` +
  858. (subscribeSign == 1 ?
  859. "已学完,可以预约考试了!" :
  860. "课程考试未通过,请重新预约考试!");
  861. uni.showModal({
  862. title: "提示",
  863. content: text,
  864. success: (res) => {
  865. if (res.confirm) {
  866. this.appointment(goods);
  867. }
  868. },
  869. });
  870. }
  871. }
  872. if (res2.code == 200) {
  873. this.livingLists = res2.rows || [];
  874. } else {
  875. this.$u.toast(res2.msg);
  876. }
  877. this.allLoading = false;
  878. this.sysTime = +this.$method.timest();
  879. // }
  880. uni.hideLoading();
  881. })
  882. .catch((err) => {
  883. uni.hideLoading();
  884. this.allLoading = false;
  885. });
  886. },
  887. getCourseList() {
  888. this.$api
  889. .listUserVideoLive(this.paramC)
  890. .then((res) => {
  891. this.courseLists.push(...res.data.rows);
  892. })
  893. .finally((e) => {
  894. uni.hideLoading();
  895. });
  896. },
  897. // 看直播
  898. toLiveLook(item) {
  899. let moduleId = item.moduleId || 0;
  900. let chapterId = item.chapterId || 0;
  901. let sectionId = item.sectionId || item.menuId;
  902. let uuid = new Date().valueOf() + "";
  903. // buyCourse 是否购买课程:1是 0否
  904. let encode = encodeURIComponent(
  905. this.other.hostLive +
  906. "/pages/live/index?token=" +
  907. uni.getStorageSync("token") +
  908. "&userInfo=" +
  909. (JSON.stringify(this.userInfo) || "") +
  910. "&channelId=" +
  911. item.liveUrl +
  912. "&gradeId=" +
  913. 0 +
  914. "&courseId=" +
  915. item.courseId +
  916. "&goodsId=" +
  917. item.goodsId +
  918. "&orderGoodsId=" +
  919. item.orderGoodsId +
  920. "&sectionId=" +
  921. sectionId +
  922. "&chapterId=" +
  923. chapterId +
  924. "&moduleId=" +
  925. moduleId +
  926. "&buyCourse=1" +
  927. "&ident=" +
  928. uuid +
  929. "&sectionType=2"
  930. );
  931. uni.navigateTo({
  932. url: `/pages5/webview/index?url=` + encode,
  933. });
  934. },
  935. toLive(item) {
  936. this.$api
  937. .courseCourseList({
  938. pageNum: 1,
  939. pageSize: 1,
  940. goodsId: item.goodsId,
  941. gradeId: 0,
  942. orderGoodsId: item.orderGoodsId,
  943. })
  944. .then((res) => {
  945. if (res.data.code == 200) {
  946. if (res.data.total > 1) {
  947. // uni.navigateTo({
  948. // url:'/pages5/liveDetail/course?orderGoodsId='+item.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0'
  949. // })
  950. uni.navigateTo({
  951. url: "/pages3/live/detail?orderGoodsId=" +
  952. item.orderGoodsId +
  953. "&goodsId=" +
  954. item.goodsId +
  955. '&gradeId=0&courseId=""',
  956. });
  957. } else if (res.data.total == 1) {
  958. uni.navigateTo({
  959. url: "/pages3/live/detail?orderGoodsId=" +
  960. item.orderGoodsId +
  961. "&goodsId=" +
  962. item.goodsId +
  963. "&gradeId=0&courseId=" +
  964. res.data.rows[0].courseId,
  965. });
  966. } else {
  967. uni.showToast({
  968. icon: "none",
  969. title: "暂无可观看的直播课程",
  970. });
  971. }
  972. }
  973. });
  974. },
  975. async studyIn(v, i, item, index) {
  976. if (item.externalLinkStatus) {
  977. this.$method.toLink(item.externalLink);
  978. return;
  979. }
  980. if (item.goodsType == 6) {
  981. // 进入直播课
  982. this.toLive(item);
  983. return;
  984. }
  985. // 进入视频课
  986. this.activeItem = item;
  987. // let playSource = 1;
  988. // this.$api
  989. // .orderGetViewSign(item.orderGoodsId)
  990. // .then((res) => {
  991. // console.log('学习中心请求的viewSign', res.data.data.viewSign)
  992. // playSource = res.data.data.viewSign;
  993. // })
  994. if (item.interfaceAccountId > 0) {
  995. //学习账号已开通
  996. if (item.learnStatus > 0) {
  997. //跳转第三方h5
  998. // if (playSource == 2) {
  999. // // #ifdef H5
  1000. // uni.navigateTo({
  1001. // url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&isOther=1`,
  1002. // });
  1003. // // #endif
  1004. // // #ifdef MP-WEIXIN
  1005. // this.$api
  1006. // .courseSkipPort()
  1007. // .then((res) => {
  1008. // console.log("请求的域名", res.data.data.domain)
  1009. // let obj = {
  1010. // goodsId: item.goodsId,
  1011. // orderGoodsId: item.orderGoodsId,
  1012. // gradeId: item.gradeId,
  1013. // isOther: 1,
  1014. // skipPort: res.data.data.skipPort,
  1015. // }
  1016. // let webViewUrl = encodeURIComponent(res.data.data.domain +
  1017. // '/pages3/polyv/detail?obj=' +
  1018. // JSON.stringify(obj))
  1019. // uni.navigateTo({
  1020. // url: `/pages5/webview/detaillink?url=${webViewUrl}`
  1021. // })
  1022. // })
  1023. // // #endif
  1024. // } else {
  1025. // uni.navigateTo({
  1026. // url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&isOther=1`,
  1027. // });
  1028. // }
  1029. uni.navigateTo({
  1030. url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&isOther=1`,
  1031. });
  1032. return;
  1033. } else {
  1034. const text = this.eduPhone ? ",有疑问,请联系" + this.eduPhone : "";
  1035. uni.showModal({
  1036. showCancel: false,
  1037. content: "您的学习账号未开通,请稍后再尝试" + text,
  1038. });
  1039. return;
  1040. }
  1041. return;
  1042. }
  1043. if (
  1044. item.serviceStartTime &&
  1045. (this.sysTime <= item.serviceStartTime ||
  1046. this.sysTime >= item.serviceEndTime)
  1047. ) {
  1048. uni.showToast({
  1049. icon: "none",
  1050. title: "不在学习服务期,不能进入学习",
  1051. });
  1052. return;
  1053. }
  1054. if (
  1055. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  1056. (item.classEndTime && this.sysTime >= item.classEndTime)
  1057. ) {
  1058. uni.showToast({
  1059. icon: "none",
  1060. title: "不在班级有效期,不能进入学习",
  1061. });
  1062. return;
  1063. }
  1064. // learningStatus: 1即刻,2待定,3不在日期内
  1065. if (item.learningStatus == 2) {
  1066. uni.showToast({
  1067. icon: "none",
  1068. title: "开放学习时间待定,不能进入学习",
  1069. });
  1070. return;
  1071. }
  1072. if (item.classStatus == 0) {
  1073. uni.showToast({
  1074. icon: "none",
  1075. title: "尚未开班,不能进入学习",
  1076. });
  1077. return;
  1078. }
  1079. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  1080. uni.showToast({
  1081. icon: "none",
  1082. title: "不在开放学习时间,不能进入学习",
  1083. });
  1084. return;
  1085. }
  1086. uni.showLoading({
  1087. title: "拼命加载中...",
  1088. mask: true,
  1089. });
  1090. // var confirmDetail = true;
  1091. // if (item.educationName == "继续教育") {
  1092. // if (
  1093. // item.officialName &&
  1094. // item.businessName == "二级" &&
  1095. // item.projectName == "建造师"
  1096. // ) {
  1097. // confirmDetail = await this.userConfirmInfoDetail();
  1098. // }
  1099. // }
  1100. // if (!confirmDetail) {
  1101. // return;
  1102. // }
  1103. this.itemIndex = index;
  1104. if (
  1105. item.gradeStatus == 1 &&
  1106. item.status == 1 &&
  1107. item.serviceEndTime > this.sysTime &&
  1108. item.classEndTime &&
  1109. item.classEndTime < this.sysTime &&
  1110. (item.periodStatus == 0 || item.periodStatus == -1) &&
  1111. item.studyCount > 0
  1112. ) {
  1113. this.selectClass(item, index, "loading");
  1114. return;
  1115. }
  1116. // /course/goodsRebuildStatus查询用户商品重修状态
  1117. let rebuildStatus = await this.courseGoodsRebuildStatus(
  1118. item.goodsId,
  1119. item.gradeId
  1120. );
  1121. if (rebuildStatus == 0) {
  1122. uni.hideLoading();
  1123. this.$navTo.togo("/pages2/learn/details", {
  1124. gradeId: item.gradeId,
  1125. goodsId: item.goodsId,
  1126. orderGoodsId: item.orderGoodsId,
  1127. });
  1128. return;
  1129. }
  1130. this.$method.checkLock().then(() => {
  1131. this.$http({
  1132. url: "/course/courseList",
  1133. method: "get",
  1134. data: {
  1135. pageNum: 1,
  1136. pageSize: 100,
  1137. goodsId: item.goodsId,
  1138. gradeId: item.gradeId,
  1139. orderGoodsId: item.orderGoodsId,
  1140. },
  1141. noLoading: true,
  1142. }).then((res) => {
  1143. if (res.data.code == 200) {
  1144. if (res.data.total > 1) {
  1145. // if (playSource == 2) {
  1146. // // #ifdef H5
  1147. // uni.navigateTo({
  1148. // url: `/pages3/polyv/detail?id=''&goodsId=${
  1149. // item.goodsId
  1150. // }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1151. // item.gradeId
  1152. // }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
  1153. // item.orderYear ? 1 : ""
  1154. // }`,
  1155. // });
  1156. // // #endif
  1157. // // #ifdef MP-WEIXIN
  1158. // this.$api
  1159. // .courseSkipPort()
  1160. // .then((res) => {
  1161. // console.log("请求的域名", res.data.data.domain)
  1162. // let obj = {
  1163. // id: '',
  1164. // goodsId: item.goodsId,
  1165. // orderGoodsId: item.orderGoodsId,
  1166. // gradeId: item.gradeId,
  1167. // periodWaitTime: item.periodWaitTime ? 1 : "",
  1168. // isQ: item.orderYear ? 1 : "",
  1169. // skipPort: res.data.data.skipPort
  1170. // }
  1171. // let webViewUrl = encodeURIComponent(
  1172. // res.data.data.domain +
  1173. // '/pages3/polyv/detail?obj=' +
  1174. // JSON.stringify(obj))
  1175. // uni.navigateTo({
  1176. // url: `/pages5/webview/detaillink?url=${webViewUrl}`
  1177. // })
  1178. // })
  1179. // // #endif
  1180. // } else {
  1181. // uni.navigateTo({
  1182. // url: `/pages3/polyv/detail?id=''&goodsId=${
  1183. // item.goodsId
  1184. // }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1185. // item.gradeId
  1186. // }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
  1187. // item.orderYear ? 1 : ""
  1188. // }`,
  1189. // });
  1190. // }
  1191. uni.navigateTo({
  1192. url: `/pages3/polyv/detail?id=''&goodsId=${
  1193. item.goodsId
  1194. }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1195. item.gradeId
  1196. }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
  1197. });
  1198. } else if (res.data.total == 1) {
  1199. // if (playSource == 2) {
  1200. // // #ifdef H5
  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. // }&isQ=${item.orderYear ? 1 : ""}`,
  1209. // });
  1210. // // #endif
  1211. // // #ifdef MP-WEIXIN
  1212. // this.$api
  1213. // .courseSkipPort()
  1214. // .then((resForDetail) => {
  1215. // console.log("请求的域名", resForDetail.data.data.domain)
  1216. // let obj = {
  1217. // id: res.data.rows[0].courseId,
  1218. // goodsId: item.goodsId,
  1219. // orderGoodsId: item.orderGoodsId,
  1220. // gradeId: item.gradeId,
  1221. // periodWaitTime: item.periodWaitTime ? "" : 1,
  1222. // isQ: item.orderYear ? 1 : "",
  1223. // skipPort: resForDetail.data.data.skipPort
  1224. // }
  1225. // let webViewUrl = encodeURIComponent(
  1226. // resForDetail.data.data.domain +
  1227. // '/pages3/polyv/detail?obj=' +
  1228. // JSON.stringify(obj))
  1229. // uni.navigateTo({
  1230. // url: `/pages5/webview/detaillink?url=${webViewUrl}`
  1231. // })
  1232. // })
  1233. // // #endif
  1234. // } else {
  1235. // uni.navigateTo({
  1236. // url: `/pages3/polyv/detail?id=${
  1237. // res.data.rows[0].courseId
  1238. // }&goodsId=${item.goodsId}&orderGoodsId=${
  1239. // item.orderGoodsId
  1240. // }&gradeId=${item.gradeId}&periodWaitTime=${
  1241. // item.periodWaitTime ? "" : 1
  1242. // }&isQ=${item.orderYear ? 1 : ""}`,
  1243. // });
  1244. // }
  1245. uni.navigateTo({
  1246. url: `/pages3/polyv/detail?id=${
  1247. res.data.rows[0].courseId
  1248. }&goodsId=${item.goodsId}&orderGoodsId=${
  1249. item.orderGoodsId
  1250. }&gradeId=${item.gradeId}&periodWaitTime=${
  1251. item.periodWaitTime ? "" : 1
  1252. }`,
  1253. });
  1254. } else {
  1255. uni.showToast({
  1256. icon: "none",
  1257. title: "暂无可观看的视频课程",
  1258. });
  1259. }
  1260. }
  1261. });
  1262. });
  1263. },
  1264. toDetail() {
  1265. this.$http({
  1266. url: "/course/courseList",
  1267. method: "get",
  1268. data: {
  1269. pageNum: 1,
  1270. pageSize: 100,
  1271. goodsId: item.goodsId,
  1272. gradeId: item.gradeId,
  1273. orderGoodsId: item.orderGoodsId,
  1274. },
  1275. noLoading: true,
  1276. }).then((res) => {
  1277. if (res.data.code == 200) {
  1278. if (res.data.total > 1) {
  1279. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  1280. uni.navigateTo({
  1281. url: `/pages3/polyv/detail?id=''&goodsId=${
  1282. item.goodsId
  1283. }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1284. item.gradeId
  1285. }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
  1286. });
  1287. } else if (res.data.total == 1) {
  1288. uni.navigateTo({
  1289. url: `/pages3/polyv/detail?id=${
  1290. res.data.rows[0].courseId
  1291. }&goodsId=${item.goodsId}&orderGoodsId=${
  1292. item.orderGoodsId
  1293. }&gradeId=${item.gradeId}&periodWaitTime=${
  1294. item.periodWaitTime ? "" : 1
  1295. }`,
  1296. });
  1297. } else {
  1298. uni.showToast({
  1299. icon: "none",
  1300. title: "暂无可观看的视频课程",
  1301. });
  1302. }
  1303. }
  1304. });
  1305. },
  1306. toInput(item) {
  1307. this.$navTo.togo("/pages2/verify/input", {
  1308. id: item.goodsId,
  1309. orderGoodsId: item.orderGoodsId,
  1310. gradeId: item.gradeId,
  1311. type: 1,
  1312. });
  1313. },
  1314. /**
  1315. * @param {Object} goodsId 商品id
  1316. * 查询商品重修状态
  1317. */
  1318. courseGoodsRebuildStatus(goodsId, gradeId) {
  1319. return new Promise((resolve) => {
  1320. this.$http({
  1321. url: "/course/goodsRebuildStatus",
  1322. method: "get",
  1323. data: {
  1324. goodsId: goodsId,
  1325. gradeId: gradeId,
  1326. },
  1327. noLoading: true,
  1328. compleLoading: true, // 请求成功是否还要继续显示加载中
  1329. }).then((res) => {
  1330. resolve(res.data.data);
  1331. });
  1332. });
  1333. },
  1334. userConfirmInfoDetail() {
  1335. return new Promise((resolve) => {
  1336. this.$http({
  1337. url: "/user/confirm/info/detail",
  1338. method: "get",
  1339. data: {
  1340. orderGoodsId: this.activeItem.orderGoodsId
  1341. },
  1342. noLoading: true,
  1343. }).then((res) => {
  1344. if (!res.data.data) {
  1345. clearInterval(this.confirmTimer);
  1346. this.confirmCount = 10;
  1347. this.showUserConfirmInfo = true;
  1348. this.confirmTimer = setInterval(() => {
  1349. if (this.confirmCount > 0) {
  1350. this.confirmCount--;
  1351. } else {
  1352. clearInterval(this.confirmTimer);
  1353. }
  1354. }, 1000);
  1355. } else {
  1356. if (res.data.data.pushInfo) {
  1357. resolve(true);
  1358. } else {
  1359. const text = this.eduPhone ?
  1360. ",有疑问,请联系" + this.eduPhone :
  1361. "";
  1362. uni.showModal({
  1363. showCancel: false,
  1364. title: "提示",
  1365. content: "开通信息推送不成功,无法进入学习" + text,
  1366. });
  1367. resolve(false);
  1368. }
  1369. }
  1370. });
  1371. });
  1372. },
  1373. selectClass(item, index, load) {
  1374. this.itemIndex = index;
  1375. this.selectItem = item;
  1376. this.selectClassModal = true;
  1377. this.goodsGradeList(item.goodsId, load);
  1378. },
  1379. goodsGradeList(id, load) {
  1380. this.$http({
  1381. url: "/grade/grade/list",
  1382. method: "get",
  1383. data: {
  1384. goodsId: id
  1385. },
  1386. noLoading: load ? true : false,
  1387. }).then((res) => {
  1388. if (res.data.code == 200) {
  1389. if (res.data.rows && res.data.rows.length > 0) {
  1390. res.data.rows = res.data.rows.filter(i => {
  1391. return !(i.studentNumAll > 0 && i.studentNumAll == i
  1392. .studentUpper)
  1393. })
  1394. }
  1395. this.gradeList = res.data.rows;
  1396. if (this.gradeList.length == 0) {
  1397. let item = {
  1398. className: "系统分班",
  1399. gradeId: 0,
  1400. };
  1401. this.gradeList.push(item);
  1402. } else {
  1403. let isGradeFull = this.gradeList.every(
  1404. (item) =>
  1405. item.studentNumAll > 0 && item.studentNumAll == item
  1406. .studentUpper
  1407. );
  1408. //所有班级都满了
  1409. if (isGradeFull) {
  1410. let item = {
  1411. className: "系统分班",
  1412. gradeId: 0,
  1413. };
  1414. this.gradeList.unshift(item);
  1415. }
  1416. }
  1417. }
  1418. });
  1419. },
  1420. radioGroupChange(e) {
  1421. // console.log(e)
  1422. },
  1423. okPopup() {
  1424. if (this.gradeValue == -1) {
  1425. uni.showToast({
  1426. icon: "none",
  1427. title: "请选择班级",
  1428. });
  1429. return;
  1430. }
  1431. this.$api
  1432. .changeGrade({
  1433. goodsId: this.selectItem.goodsId,
  1434. gradeId: this.gradeValue,
  1435. oldGradeId: this.selectItem.gradeId,
  1436. orderGoodsId: this.selectItem.orderGoodsId,
  1437. userId: this.selectItem.userId,
  1438. })
  1439. .then((res) => {
  1440. if (res.data.code == 200) {
  1441. if (this.itemIndex !== "") {
  1442. this.refreshByIndex();
  1443. }
  1444. this.selectClassModal = false;
  1445. uni.showToast({
  1446. title: "选班成功",
  1447. });
  1448. } else {
  1449. uni.showToast({
  1450. icon: "none",
  1451. title: res.data.msg,
  1452. });
  1453. }
  1454. });
  1455. },
  1456. /**
  1457. * 返回刷新之前进入的课程数据
  1458. */
  1459. refreshByIndex() {
  1460. this.$api
  1461. .listUserVideoLive({
  1462. pageNum: this.itemIndex + 1,
  1463. pageSize: 1,
  1464. })
  1465. .then((res) => {
  1466. if (res.data.code == 200) {
  1467. this.$set(this.courseLists, this.itemIndex, res.data.rows[0]);
  1468. }
  1469. });
  1470. },
  1471. confirmUserConfirm() {
  1472. this.$refs.uModal.clearLoading();
  1473. if (this.confirmCount <= 0) {
  1474. if (this.confirmChecked) {
  1475. let infoJson = {
  1476. realname: this.userInfo.realname,
  1477. idCard: this.userInfo.idCard,
  1478. telphone: this.userInfo.telphone,
  1479. };
  1480. this.$api
  1481. .userConfirminfo({
  1482. orderGoodsId: this.activeItem.orderGoodsId,
  1483. infoJson: JSON.stringify(infoJson),
  1484. })
  1485. .then((res) => {
  1486. if (res.data.code != 200) {
  1487. this.showUserConfirmInfo = false;
  1488. uni.showToast({
  1489. icon: "none",
  1490. title: res.data.msg,
  1491. });
  1492. return;
  1493. }
  1494. if (res.data.data.pushInfo) {
  1495. uni.showToast({
  1496. icon: "none",
  1497. title: "提交成功",
  1498. });
  1499. } else {
  1500. const text = this.eduPhone ?
  1501. ",有疑问,请联系" + this.eduPhone :
  1502. "";
  1503. uni.showModal({
  1504. showCancel: false,
  1505. title: "提示",
  1506. content: "开通信息推送不成功,无法进入学!" + text,
  1507. });
  1508. }
  1509. this.showUserConfirmInfo = false;
  1510. });
  1511. } else {
  1512. uni.showToast({
  1513. icon: "none",
  1514. title: "请勾选确认个人信息无误",
  1515. });
  1516. }
  1517. } else {
  1518. return;
  1519. }
  1520. },
  1521. cancelUserConfirm() {
  1522. clearInterval(this.confirmTimer);
  1523. },
  1524. call() {
  1525. // #ifdef MP-WEIXIN
  1526. uni.makePhoneCall({
  1527. phoneNumber: "020-87085982", //仅为示例
  1528. });
  1529. // #endif
  1530. },
  1531. closePop() {
  1532. this.appointTestShow = false;
  1533. },
  1534. jumpTest(appoint) {
  1535. this.$api
  1536. .getExamTip()
  1537. .then((res) => {
  1538. this.nodesCcontent = res.data.data.value;
  1539. this.appoint = appoint;
  1540. this.showTip = true;
  1541. })
  1542. .catch(() => {
  1543. this.appoint_an(appoint);
  1544. this.appointTestShow = false;
  1545. });
  1546. },
  1547. confirmTip() {
  1548. this.showTip = false;
  1549. this.appointTestShow = false;
  1550. this.appoint_an(this.appoint);
  1551. },
  1552. toBuyQuestionBank(item) {
  1553. this.$api.goodsDetail(item.questionGoodsId).then((res) => {
  1554. this.$store.commit("setShoppingCartList", {
  1555. shoppingCartList: [{
  1556. relevanceId: item.orderGoodsId,
  1557. ...res.data.data
  1558. }, ],
  1559. });
  1560. this.$navTo.togo("/pages2/order/confirm_pay");
  1561. });
  1562. },
  1563. async appointment(item) {
  1564. // #ifdef H5
  1565. const {
  1566. data
  1567. } = await this.$api.courseoldgoodsredirect()
  1568. if (data.data) {
  1569. window.location.href = data.data.h5Url
  1570. return
  1571. }
  1572. // #endif
  1573. if (item.subscribeSign == 4) {
  1574. this.$navTo.togo("/pages2/exam/exam_appointment");
  1575. return;
  1576. }
  1577. this.appointItemIndex = item;
  1578. this.appointTestList = item.examApplyGoodsList;
  1579. this.appointTestShow = true;
  1580. if (item.examApplyGoodsList.length >= 1) {
  1581. // 多个考试预约
  1582. this.appointTestList = item.examApplyGoodsList;
  1583. this.appointTestShow = true;
  1584. return;
  1585. }
  1586. // let appoint_item = item.examApplyGoodsList[0];
  1587. // this.appoint_an(appoint_item);
  1588. },
  1589. appoint_an(appoint) {
  1590. const {
  1591. goodsId,
  1592. gradeId,
  1593. orderGoodsId
  1594. } = this.appointItemIndex;
  1595. var data = {
  1596. goodsId,
  1597. gradeId,
  1598. applyId: appoint.applyId,
  1599. orderGoodsId,
  1600. };
  1601. this.$api.getApplysubscribe(data).then((res) => {
  1602. if (res.data.code === 500) {
  1603. uni.showModal({
  1604. showCancel: false,
  1605. content: res.data.msg,
  1606. });
  1607. }
  1608. if (res.data.code === 200) {
  1609. this.$navTo.togo("/pages2/appointment/index", {
  1610. goodsId,
  1611. gradeId,
  1612. orderGoodsId,
  1613. applyId: appoint.applyId,
  1614. });
  1615. }
  1616. });
  1617. },
  1618. // 进入刷题,调整小程序
  1619. appBeforeAddress(goodsId, item) {
  1620. this.$api
  1621. .appBeforeAddress({
  1622. orderGoodsId: item.orderGoodsId,
  1623. })
  1624. .then((res) => {
  1625. if (res.data.code == 200) {
  1626. uni.navigateToMiniProgram({
  1627. appId: res.data.data.url,
  1628. success(res) {
  1629. // 打开成功
  1630. },
  1631. });
  1632. } else {
  1633. uni.showModal({
  1634. title: "提示",
  1635. content: res.data.msg,
  1636. showCancel: false,
  1637. });
  1638. }
  1639. });
  1640. },
  1641. },
  1642. };
  1643. </script>
  1644. <style>
  1645. page {
  1646. background: #eaeef1;
  1647. }
  1648. </style>
  1649. <style lang="scss" scoped>
  1650. @import "./index.scss";
  1651. @import "./quill.core";
  1652. .oldPageJump {
  1653. margin-top: 20rpx;
  1654. border: 1rpx solid #eee;
  1655. border-left: none;
  1656. border-right: none;
  1657. padding: 20rpx 24rpx;
  1658. &>h4 {
  1659. margin-bottom: 10rpx;
  1660. font-weight: 400;
  1661. }
  1662. ul {
  1663. padding-left: 0rpx;
  1664. li {
  1665. list-style: none;
  1666. margin-bottom: 10rpx;
  1667. font-weight: bold;
  1668. }
  1669. }
  1670. p {
  1671. margin-bottom: 10rpx;
  1672. }
  1673. }
  1674. </style>