detail.vue 11 KB

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