detail.vue 16 KB

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