detail.vue 16 KB

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