detail.vue 15 KB

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