index.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546
  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. let playSource = 2;
  873. if (item.externalLinkStatus) {
  874. this.$method.toLink(item.externalLink);
  875. return;
  876. }
  877. if (item.goodsType == 6) {
  878. // 进入直播课
  879. this.toLive(item);
  880. return;
  881. }
  882. // 进入视频课
  883. this.activeItem = item;
  884. if (item.interfaceAccountId > 0) {
  885. //学习账号已开通
  886. if (item.learnStatus > 0) {
  887. //跳转第三方h5
  888. if (playSource == 1) {
  889. uni.navigateTo({
  890. url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&isOther=1`,
  891. });
  892. } else {
  893. // #ifdef H5
  894. uni.navigateTo({
  895. url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&isOther=1`,
  896. });
  897. // #endif
  898. // #ifdef MP-WEIXIN
  899. this.$api
  900. .courseSkipPort()
  901. .then((res) => {
  902. let obj = {
  903. goodsId: item.goodsId,
  904. orderGoodsId: item.orderGoodsId,
  905. gradeId: item.gradeId,
  906. isOther: 1,
  907. skipPort: res.data.data.skipPort
  908. }
  909. let webViewUrl = encodeURIComponent('http://192.168.1.213:8081' +
  910. '/pages3/polyv/detail?obj=' +
  911. JSON.stringify(obj))
  912. uni.navigateTo({
  913. url: `/pages5/webview/detaillink?url=${webViewUrl}`
  914. })
  915. })
  916. // #endif
  917. }
  918. return;
  919. } else {
  920. const text = this.eduPhone ? ",有疑问,请联系" + this.eduPhone : "";
  921. uni.showModal({
  922. showCancel: false,
  923. content: "您的学习账号未开通,请稍后再尝试" + text,
  924. });
  925. return;
  926. }
  927. return;
  928. }
  929. if (
  930. item.serviceStartTime &&
  931. (this.sysTime <= item.serviceStartTime ||
  932. this.sysTime >= item.serviceEndTime)
  933. ) {
  934. uni.showToast({
  935. icon: "none",
  936. title: "不在学习服务期,不能进入学习",
  937. });
  938. return;
  939. }
  940. if (
  941. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  942. (item.classEndTime && this.sysTime >= item.classEndTime)
  943. ) {
  944. uni.showToast({
  945. icon: "none",
  946. title: "不在班级有效期,不能进入学习",
  947. });
  948. return;
  949. }
  950. // learningStatus: 1即刻,2待定,3不在日期内
  951. if (item.learningStatus == 2) {
  952. uni.showToast({
  953. icon: "none",
  954. title: "开放学习时间待定,不能进入学习",
  955. });
  956. return;
  957. }
  958. if (item.classStatus == 0) {
  959. uni.showToast({
  960. icon: "none",
  961. title: "尚未开班,不能进入学习",
  962. });
  963. return;
  964. }
  965. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  966. uni.showToast({
  967. icon: "none",
  968. title: "不在开放学习时间,不能进入学习",
  969. });
  970. return;
  971. }
  972. uni.showLoading({
  973. title: "拼命加载中...",
  974. mask: true,
  975. });
  976. // var confirmDetail = true;
  977. // if (item.educationName == "继续教育") {
  978. // if (
  979. // item.officialName &&
  980. // item.businessName == "二级" &&
  981. // item.projectName == "建造师"
  982. // ) {
  983. // confirmDetail = await this.userConfirmInfoDetail();
  984. // }
  985. // }
  986. // if (!confirmDetail) {
  987. // return;
  988. // }
  989. this.itemIndex = index;
  990. if (
  991. item.gradeStatus == 1 &&
  992. item.status == 1 &&
  993. item.serviceEndTime > this.sysTime &&
  994. item.classEndTime &&
  995. item.classEndTime < this.sysTime &&
  996. (item.periodStatus == 0 || item.periodStatus == -1) &&
  997. item.studyCount > 0
  998. ) {
  999. this.selectClass(item, index, "loading");
  1000. return;
  1001. }
  1002. // /course/goodsRebuildStatus查询用户商品重修状态
  1003. let rebuildStatus = await this.courseGoodsRebuildStatus(
  1004. item.goodsId,
  1005. item.gradeId
  1006. );
  1007. if (rebuildStatus == 0) {
  1008. uni.hideLoading();
  1009. this.$navTo.togo("/pages2/learn/details", {
  1010. gradeId: item.gradeId,
  1011. goodsId: item.goodsId,
  1012. orderGoodsId: item.orderGoodsId,
  1013. });
  1014. return;
  1015. }
  1016. this.$method.checkLock().then(() => {
  1017. this.$http({
  1018. url: "/course/courseList",
  1019. method: "get",
  1020. data: {
  1021. pageNum: 1,
  1022. pageSize: 100,
  1023. goodsId: item.goodsId,
  1024. gradeId: item.gradeId,
  1025. orderGoodsId: item.orderGoodsId,
  1026. },
  1027. noLoading: true,
  1028. }).then((res) => {
  1029. if (res.data.code == 200) {
  1030. if (res.data.total > 1) {
  1031. if (playSource == 1) {
  1032. uni.navigateTo({
  1033. url: `/pages3/polyv/detail?id=''&goodsId=${
  1034. item.goodsId
  1035. }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1036. item.gradeId
  1037. }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
  1038. item.orderYear ? 1 : ""
  1039. }`,
  1040. });
  1041. } else {
  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. let obj = {
  1058. id: '',
  1059. goodsId: item.goodsId,
  1060. orderGoodsId: item.orderGoodsId,
  1061. gradeId: item.gradeId,
  1062. periodWaitTime: item.periodWaitTime ? 1 : "",
  1063. isQ: item.orderYear ? 1 : "",
  1064. skipPort: res.data.data.skipPort
  1065. }
  1066. let webViewUrl = encodeURIComponent(
  1067. 'http://192.168.1.213:8081' +
  1068. '/pages3/polyv/detail?obj=' +
  1069. JSON.stringify(obj))
  1070. uni.navigateTo({
  1071. url: `/pages5/webview/detaillink?url=${webViewUrl}`
  1072. })
  1073. })
  1074. // #endif
  1075. }
  1076. } else if (res.data.total == 1) {
  1077. if (playSource == 1) {
  1078. uni.navigateTo({
  1079. url: `/pages3/polyv/detail?id=${
  1080. res.data.rows[0].courseId
  1081. }&goodsId=${item.goodsId}&orderGoodsId=${
  1082. item.orderGoodsId
  1083. }&gradeId=${item.gradeId}&periodWaitTime=${
  1084. item.periodWaitTime ? "" : 1
  1085. }&isQ=${item.orderYear ? 1 : ""}`,
  1086. });
  1087. } else {
  1088. // #ifdef H5
  1089. uni.navigateTo({
  1090. url: `/pages3/polyv/detail?id=${
  1091. res.data.rows[0].courseId
  1092. }&goodsId=${item.goodsId}&orderGoodsId=${
  1093. item.orderGoodsId
  1094. }&gradeId=${item.gradeId}&periodWaitTime=${
  1095. item.periodWaitTime ? "" : 1
  1096. }&isQ=${item.orderYear ? 1 : ""}`,
  1097. });
  1098. // #endif
  1099. // #ifdef MP-WEIXIN
  1100. this.$api
  1101. .courseSkipPort()
  1102. .then((resForDetail) => {
  1103. let obj = {
  1104. id: res.data.rows[0].courseId,
  1105. goodsId: item.goodsId,
  1106. orderGoodsId: item.orderGoodsId,
  1107. gradeId: item.gradeId,
  1108. periodWaitTime: item.periodWaitTime ? "" : 1,
  1109. isQ: item.orderYear ? 1 : "",
  1110. skipPort: resForDetail.data.data.skipPort
  1111. }
  1112. let webViewUrl = encodeURIComponent(
  1113. 'http://192.168.1.213:8081' +
  1114. '/pages3/polyv/detail?obj=' +
  1115. JSON.stringify(obj))
  1116. uni.navigateTo({
  1117. url: `/pages5/webview/detaillink?url=${webViewUrl}`
  1118. })
  1119. })
  1120. // #endif
  1121. }
  1122. } else {
  1123. uni.showToast({
  1124. icon: "none",
  1125. title: "暂无可观看的视频课程",
  1126. });
  1127. }
  1128. }
  1129. });
  1130. });
  1131. },
  1132. toDetail() {
  1133. this.$http({
  1134. url: "/course/courseList",
  1135. method: "get",
  1136. data: {
  1137. pageNum: 1,
  1138. pageSize: 100,
  1139. goodsId: item.goodsId,
  1140. gradeId: item.gradeId,
  1141. orderGoodsId: item.orderGoodsId,
  1142. },
  1143. noLoading: true,
  1144. }).then((res) => {
  1145. if (res.data.code == 200) {
  1146. if (res.data.total > 1) {
  1147. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  1148. uni.navigateTo({
  1149. url: `/pages3/polyv/detail?id=''&goodsId=${
  1150. item.goodsId
  1151. }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1152. item.gradeId
  1153. }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
  1154. });
  1155. } else if (res.data.total == 1) {
  1156. uni.navigateTo({
  1157. url: `/pages3/polyv/detail?id=${
  1158. res.data.rows[0].courseId
  1159. }&goodsId=${item.goodsId}&orderGoodsId=${
  1160. item.orderGoodsId
  1161. }&gradeId=${item.gradeId}&periodWaitTime=${
  1162. item.periodWaitTime ? "" : 1
  1163. }`,
  1164. });
  1165. } else {
  1166. uni.showToast({
  1167. icon: "none",
  1168. title: "暂无可观看的视频课程",
  1169. });
  1170. }
  1171. }
  1172. });
  1173. },
  1174. toInput(item) {
  1175. this.$navTo.togo("/pages2/verify/input", {
  1176. id: item.goodsId,
  1177. orderGoodsId: item.orderGoodsId,
  1178. gradeId: item.gradeId,
  1179. type: 1,
  1180. });
  1181. },
  1182. /**
  1183. * @param {Object} goodsId 商品id
  1184. * 查询商品重修状态
  1185. */
  1186. courseGoodsRebuildStatus(goodsId, gradeId) {
  1187. return new Promise((resolve) => {
  1188. this.$http({
  1189. url: "/course/goodsRebuildStatus",
  1190. method: "get",
  1191. data: {
  1192. goodsId: goodsId,
  1193. gradeId: gradeId,
  1194. },
  1195. noLoading: true,
  1196. compleLoading: true, // 请求成功是否还要继续显示加载中
  1197. }).then((res) => {
  1198. resolve(res.data.data);
  1199. });
  1200. });
  1201. },
  1202. userConfirmInfoDetail() {
  1203. return new Promise((resolve) => {
  1204. this.$http({
  1205. url: "/user/confirm/info/detail",
  1206. method: "get",
  1207. data: {
  1208. orderGoodsId: this.activeItem.orderGoodsId
  1209. },
  1210. noLoading: true,
  1211. }).then((res) => {
  1212. if (!res.data.data) {
  1213. clearInterval(this.confirmTimer);
  1214. this.confirmCount = 10;
  1215. this.showUserConfirmInfo = true;
  1216. this.confirmTimer = setInterval(() => {
  1217. if (this.confirmCount > 0) {
  1218. this.confirmCount--;
  1219. } else {
  1220. clearInterval(this.confirmTimer);
  1221. }
  1222. }, 1000);
  1223. } else {
  1224. if (res.data.data.pushInfo) {
  1225. resolve(true);
  1226. } else {
  1227. const text = this.eduPhone ?
  1228. ",有疑问,请联系" + this.eduPhone :
  1229. "";
  1230. uni.showModal({
  1231. showCancel: false,
  1232. title: "提示",
  1233. content: "开通信息推送不成功,无法进入学习" + text,
  1234. });
  1235. resolve(false);
  1236. }
  1237. }
  1238. });
  1239. });
  1240. },
  1241. selectClass(item, index, load) {
  1242. this.itemIndex = index;
  1243. this.selectItem = item;
  1244. this.selectClassModal = true;
  1245. this.goodsGradeList(item.goodsId, load);
  1246. },
  1247. goodsGradeList(id, load) {
  1248. this.$http({
  1249. url: "/grade/grade/list",
  1250. method: "get",
  1251. data: {
  1252. goodsId: id
  1253. },
  1254. noLoading: load ? true : false,
  1255. }).then((res) => {
  1256. if (res.data.code == 200) {
  1257. this.gradeList = res.data.rows;
  1258. if (this.gradeList.length == 0) {
  1259. let item = {
  1260. className: "系统分班",
  1261. gradeId: 0,
  1262. };
  1263. this.gradeList.push(item);
  1264. } else {
  1265. let isGradeFull = this.gradeList.every(
  1266. (item) =>
  1267. item.studentNum > 0 && item.studentNum == item.studentUpper
  1268. );
  1269. //所有班级都满了
  1270. if (isGradeFull) {
  1271. let item = {
  1272. className: "系统分班",
  1273. gradeId: 0,
  1274. };
  1275. this.gradeList.unshift(item);
  1276. }
  1277. }
  1278. }
  1279. });
  1280. },
  1281. radioGroupChange(e) {
  1282. // console.log(e)
  1283. },
  1284. okPopup() {
  1285. if (this.gradeValue == -1) {
  1286. uni.showToast({
  1287. icon: "none",
  1288. title: "请选择班级",
  1289. });
  1290. return;
  1291. }
  1292. this.$api
  1293. .changeGrade({
  1294. goodsId: this.selectItem.goodsId,
  1295. gradeId: this.gradeValue,
  1296. oldGradeId: this.selectItem.gradeId,
  1297. orderGoodsId: this.selectItem.orderGoodsId,
  1298. userId: this.selectItem.userId,
  1299. })
  1300. .then((res) => {
  1301. if (res.data.code == 200) {
  1302. if (this.itemIndex !== "") {
  1303. this.refreshByIndex();
  1304. }
  1305. this.selectClassModal = false;
  1306. uni.showToast({
  1307. title: "选班成功",
  1308. });
  1309. } else {
  1310. uni.showToast({
  1311. icon: "none",
  1312. title: res.data.msg,
  1313. });
  1314. }
  1315. });
  1316. },
  1317. /**
  1318. * 返回刷新之前进入的课程数据
  1319. */
  1320. refreshByIndex() {
  1321. this.$api
  1322. .listUserVideoLive({
  1323. pageNum: this.itemIndex + 1,
  1324. pageSize: 1,
  1325. })
  1326. .then((res) => {
  1327. if (res.data.code == 200) {
  1328. this.$set(this.courseLists, this.itemIndex, res.data.rows[0]);
  1329. }
  1330. });
  1331. },
  1332. confirmUserConfirm() {
  1333. this.$refs.uModal.clearLoading();
  1334. if (this.confirmCount <= 0) {
  1335. if (this.confirmChecked) {
  1336. let infoJson = {
  1337. realname: this.userInfo.realname,
  1338. idCard: this.userInfo.idCard,
  1339. telphone: this.userInfo.telphone,
  1340. };
  1341. this.$api
  1342. .userConfirminfo({
  1343. orderGoodsId: this.activeItem.orderGoodsId,
  1344. infoJson: JSON.stringify(infoJson),
  1345. })
  1346. .then((res) => {
  1347. if (res.data.code != 200) {
  1348. this.showUserConfirmInfo = false;
  1349. uni.showToast({
  1350. icon: "none",
  1351. title: res.data.msg,
  1352. });
  1353. return;
  1354. }
  1355. if (res.data.data.pushInfo) {
  1356. uni.showToast({
  1357. icon: "none",
  1358. title: "提交成功",
  1359. });
  1360. } else {
  1361. const text = this.eduPhone ?
  1362. ",有疑问,请联系" + this.eduPhone :
  1363. "";
  1364. uni.showModal({
  1365. showCancel: false,
  1366. title: "提示",
  1367. content: "开通信息推送不成功,无法进入学!" + text,
  1368. });
  1369. }
  1370. this.showUserConfirmInfo = false;
  1371. });
  1372. } else {
  1373. uni.showToast({
  1374. icon: "none",
  1375. title: "请勾选确认个人信息无误",
  1376. });
  1377. }
  1378. } else {
  1379. return;
  1380. }
  1381. },
  1382. cancelUserConfirm() {
  1383. clearInterval(this.confirmTimer);
  1384. },
  1385. call() {
  1386. // #ifdef MP-WEIXIN
  1387. uni.makePhoneCall({
  1388. phoneNumber: "020-87085982", //仅为示例
  1389. });
  1390. // #endif
  1391. },
  1392. closePop() {
  1393. this.appointTestShow = false;
  1394. },
  1395. jumpTest(appoint) {
  1396. this.$api
  1397. .getExamTip()
  1398. .then((res) => {
  1399. this.nodesCcontent = res.data.data.value;
  1400. this.appoint = appoint;
  1401. this.showTip = true;
  1402. })
  1403. .catch(() => {
  1404. this.appoint_an(appoint);
  1405. this.appointTestShow = false;
  1406. });
  1407. },
  1408. confirmTip() {
  1409. this.showTip = false;
  1410. this.appointTestShow = false;
  1411. this.appoint_an(this.appoint);
  1412. },
  1413. toBuyQuestionBank(item) {
  1414. this.$api.goodsDetail(item.questionGoodsId).then((res) => {
  1415. this.$store.commit("setShoppingCartList", {
  1416. shoppingCartList: [{
  1417. relevanceId: item.orderGoodsId,
  1418. ...res.data.data
  1419. }, ],
  1420. });
  1421. this.$navTo.togo("/pages2/order/confirm_pay");
  1422. });
  1423. },
  1424. appointment(item) {
  1425. if (item.subscribeSign == 4) {
  1426. this.$navTo.togo("/pages2/exam/exam_appointment");
  1427. return;
  1428. }
  1429. this.appointItemIndex = item;
  1430. this.appointTestList = item.examApplyGoodsList;
  1431. this.appointTestShow = true;
  1432. if (item.examApplyGoodsList.length >= 1) {
  1433. // 多个考试预约
  1434. this.appointTestList = item.examApplyGoodsList;
  1435. this.appointTestShow = true;
  1436. return;
  1437. }
  1438. // let appoint_item = item.examApplyGoodsList[0];
  1439. // this.appoint_an(appoint_item);
  1440. },
  1441. appoint_an(appoint) {
  1442. const {
  1443. goodsId,
  1444. gradeId,
  1445. orderGoodsId
  1446. } = this.appointItemIndex;
  1447. var data = {
  1448. goodsId,
  1449. gradeId,
  1450. applyId: appoint.applyId,
  1451. orderGoodsId,
  1452. };
  1453. this.$api.getApplysubscribe(data).then((res) => {
  1454. if (res.data.code === 500) {
  1455. uni.showModal({
  1456. showCancel: false,
  1457. content: res.data.msg,
  1458. });
  1459. }
  1460. if (res.data.code === 200) {
  1461. this.$navTo.togo("/pages2/appointment/index", {
  1462. goodsId,
  1463. gradeId,
  1464. orderGoodsId,
  1465. applyId: appoint.applyId,
  1466. });
  1467. }
  1468. });
  1469. },
  1470. // 进入刷题,调整小程序
  1471. appBeforeAddress(goodsId, item) {
  1472. this.$api
  1473. .appBeforeAddress({
  1474. orderGoodsId: item.orderGoodsId,
  1475. })
  1476. .then((res) => {
  1477. if (res.data.code == 200) {
  1478. uni.navigateToMiniProgram({
  1479. appId: res.data.data.url,
  1480. success(res) {
  1481. // 打开成功
  1482. },
  1483. });
  1484. } else {
  1485. uni.showModal({
  1486. title: "提示",
  1487. content: res.data.msg,
  1488. showCancel: false,
  1489. });
  1490. }
  1491. });
  1492. },
  1493. },
  1494. };
  1495. </script>
  1496. <style>
  1497. page {
  1498. background: #eaeef1;
  1499. }
  1500. </style>
  1501. <style lang="scss" scoped>
  1502. @import "./index.scss";
  1503. @import "./quill.core";
  1504. .oldPageJump {
  1505. margin-top: 20rpx;
  1506. border: 1rpx solid #eee;
  1507. border-left: none;
  1508. border-right: none;
  1509. padding: 20rpx 24rpx;
  1510. &>h4 {
  1511. margin-bottom: 10rpx;
  1512. font-weight: 400;
  1513. }
  1514. ul {
  1515. padding-left: 0rpx;
  1516. li {
  1517. list-style: none;
  1518. margin-bottom: 10rpx;
  1519. font-weight: bold;
  1520. }
  1521. }
  1522. p {
  1523. margin-bottom: 10rpx;
  1524. }
  1525. }
  1526. </style>