detail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  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. goodsType: item.goodsType
  289. });
  290. break;
  291. default:
  292. break;
  293. }
  294. },
  295. toLive(item) {
  296. this.$api.courseCourseList({
  297. pageNum: 1,
  298. pageSize: 1,
  299. goodsId: item.goodsId,
  300. gradeId: 0,
  301. orderGoodsId: this.orderGoodsId,
  302. }).then(res => {
  303. if (res.data.code == 200) {
  304. if(res.data.total > 1) {
  305. // uni.navigateTo({
  306. // url:'/pages5/liveDetail/course?orderGoodsId='+this.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0'
  307. // })
  308. uni.navigateTo({
  309. url:'/pages3/live/detail?orderGoodsId='+this.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0&courseId=""'
  310. })
  311. } else if(res.data.total == 1) {
  312. uni.navigateTo({
  313. url:'/pages3/live/detail?orderGoodsId='+this.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0&courseId='+ res.data.rows[0].courseId
  314. })
  315. } else {
  316. uni.showToast({
  317. icon:'none',
  318. title:'暂无可观看的直播课程'
  319. })
  320. }
  321. }
  322. })
  323. },
  324. /**
  325. * @param {Object} goodsId 商品id
  326. * 查询商品重修状态
  327. */
  328. courseGoodsRebuildStatus(goodsId,gradeId) {
  329. return new Promise(resolve => {
  330. this.$api.courseGoodsRebuildStatus({
  331. goodsId:goodsId,
  332. gradeId:gradeId
  333. }).then(res => {
  334. resolve(res.data.data)
  335. })
  336. })
  337. },
  338. //跳转节视频
  339. jumpSection(item) {
  340. console.log(item)
  341. item.noteSecond = Number(item.topicNum) * 60; //转秒数
  342. this.$navTo.togo('/pages3/polyv/detail', {
  343. id: item.courseId,
  344. goodsId: item.goodsId,
  345. noteSecond: item.noteSecond,
  346. sectionId: item.sectionId,
  347. recordingUrl: item.recordingUrl,
  348. moduleId:item.moduleId || 0,
  349. chapterId:item.chapterId || 0,
  350. orderGoodsId: this.orderGoodsId,
  351. gradeId: item.gradeId,
  352. });
  353. },
  354. //跳转题库题目
  355. jumpExam(item) {
  356. console.log(item);
  357. uni.navigateTo({
  358. url:
  359. '/pages2/bank/questionBank?current=' +
  360. (item.topicNum - 1) +
  361. '&id=' +
  362. item.examId +
  363. '&goodsid=' +
  364. item.goodsId +
  365. '&chapterId=' +
  366. item.moduleId +
  367. '&moduleId=' +
  368. item.moduleId
  369. });
  370. },
  371. isOk() {
  372. this.$api.courseappinformUser({ id: this.listData.id, receiptStatus: 1 }).then(res => {
  373. if (res.data.code === 200) {
  374. uni.navigateBack({
  375. delta: 1
  376. });
  377. }
  378. });
  379. },
  380. backPage() {
  381. uni.navigateBack({
  382. delta: 1
  383. });
  384. },
  385. getInfo() {
  386. // /app/informUser/' + data,
  387. this.$api.getappinformUserId(this.id).then(res => {
  388. if (res.data.code === 200) {
  389. if (res.data.data.receiptStatus === 1 && (res.data.data.remindId === 2 || res.data.data.remindId === 4 || res.data.data.remindId === 24)) {
  390. this.$api.getbaseprofiletpgetInfo({ goodsId: res.data.data.goodsId }).then(k => {
  391. if ((k.data.data.status === 3 && k.data.data.changeStatus === 2) || k.data.data.status === 2 || k.data.data.status === 1) {
  392. this.statusGO = false;
  393. }
  394. });
  395. }
  396. if (!res.data.data.receiptStatus) {
  397. this.$api.courseappinformUser({ id: res.data.data.id, receiptStatus: 1 }).then(res => {
  398. if (res.data.code === 200) {
  399. }
  400. });
  401. }
  402. if (res.data.data.informVo && res.data.data.informVo.affiche) {
  403. res.data.data.informVo.affiche = res.data.data.informVo.affiche.replace(/<img/gi, '<img style="max-width:100%;"');
  404. }
  405. this.listData = res.data.data;
  406. console.log('listDatalistData:', this.listData)
  407. if(res.data.data.goodsId) {
  408. if(res.data.data.gradeId) {
  409. // /goods/'+ data,
  410. this.$api.goodsDetail(res.data.data.goodsId).then(rs => {
  411. this.goodsData = rs.data.data
  412. if (
  413. rs.data.data.goodsType === 3 &&
  414. (res.data.data.remindId === 1 ||
  415. res.data.data.remindId === 3 ||
  416. res.data.data.remindId === 5 ||
  417. res.data.data.remindId === 6 ||
  418. res.data.data.remindId === 7 ||
  419. res.data.data.remindId === 19 ||
  420. res.data.data.remindId === 21 ||
  421. res.data.data.remindId === 22)
  422. ) {
  423. this.statusGO = false;
  424. }
  425. });
  426. } else {
  427. this.$api.commonGoodsDetail(res.data.data.goodsId).then(rs => {
  428. this.goodsData = rs.data.data
  429. if (
  430. rs.data.data.goodsType === 3 &&
  431. (res.data.data.remindId === 1 ||
  432. res.data.data.remindId === 3 ||
  433. res.data.data.remindId === 5 ||
  434. res.data.data.remindId === 6 ||
  435. res.data.data.remindId === 7 ||
  436. res.data.data.remindId === 19 ||
  437. res.data.data.remindId === 21 ||
  438. res.data.data.remindId === 22)
  439. ) {
  440. this.statusGO = false;
  441. }
  442. });
  443. }
  444. }
  445. }
  446. });
  447. },
  448. change(index) {
  449. this.current = index;
  450. },
  451. getNames(int) {
  452. var arsty = '';
  453. switch (int) {
  454. case 1:
  455. case 3:
  456. case 5:
  457. case 6:
  458. case 7:
  459. case 19:
  460. case 21:
  461. case 22:
  462. case 23:
  463. case 28:
  464. case 29:
  465. case 31:
  466. case 32:
  467. arsty = '立刻学习';
  468. break;
  469. case 2:
  470. case 4:
  471. case 24:
  472. arsty = '马上填写';
  473. break;
  474. case 10:
  475. case 12:
  476. case 18:
  477. arsty = '立即重学';
  478. break;
  479. case 11:
  480. arsty = '立即预约';
  481. break;
  482. case 13:
  483. arsty = '预约考试';
  484. break;
  485. case 20:
  486. arsty = '重新购买';
  487. break;
  488. default:
  489. break;
  490. }
  491. return arsty;
  492. }
  493. },
  494. onReachBottom() {},
  495. computed: { ...mapGetters(['userInfo']) },
  496. onUnload() {
  497. var pages = getCurrentPages();
  498. var currPage = pages[pages.length - 1]; //当前页面
  499. var prePage = pages[pages.length - 2]; //上一个页面
  500. //调用上一页拉取数据的方法
  501. if (prePage.route == 'pages2/msg/index') {
  502. prePage.$vm.getChangeData(this.id);
  503. }
  504. }
  505. };
  506. </script>
  507. <style>
  508. page {
  509. background: #eaeef1;
  510. }
  511. </style>
  512. <style scoped>
  513. .lsow:last-child {
  514. border-bottom: none !important;
  515. }
  516. .timeStys {
  517. margin: 0rpx 6rpx;
  518. color: #007aff;
  519. font-size: 28rpx;
  520. font-weight: bold;
  521. border-bottom: 1rpx solid #007aff;
  522. }
  523. .h4 {
  524. color: #333;
  525. font-size: 28rpx;
  526. font-weight: bold;
  527. }
  528. .aSty {
  529. color: #999;
  530. font-size: 24rpx;
  531. margin-left: 8rpx;
  532. }
  533. .h33 {
  534. font-size: 28rpx;
  535. color: #666;
  536. }
  537. .content {
  538. font-size: 28rpx;
  539. color: #666666;
  540. line-height: 36rpx;
  541. }
  542. .time {
  543. font-size: 24rpx;
  544. color: #999999;
  545. margin: 15rpx 0;
  546. }
  547. .btn1 {
  548. width: 526rpx;
  549. height: 80rpx;
  550. background: #007aff;
  551. border-radius: 40rpx;
  552. color: #ffffff;
  553. font-size: 30rpx;
  554. font-weight: bold;
  555. text-align: center;
  556. line-height: 80rpx;
  557. margin: 30rpx auto;
  558. }
  559. .item {
  560. width: 100%;
  561. background: #ffffff;
  562. border-radius: 16rpx;
  563. padding: 15rpx;
  564. }
  565. .title {
  566. font-size: 30rpx;
  567. font-weight: bold;
  568. color: #333333;
  569. }
  570. </style>