detail.vue 13 KB

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