xxzlxz.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <!-- 学习资料下载 -->
  3. <view class="myComRoot df jcc syjj-root">
  4. <view class="syjj-body" v-for="(page,pageI) in data_SYJJ" :key="pageI" v-show="checkedIndex_second==pageI">
  5. <!-- 标题 -->
  6. <view class="titleBox df fdr jcc" v-show="data_SYJJ[checkedIndex_second].page.length>1">
  7. <view v-for="(item,i) in data_SYJJ[checkedIndex_second].page" :key="i" @click="onTitleClick(i)" class="df fdc aic jcc title-item"
  8. :style="{color:checkedIndex_bodyTitle==i?checkedColor:unCheckedColor_text,
  9. borderColor:checkedIndex_bodyTitle==i?checkedColor:unCheckedColor_border,
  10. borderLeftStyle:checkedIndex_bodyTitle==i-1?'none':((i!=0&&checkedIndex_bodyTitle!=i)?'none':'solid'),
  11. borderRightStyle:checkedIndex_bodyTitle==i+1?'none':'solid'}">
  12. {{item.title}}
  13. </view>
  14. </view>
  15. <!-- 内容 -->
  16. <view class="df fdc">
  17. <view class="syjj-content" v-for="(content,contentI) in data_SYJJ[checkedIndex_second].page[checkedIndex_bodyTitle].content"
  18. :key="contentI">
  19. <!-- 文字 -->
  20. <view v-show="content.type=='text'">
  21. <text selectable="true" v-for="(text,textI) in content.textList" :key="textI" :class="'syjj-text-'+text.textType" v-show="text.textType!='link'">
  22. {{text.text}}
  23. </text>
  24. <!-- link -->
  25. <text selectable="true" v-for="(link,index) in content.textList" v-show="link.textType=='link'">
  26. <!-- <uni-link href="link.text" text="下载" :showUnderLine="true" style="text-decoration:underline;color:blue"></uni-link> -->
  27. <!-- <a :href="link.url" style="text-decoration:underline;color:blue">{{link.text}}</a> -->
  28. <a :href="link.text" style="text-decoration:underline;color:blue">下载</a>
  29. </text>
  30. </view>
  31. <!-- 图片 -->
  32. <view class="syjj-pic df jcc" v-show="content.type=='pic'">
  33. <img :src="content.src"></img>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. // import '../../assets/myData/mydata_SYJJ.js';
  42. export default {
  43. data() {
  44. return {
  45. checkedIndex_second: 0, //二级页面选择、外部调用:如,评审账号、快速进入实验等
  46. checkedIndex_bodyTitle: 0, //正文小标题选择
  47. //以下为静态
  48. data_SYJJ: [
  49. myData_XQDL_XXZLXZ, //学习资料下载
  50. ],
  51. checkedColor: "#EA252C",
  52. unCheckedColor_text: "#0E0E0E",
  53. unCheckedColor_border: "#C4C4C4",
  54. }
  55. },
  56. methods: {
  57. // initData(){
  58. // this.checkedIndex_second=0;
  59. // this.checkedIndex_bodyTitle=0;
  60. // },
  61. onTitleClick(index) {
  62. this.checkedIndex_bodyTitle = index
  63. // console.log("***", this.data_SYJJ[this.checkedIndex_second][this.checkedIndex_bodyTitle].content.src.type);
  64. },
  65. showPage(pageIndex) {
  66. // console.log("切换页面", pageIndex);
  67. this.checkedIndex_second = pageIndex;
  68. this.checkedIndex_bodyTitle = 0;
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss">
  74. .syjj-root {
  75. background: #FFFFFF;
  76. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  77. }
  78. .syjj-body {
  79. // width: px2vw(1789);
  80. width: px2vw(1150);
  81. margin-bottom: px2vw(63);
  82. }
  83. .titleBox {
  84. margin-top: px2vw(63);
  85. margin-bottom: px2vw(63);
  86. }
  87. .title-item {
  88. font-size: px2vw(20);
  89. padding: px2vw(15) px2vw(56) px2vw(15) px2vw(56);
  90. border: 1px solid;
  91. }
  92. .syjj-content {
  93. margin-top: px2vw(34);
  94. }
  95. .syjj-content text {
  96. font-size: px2vw(22);
  97. line-height: px2vw(46);
  98. }
  99. .syjj-text-nor {
  100. color: #020202;
  101. }
  102. .syjj-text-dif {
  103. color: #EA252C;
  104. }
  105. .syjj-text-dif2 {
  106. color: #EA252C;
  107. font-weight: bold;
  108. }
  109. .syjj-text-link {
  110. color: #EA252C;
  111. }
  112. .syjj-pic img {
  113. max-width: 100%;
  114. }
  115. .syjj-link{
  116. color: #EA252C;
  117. text-decoration:underline;
  118. }
  119. </style>