pano.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <div class="ifrcon">
  3. <iframe
  4. allowfullscreen="true"
  5. ref="iframe"
  6. :key="selected.id"
  7. :src="`https://www.4dkankan.com/spc.html?m=${selected.id}`"
  8. frameborder="0"
  9. @click="handleifrclk"
  10. @load="onIframLoad"
  11. ></iframe>
  12. <mbui :type="type" :isShow="isShow" @close="isShow =false">
  13. <div class="img_ul" slot="imgList">
  14. <ul v-if="selectExh.scenes">
  15. <li
  16. v-for="(item, i) in selectExh.scenes"
  17. @click="selected = item"
  18. :key="i"
  19. :class="{ active: selected.id == item.id }"
  20. >
  21. <div>
  22. <img :src="`https://4dkk.4dage.com/images/images${item.id}/floor_0.png?t=1667802021476?v=0&rnd=0.5813201205835572&x-oss-process=image/resize,m_fill,w_80,h_60/quality,q_70`" v-errorimg="`${fdkk_CDN}/hangzhan/images/images${item.id}/result.png`" alt="" />
  23. <rollName
  24. :offset="20"
  25. :active="selected.id == item.id"
  26. class="pic-name"
  27. :myref="'subw' + item.id"
  28. :name="item.title"
  29. />
  30. </div>
  31. <span class="bar"></span>
  32. </li>
  33. </ul>
  34. </div>
  35. <div class="txt_ul" slot="txtList">
  36. <ul>
  37. <li
  38. v-for="(item, i) in list"
  39. @click="selectExh = item"
  40. :key="i"
  41. :class="{ active: selectExh.id == item.id }"
  42. >
  43. <span>{{ selectExh.id == item.id ? item.title : item.short }}</span>
  44. </li>
  45. </ul>
  46. </div>
  47. <div v-if="!isShow" @click="isShow = true" class="btn_zhankai" slot="btn_zhankai">
  48. <i class="iconfont icon-more"></i>
  49. </div>
  50. <vAside class="ui_header" slot="aside"/>
  51. <vSelect slot="select" :type="type"></vSelect>
  52. </mbui>
  53. </div>
  54. </template>
  55. <script>
  56. import mbui from "./ui";
  57. import vAside from "./ui/aside.vue";
  58. import vSelect from "./ui/select.vue";
  59. export default {
  60. props:['type'],
  61. components: {
  62. mbui,
  63. vSelect,
  64. vAside
  65. },
  66. data() {
  67. return {
  68. params: "",
  69. isShow:true,
  70. selected: '',
  71. selectExh:{},
  72. list:[]
  73. };
  74. },
  75. watch:{
  76. selected:{
  77. deep:true,
  78. handler:function (newVal) {
  79. console.log(newVal);
  80. }
  81. }
  82. },
  83. methods: {
  84. handleifrclk(){
  85. console.log(1111);
  86. },
  87. getList(){
  88. window.$.ajax({url:`${this.g_CDN}fdkk/data2.json`,success:(data)=>{
  89. this.list=data.list
  90. this.selectExh = this.list[0]
  91. this.selected = this.selectExh.scenes[0]
  92. }})
  93. },
  94. onIframLoad() {
  95. window.onmessage = () => {
  96. };
  97. },
  98. },
  99. mounted(){
  100. this.getList()
  101. this.$bus.$on('showM',()=>{
  102. this.isShowM = true
  103. })
  104. }
  105. };
  106. </script>
  107. <style lang="less" scoped>
  108. .ifrcon {
  109. width: 100%;
  110. height: 100%;
  111. background: #fcfcfc;
  112. text-align: center;
  113. > iframe {
  114. width: 100%;
  115. height: 100%;
  116. }
  117. .img_ul {
  118. width: 100%;
  119. position: relative;
  120. > ul {
  121. overflow-x: auto;
  122. display: inline-block;
  123. background: linear-gradient(to right,rgba(32,32,32,0),rgba(32,32,32,1),rgba(32,32,32,0));
  124. min-width: 50%;
  125. > li {
  126. cursor: pointer;
  127. list-style: none;
  128. display: inline-block;
  129. margin: 8px 10px;
  130. position: relative;
  131. padding-bottom: 8px;
  132. > div {
  133. width: 68px;
  134. height: 68px;
  135. overflow: hidden;
  136. position: relative;
  137. border-radius: 4px;
  138. cursor: pointer;
  139. color: rgba(256, 256, 256, 0.4);
  140. > img {
  141. position: absolute;
  142. top: 50%;
  143. left: 50%;
  144. height: 100%;
  145. transform: translate(-50%, -50%);
  146. }
  147. .iconfont {
  148. position: absolute;
  149. left: 4px;
  150. top: 4px;
  151. z-index: 99;
  152. }
  153. > span {
  154. text-align: center;
  155. display: inline-block;
  156. background: rgba(0, 0, 0, 0.3);
  157. position: absolute;
  158. text-overflow: ellipsis;
  159. overflow: hidden;
  160. white-space: nowrap;
  161. left: 0;
  162. bottom: 0;
  163. width: 100%;
  164. }
  165. }
  166. .bar {
  167. display: none;
  168. }
  169. .pic-name {
  170. background: rgba(0, 0, 0, 0.6);
  171. position: absolute;
  172. left: 0;
  173. bottom: 0;
  174. text-align: center;
  175. /deep/ span {
  176. word-break: keep-all;
  177. white-space: nowrap;
  178. font-size: 12px;
  179. }
  180. }
  181. &.active {
  182. .bar {
  183. display: inline-block;
  184. position: absolute;
  185. bottom: 0px;
  186. width: 80%;
  187. left: 50%;
  188. transform: translateX(-50%);
  189. height: 2px;
  190. background: @color;
  191. }
  192. >div{
  193. color: rgba(256, 256, 256, 1);
  194. }
  195. }
  196. }
  197. }
  198. }
  199. .txt_ul {
  200. margin: 18px auto;
  201. border: 2px solid @color;
  202. border-radius: 30px;
  203. padding: 6px 15px;
  204. display: inline-block;
  205. > ul {
  206. overflow-x: auto;
  207. display: flex;
  208. &::-webkit-scrollbar {
  209. display: none;
  210. }
  211. > li {
  212. border: 1px solid rgba(256, 256, 256, 0.4);
  213. border-radius: 24px;
  214. padding: 6px 9px;
  215. margin: 0 5px;
  216. cursor: pointer;
  217. > span {
  218. font-size: 16px;
  219. display: inline-block;
  220. vertical-align: middle;
  221. line-height: 1.2;
  222. word-break: keep-all;
  223. color: rgba(256, 256, 256, 0.4);
  224. }
  225. &.active {
  226. padding: 6px 12px;
  227. border: 1px solid @color;
  228. > span {
  229. color: #fff;
  230. }
  231. }
  232. }
  233. }
  234. }
  235. .btn_zhankai{
  236. position: fixed;
  237. left: 50%;
  238. bottom: 8px;
  239. transform: translateX(-50%);
  240. background: rgba(0,0,0,.3);
  241. border-radius: 50%;
  242. padding: 6px;
  243. cursor: pointer;
  244. >i{
  245. font-size: 28px;
  246. cursor: pointer;
  247. }
  248. }
  249. }
  250. </style>