detail.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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. // arsty = '立刻学习';
  77. break;
  78. case 2:
  79. case 4:
  80. this.$navTo.togo('/pages2/verify/input');
  81. break;
  82. case 10:
  83. case 12:
  84. case 18:
  85. // arsty = '立即重学';
  86. break;
  87. case 11:
  88. // arsty = '立即预约';
  89. break;
  90. case 13:
  91. // arsty = '预约考试';
  92. break;
  93. case 20:
  94. // arsty = '重新购买';
  95. break;
  96. default:
  97. break;
  98. }
  99. },
  100. //跳转节视频
  101. jumpSection(item) {
  102. console.log(item);
  103. },
  104. //跳转题库题目
  105. jumpExam(item) {
  106. console.log(item);
  107. },
  108. isOk() {
  109. this.$api.courseappinformUser({ id: this.listData.id, receiptStatus: 1 }).then(res => {
  110. if (res.data.code === 200) {
  111. uni.navigateBack({
  112. delta: 1
  113. });
  114. }
  115. });
  116. },
  117. backPage() {
  118. uni.navigateBack({
  119. delta: 1
  120. });
  121. },
  122. getInfo() {
  123. this.$api.getappinformUserId(this.id).then(res => {
  124. if (res.data.code === 200) {
  125. if(!res.data.data.receiptStatus){
  126. this.$api.courseappinformUser({ id: res.data.data.id, receiptStatus: 1 }).then(res => {
  127. if (res.data.code === 200) {
  128. }
  129. });
  130. }
  131. if (res.data.data.informVo && res.data.data.informVo.affiche) {
  132. res.data.data.informVo.affiche = res.data.data.informVo.affiche.replace(/<img/gi, '<img style="max-width:100%;"');
  133. }
  134. this.listData = res.data.data;
  135. }
  136. });
  137. },
  138. change(index) {
  139. this.current = index;
  140. },
  141. getNames(int) {
  142. var arsty = '';
  143. switch (int) {
  144. case 1:
  145. case 3:
  146. case 5:
  147. case 6:
  148. case 7:
  149. case 19:
  150. case 21:
  151. case 22:
  152. arsty = '立刻学习';
  153. break;
  154. case 2:
  155. case 4:
  156. arsty = '马上填写';
  157. break;
  158. case 10:
  159. case 12:
  160. case 18:
  161. arsty = '立即重学';
  162. break;
  163. case 11:
  164. arsty = '立即预约';
  165. break;
  166. case 13:
  167. arsty = '预约考试';
  168. break;
  169. case 20:
  170. arsty = '重新购买';
  171. break;
  172. default:
  173. break;
  174. }
  175. return arsty;
  176. }
  177. },
  178. onReachBottom() {},
  179. computed: { ...mapGetters(['userInfo']) }
  180. };
  181. </script>
  182. <style>
  183. page {
  184. background: #eaeef1;
  185. }
  186. </style>
  187. <style scoped>
  188. .lsow:last-child {
  189. border-bottom: none !important;
  190. }
  191. .timeStys {
  192. margin: 0rpx 6rpx;
  193. color: #007aff;
  194. font-size: 28rpx;
  195. font-weight: bold;
  196. border-bottom: 1rpx solid #007aff;
  197. }
  198. .h4 {
  199. color: #333;
  200. font-size: 28rpx;
  201. font-weight: bold;
  202. }
  203. .aSty {
  204. color: #999;
  205. font-size: 24rpx;
  206. margin-left: 8rpx;
  207. }
  208. .h33 {
  209. font-size: 28rpx;
  210. color: #666;
  211. }
  212. .content {
  213. font-size: 28rpx;
  214. color: #666666;
  215. line-height: 36rpx;
  216. }
  217. .time {
  218. font-size: 24rpx;
  219. color: #999999;
  220. margin: 15rpx 0;
  221. }
  222. .btn1 {
  223. width: 526rpx;
  224. height: 80rpx;
  225. background: #007aff;
  226. border-radius: 40rpx;
  227. color: #ffffff;
  228. font-size: 30rpx;
  229. font-weight: bold;
  230. text-align: center;
  231. line-height: 80rpx;
  232. margin: 30rpx auto;
  233. }
  234. .item {
  235. width: 100%;
  236. background: #ffffff;
  237. border-radius: 16rpx;
  238. padding: 15rpx;
  239. }
  240. .title {
  241. font-size: 30rpx;
  242. font-weight: bold;
  243. color: #333333;
  244. }
  245. </style>