detail.vue 16 KB

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