index.vue 54 KB

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