learningAndExperiment.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <!-- 学习与实验 -->
  3. <view class="myComRoot df jcc bgclF8">
  4. <view class="df fdc contentBox" v-show='checkedIndex_topTitle!=4'>
  5. <!-- 换行的段落文字 -->
  6. <view class="df content-paragraph" v-for="(paragraph,i) in data_XXYSY[checkedIndex_topTitle].content.paragraphList"
  7. :key="i">
  8. <!-- 不换行文字 -->
  9. <view class="contentText">
  10. <text v-for="(text,m) in paragraph" :key="m" :style="{color:text.color,fontWeight:text.fontWeight}">
  11. {{text.text}}
  12. </text>
  13. </view>
  14. </view>
  15. <!-- 媒体文件 -->
  16. <view class="contentMedia df jcc">
  17. <view v-for="(media,n) in data_XXYSY[checkedIndex_topTitle].content.src.list" :key="n">
  18. <img v-show='data_XXYSY[checkedIndex_topTitle].content.src.type=== "image"' :src="media"></img>
  19. </view>
  20. </view>
  21. <!-- 按钮 -->
  22. <view class="df jcc">
  23. <view class="df aic jcc btn-xxysy" v-show='checkedIndex_topTitle==0' @click="onClick_KSRZ">开始认知</view>
  24. <view class="df aic jcc btn-xxysy" v-show='checkedIndex_topTitle==1' @click="onClick_KSKC">开始勘察</view>
  25. <view class="df aic jcc btn-xxysy" v-show='checkedIndex_topTitle==2' @click="onClick_download_btn">下载客户端</view>
  26. <view class="df aic jcc btn-xxysy" v-show='checkedIndex_topTitle==3' @click="onClick_download_btn">下载客户端</view>
  27. <view class="df aic jcc btn-xxysy" v-show='checkedIndex_topTitle==4'>进入虚拟资源库</view>
  28. </view>
  29. </view>
  30. <simulationLibrary ref="simulationLibrary" v-show='checkedIndex_topTitle==4'></simulationLibrary>
  31. </view>
  32. </template>
  33. <script>
  34. import simulationLibrary from "../../../components/home/simulationLibrary.vue"
  35. export default {
  36. components: {
  37. simulationLibrary
  38. },
  39. data() {
  40. return {
  41. checkedIndex_topTitle: 0, //顶部标题选择
  42. //以下为静态
  43. myData_QXZB_SYQY: myData_QXZB_SYQY,
  44. data_XXYSY: [
  45. myData_XXYSY_YLRZ, //原理认知
  46. myData_XXYSY_SJKC, //实景勘察
  47. myData_XXYSY_XNJSDJ, //虚拟技术搭建
  48. myData_XXYSY_XNYSZZ, //虚拟艺术创作
  49. myData_XXYSY_XNZYKJS, //虚拟资源库建设
  50. ],
  51. checkedColor: "#EA252C",
  52. unCheckedColor_text: "#0E0E0E",
  53. unCheckedColor_border: "#C4C4C4",
  54. }
  55. },
  56. methods: {
  57. onTopXXYSYClick(index) {
  58. this.checkedIndex_topTitle = index;
  59. // console.log("2级点击", index, this.data_XXYSY[index].content);
  60. // console.log("***",this.myData_QXZB_SYQY);
  61. if(index == 4)
  62. {
  63. this.$refs.simulationLibrary.init();
  64. }
  65. },
  66. onClick_KSRZ(){
  67. this.$emit("onClick_KSRZ")
  68. },
  69. onClick_KSKC(){
  70. uni.pageScrollTo({
  71.   scrollTop: 0, duration:1
  72. });
  73. this.$emit("onShowWebview720");
  74. // this.$emit("onClick_KSKC")
  75. },
  76. onClick_download_btn() {
  77. let url = this.$Api + "/file/simulationexe";
  78. uni.request({
  79. url: url, //仅为示例,并非真实接口地址。
  80. success: (res) => {
  81. console.log('get成功');
  82. console.log(res.data);
  83. window.location.href = res.data;
  84. },
  85. fail: (res) => {
  86. console.log('get失败');
  87. console.log(res.data);
  88. }
  89. });
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss">
  95. .contentBox {
  96. // width: px2vw(1789);
  97. width: px2vw(1150);
  98. margin-top: px2vw(66);
  99. }
  100. .content-paragraph {}
  101. .contentText {
  102. // width: px2vw(1789);
  103. font-size: px2vw(22);
  104. line-height: px2vw(46);
  105. }
  106. .contentMedia {
  107. margin-top: px2vw(66);
  108. }
  109. .contentMedia img {
  110. width: px2vw(780);
  111. margin-bottom: px2vw(63);
  112. }
  113. // .contentMedia video {
  114. // width: px2vw(1306);
  115. // }
  116. .btn-xxysy {
  117. width: px2vw(200);
  118. height: px2vw(58);
  119. background: #EA252C;
  120. border-radius: px2vw(8);
  121. font-size: px2vw(24);
  122. color: #FFFFFF;
  123. line-height: px2vw(31);
  124. margin-bottom: px2vw(63);
  125. }
  126. </style>