preludePreparation.vue 3.7 KB

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