index.vue 53 KB

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