index.vue 53 KB

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