detail.vue 12 KB

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