syjj_second.vue 3.1 KB

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