detail.vue 6.0 KB

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