detail.vue 16 KB

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