index.vue 48 KB

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