detail.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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(listData)">{{ 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. id: null,
  43. img1: '/static/icon/msg_icon1.png',
  44. img2: '/static/icon/msg_icon2.png',
  45. statusGO: true
  46. };
  47. },
  48. onPullDownRefresh() {},
  49. onLoad(option) {
  50. this.id = Number(option.id);
  51. },
  52. onShow() {
  53. this.getInfo();
  54. /* if(this.current === 2 && this.$method.isLogin()){
  55. this.$refs.refMy.init();
  56. } */
  57. },
  58. onShareAppMessage(res) {
  59. var self = this;
  60. return {
  61. title: '中正',
  62. path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
  63. };
  64. },
  65. methods: {
  66. //跳转页面
  67. jumpFuns(item) {
  68. switch (item.remindId) {
  69. case 1:
  70. case 3:
  71. case 5:
  72. case 6:
  73. case 7:
  74. case 19:
  75. case 21:
  76. case 22:
  77. case 23:
  78. case 10:
  79. case 12:
  80. case 18:
  81. this.$navTo.togo('/pages2/wd/course', {
  82. id: item.goodsId,
  83. gid: item.gradeId
  84. });
  85. // arsty = '立刻学习';
  86. break;
  87. case 2:
  88. case 4:
  89. this.$navTo.togo('/pages2/verify/input', {
  90. id: item.goodsId
  91. });
  92. break;
  93. case 24:
  94. this.$navTo.togo('/pages2/verify/input2', {
  95. id: item.goodsId
  96. });
  97. break;
  98. case 11:
  99. case 13:
  100. var data = {
  101. goodsId: item.goodsId,
  102. gradeId: item.gradeId
  103. };
  104. this.$api.getApplysubscribe(data).then(res => {
  105. if (res.data.code === 500) {
  106. uni.showModal({
  107. showCancel: false,
  108. content: res.data.msg
  109. });
  110. }
  111. if (res.data.code === 200) {
  112. this.$navTo.togo('/pages2/appointment/index', {
  113. goodsId: item.goodsId,
  114. gradeId: item.gradeId
  115. });
  116. }
  117. });
  118. break;
  119. case 20:
  120. this.$navTo.togo('/pages3/course/detail', {
  121. id: item.goodsId
  122. });
  123. break;
  124. default:
  125. break;
  126. }
  127. },
  128. //跳转节视频
  129. jumpSection(item) {
  130. item.noteSecond = Number(item.topicNum) * 60; //转秒数
  131. this.$navTo.togo('/pages3/polyv/detail', {
  132. id: item.courseId,
  133. goodsId: item.goodsId,
  134. noteSecond: item.noteSecond,
  135. sectionId: item.sectionId,
  136. recordingUrl: item.recordingUrl
  137. });
  138. },
  139. //跳转题库题目
  140. jumpExam(item) {
  141. console.log(item);
  142. uni.navigateTo({
  143. url:
  144. '/pages2/bank/questionBank?current=' +
  145. (item.topicNum - 1) +
  146. '&id=' +
  147. item.examId +
  148. '&goodsid=' +
  149. item.goodsId +
  150. '&chapterId=' +
  151. item.moduleId +
  152. '&moduleId=' +
  153. item.moduleId
  154. });
  155. },
  156. isOk() {
  157. this.$api.courseappinformUser({ id: this.listData.id, receiptStatus: 1 }).then(res => {
  158. if (res.data.code === 200) {
  159. uni.navigateBack({
  160. delta: 1
  161. });
  162. }
  163. });
  164. },
  165. backPage() {
  166. uni.navigateBack({
  167. delta: 1
  168. });
  169. },
  170. getInfo() {
  171. this.$api.getappinformUserId(this.id).then(res => {
  172. if (res.data.code === 200) {
  173. if (res.data.data.receiptStatus === 1 && (res.data.data.remindId === 2 || res.data.data.remindId === 4 || res.data.data.remindId === 24)) {
  174. this.$api.getbaseprofiletpgetInfo({ goodsId: res.data.data.goodsId }).then(k => {
  175. if ((k.data.data.status === 3 && k.data.data.changeStatus === 2) || k.data.data.status === 2 || k.data.data.status === 1) {
  176. this.statusGO = false;
  177. }
  178. });
  179. }
  180. if (!res.data.data.receiptStatus) {
  181. this.$api.courseappinformUser({ id: res.data.data.id, receiptStatus: 1 }).then(res => {
  182. if (res.data.code === 200) {
  183. }
  184. });
  185. }
  186. if (res.data.data.informVo && res.data.data.informVo.affiche) {
  187. res.data.data.informVo.affiche = res.data.data.informVo.affiche.replace(/<img/gi, '<img style="max-width:100%;"');
  188. }
  189. this.listData = res.data.data;
  190. this.$api.goodsDetail(res.data.data.goodsId).then(rs => {
  191. if (
  192. rs.data.data.goodsType === 3 &&
  193. (res.data.data.remindId === 1 ||
  194. res.data.data.remindId === 3 ||
  195. res.data.data.remindId === 5 ||
  196. res.data.data.remindId === 6 ||
  197. res.data.data.remindId === 7 ||
  198. res.data.data.remindId === 19 ||
  199. res.data.data.remindId === 21 ||
  200. res.data.data.remindId === 22)
  201. ) {
  202. this.statusGO = false;
  203. }
  204. });
  205. }
  206. });
  207. },
  208. change(index) {
  209. this.current = index;
  210. },
  211. getNames(int) {
  212. var arsty = '';
  213. switch (int) {
  214. case 1:
  215. case 3:
  216. case 5:
  217. case 6:
  218. case 7:
  219. case 19:
  220. case 21:
  221. case 22:
  222. case 23:
  223. arsty = '立刻学习';
  224. break;
  225. case 2:
  226. case 4:
  227. case 24:
  228. arsty = '马上填写';
  229. break;
  230. case 10:
  231. case 12:
  232. case 18:
  233. arsty = '立即重学';
  234. break;
  235. case 11:
  236. arsty = '立即预约';
  237. break;
  238. case 13:
  239. arsty = '预约考试';
  240. break;
  241. case 20:
  242. arsty = '重新购买';
  243. break;
  244. default:
  245. break;
  246. }
  247. return arsty;
  248. }
  249. },
  250. onReachBottom() {},
  251. computed: { ...mapGetters(['userInfo']) },
  252. onUnload() {
  253. var pages = getCurrentPages();
  254. var currPage = pages[pages.length - 1]; //当前页面
  255. var prePage = pages[pages.length - 2]; //上一个页面
  256. //调用上一页拉取数据的方法
  257. if (prePage.route == 'pages2/msg/index') {
  258. prePage.$vm.getChangeData(this.id);
  259. }
  260. }
  261. };
  262. </script>
  263. <style>
  264. page {
  265. background: #eaeef1;
  266. }
  267. </style>
  268. <style scoped>
  269. .lsow:last-child {
  270. border-bottom: none !important;
  271. }
  272. .timeStys {
  273. margin: 0rpx 6rpx;
  274. color: #007aff;
  275. font-size: 28rpx;
  276. font-weight: bold;
  277. border-bottom: 1rpx solid #007aff;
  278. }
  279. .h4 {
  280. color: #333;
  281. font-size: 28rpx;
  282. font-weight: bold;
  283. }
  284. .aSty {
  285. color: #999;
  286. font-size: 24rpx;
  287. margin-left: 8rpx;
  288. }
  289. .h33 {
  290. font-size: 28rpx;
  291. color: #666;
  292. }
  293. .content {
  294. font-size: 28rpx;
  295. color: #666666;
  296. line-height: 36rpx;
  297. }
  298. .time {
  299. font-size: 24rpx;
  300. color: #999999;
  301. margin: 15rpx 0;
  302. }
  303. .btn1 {
  304. width: 526rpx;
  305. height: 80rpx;
  306. background: #007aff;
  307. border-radius: 40rpx;
  308. color: #ffffff;
  309. font-size: 30rpx;
  310. font-weight: bold;
  311. text-align: center;
  312. line-height: 80rpx;
  313. margin: 30rpx auto;
  314. }
  315. .item {
  316. width: 100%;
  317. background: #ffffff;
  318. border-radius: 16rpx;
  319. padding: 15rpx;
  320. }
  321. .title {
  322. font-size: 30rpx;
  323. font-weight: bold;
  324. color: #333333;
  325. }
  326. </style>