index.vue 53 KB

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