index.vue 50 KB

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