xxgy.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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" :key="contentI">
  18. <!-- 文字 -->
  19. <view v-show="content.type=='text'">
  20. <text selectable="true"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 df jcc" 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_XQDL_XXGY, //学习概要
  43. ],
  44. checkedColor: "#EA252C",
  45. unCheckedColor_text: "#0E0E0E",
  46. unCheckedColor_border: "#C4C4C4",
  47. }
  48. },
  49. methods: {
  50. // initData(){
  51. // this.checkedIndex_second=0;
  52. // this.checkedIndex_bodyTitle=0;
  53. // },
  54. onTitleClick(index) {
  55. this.checkedIndex_bodyTitle = index
  56. // console.log("***", this.data_SYJJ[this.checkedIndex_second][this.checkedIndex_bodyTitle].content.src.type);
  57. },
  58. showPage(pageIndex) {
  59. // console.log("切换页面", pageIndex);
  60. this.checkedIndex_second = pageIndex;
  61. this.checkedIndex_bodyTitle = 0;
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss">
  67. .syjj-root{
  68. background: #FFFFFF;
  69. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  70. }
  71. .syjj-body {
  72. // width: px2vw(1789);
  73. width: px2vw(1150);
  74. margin-bottom: px2vw(63);
  75. }
  76. .titleBox {
  77. margin-top: px2vw(63);
  78. margin-bottom: px2vw(63);
  79. }
  80. .title-item {
  81. font-size: px2vw(20);
  82. padding: px2vw(15) px2vw(56) px2vw(15) px2vw(56);
  83. border: 1px solid;
  84. }
  85. .syjj-content{
  86. margin-top: px2vw(34);
  87. }
  88. .syjj-content text{
  89. font-size: px2vw(22);
  90. line-height: px2vw(46);
  91. }
  92. .syjj-text-nor{
  93. color: #020202;
  94. }
  95. .syjj-text-dif{
  96. color: #EA252C;
  97. }
  98. .syjj-text-link{
  99. color: #EA252C;
  100. }
  101. .syjj-pic img {
  102. max-width: 100%;
  103. }
  104. </style>