detail.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. <template>
  2. <view>
  3. <nav-bar title="消息详情"></nav-bar>
  4. <view class="item">
  5. <view class="title">{{ getTitleName() }}</view>
  6. <view class="time">{{
  7. $method.timestampToTime(listData.sendTime, false)
  8. }}</view>
  9. <view
  10. v-if="listData.systemStatus === 2"
  11. class="content"
  12. v-html="listData.informVo.affiche"
  13. style="width: 100%"
  14. ></view>
  15. <view
  16. v-if="listData.systemStatus === 1"
  17. class="content"
  18. style="width: 100%"
  19. >{{ listData.text }}</view
  20. >
  21. <view class="boxstistyle" v-if="listData.informVo">
  22. <view
  23. class="lsow"
  24. style="border-bottom: 1rpx solid #eee; margin-top: 10rpx"
  25. v-for="(item, index) in listData.informVo.informCourseVo"
  26. :key="index"
  27. >
  28. <view class="h4">{{ item.goodsName }}</view>
  29. <view class="h33">
  30. {{ item.courseName
  31. }}{{ item.moduleName ? "/" + item.moduleName : ""
  32. }}{{ item.chapterName ? "/" + item.chapterName : ""
  33. }}{{ item.sectionName }}
  34. </view>
  35. <view
  36. style="display: flex; align-items: center; margin: 28rpx 0rpx"
  37. @click="jumpSection(item)"
  38. >
  39. <image
  40. style="width: 35rpx; height: 35rpx"
  41. src="@/static/courseIcon.png"
  42. mode=""
  43. ></image>
  44. <text class="timeStys">{{
  45. $method.secondToTime(item.topicNum, false)
  46. }}</text>
  47. <text class="aSty">点击可直接跳转</text>
  48. </view>
  49. </view>
  50. <view
  51. class="lsow"
  52. style="border-bottom: 1rpx solid #eee; margin-top: 10rpx"
  53. v-for="(item, index) in listData.informVo.informExamVo"
  54. :key="index"
  55. >
  56. <view class="h4">{{ item.goodsName }}</view>
  57. <view class="h33"
  58. >{{ item.moduleName ? "/" + item.moduleName : ""
  59. }}{{ item.chapterName ? "/" + item.chapterName : ""
  60. }}{{ item.examName }}</view
  61. >
  62. <view
  63. style="display: flex; align-items: center; margin: 28rpx 0rpx"
  64. @click="jumpExam(item)"
  65. >
  66. <image
  67. style="width: 35rpx; height: 35rpx"
  68. src="@/static/examIcon.png"
  69. mode=""
  70. ></image>
  71. <text class="timeStys">第{{ item.topicNum }}道题</text>
  72. <text class="aSty">点击可直接跳转</text>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <view
  78. class="btn1"
  79. @click="isOk"
  80. v-if="listData.systemStatus === 2 && listData.receiptStatus === 0"
  81. >我已阅读</view
  82. >
  83. <view
  84. class="btn1"
  85. v-if="
  86. statusGO &&
  87. listData.systemStatus === 1 &&
  88. getNames(listData.remindId) !== ''
  89. "
  90. @click="jumpFuns(goodsData, listData.remindId)"
  91. >{{ getNames(listData.remindId) }}</view
  92. >
  93. </view>
  94. </template>
  95. <script>
  96. import { mapGetters } from "vuex";
  97. export default {
  98. components: {},
  99. data() {
  100. return {
  101. listData: {},
  102. goodsData: {},
  103. sysTime: 0,
  104. id: null,
  105. img1: "/static/icon/msg_icon1.png",
  106. img2: "/static/icon/msg_icon2.png",
  107. statusGO: true,
  108. orderGoodsId: 0,
  109. };
  110. },
  111. onPullDownRefresh() {},
  112. onLoad(option) {
  113. this.sysTime = this.$method.timest();
  114. this.id = Number(option.id);
  115. this.orderGoodsId = option.orderGoodsId;
  116. },
  117. onShow() {
  118. this.getInfo();
  119. /* if(this.current === 2 && this.$method.isLogin()){
  120. this.$refs.refMy.init();
  121. } */
  122. },
  123. onShareAppMessage(res) {
  124. var self = this;
  125. return {
  126. title: "中正",
  127. path:
  128. `/pages/index/index?inviteCode=` + userInfo == null
  129. ? ""
  130. : userInfo.userAccount,
  131. };
  132. },
  133. methods: {
  134. getTitleName() {
  135. // 28-已开通商品课程2天后学员未上课,29-已开通商品课程5天后学员未上课,31-近3天学员没有学习,32-近5天学员没有学习
  136. if ([28, 29, 31, 32].includes(+this.listData.remindId)) {
  137. // 要先判断督学消息的显示
  138. return this.listData.remind;
  139. } else {
  140. return this.listData.systemStatus === 2
  141. ? this.listData.informVo.informName
  142. : this.listData.systemStatus === 1
  143. ? this.listData.remind
  144. : "";
  145. }
  146. },
  147. /**
  148. * 获取系统当前时间
  149. */
  150. commonSystemTime() {
  151. this.$api.commonSystemTime().then((res) => {
  152. this.sysTime = res.data.data;
  153. });
  154. },
  155. //跳转页面
  156. async jumpFuns(item, remindId) {
  157. console.log("======items", item);
  158. switch (remindId) {
  159. case 1:
  160. case 3:
  161. case 5:
  162. case 6:
  163. case 7:
  164. case 19:
  165. case 21:
  166. case 22:
  167. case 23:
  168. case 10:
  169. case 12:
  170. case 18:
  171. case 28:
  172. case 29:
  173. case 31:
  174. case 32:
  175. //课程
  176. if (item.goodsType == 1) {
  177. this.$api
  178. .orderInfo({
  179. orderGoodsId: this.orderGoodsId,
  180. })
  181. .then(async (res) => {
  182. console.log(res);
  183. let item = res.data.data;
  184. let currentTime = this.$method.timest();
  185. console.log(currentTime);
  186. console.log(item);
  187. console.log(item.serviceStartTime);
  188. console.log(item.serviceEndTime);
  189. console.log(
  190. currentTime < item.serviceStartTime ||
  191. currentTime > item.serviceEndTime
  192. );
  193. //内部系统
  194. if (item.interfacePushId > 0 && item.officialStatus != 1) {
  195. // ,有疑问请联系020-87085982
  196. uni.showModal({
  197. showCancel: false,
  198. content: "机构正在为您报名中,请耐心等待!",
  199. });
  200. return;
  201. }
  202. if (
  203. this.sysTime <= item.serviceStartTime ||
  204. this.sysTime >= item.serviceEndTime
  205. ) {
  206. uni.showToast({
  207. icon: "none",
  208. title: "不在学习服务期,不能进入学习",
  209. });
  210. return;
  211. }
  212. if (
  213. (item.classStartTime &&
  214. this.sysTime <= item.classStartTime) ||
  215. (item.classEndTime && this.sysTime >= item.classEndTime)
  216. ) {
  217. uni.showToast({
  218. icon: "none",
  219. title: "不在班级有效期,不能进入学习",
  220. });
  221. return;
  222. }
  223. if (item.learningStatus == 2) {
  224. uni.showToast({
  225. icon: "none",
  226. title: "开放学习时间待定,不能进入学习",
  227. });
  228. return;
  229. }
  230. if (item.classStatus == 0) {
  231. uni.showToast({
  232. icon: "none",
  233. title: "尚未开班,不能进入学习",
  234. });
  235. return;
  236. }
  237. console.log(this.sysTime, item.learningTimeStart);
  238. console.log(this.sysTime < item.learningTimeStart);
  239. if (
  240. item.learningStatus == 3 &&
  241. this.sysTime < item.learningTimeStart
  242. ) {
  243. uni.showToast({
  244. icon: "none",
  245. title: "不在开放学习时间,不能进入学习",
  246. });
  247. return;
  248. }
  249. if (
  250. item.gradeStatus == 1 &&
  251. item.status == 1 &&
  252. item.serviceEndTime > this.sysTime &&
  253. item.classEndTime &&
  254. item.classEndTime < this.sysTime &&
  255. (item.periodStatus == 0 || item.periodStatus == -1) &&
  256. item.studyCount > 0
  257. ) {
  258. uni.showModal({
  259. title: "提示",
  260. content: "班级有效期已过期,请选择班级",
  261. success: (res) => {
  262. if (res.confirm) {
  263. uni.navigateTo({
  264. url: "../wd/class",
  265. });
  266. }
  267. },
  268. });
  269. return;
  270. }
  271. let rebuildStatus = await this.courseGoodsRebuildStatus(
  272. item.goodsId,
  273. item.gradeId
  274. );
  275. if (rebuildStatus == 0) {
  276. this.$navTo.togo("/pages2/learn/details", {
  277. gradeId: item.gradeId,
  278. goodsId: item.goodsId,
  279. orderGoodsId: this.orderGoodsId,
  280. });
  281. return;
  282. }
  283. this.$api
  284. .courseCourseList({
  285. pageNum: 1,
  286. pageSize: 1,
  287. goodsId: item.goodsId,
  288. gradeId: item.gradeId,
  289. orderGoodsId: this.orderGoodsId,
  290. })
  291. .then((res) => {
  292. if (res.data.code == 200) {
  293. if (res.data.total > 1) {
  294. // this.$navTo.togo(`/pages2/wd/course?id=${item.goodsId}&gid=${item.gradeId}&orderGoodsId=${this.orderGoodsId}`);
  295. uni.navigateTo({
  296. url: `/pages3/polyv/detail?id=''&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`,
  297. });
  298. } else if (res.data.total == 1) {
  299. uni.navigateTo({
  300. url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${item.gradeId}`,
  301. });
  302. } else {
  303. uni.showToast({
  304. icon: "none",
  305. title: "暂无可观看的视频课程",
  306. });
  307. }
  308. }
  309. });
  310. // if(item.courseNum == 1 ) {
  311. // this.$api.courseCourseList({
  312. // pageNum:1,
  313. // pageSize:1,
  314. // goodsId:item.goodsId,
  315. // gradeId:item.gradeId
  316. // }).then(res => {
  317. // if(res.data.code == 200) {
  318. // uni.navigateTo({
  319. // url:`/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}`
  320. // })
  321. // }
  322. // });
  323. // return;
  324. // }
  325. // this.$navTo.togo('/pages2/wd/course', {
  326. // id: item.goodsId,
  327. // gid: item.gradeId
  328. // });
  329. });
  330. // arsty = '立刻学习';
  331. //题库
  332. } else if (item.goodsType == 2) {
  333. // this.$navTo.togo('/pages2/bank/question_detail', {
  334. // id: item.goodsId
  335. // });
  336. uni.navigateTo({
  337. url:
  338. "/pages2/bank/question_detail?id=" +
  339. item.goodsId +
  340. "&orderGoodsId=" +
  341. this.orderGoodsId,
  342. });
  343. } else if (item.goodsType == 6) {
  344. // 进入直播课
  345. this.toLive(item);
  346. }
  347. break;
  348. case 2:
  349. case 4:
  350. this.$navTo.togo("/pages2/verify/input", {
  351. id: item.goodsId,
  352. });
  353. break;
  354. case 24:
  355. this.$navTo.togo("/pages2/verify/input2", {
  356. id: item.goodsId,
  357. });
  358. break;
  359. case 11:
  360. case 13:
  361. var data = {
  362. goodsId: item.goodsId,
  363. gradeId: item.gradeId,
  364. };
  365. this.$api.getApplysubscribe(data).then((res) => {
  366. if (res.data.code === 500) {
  367. uni.showModal({
  368. showCancel: false,
  369. content: res.data.msg,
  370. });
  371. }
  372. if (res.data.code === 200) {
  373. // 725,645,2232
  374. this.$navTo.togo("/pages2/appointment/index", {
  375. goodsId: item.goodsId,
  376. gradeId: item.gradeId,
  377. orderGoodsId: this.orderGoodsId,
  378. });
  379. }
  380. });
  381. break;
  382. case 20:
  383. this.$navTo.togo("/pages3/course/detail", {
  384. id: item.goodsId,
  385. goodsType: item.goodsType,
  386. });
  387. break;
  388. default:
  389. break;
  390. }
  391. },
  392. toLive(item) {
  393. this.$api
  394. .courseCourseList({
  395. pageNum: 1,
  396. pageSize: 1,
  397. goodsId: item.goodsId,
  398. gradeId: 0,
  399. orderGoodsId: this.orderGoodsId,
  400. })
  401. .then((res) => {
  402. if (res.data.code == 200) {
  403. if (res.data.total > 1) {
  404. // uni.navigateTo({
  405. // url:'/pages5/liveDetail/course?orderGoodsId='+this.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0'
  406. // })
  407. uni.navigateTo({
  408. url:
  409. "/pages3/live/detail?orderGoodsId=" +
  410. this.orderGoodsId +
  411. "&goodsId=" +
  412. item.goodsId +
  413. '&gradeId=0&courseId=""',
  414. });
  415. } else if (res.data.total == 1) {
  416. uni.navigateTo({
  417. url:
  418. "/pages3/live/detail?orderGoodsId=" +
  419. this.orderGoodsId +
  420. "&goodsId=" +
  421. item.goodsId +
  422. "&gradeId=0&courseId=" +
  423. res.data.rows[0].courseId,
  424. });
  425. } else {
  426. uni.showToast({
  427. icon: "none",
  428. title: "暂无可观看的直播课程",
  429. });
  430. }
  431. }
  432. });
  433. },
  434. /**
  435. * @param {Object} goodsId 商品id
  436. * 查询商品重修状态
  437. */
  438. courseGoodsRebuildStatus(goodsId, gradeId) {
  439. return new Promise((resolve) => {
  440. this.$api
  441. .courseGoodsRebuildStatus({
  442. goodsId: goodsId,
  443. gradeId: gradeId,
  444. })
  445. .then((res) => {
  446. resolve(res.data.data);
  447. });
  448. });
  449. },
  450. //跳转节视频
  451. jumpSection(item) {
  452. console.log(item);
  453. item.noteSecond = Number(item.topicNum) * 60; //转秒数
  454. this.$navTo.togo("/pages3/polyv/detail", {
  455. id: item.courseId,
  456. goodsId: item.goodsId,
  457. noteSecond: item.noteSecond,
  458. sectionId: item.sectionId,
  459. recordingUrl: item.recordingUrl,
  460. moduleId: item.moduleId || 0,
  461. chapterId: item.chapterId || 0,
  462. orderGoodsId: this.orderGoodsId,
  463. gradeId: item.gradeId,
  464. });
  465. },
  466. //跳转题库题目
  467. jumpExam(item) {
  468. console.log(item);
  469. uni.navigateTo({
  470. url:
  471. "/pages2/bank/questionBank?current=" +
  472. (item.topicNum - 1) +
  473. "&id=" +
  474. item.examId +
  475. "&goodsid=" +
  476. item.goodsId +
  477. "&chapterId=" +
  478. item.moduleId +
  479. "&moduleId=" +
  480. item.moduleId,
  481. });
  482. },
  483. isOk() {
  484. this.$api
  485. .courseappinformUser({ id: this.listData.id, receiptStatus: 1 })
  486. .then((res) => {
  487. if (res.data.code === 200) {
  488. uni.navigateBack({
  489. delta: 1,
  490. });
  491. }
  492. });
  493. },
  494. backPage() {
  495. uni.navigateBack({
  496. delta: 1,
  497. });
  498. },
  499. getInfo() {
  500. // /app/informUser/' + data,
  501. this.$api.getappinformUserId(this.id).then((res) => {
  502. if (res.data.code === 200) {
  503. if (
  504. res.data.data.receiptStatus === 1 &&
  505. (res.data.data.remindId === 2 ||
  506. res.data.data.remindId === 4 ||
  507. res.data.data.remindId === 24)
  508. ) {
  509. this.$api
  510. .getbaseprofiletpgetInfo({ goodsId: res.data.data.goodsId })
  511. .then((k) => {
  512. if (
  513. (k.data.data.status === 3 &&
  514. k.data.data.changeStatus === 2) ||
  515. k.data.data.status === 2 ||
  516. k.data.data.status === 1
  517. ) {
  518. this.statusGO = false;
  519. }
  520. });
  521. }
  522. if (!res.data.data.receiptStatus) {
  523. this.$api
  524. .courseappinformUser({ id: res.data.data.id, receiptStatus: 1 })
  525. .then((res) => {
  526. if (res.data.code === 200) {
  527. }
  528. });
  529. }
  530. if (res.data.data.informVo && res.data.data.informVo.affiche) {
  531. res.data.data.informVo.affiche =
  532. res.data.data.informVo.affiche.replace(
  533. /<img/gi,
  534. '<img style="max-width:100%;"'
  535. );
  536. }
  537. this.listData = res.data.data;
  538. console.log("listDatalistData:", this.listData);
  539. if (res.data.data.goodsId) {
  540. if (res.data.data.gradeId) {
  541. // /goods/'+ data,
  542. this.$api.goodsDetail(res.data.data.goodsId).then((rs) => {
  543. this.goodsData = rs.data.data;
  544. if (
  545. rs.data.data.goodsType === 3 &&
  546. (res.data.data.remindId === 1 ||
  547. res.data.data.remindId === 3 ||
  548. res.data.data.remindId === 5 ||
  549. res.data.data.remindId === 6 ||
  550. res.data.data.remindId === 7 ||
  551. res.data.data.remindId === 19 ||
  552. res.data.data.remindId === 21 ||
  553. res.data.data.remindId === 22)
  554. ) {
  555. this.statusGO = false;
  556. }
  557. });
  558. } else {
  559. this.$api.commonGoodsDetail(res.data.data.goodsId).then((rs) => {
  560. this.goodsData = rs.data.data;
  561. if (
  562. rs.data.data.goodsType === 3 &&
  563. (res.data.data.remindId === 1 ||
  564. res.data.data.remindId === 3 ||
  565. res.data.data.remindId === 5 ||
  566. res.data.data.remindId === 6 ||
  567. res.data.data.remindId === 7 ||
  568. res.data.data.remindId === 19 ||
  569. res.data.data.remindId === 21 ||
  570. res.data.data.remindId === 22)
  571. ) {
  572. this.statusGO = false;
  573. }
  574. });
  575. }
  576. }
  577. }
  578. });
  579. },
  580. change(index) {
  581. this.current = index;
  582. },
  583. getNames(int) {
  584. var arsty = "";
  585. switch (int) {
  586. case 1:
  587. case 3:
  588. case 5:
  589. case 6:
  590. case 7:
  591. case 19:
  592. case 21:
  593. case 22:
  594. case 23:
  595. case 28:
  596. case 29:
  597. case 31:
  598. case 32:
  599. arsty = "立刻学习";
  600. break;
  601. case 2:
  602. case 4:
  603. case 24:
  604. arsty = "马上填写";
  605. break;
  606. case 10:
  607. case 12:
  608. case 18:
  609. arsty = "立即重学";
  610. break;
  611. case 11:
  612. arsty = "立即预约";
  613. break;
  614. case 13:
  615. arsty = "预约考试";
  616. break;
  617. case 20:
  618. arsty = "重新购买";
  619. break;
  620. default:
  621. break;
  622. }
  623. return arsty;
  624. },
  625. },
  626. onReachBottom() {},
  627. computed: { ...mapGetters(["userInfo"]) },
  628. onUnload() {
  629. var pages = getCurrentPages();
  630. var currPage = pages[pages.length - 1]; //当前页面
  631. var prePage = pages[pages.length - 2]; //上一个页面
  632. //调用上一页拉取数据的方法
  633. if (prePage.route == "pages2/msg/index") {
  634. prePage.$vm.getChangeData(this.id);
  635. }
  636. },
  637. };
  638. </script>
  639. <style>
  640. page {
  641. background: #eaeef1;
  642. }
  643. </style>
  644. <style scoped>
  645. .lsow:last-child {
  646. border-bottom: none !important;
  647. }
  648. .timeStys {
  649. margin: 0rpx 6rpx;
  650. color: #007aff;
  651. font-size: 28rpx;
  652. font-weight: bold;
  653. border-bottom: 1rpx solid #007aff;
  654. }
  655. .h4 {
  656. color: #333;
  657. font-size: 28rpx;
  658. font-weight: bold;
  659. }
  660. .aSty {
  661. color: #999;
  662. font-size: 24rpx;
  663. margin-left: 8rpx;
  664. }
  665. .h33 {
  666. font-size: 28rpx;
  667. color: #666;
  668. }
  669. .content {
  670. font-size: 28rpx;
  671. color: #666666;
  672. line-height: 36rpx;
  673. }
  674. .time {
  675. font-size: 24rpx;
  676. color: #999999;
  677. margin: 15rpx 0;
  678. }
  679. .btn1 {
  680. width: 526rpx;
  681. height: 80rpx;
  682. background: #007aff;
  683. border-radius: 40rpx;
  684. color: #ffffff;
  685. font-size: 30rpx;
  686. font-weight: bold;
  687. text-align: center;
  688. line-height: 80rpx;
  689. margin: 30rpx auto;
  690. }
  691. .item {
  692. width: 100%;
  693. background: #ffffff;
  694. border-radius: 16rpx;
  695. padding: 15rpx;
  696. }
  697. .title {
  698. font-size: 30rpx;
  699. font-weight: bold;
  700. color: #333333;
  701. }
  702. </style>