detail.vue 13 KB

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