contentDetail.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view>
  3. <Headers></Headers>
  4. <view class="project">
  5. <view style="width: 1200px;margin: auto;">职业技能在线考试系统</view>
  6. </view>
  7. <view class="project-content ddflex">
  8. <!-- 成绩区域 -->
  9. <view class="test-box">
  10. <view class="test-title">{{content.title}}</view>
  11. <view class="test-time">
  12. <text style="color: #999999;margin-right: 10px;">发布日期</text>
  13. <text>{{content.time}}</text>
  14. </view>
  15. <mp-html :content="content.text" :lazy-load="true" @imgtap="choose"></mp-html>
  16. </view>
  17. <!-- 答题卡区域 -->
  18. <view class="test-info ddflex">
  19. <view class="note-box">
  20. <view class="note-title ddflex">
  21. <image class="note-title-icon" src="/static/images/ksgg.png"></image>
  22. <view>考试公告</view>
  23. </view>
  24. <view>
  25. <view class="note-item ddflex" v-for="item,index in otherInfo" :key="index" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
  26. <view class="note-item-content">{{item.title}}</view>
  27. </view>
  28. </view>
  29. </view>
  30. <!-- 注意事项 -->
  31. <view class="note-box">
  32. <view class="note-title ddflex">
  33. <image class="note-title-icon" src="/static/images/zysx.png"></image>
  34. <view>注意事项</view>
  35. </view>
  36. <view>
  37. <view class="note-item ddflex" v-for="item,index in noteInfo" :key="index+'zy'" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
  38. <view class="note-item-content">{{item.title}}</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <Foot></Foot>
  45. </view>
  46. </template>
  47. <script>
  48. const app = getApp();
  49. const req = require('../../utils/request.js');
  50. import mpHtml from "../../components/mp-html/mp-html.vue";
  51. export default {
  52. data() {
  53. return {
  54. id:null,
  55. content:'',
  56. otherInfo:[],
  57. noteInfo:[]
  58. }
  59. },
  60. onReady() {},
  61. onLoad(options) {
  62. this.id = options.id
  63. this.getDetail()
  64. this.getTextOtherInfo()
  65. this.getTextNoteInfo()
  66. },
  67. methods: {
  68. jumpUrl(url){
  69. uni.navigateTo({
  70. url:url
  71. })
  72. },
  73. getDetail(){
  74. req.getRequest('/api/content/detail',{id:this.id},res=>{
  75. this.content = res
  76. })
  77. },
  78. // 考试公告
  79. getTextOtherInfo(){
  80. let form={
  81. code:req.public.ksggCode,
  82. page:1,
  83. limit:3
  84. }
  85. req.getRequest('/api/content/list',form,res=>{
  86. this.otherInfo = res
  87. })
  88. },
  89. // 注意事项
  90. getTextNoteInfo(){
  91. let form={
  92. code:req.public.zysxCode,
  93. page:1,
  94. limit:3
  95. }
  96. req.getRequest('/api/content/list',form,res=>{
  97. this.noteInfo = res
  98. })
  99. },
  100. }
  101. }
  102. </script>
  103. <style>
  104. @import url('./contentDetail.css');
  105. </style>