xxzlxz.vue 3.0 KB

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