detail.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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.informVo && res.data.data.informVo.affiche) {
  126. res.data.data.informVo.affiche = res.data.data.informVo.affiche.replace(/<img/gi, '<img style="max-width:100%;"');
  127. }
  128. this.listData = res.data.data;
  129. }
  130. });
  131. },
  132. change(index) {
  133. this.current = index;
  134. },
  135. getNames(int) {
  136. var arsty = '';
  137. switch (int) {
  138. case 1:
  139. case 3:
  140. case 5:
  141. case 6:
  142. case 7:
  143. case 19:
  144. case 21:
  145. case 22:
  146. arsty = '立刻学习';
  147. break;
  148. case 2:
  149. case 4:
  150. arsty = '马上填写';
  151. break;
  152. case 10:
  153. case 12:
  154. case 18:
  155. arsty = '立即重学';
  156. break;
  157. case 11:
  158. arsty = '立即预约';
  159. break;
  160. case 13:
  161. arsty = '预约考试';
  162. break;
  163. case 20:
  164. arsty = '重新购买';
  165. break;
  166. default:
  167. break;
  168. }
  169. return arsty;
  170. }
  171. },
  172. onReachBottom() {},
  173. computed: { ...mapGetters(['userInfo']) }
  174. };
  175. </script>
  176. <style>
  177. page {
  178. background: #eaeef1;
  179. }
  180. </style>
  181. <style scoped>
  182. .lsow:last-child {
  183. border-bottom: none !important;
  184. }
  185. .timeStys {
  186. margin: 0rpx 6rpx;
  187. color: #007aff;
  188. font-size: 28rpx;
  189. font-weight: bold;
  190. border-bottom: 1rpx solid #007aff;
  191. }
  192. .h4 {
  193. color: #333;
  194. font-size: 28rpx;
  195. font-weight: bold;
  196. }
  197. .aSty {
  198. color: #999;
  199. font-size: 24rpx;
  200. margin-left: 8rpx;
  201. }
  202. .h33 {
  203. font-size: 28rpx;
  204. color: #666;
  205. }
  206. .content {
  207. font-size: 28rpx;
  208. color: #666666;
  209. line-height: 36rpx;
  210. }
  211. .time {
  212. font-size: 24rpx;
  213. color: #999999;
  214. margin: 15rpx 0;
  215. }
  216. .btn1 {
  217. width: 526rpx;
  218. height: 80rpx;
  219. background: #007aff;
  220. border-radius: 40rpx;
  221. color: #ffffff;
  222. font-size: 30rpx;
  223. font-weight: bold;
  224. text-align: center;
  225. line-height: 80rpx;
  226. margin: 30rpx auto;
  227. }
  228. .item {
  229. width: 100%;
  230. background: #ffffff;
  231. border-radius: 16rpx;
  232. padding: 15rpx;
  233. }
  234. .title {
  235. font-size: 30rpx;
  236. font-weight: bold;
  237. color: #333333;
  238. }
  239. </style>