index.vue 60 KB

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