index.vue 44 KB

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