detail.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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;">
  15. <image style="width: 35rpx;height: 35rpx;" src="@/static/courseIcon.png" mode=""></image>
  16. <text class="timeStys">第{{ item.topicNum }}分钟</text>
  17. <text class="aSty" @click="jumpSection(item)">点击可直接跳转</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;">
  24. <image style="width: 35rpx;height: 35rpx;" src="@/static/examIcon.png" mode=""></image>
  25. <text class="timeStys">第{{ item.topicNum }}道题</text>
  26. <text class="aSty" @click="jumpSection(item)">点击可直接跳转</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="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. };
  46. },
  47. onPullDownRefresh() {},
  48. onLoad(option) {
  49. this.id = Number(option.id);
  50. this.getInfo();
  51. },
  52. onShow() {
  53. /* if(this.current === 2 && this.$method.isLogin()){
  54. this.$refs.refMy.init();
  55. } */
  56. },
  57. onShareAppMessage(res) {
  58. var self = this;
  59. return {
  60. title: '中正',
  61. path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
  62. };
  63. },
  64. methods: {
  65. //跳转页面
  66. jumpFuns(item) {
  67. switch (item.remindId) {
  68. case 1:
  69. case 3:
  70. case 5:
  71. case 6:
  72. case 7:
  73. case 19:
  74. case 21:
  75. case 22:
  76. this.$navTo.togo('/pages2/wd/course', {
  77. id: item.goodsId
  78. });
  79. // arsty = '立刻学习';
  80. break;
  81. case 2:
  82. case 4:
  83. this.$navTo.togo('/pages2/verify/input', {
  84. id: item.goodsId
  85. });
  86. break;
  87. case 10:
  88. case 12:
  89. case 18:
  90. // arsty = '立即重学';
  91. break;
  92. case 11:
  93. case 13:
  94. var data = {
  95. goodsId: item.goodsId,
  96. gradeId: item.gradeId
  97. };
  98. this.$api.getApplysubscribe(data).then(res => {
  99. if (res.data.code === 500) {
  100. uni.showModal({
  101. showCancel: false,
  102. content: res.data.msg
  103. });
  104. }
  105. if (res.data.code === 200) {
  106. this.$navTo.togo('/pages2/appointment/index', {
  107. goodsId: item.goodsId,
  108. gradeId: item.gradeId
  109. });
  110. }
  111. });
  112. break;
  113. case 20:
  114. // arsty = '重新购买';
  115. break;
  116. default:
  117. break;
  118. }
  119. },
  120. //跳转节视频
  121. jumpSection(item) {
  122. console.log(item);
  123. },
  124. //跳转题库题目
  125. jumpExam(item) {
  126. console.log(item);
  127. },
  128. isOk() {
  129. this.$api.courseappinformUser({ id: this.listData.id, receiptStatus: 1 }).then(res => {
  130. if (res.data.code === 200) {
  131. uni.navigateBack({
  132. delta: 1
  133. });
  134. }
  135. });
  136. },
  137. backPage() {
  138. uni.navigateBack({
  139. delta: 1
  140. });
  141. },
  142. getInfo() {
  143. this.$api.getappinformUserId(this.id).then(res => {
  144. if (res.data.code === 200) {
  145. if (!res.data.data.receiptStatus) {
  146. this.$api.courseappinformUser({ id: res.data.data.id, receiptStatus: 1 }).then(res => {
  147. if (res.data.code === 200) {
  148. }
  149. });
  150. }
  151. if (res.data.data.informVo && res.data.data.informVo.affiche) {
  152. res.data.data.informVo.affiche = res.data.data.informVo.affiche.replace(/<img/gi, '<img style="max-width:100%;"');
  153. }
  154. this.listData = res.data.data;
  155. }
  156. });
  157. },
  158. change(index) {
  159. this.current = index;
  160. },
  161. getNames(int) {
  162. var arsty = '';
  163. switch (int) {
  164. case 1:
  165. case 3:
  166. case 5:
  167. case 6:
  168. case 7:
  169. case 19:
  170. case 21:
  171. case 22:
  172. arsty = '立刻学习';
  173. break;
  174. case 2:
  175. case 4:
  176. arsty = '马上填写';
  177. break;
  178. case 10:
  179. case 12:
  180. case 18:
  181. arsty = '立即重学';
  182. break;
  183. case 11:
  184. arsty = '立即预约';
  185. break;
  186. case 13:
  187. arsty = '预约考试';
  188. break;
  189. case 20:
  190. arsty = '重新购买';
  191. break;
  192. default:
  193. break;
  194. }
  195. return arsty;
  196. }
  197. },
  198. onReachBottom() {},
  199. computed: { ...mapGetters(['userInfo']) }
  200. };
  201. </script>
  202. <style>
  203. page {
  204. background: #eaeef1;
  205. }
  206. </style>
  207. <style scoped>
  208. .lsow:last-child {
  209. border-bottom: none !important;
  210. }
  211. .timeStys {
  212. margin: 0rpx 6rpx;
  213. color: #007aff;
  214. font-size: 28rpx;
  215. font-weight: bold;
  216. border-bottom: 1rpx solid #007aff;
  217. }
  218. .h4 {
  219. color: #333;
  220. font-size: 28rpx;
  221. font-weight: bold;
  222. }
  223. .aSty {
  224. color: #999;
  225. font-size: 24rpx;
  226. margin-left: 8rpx;
  227. }
  228. .h33 {
  229. font-size: 28rpx;
  230. color: #666;
  231. }
  232. .content {
  233. font-size: 28rpx;
  234. color: #666666;
  235. line-height: 36rpx;
  236. }
  237. .time {
  238. font-size: 24rpx;
  239. color: #999999;
  240. margin: 15rpx 0;
  241. }
  242. .btn1 {
  243. width: 526rpx;
  244. height: 80rpx;
  245. background: #007aff;
  246. border-radius: 40rpx;
  247. color: #ffffff;
  248. font-size: 30rpx;
  249. font-weight: bold;
  250. text-align: center;
  251. line-height: 80rpx;
  252. margin: 30rpx auto;
  253. }
  254. .item {
  255. width: 100%;
  256. background: #ffffff;
  257. border-radius: 16rpx;
  258. padding: 15rpx;
  259. }
  260. .title {
  261. font-size: 30rpx;
  262. font-weight: bold;
  263. color: #333333;
  264. }
  265. </style>