detail.vue 15 KB

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