detail.vue 17 KB

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