jstxInfo.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="ezy-jstx-ziliao-page">
  3. <view class="icon-title-navBar-box">
  4. <text class="nav-bar-title">{{data.ziliaoName}}</text>
  5. </view>
  6. <!--<view class="ezy-page-body">
  7. <scroll-view scroll-y="true" class="level-list-container">
  8. <view v-for="(item, index) in data.dengjiList" :key="item.dengjiId" class="level-item">
  9. <view class="level-item-content">
  10. &lt;!&ndash; 图标 &ndash;&gt;
  11. <view @click="selectDjBtn(item)"
  12. :class="{active: item.dengjiId == data.dengjiActiveSelect}">{{ item.dengjiName }}</view>
  13. <view>
  14. <view class="ziliao-card-box">
  15. &lt;!&ndash; <img/> &ndash;&gt;
  16. &lt;!&ndash; 内容区 &ndash;&gt;
  17. <view class="content-box">
  18. <text class="title">{{ ziliaoName }}</text>
  19. <text class="version">{{ getFirstVersion(item.banbenList) }}</text>
  20. </view>
  21. &lt;!&ndash; PDF 按钮 &ndash;&gt;
  22. <view class="pdf-btn">
  23. <icon>PDF</icon>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </scroll-view>
  30. </view>-->
  31. <!--<jstxDownDialog ref="jiaocaiRef" @confirm-btn="jcConfirm" :content="jcContent"></jstxDownDialog>-->
  32. </view>
  33. </template>
  34. <script setup>
  35. import {reactive, ref} from "vue";
  36. import {onLoad,onShow} from "@dcloudio/uni-app"
  37. import {jisuanInfo,jisuanPdf} from '@/api/ziliao.js'
  38. import jstxDownDialog from './jstxDownDialog.vue';
  39. const data = reactive({
  40. id: '',
  41. ziliaoName: '',
  42. dengjiList: [],
  43. dengjiActiveSelect: '',
  44. })
  45. // jisuantexun Info data
  46. function getJisuanInfo() {
  47. jisuanInfo({ziliaoId:data.id}).then(res => {
  48. data.ziliaoName = res.data.ziliaoName;
  49. data.dengjiList = res.data.dengjiList;
  50. // 默认为等级list中第一个
  51. data.dengjiActiveSelect = res.data.dengjiList[0].dengjiId;
  52. })
  53. }
  54. // 获取第一个版本名称
  55. function getFirstVersion(banbenList) {
  56. if (banbenList && banbenList.length > 0) {
  57. return banbenList[0].banbenName;
  58. }
  59. return '未知版本';
  60. }
  61. function selectDjBtn(item){
  62. data.dengjiActiveSelect = item.dengjiId
  63. }
  64. onLoad((options) => {
  65. data.id = options.ziliaoId;
  66. console.log('options',options);
  67. getJisuanInfo()
  68. })
  69. </script>