detail.vue 6.0 KB

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