detail.vue 11 KB

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