detail.vue 15 KB

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