detail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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">
  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">第{{ 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. this.$api.goodsDetail(res.data.data.goodsId).then(rs => {
  283. this.goodsData = rs.data.data
  284. if (
  285. rs.data.data.goodsType === 3 &&
  286. (res.data.data.remindId === 1 ||
  287. res.data.data.remindId === 3 ||
  288. res.data.data.remindId === 5 ||
  289. res.data.data.remindId === 6 ||
  290. res.data.data.remindId === 7 ||
  291. res.data.data.remindId === 19 ||
  292. res.data.data.remindId === 21 ||
  293. res.data.data.remindId === 22)
  294. ) {
  295. this.statusGO = false;
  296. }
  297. });
  298. }
  299. });
  300. },
  301. change(index) {
  302. this.current = index;
  303. },
  304. getNames(int) {
  305. var arsty = '';
  306. switch (int) {
  307. case 1:
  308. case 3:
  309. case 5:
  310. case 6:
  311. case 7:
  312. case 19:
  313. case 21:
  314. case 22:
  315. case 23:
  316. arsty = '立刻学习';
  317. break;
  318. case 2:
  319. case 4:
  320. case 24:
  321. arsty = '马上填写';
  322. break;
  323. case 10:
  324. case 12:
  325. case 18:
  326. arsty = '立即重学';
  327. break;
  328. case 11:
  329. arsty = '立即预约';
  330. break;
  331. case 13:
  332. arsty = '预约考试';
  333. break;
  334. case 20:
  335. arsty = '重新购买';
  336. break;
  337. default:
  338. break;
  339. }
  340. return arsty;
  341. }
  342. },
  343. onReachBottom() {},
  344. computed: { ...mapGetters(['userInfo']) },
  345. onUnload() {
  346. var pages = getCurrentPages();
  347. var currPage = pages[pages.length - 1]; //当前页面
  348. var prePage = pages[pages.length - 2]; //上一个页面
  349. //调用上一页拉取数据的方法
  350. if (prePage.route == 'pages2/msg/index') {
  351. prePage.$vm.getChangeData(this.id);
  352. }
  353. }
  354. };
  355. </script>
  356. <style>
  357. page {
  358. background: #eaeef1;
  359. }
  360. </style>
  361. <style scoped>
  362. .lsow:last-child {
  363. border-bottom: none !important;
  364. }
  365. .timeStys {
  366. margin: 0rpx 6rpx;
  367. color: #007aff;
  368. font-size: 28rpx;
  369. font-weight: bold;
  370. border-bottom: 1rpx solid #007aff;
  371. }
  372. .h4 {
  373. color: #333;
  374. font-size: 28rpx;
  375. font-weight: bold;
  376. }
  377. .aSty {
  378. color: #999;
  379. font-size: 24rpx;
  380. margin-left: 8rpx;
  381. }
  382. .h33 {
  383. font-size: 28rpx;
  384. color: #666;
  385. }
  386. .content {
  387. font-size: 28rpx;
  388. color: #666666;
  389. line-height: 36rpx;
  390. }
  391. .time {
  392. font-size: 24rpx;
  393. color: #999999;
  394. margin: 15rpx 0;
  395. }
  396. .btn1 {
  397. width: 526rpx;
  398. height: 80rpx;
  399. background: #007aff;
  400. border-radius: 40rpx;
  401. color: #ffffff;
  402. font-size: 30rpx;
  403. font-weight: bold;
  404. text-align: center;
  405. line-height: 80rpx;
  406. margin: 30rpx auto;
  407. }
  408. .item {
  409. width: 100%;
  410. background: #ffffff;
  411. border-radius: 16rpx;
  412. padding: 15rpx;
  413. }
  414. .title {
  415. font-size: 30rpx;
  416. font-weight: bold;
  417. color: #333333;
  418. }
  419. </style>