xxzlxz.vue 3.3 KB

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