preludePreparation.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <!-- 前序准备df fdc -->
  3. <view class="myComRoot df fdc aic bgclF8">
  4. <view class="qxzb-body">
  5. <!-- 标题 -->
  6. <view class="titleBox df fdr jcc" v-show="data_QXZB[checkedIndex_topTitle].length>1">
  7. <view v-for="(item,i) in data_QXZB[checkedIndex_topTitle]" :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.text}}
  13. </view>
  14. </view>
  15. <!-- 内容 -->
  16. <view class="df fdc ">
  17. <!-- 文字 -->
  18. <view class="contentText">
  19. <text v-for="(item,i) in data_QXZB[checkedIndex_topTitle][checkedIndex_bodyTitle].content.text" :key="i+1" :style="{color:item.color}">
  20. {{item.text}}
  21. </text>
  22. </view>
  23. <!-- 媒体文件 -->
  24. <view class="contentMedia df jcc">
  25. <!-- <img v-show='data_QXZB[checkedIndex_topTitle][checkedIndex_bodyTitle].content.src.type=== "image"' v-for="(item,i) in data_QXZB[checkedIndex_topTitle][checkedIndex_bodyTitle].content.src.list"
  26. :key="i+2" :src="item"></img> -->
  27. <!-- <video id="myVideo" src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4"
  28. enable-danmu danmu-btn controls></video> -->
  29. <!-- <video v-show='data_QXZB[checkedIndex_topTitle][checkedIndex_bodyTitle].content.src.type=== "video"' v-for="(item,i) in data_QXZB[checkedIndex_topTitle][checkedIndex_bodyTitle].content.src.list"
  30. :key="i+2" :src="item"></video> -->
  31. <view v-for="(item,i) in data_QXZB[checkedIndex_topTitle][checkedIndex_bodyTitle].content.src.list" :key="i+2">
  32. <img v-show='data_QXZB[checkedIndex_topTitle][checkedIndex_bodyTitle].content.src.type=== "image"' :src="item"></img>
  33. <!-- <video v-show='data_QXZB[checkedIndex_topTitle][checkedIndex_bodyTitle].content.src.type=== "video"' :src="item" id="myVideo" ></video> -->
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. // import '../../assets/myData/myData_QXZB.js';
  42. export default {
  43. data() {
  44. return {
  45. checkedIndex_topTitle: 0, //顶部标题选择
  46. checkedIndex_bodyTitle: 0, //正文小标题选择
  47. //以下为静态
  48. // myData_QXZB_SYQY: myData_QXZB_SYQY,
  49. data_QXZB: [
  50. myData_QXZB_SYQY, //实验前言
  51. myData_QXZB_SYLCBZ, //实验流程步骤
  52. myData_QXZB_JXYDSP, //教学引导视频
  53. myData_QXZB_JCZS, //基础知识
  54. ],
  55. checkedColor: "#EA252C",
  56. unCheckedColor_text: "#0E0E0E",
  57. unCheckedColor_border: "#C4C4C4",
  58. scrollTop: 0,
  59. old: {
  60. scrollTop: 0
  61. }
  62. }
  63. },
  64. methods: {
  65. // initData(){
  66. // this.checkedIndex_topTitle=0;
  67. // this.checkedIndex_bodyTitle=0;
  68. // },
  69. onTitleClick(index) {
  70. this.checkedIndex_bodyTitle = index
  71. // console.log("***", this.data_QXZB[this.checkedIndex_topTitle][this.checkedIndex_bodyTitle].content.src.type);
  72. },
  73. onTopQXZBClick(index) {
  74. // console.log("顶部点击",index);
  75. this.checkedIndex_topTitle = index;
  76. this.checkedIndex_bodyTitle = 0;
  77. },
  78. }
  79. }
  80. </script>
  81. <style lang="scss">
  82. .qxzb-body {
  83. width: px2vw(1200);
  84. // width: 1000px;
  85. }
  86. .titleBox {
  87. margin-top: px2vw(63);
  88. margin-bottom: px2vw(63);
  89. }
  90. .title-item {
  91. font-size: px2vw(20);
  92. padding: px2vw(15) px2vw(56) px2vw(15) px2vw(56);
  93. border: 1px solid;
  94. }
  95. .contentText {
  96. font-size: px2vw(22);
  97. line-height: px2vw(46);
  98. }
  99. .contentMedia {
  100. margin-top: px2vw(66);
  101. }
  102. .contentMedia img {
  103. width: px2vw(780);
  104. max-width: 100%;
  105. margin-bottom: px2vw(63);
  106. }
  107. </style>