index.vue 44 KB

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