index.vue 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680
  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="isMajorEducation(item)">
  302. <span v-if="item.sevenPushReason === '培训周期时间未到'">
  303. 温馨提示:您{{item.orderYear}}年{{ item.major }}培训周期还没到,请在{{ $method.timestampToTime(item.sevenPushDate) }}后再进行继教。
  304. </span>
  305. <span v-if="item.sevenPushReason === '无相关专业专书'">
  306. 温馨提示:您当前的课程{{item.orderYear}}年{{ item.major }},未能匹配到可继教证书,可前往住建证书官网查询。
  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}}年{{ item.major }}已完成继教,无需重复继教,可前往住建证书官网查询。
  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. isMajorEducation() {
  679. return function(item) {
  680. return (
  681. item.projectName + item.educationName ===
  682. "施工现场专业人员继续教育"
  683. );
  684. }
  685. },
  686. },
  687. async onLoad(options) {
  688. uni.hideTabBar();
  689. this.leftDays = 1668873600 - parseInt(curTime / 1000);
  690. this.sysTime = +this.$method.timest();
  691. if (options.skipPort) {
  692. await this.$method.skipLogin(options.skipPort);
  693. }
  694. if (this.$method.isLogin()) {
  695. !this.userInfo && this.$api.refreshUserInfo();
  696. }
  697. },
  698. onShow() {
  699. uni.pageScrollTo({
  700. duration: 0,
  701. scrollTop: 0, // number number number!
  702. });
  703. // #ifdef H5
  704. this.getCourseoldgoodslist()
  705. // #endif
  706. this.getCourseLiveQues();
  707. },
  708. onPullDownRefresh() {
  709. this.getCourseLiveQues();
  710. },
  711. onPageScroll(e) {
  712. if (e.scrollTop > 100) {
  713. this.backTopBtn = true
  714. } else {
  715. this.backTopBtn = false
  716. }
  717. },
  718. onReachBottom() {
  719. if (this.courseLists.length < this.total) {
  720. this.paramC.pageNum++;
  721. this.getCourseList();
  722. }
  723. },
  724. methods: {
  725. ...mapActions(["getUserInfo"]),
  726. sevenFunc(item) {
  727. return (
  728. item.educationName == "继续教育" &&
  729. item.projectName == "施工现场专业人员"
  730. );
  731. },
  732. goPage(url, type) {
  733. if (type == 1) {
  734. window.location.href = url
  735. }
  736. if (type == 2) {
  737. uni.setClipboardData({
  738. data: url,
  739. success: function() {
  740. console.log('复制成功');
  741. }
  742. })
  743. }
  744. },
  745. getCourseoldgoodslist() {
  746. if (!this.$method.isLogin()) {
  747. return;
  748. }
  749. this.$api.courseoldgoodslist().then(res => {
  750. if (res.data.data && res.data.data.goodsNames.length > 3) {
  751. res.data.data.goodsNames.splice(3, res.data.data.goodsNames.length, "...");
  752. }
  753. this.oldPageJumpData = res.data.data || null
  754. })
  755. },
  756. bgShow(liveTime, watchStatus) {
  757. let value = liveTime * 1000;
  758. if (curTime > value) {
  759. // 判断当前时间和直播开始时间
  760. return watchStatus == "live" ? true : false;
  761. }
  762. },
  763. lookTimeStatus(liveTime, watchStatus) {
  764. if (liveTime) {
  765. let value = new Date(liveTime * 1000);
  766. var Y = value.getFullYear();
  767. var M =
  768. value.getMonth() + 1 < 10 ?
  769. "0" + (value.getMonth() + 1) :
  770. value.getMonth() + 1;
  771. var D = value.getDate() < 10 ? "0" + value.getDate() : value.getDate();
  772. var valZ = Y + "/" + M + "/" + D;
  773. let curZeroTime = new Date(valZ).getTime(); // 获取开始直播时间当天的零点时间戳
  774. if (curTime > value) {
  775. // 判断当前时间和直播开始时间
  776. if (watchStatus == "live") {
  777. //
  778. return 1;
  779. } else {
  780. return 2;
  781. }
  782. } else {
  783. if (curZeroTime <= curTime && curTime <= value) {
  784. //当天
  785. return 3;
  786. } else {
  787. return 4;
  788. }
  789. }
  790. }
  791. },
  792. curTimeTamp(liveTime) {
  793. let min = liveTime - parseInt(curTime / 1000);
  794. return min;
  795. },
  796. toSeeClassHours() {
  797. uni.navigateTo({
  798. url: "/pages2/learn/my_learn",
  799. });
  800. },
  801. toChoose() {
  802. this.$store.state.current = 0
  803. uni.switchTab({
  804. url: '/pages/course/index'
  805. });
  806. },
  807. // 查询直播课
  808. getCourseLiveQues() {
  809. if (!this.$method.isLogin()) {
  810. return;
  811. }
  812. this.allLoading = true;
  813. this.paramC.pageNum = 1;
  814. let arrs = [
  815. this.$api.listUserVideoLive(this.paramC), // 查询用户拥有视频+直播商品 /goods/listUserVideoLive
  816. this.$api.getgoodsLiveList({
  817. pageNum: 1,
  818. pageSize: 3, // 默认3条
  819. }),
  820. ];
  821. wx.stopPullDownRefresh();
  822. Promise.all(arrs)
  823. .then((res) => {
  824. // if (res.data.code == 200) {
  825. const [{
  826. data: res1
  827. }, {
  828. data: res2
  829. }] = res;
  830. if (res1.code == 200) {
  831. this.total = res1.total;
  832. this.courseLists = res1.rows || [];
  833. const goods = this.courseLists.find(
  834. (e) => e.subscribeSign == 1 || e.subscribeSign == 3
  835. );
  836. if (goods) {
  837. let {
  838. goodsName,
  839. subscribeSign
  840. } = goods;
  841. console.log(goods, 'goods')
  842. let text =
  843. `您七大员新考【${goodsName}】课程` +
  844. (subscribeSign == 1 ?
  845. "已学完,可以预约考试了!" :
  846. "课程考试未通过,请重新预约考试!");
  847. uni.showModal({
  848. title: "提示",
  849. content: text,
  850. success: (res) => {
  851. if (res.confirm) {
  852. this.appointment(goods);
  853. }
  854. },
  855. });
  856. }
  857. }
  858. if (res2.code == 200) {
  859. this.livingLists = res2.rows || [];
  860. } else {
  861. this.$u.toast(res2.msg);
  862. }
  863. this.allLoading = false;
  864. this.sysTime = +this.$method.timest();
  865. // }
  866. uni.hideLoading();
  867. })
  868. .catch((err) => {
  869. uni.hideLoading();
  870. this.allLoading = false;
  871. });
  872. },
  873. getCourseList() {
  874. this.$api
  875. .listUserVideoLive(this.paramC)
  876. .then((res) => {
  877. this.courseLists.push(...res.data.rows);
  878. })
  879. .finally((e) => {
  880. uni.hideLoading();
  881. });
  882. },
  883. // 看直播
  884. toLiveLook(item) {
  885. let moduleId = item.moduleId || 0;
  886. let chapterId = item.chapterId || 0;
  887. let sectionId = item.sectionId || item.menuId;
  888. let uuid = new Date().valueOf() + "";
  889. // buyCourse 是否购买课程:1是 0否
  890. let encode = encodeURIComponent(
  891. this.other.hostLive +
  892. "/pages/live/index?token=" +
  893. uni.getStorageSync("token") +
  894. "&userInfo=" +
  895. (JSON.stringify(this.userInfo) || "") +
  896. "&channelId=" +
  897. item.liveUrl +
  898. "&gradeId=" +
  899. 0 +
  900. "&courseId=" +
  901. item.courseId +
  902. "&goodsId=" +
  903. item.goodsId +
  904. "&orderGoodsId=" +
  905. item.orderGoodsId +
  906. "&sectionId=" +
  907. sectionId +
  908. "&chapterId=" +
  909. chapterId +
  910. "&moduleId=" +
  911. moduleId +
  912. "&buyCourse=1" +
  913. "&ident=" +
  914. uuid +
  915. "&sectionType=2"
  916. );
  917. uni.navigateTo({
  918. url: `/pages5/webview/index?url=` + encode,
  919. });
  920. },
  921. toLive(item) {
  922. this.$api
  923. .courseCourseList({
  924. pageNum: 1,
  925. pageSize: 1,
  926. goodsId: item.goodsId,
  927. gradeId: 0,
  928. orderGoodsId: item.orderGoodsId,
  929. })
  930. .then((res) => {
  931. if (res.data.code == 200) {
  932. if (res.data.total > 1) {
  933. // uni.navigateTo({
  934. // url:'/pages5/liveDetail/course?orderGoodsId='+item.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0'
  935. // })
  936. uni.navigateTo({
  937. url: "/pages3/live/detail?orderGoodsId=" +
  938. item.orderGoodsId +
  939. "&goodsId=" +
  940. item.goodsId +
  941. '&gradeId=0&courseId=""',
  942. });
  943. } else if (res.data.total == 1) {
  944. uni.navigateTo({
  945. url: "/pages3/live/detail?orderGoodsId=" +
  946. item.orderGoodsId +
  947. "&goodsId=" +
  948. item.goodsId +
  949. "&gradeId=0&courseId=" +
  950. res.data.rows[0].courseId,
  951. });
  952. } else {
  953. uni.showToast({
  954. icon: "none",
  955. title: "暂无可观看的直播课程",
  956. });
  957. }
  958. }
  959. });
  960. },
  961. async studyIn(v, i, item, index) {
  962. if (item.externalLinkStatus) {
  963. this.$method.toLink(item.externalLink);
  964. return;
  965. }
  966. if (item.goodsType == 6) {
  967. // 进入直播课
  968. this.toLive(item);
  969. return;
  970. }
  971. // 进入视频课
  972. this.activeItem = item;
  973. // let playSource = 1;
  974. // this.$api
  975. // .orderGetViewSign(item.orderGoodsId)
  976. // .then((res) => {
  977. // console.log('学习中心请求的viewSign', res.data.data.viewSign)
  978. // playSource = res.data.data.viewSign;
  979. // })
  980. if (item.interfaceAccountId > 0) {
  981. //学习账号已开通
  982. if (item.learnStatus > 0) {
  983. //跳转第三方h5
  984. // if (playSource == 2) {
  985. // // #ifdef H5
  986. // uni.navigateTo({
  987. // url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&isOther=1`,
  988. // });
  989. // // #endif
  990. // // #ifdef MP-WEIXIN
  991. // this.$api
  992. // .courseSkipPort()
  993. // .then((res) => {
  994. // console.log("请求的域名", res.data.data.domain)
  995. // let obj = {
  996. // goodsId: item.goodsId,
  997. // orderGoodsId: item.orderGoodsId,
  998. // gradeId: item.gradeId,
  999. // isOther: 1,
  1000. // skipPort: res.data.data.skipPort,
  1001. // }
  1002. // let webViewUrl = encodeURIComponent(res.data.data.domain +
  1003. // '/pages3/polyv/detail?obj=' +
  1004. // JSON.stringify(obj))
  1005. // uni.navigateTo({
  1006. // url: `/pages5/webview/detaillink?url=${webViewUrl}`
  1007. // })
  1008. // })
  1009. // // #endif
  1010. // } else {
  1011. // uni.navigateTo({
  1012. // url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&isOther=1`,
  1013. // });
  1014. // }
  1015. uni.navigateTo({
  1016. url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&isOther=1`,
  1017. });
  1018. return;
  1019. } else {
  1020. const text = this.eduPhone ? ",有疑问,请联系" + this.eduPhone : "";
  1021. uni.showModal({
  1022. showCancel: false,
  1023. content: "您的学习账号未开通,请稍后再尝试" + text,
  1024. });
  1025. return;
  1026. }
  1027. return;
  1028. }
  1029. if (
  1030. item.serviceStartTime &&
  1031. (this.sysTime <= item.serviceStartTime ||
  1032. this.sysTime >= item.serviceEndTime)
  1033. ) {
  1034. uni.showToast({
  1035. icon: "none",
  1036. title: "不在学习服务期,不能进入学习",
  1037. });
  1038. return;
  1039. }
  1040. if (
  1041. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  1042. (item.classEndTime && this.sysTime >= item.classEndTime)
  1043. ) {
  1044. uni.showToast({
  1045. icon: "none",
  1046. title: "不在班级有效期,不能进入学习",
  1047. });
  1048. return;
  1049. }
  1050. // learningStatus: 1即刻,2待定,3不在日期内
  1051. if (item.learningStatus == 2) {
  1052. uni.showToast({
  1053. icon: "none",
  1054. title: "开放学习时间待定,不能进入学习",
  1055. });
  1056. return;
  1057. }
  1058. if (item.classStatus == 0) {
  1059. uni.showToast({
  1060. icon: "none",
  1061. title: "尚未开班,不能进入学习",
  1062. });
  1063. return;
  1064. }
  1065. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  1066. uni.showToast({
  1067. icon: "none",
  1068. title: "不在开放学习时间,不能进入学习",
  1069. });
  1070. return;
  1071. }
  1072. uni.showLoading({
  1073. title: "拼命加载中...",
  1074. mask: true,
  1075. });
  1076. // var confirmDetail = true;
  1077. // if (item.educationName == "继续教育") {
  1078. // if (
  1079. // item.officialName &&
  1080. // item.businessName == "二级" &&
  1081. // item.projectName == "建造师"
  1082. // ) {
  1083. // confirmDetail = await this.userConfirmInfoDetail();
  1084. // }
  1085. // }
  1086. // if (!confirmDetail) {
  1087. // return;
  1088. // }
  1089. this.itemIndex = index;
  1090. if (
  1091. item.gradeStatus == 1 &&
  1092. item.status == 1 &&
  1093. item.serviceEndTime > this.sysTime &&
  1094. item.classEndTime &&
  1095. item.classEndTime < this.sysTime &&
  1096. (item.periodStatus == 0 || item.periodStatus == -1) &&
  1097. item.studyCount > 0
  1098. ) {
  1099. this.selectClass(item, index, "loading");
  1100. return;
  1101. }
  1102. // /course/goodsRebuildStatus查询用户商品重修状态
  1103. let rebuildStatus = await this.courseGoodsRebuildStatus(
  1104. item.goodsId,
  1105. item.gradeId
  1106. );
  1107. if (rebuildStatus == 0) {
  1108. uni.hideLoading();
  1109. this.$navTo.togo("/pages2/learn/details", {
  1110. gradeId: item.gradeId,
  1111. goodsId: item.goodsId,
  1112. orderGoodsId: item.orderGoodsId,
  1113. });
  1114. return;
  1115. }
  1116. this.$method.checkLock().then(() => {
  1117. this.$http({
  1118. url: "/course/courseList",
  1119. method: "get",
  1120. data: {
  1121. pageNum: 1,
  1122. pageSize: 100,
  1123. goodsId: item.goodsId,
  1124. gradeId: item.gradeId,
  1125. orderGoodsId: item.orderGoodsId,
  1126. },
  1127. noLoading: true,
  1128. }).then((res) => {
  1129. if (res.data.code == 200) {
  1130. if (res.data.total > 1) {
  1131. // if (playSource == 2) {
  1132. // // #ifdef H5
  1133. // uni.navigateTo({
  1134. // url: `/pages3/polyv/detail?id=''&goodsId=${
  1135. // item.goodsId
  1136. // }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1137. // item.gradeId
  1138. // }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
  1139. // item.orderYear ? 1 : ""
  1140. // }`,
  1141. // });
  1142. // // #endif
  1143. // // #ifdef MP-WEIXIN
  1144. // this.$api
  1145. // .courseSkipPort()
  1146. // .then((res) => {
  1147. // console.log("请求的域名", res.data.data.domain)
  1148. // let obj = {
  1149. // id: '',
  1150. // goodsId: item.goodsId,
  1151. // orderGoodsId: item.orderGoodsId,
  1152. // gradeId: item.gradeId,
  1153. // periodWaitTime: item.periodWaitTime ? 1 : "",
  1154. // isQ: item.orderYear ? 1 : "",
  1155. // skipPort: res.data.data.skipPort
  1156. // }
  1157. // let webViewUrl = encodeURIComponent(
  1158. // res.data.data.domain +
  1159. // '/pages3/polyv/detail?obj=' +
  1160. // JSON.stringify(obj))
  1161. // uni.navigateTo({
  1162. // url: `/pages5/webview/detaillink?url=${webViewUrl}`
  1163. // })
  1164. // })
  1165. // // #endif
  1166. // } else {
  1167. // uni.navigateTo({
  1168. // url: `/pages3/polyv/detail?id=''&goodsId=${
  1169. // item.goodsId
  1170. // }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1171. // item.gradeId
  1172. // }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
  1173. // item.orderYear ? 1 : ""
  1174. // }`,
  1175. // });
  1176. // }
  1177. uni.navigateTo({
  1178. url: `/pages3/polyv/detail?id=''&goodsId=${
  1179. item.goodsId
  1180. }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1181. item.gradeId
  1182. }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
  1183. });
  1184. } else if (res.data.total == 1) {
  1185. // if (playSource == 2) {
  1186. // // #ifdef H5
  1187. // uni.navigateTo({
  1188. // url: ` / pages3 / polyv / detail ? id = $ {
  1189. // res.data.rows[0].courseId
  1190. // }&goodsId=${item.goodsId}&orderGoodsId=${
  1191. // item.orderGoodsId
  1192. // }&gradeId=${item.gradeId}&periodWaitTime=${
  1193. // item.periodWaitTime ? "" : 1
  1194. // }&isQ=${item.orderYear ? 1 : ""}`,
  1195. // });
  1196. // // #endif
  1197. // // #ifdef MP-WEIXIN
  1198. // this.$api
  1199. // .courseSkipPort()
  1200. // .then((resForDetail) => {
  1201. // console.log("请求的域名", resForDetail.data.data.domain)
  1202. // let obj = {
  1203. // id: res.data.rows[0].courseId,
  1204. // goodsId: item.goodsId,
  1205. // orderGoodsId: item.orderGoodsId,
  1206. // gradeId: item.gradeId,
  1207. // periodWaitTime: item.periodWaitTime ? "" : 1,
  1208. // isQ: item.orderYear ? 1 : "",
  1209. // skipPort: resForDetail.data.data.skipPort
  1210. // }
  1211. // let webViewUrl = encodeURIComponent(
  1212. // resForDetail.data.data.domain +
  1213. // '/pages3/polyv/detail?obj=' +
  1214. // JSON.stringify(obj))
  1215. // uni.navigateTo({
  1216. // url: `/pages5/webview/detaillink?url=${webViewUrl}`
  1217. // })
  1218. // })
  1219. // // #endif
  1220. // } else {
  1221. // uni.navigateTo({
  1222. // url: `/pages3/polyv/detail?id=${
  1223. // res.data.rows[0].courseId
  1224. // }&goodsId=${item.goodsId}&orderGoodsId=${
  1225. // item.orderGoodsId
  1226. // }&gradeId=${item.gradeId}&periodWaitTime=${
  1227. // item.periodWaitTime ? "" : 1
  1228. // }&isQ=${item.orderYear ? 1 : ""}`,
  1229. // });
  1230. // }
  1231. uni.navigateTo({
  1232. url: `/pages3/polyv/detail?id=${
  1233. res.data.rows[0].courseId
  1234. }&goodsId=${item.goodsId}&orderGoodsId=${
  1235. item.orderGoodsId
  1236. }&gradeId=${item.gradeId}&periodWaitTime=${
  1237. item.periodWaitTime ? "" : 1
  1238. }`,
  1239. });
  1240. } else {
  1241. uni.showToast({
  1242. icon: "none",
  1243. title: "暂无可观看的视频课程",
  1244. });
  1245. }
  1246. }
  1247. });
  1248. });
  1249. },
  1250. toDetail() {
  1251. this.$http({
  1252. url: "/course/courseList",
  1253. method: "get",
  1254. data: {
  1255. pageNum: 1,
  1256. pageSize: 100,
  1257. goodsId: item.goodsId,
  1258. gradeId: item.gradeId,
  1259. orderGoodsId: item.orderGoodsId,
  1260. },
  1261. noLoading: true,
  1262. }).then((res) => {
  1263. if (res.data.code == 200) {
  1264. if (res.data.total > 1) {
  1265. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  1266. uni.navigateTo({
  1267. url: `/pages3/polyv/detail?id=''&goodsId=${
  1268. item.goodsId
  1269. }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1270. item.gradeId
  1271. }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
  1272. });
  1273. } else if (res.data.total == 1) {
  1274. uni.navigateTo({
  1275. url: `/pages3/polyv/detail?id=${
  1276. res.data.rows[0].courseId
  1277. }&goodsId=${item.goodsId}&orderGoodsId=${
  1278. item.orderGoodsId
  1279. }&gradeId=${item.gradeId}&periodWaitTime=${
  1280. item.periodWaitTime ? "" : 1
  1281. }`,
  1282. });
  1283. } else {
  1284. uni.showToast({
  1285. icon: "none",
  1286. title: "暂无可观看的视频课程",
  1287. });
  1288. }
  1289. }
  1290. });
  1291. },
  1292. toInput(item) {
  1293. this.$navTo.togo("/pages2/verify/input", {
  1294. id: item.goodsId,
  1295. orderGoodsId: item.orderGoodsId,
  1296. gradeId: item.gradeId,
  1297. type: 1,
  1298. });
  1299. },
  1300. /**
  1301. * @param {Object} goodsId 商品id
  1302. * 查询商品重修状态
  1303. */
  1304. courseGoodsRebuildStatus(goodsId, gradeId) {
  1305. return new Promise((resolve) => {
  1306. this.$http({
  1307. url: "/course/goodsRebuildStatus",
  1308. method: "get",
  1309. data: {
  1310. goodsId: goodsId,
  1311. gradeId: gradeId,
  1312. },
  1313. noLoading: true,
  1314. compleLoading: true, // 请求成功是否还要继续显示加载中
  1315. }).then((res) => {
  1316. resolve(res.data.data);
  1317. });
  1318. });
  1319. },
  1320. userConfirmInfoDetail() {
  1321. return new Promise((resolve) => {
  1322. this.$http({
  1323. url: "/user/confirm/info/detail",
  1324. method: "get",
  1325. data: {
  1326. orderGoodsId: this.activeItem.orderGoodsId
  1327. },
  1328. noLoading: true,
  1329. }).then((res) => {
  1330. if (!res.data.data) {
  1331. clearInterval(this.confirmTimer);
  1332. this.confirmCount = 10;
  1333. this.showUserConfirmInfo = true;
  1334. this.confirmTimer = setInterval(() => {
  1335. if (this.confirmCount > 0) {
  1336. this.confirmCount--;
  1337. } else {
  1338. clearInterval(this.confirmTimer);
  1339. }
  1340. }, 1000);
  1341. } else {
  1342. if (res.data.data.pushInfo) {
  1343. resolve(true);
  1344. } else {
  1345. const text = this.eduPhone ?
  1346. ",有疑问,请联系" + this.eduPhone :
  1347. "";
  1348. uni.showModal({
  1349. showCancel: false,
  1350. title: "提示",
  1351. content: "开通信息推送不成功,无法进入学习" + text,
  1352. });
  1353. resolve(false);
  1354. }
  1355. }
  1356. });
  1357. });
  1358. },
  1359. selectClass(item, index, load) {
  1360. this.itemIndex = index;
  1361. this.selectItem = item;
  1362. this.selectClassModal = true;
  1363. this.goodsGradeList(item.goodsId, load);
  1364. },
  1365. goodsGradeList(id, load) {
  1366. this.$http({
  1367. url: "/grade/grade/list",
  1368. method: "get",
  1369. data: {
  1370. goodsId: id
  1371. },
  1372. noLoading: load ? true : false,
  1373. }).then((res) => {
  1374. if (res.data.code == 200) {
  1375. if (res.data.rows && res.data.rows.length > 0) {
  1376. res.data.rows = res.data.rows.filter(i => {
  1377. return !(i.studentNumAll > 0 && i.studentNumAll == i
  1378. .studentUpper)
  1379. })
  1380. }
  1381. this.gradeList = res.data.rows;
  1382. if (this.gradeList.length == 0) {
  1383. let item = {
  1384. className: "系统分班",
  1385. gradeId: 0,
  1386. };
  1387. this.gradeList.push(item);
  1388. } else {
  1389. let isGradeFull = this.gradeList.every(
  1390. (item) =>
  1391. item.studentNumAll > 0 && item.studentNumAll == item
  1392. .studentUpper
  1393. );
  1394. //所有班级都满了
  1395. if (isGradeFull) {
  1396. let item = {
  1397. className: "系统分班",
  1398. gradeId: 0,
  1399. };
  1400. this.gradeList.unshift(item);
  1401. }
  1402. }
  1403. }
  1404. });
  1405. },
  1406. radioGroupChange(e) {
  1407. // console.log(e)
  1408. },
  1409. okPopup() {
  1410. if (this.gradeValue == -1) {
  1411. uni.showToast({
  1412. icon: "none",
  1413. title: "请选择班级",
  1414. });
  1415. return;
  1416. }
  1417. this.$api
  1418. .changeGrade({
  1419. goodsId: this.selectItem.goodsId,
  1420. gradeId: this.gradeValue,
  1421. oldGradeId: this.selectItem.gradeId,
  1422. orderGoodsId: this.selectItem.orderGoodsId,
  1423. userId: this.selectItem.userId,
  1424. })
  1425. .then((res) => {
  1426. if (res.data.code == 200) {
  1427. if (this.itemIndex !== "") {
  1428. this.refreshByIndex();
  1429. }
  1430. this.selectClassModal = false;
  1431. uni.showToast({
  1432. title: "选班成功",
  1433. });
  1434. } else {
  1435. uni.showToast({
  1436. icon: "none",
  1437. title: res.data.msg,
  1438. });
  1439. }
  1440. });
  1441. },
  1442. /**
  1443. * 返回刷新之前进入的课程数据
  1444. */
  1445. refreshByIndex() {
  1446. this.$api
  1447. .listUserVideoLive({
  1448. pageNum: this.itemIndex + 1,
  1449. pageSize: 1,
  1450. })
  1451. .then((res) => {
  1452. if (res.data.code == 200) {
  1453. this.$set(this.courseLists, this.itemIndex, res.data.rows[0]);
  1454. }
  1455. });
  1456. },
  1457. confirmUserConfirm() {
  1458. this.$refs.uModal.clearLoading();
  1459. if (this.confirmCount <= 0) {
  1460. if (this.confirmChecked) {
  1461. let infoJson = {
  1462. realname: this.userInfo.realname,
  1463. idCard: this.userInfo.idCard,
  1464. telphone: this.userInfo.telphone,
  1465. };
  1466. this.$api
  1467. .userConfirminfo({
  1468. orderGoodsId: this.activeItem.orderGoodsId,
  1469. infoJson: JSON.stringify(infoJson),
  1470. })
  1471. .then((res) => {
  1472. if (res.data.code != 200) {
  1473. this.showUserConfirmInfo = false;
  1474. uni.showToast({
  1475. icon: "none",
  1476. title: res.data.msg,
  1477. });
  1478. return;
  1479. }
  1480. if (res.data.data.pushInfo) {
  1481. uni.showToast({
  1482. icon: "none",
  1483. title: "提交成功",
  1484. });
  1485. } else {
  1486. const text = this.eduPhone ?
  1487. ",有疑问,请联系" + this.eduPhone :
  1488. "";
  1489. uni.showModal({
  1490. showCancel: false,
  1491. title: "提示",
  1492. content: "开通信息推送不成功,无法进入学!" + text,
  1493. });
  1494. }
  1495. this.showUserConfirmInfo = false;
  1496. });
  1497. } else {
  1498. uni.showToast({
  1499. icon: "none",
  1500. title: "请勾选确认个人信息无误",
  1501. });
  1502. }
  1503. } else {
  1504. return;
  1505. }
  1506. },
  1507. cancelUserConfirm() {
  1508. clearInterval(this.confirmTimer);
  1509. },
  1510. call() {
  1511. // #ifdef MP-WEIXIN
  1512. uni.makePhoneCall({
  1513. phoneNumber: "020-87085982", //仅为示例
  1514. });
  1515. // #endif
  1516. },
  1517. closePop() {
  1518. this.appointTestShow = false;
  1519. },
  1520. jumpTest(appoint) {
  1521. this.$api
  1522. .getExamTip()
  1523. .then((res) => {
  1524. this.nodesCcontent = res.data.data.value;
  1525. this.appoint = appoint;
  1526. this.showTip = true;
  1527. })
  1528. .catch(() => {
  1529. this.appoint_an(appoint);
  1530. this.appointTestShow = false;
  1531. });
  1532. },
  1533. confirmTip() {
  1534. this.showTip = false;
  1535. this.appointTestShow = false;
  1536. this.appoint_an(this.appoint);
  1537. },
  1538. toBuyQuestionBank(item) {
  1539. this.$api.goodsDetail(item.questionGoodsId).then((res) => {
  1540. this.$store.commit("setShoppingCartList", {
  1541. shoppingCartList: [{
  1542. relevanceId: item.orderGoodsId,
  1543. ...res.data.data
  1544. }, ],
  1545. });
  1546. this.$navTo.togo("/pages2/order/confirm_pay");
  1547. });
  1548. },
  1549. async appointment(item) {
  1550. // #ifdef H5
  1551. const {
  1552. data
  1553. } = await this.$api.courseoldgoodsredirect()
  1554. if (data.data) {
  1555. window.location.href = data.data.h5Url
  1556. return
  1557. }
  1558. // #endif
  1559. if (item.subscribeSign == 4) {
  1560. this.$navTo.togo("/pages2/exam/exam_appointment");
  1561. return;
  1562. }
  1563. this.appointItemIndex = item;
  1564. this.appointTestList = item.examApplyGoodsList;
  1565. this.appointTestShow = true;
  1566. if (item.examApplyGoodsList.length >= 1) {
  1567. // 多个考试预约
  1568. this.appointTestList = item.examApplyGoodsList;
  1569. this.appointTestShow = true;
  1570. return;
  1571. }
  1572. // let appoint_item = item.examApplyGoodsList[0];
  1573. // this.appoint_an(appoint_item);
  1574. },
  1575. appoint_an(appoint) {
  1576. const {
  1577. goodsId,
  1578. gradeId,
  1579. orderGoodsId
  1580. } = this.appointItemIndex;
  1581. var data = {
  1582. goodsId,
  1583. gradeId,
  1584. applyId: appoint.applyId,
  1585. orderGoodsId,
  1586. };
  1587. this.$api.getApplysubscribe(data).then((res) => {
  1588. if (res.data.code === 500) {
  1589. uni.showModal({
  1590. showCancel: false,
  1591. content: res.data.msg,
  1592. });
  1593. }
  1594. if (res.data.code === 200) {
  1595. this.$navTo.togo("/pages2/appointment/index", {
  1596. goodsId,
  1597. gradeId,
  1598. orderGoodsId,
  1599. applyId: appoint.applyId,
  1600. });
  1601. }
  1602. });
  1603. },
  1604. // 进入刷题,调整小程序
  1605. appBeforeAddress(goodsId, item) {
  1606. this.$api
  1607. .appBeforeAddress({
  1608. orderGoodsId: item.orderGoodsId,
  1609. })
  1610. .then((res) => {
  1611. if (res.data.code == 200) {
  1612. uni.navigateToMiniProgram({
  1613. appId: res.data.data.url,
  1614. success(res) {
  1615. // 打开成功
  1616. },
  1617. });
  1618. } else {
  1619. uni.showModal({
  1620. title: "提示",
  1621. content: res.data.msg,
  1622. showCancel: false,
  1623. });
  1624. }
  1625. });
  1626. },
  1627. },
  1628. };
  1629. </script>
  1630. <style>
  1631. page {
  1632. background: #eaeef1;
  1633. }
  1634. </style>
  1635. <style lang="scss" scoped>
  1636. @import "./index.scss";
  1637. @import "./quill.core";
  1638. .oldPageJump {
  1639. margin-top: 20rpx;
  1640. border: 1rpx solid #eee;
  1641. border-left: none;
  1642. border-right: none;
  1643. padding: 20rpx 24rpx;
  1644. &>h4 {
  1645. margin-bottom: 10rpx;
  1646. font-weight: 400;
  1647. }
  1648. ul {
  1649. padding-left: 0rpx;
  1650. li {
  1651. list-style: none;
  1652. margin-bottom: 10rpx;
  1653. font-weight: bold;
  1654. }
  1655. }
  1656. p {
  1657. margin-bottom: 10rpx;
  1658. }
  1659. }
  1660. </style>