index.vue 46 KB

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