index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <!-- 编辑器-热点 -->
  3. <div class="editor-hotspot">
  4. <!-- 内嵌的全景场景预览区域 -->
  5. <div
  6. class="app-player"
  7. ref="layer"
  8. >
  9. <Core/>
  10. <toolbar class="navigation-toolbar"></toolbar>
  11. </div>
  12. <setting @select="handleSelectScene"></setting>
  13. <!-- <toolbar></toolbar> -->
  14. <div class="dialog" v-if="show">
  15. <Select
  16. @updateList="undatePano"
  17. :panos="list"
  18. :current="activeItem"
  19. @cancle="show = false"
  20. :title="'选择场景'"
  21. :name="'scene'"
  22. @submit="handelSelect"
  23. >
  24. <template slot="list" slot-scope="{ data }">
  25. <div class="pano-con">
  26. <div class="ui-remark">{{ data.name }}</div>
  27. <ul>
  28. <li
  29. v-for="(item, i) in data.arr"
  30. @click="activeItem = item"
  31. :class="{ 'li-active': item.id == activeItem.id }"
  32. :key="i"
  33. >
  34. <div class="typeli">
  35. <i class="iconfont iconedit_type_3d" :class="{'iconedit_type_panorama':item.type!=='house'}"></i>
  36. </div>
  37. <div class="img">
  38. <img :src="item.icon" alt="">
  39. </div>
  40. <div class="ui-title">
  41. <span>{{item.sceneTitle}}</span>
  42. </div>
  43. </li>
  44. </ul>
  45. </div>
  46. </template>
  47. </Select>
  48. </div>
  49. </div>
  50. </template>
  51. <script>
  52. import Setting from "./Setting";
  53. import Select from "@/components/select";
  54. import Core from "@/framework/core/core-v1.2.vue";
  55. import Toolbar from "@/framework/Toolbar.vue";
  56. export default {
  57. name: "home",
  58. components: {
  59. Setting,
  60. Select,
  61. Core,
  62. Toolbar,
  63. },
  64. mounted(){
  65. },
  66. watch: {
  67. show(newVal){
  68. if (newVal) {
  69. this.searchKey = ''
  70. }
  71. else{
  72. this.activeWebsite = ''
  73. }
  74. },
  75. activeWebsite(newVal){
  76. if (!newVal||!newVal.sceneCode) {
  77. return
  78. }
  79. let tmp = ''
  80. this.list.forEach(item=>{
  81. if (!tmp) {
  82. tmp = item.arr.find(i=>{
  83. return newVal.sceneCode==i.sceneCode
  84. })
  85. }
  86. })
  87. this.activeItem = tmp || this.activeItem
  88. }
  89. },
  90. data(){
  91. return {
  92. show:false,
  93. list:[],
  94. activeItem: "",
  95. searchKey: "",
  96. activeWebsite:''
  97. }
  98. },
  99. methods:{
  100. undatePano(data){
  101. this.searchKey = data
  102. },
  103. handleSelectScene(data){
  104. this.activeWebsite = data
  105. this.show=true
  106. },
  107. handelSelect() {
  108. this.$bus.emit('selectUrl',this.activeItem)
  109. this.show = false
  110. }
  111. }
  112. };
  113. </script>
  114. <style lang="less" scoped>
  115. .editor-hotspot {
  116. height: 100%;
  117. display: flex;
  118. .app-player {
  119. flex: 1 1 auto;
  120. padding: 10px;
  121. position: relative;
  122. height: 100%;
  123. .navigation-toolbar {
  124. position: absolute;
  125. left: 10%;
  126. right: 10%;
  127. top: 70%;
  128. bottom: 10%;
  129. }
  130. }
  131. .dialog {
  132. position: fixed;
  133. z-index: 30;
  134. left: 0;
  135. top: 0;
  136. width: 100%;
  137. height: 100%;
  138. background-color: rgba(0, 0, 0, 0.5);
  139. .pano-con{
  140. height: auto;
  141. background: none;
  142. padding: 10px 0;
  143. .ui-remark{
  144. padding-left: 10px;
  145. }
  146. }
  147. }
  148. }
  149. </style>