index.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <div class="zhanxiang">
  3. <div class="z-bar">
  4. <img @click.stop="$emit('close')" :src="require('@/assets/images/proj2022/mobile/left@2x.png')" alt="" />
  5. <span @click.stop="search">请输入项目名称...</span>
  6. <img @click.stop="search" :src="require('@/assets/images/proj2022/mobile/search@2x.png')" alt="" />
  7. </div>
  8. <div class="zhan-con" ref="bgsw" v-swiper:mySwiper="swiperOptions">
  9. <ul class="swiper-wrapper">
  10. <li @click="onClick(item, i)" class="swiper-slide" v-for="(item, i) in zhanxiangData.company" :key="i">
  11. <div class="img">
  12. <img :src="`zhanxiang/images/${theme}/${item.img}`" alt="" />
  13. </div>
  14. <div>
  15. <h3 class="primarytxt">{{ zhanxiangData.name }}</h3>
  16. <span v-html="item.name"></span>
  17. </div>
  18. </li>
  19. </ul>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. import { directive } from "vue-awesome-swiper";
  25. // import style (<= Swiper 5.x)
  26. import "swiper/css/swiper.css";
  27. import { Booth } from "@/data/booth.js";
  28. export default {
  29. props: ["zxdata", "currentPanoid"],
  30. data() {
  31. return {
  32. searchkey: "",
  33. initIdx: 0
  34. };
  35. },
  36. methods: {
  37. nextsw() {
  38. this.swiper.slideNext();
  39. },
  40. back() {
  41. this.$bus.$emit("emitShowZX", {
  42. show: false,
  43. });
  44. },
  45. onClick(data, idx) {
  46. if (this.swiper.realIndex != idx) {
  47. return
  48. }
  49. this.$bus.$emit("ifrMessage", {
  50. events: "flyToPano",
  51. data: data,
  52. });
  53. this.$emit("close");
  54. },
  55. search() {
  56. this.$emit("showSearch", true);
  57. },
  58. },
  59. directives: {
  60. swiper: directive,
  61. },
  62. computed: {
  63. swiper() {
  64. return this.$refs.bgsw.swiper;
  65. },
  66. zhanxiangData() {
  67. console.log(Booth.find((item) => item.id == this.theme));
  68. return Booth.find((item) => item.id == this.theme);
  69. },
  70. swiperOptions() {
  71. let that = this;
  72. return {
  73. watchSlidesProgress: true,
  74. effect: that.g_isLandscape ? "coverflow" : "slide",
  75. slidesPerView: "auto",
  76. centeredSlides: true,
  77. initialSlide: this.initIdx,
  78. coverflowEffect: {
  79. rotate: 0,
  80. stretch: 124,
  81. depth: 50,
  82. modifier: 2.6,
  83. slideShadows: false,
  84. },
  85. loop: false,
  86. on: that.g_isLandscape
  87. ? {}
  88. : {
  89. progress: function () {
  90. for (let i = 0; i < this.slides.length; i++) {
  91. var slide = this.slides.eq(i);
  92. var slideProgress = this.slides[i].progress;
  93. let modify = 1;
  94. let fixY = 0;
  95. if (Math.abs(slideProgress) > 1) {
  96. modify = (Math.abs(slideProgress) - 1) * 0.3 + 1;
  97. }
  98. let translateX = slideProgress * modify * 120 + "px";
  99. let translateY = fixY + (that.g_isLandscape ? Math.abs(slideProgress) : -Math.abs(slideProgress)) * 35 + "px";
  100. let zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
  101. let opacity = 1 - Math.abs(slideProgress) / 10;
  102. slide.transform(`translateX(${translateX}) translateY(${translateY})`);
  103. slide.css("zIndex", zIndex);
  104. slide.css("opacity", opacity);
  105. if (Math.abs(slideProgress) > 3) {
  106. slide.css("opacity", 0);
  107. }
  108. }
  109. },
  110. setTransition: function (transition) {
  111. for (var i = 0; i < this.slides.length; i++) {
  112. var slide = this.slides.eq(i);
  113. slide.transition(transition);
  114. }
  115. }
  116. },
  117. };
  118. },
  119. },
  120. watch: {
  121. currentPanoid: {
  122. immediate: true,
  123. handler: function (newVal) {
  124. let idx = this.zxdata.company.findIndex((item) => newVal == item.panoId);
  125. if (idx > -1) {
  126. this.initIdx = idx
  127. }
  128. }
  129. }
  130. },
  131. };
  132. </script>
  133. <style lang="less" scoped>
  134. .zhanxiang {
  135. position: fixed;
  136. z-index: 999999;
  137. width: 100%;
  138. height: 100%;
  139. top: 0;
  140. right: 0;
  141. bottom: 0;
  142. left: 0;
  143. background-color: rgba(255, 255, 255, 0.5);
  144. backdrop-filter: blur(20px);
  145. .z-bar {
  146. height: 60px;
  147. width: 100%;
  148. background-color: rgba(0, 0, 0, 0.6);
  149. backdrop-filter: blur(12px) brightness(100%);
  150. display: flex;
  151. justify-content: space-between;
  152. align-items: center;
  153. padding: 0 10px;
  154. >img {
  155. width: 50px;
  156. flex-shrink: 0;
  157. }
  158. >span {
  159. text-align: left;
  160. display: inline-block;
  161. flex: auto;
  162. font-size: 20px;
  163. color: rgba(255, 255, 255, 0.5);
  164. }
  165. }
  166. .zhan-con {
  167. width: 100%;
  168. position: relative;
  169. height: calc(100vh - 60px);
  170. padding-bottom: 30px;
  171. >ul {
  172. width: 100%;
  173. align-items: flex-end;
  174. >li {
  175. width: 80%;
  176. max-height: 56vh;
  177. padding: 20px 16px;
  178. background-color: rgba(255, 255, 255, 1);
  179. box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.16);
  180. border-radius: 5px 5px 5px 5px;
  181. background-image: url("~@/assets/images/proj2022/mobile/bg_heng.png");
  182. background-size: 100% auto;
  183. background-position: bottom left;
  184. background-repeat: no-repeat;
  185. .img {
  186. width: 100%;
  187. margin-top: 0;
  188. >img {
  189. width: 100%;
  190. }
  191. }
  192. >div {
  193. color: #000;
  194. text-align: center;
  195. margin-top: 30px;
  196. >h3 {
  197. font-size: 20px;
  198. margin-bottom: 10px;
  199. }
  200. >span {
  201. font-size: 16px;
  202. line-height: 1.5;
  203. display: inline-block;
  204. width: 70%;
  205. }
  206. }
  207. }
  208. }
  209. }
  210. }
  211. @media screen and (orientation: landscape) {
  212. .zhanxiang {
  213. position: fixed;
  214. z-index: 999999;
  215. width: 100%;
  216. height: 100%;
  217. top: 0;
  218. right: 0;
  219. bottom: 0;
  220. left: 0;
  221. background-color: rgba(255, 255, 255, 0.5);
  222. backdrop-filter: blur(20px);
  223. .z-bar {
  224. height: 60px;
  225. width: 100%;
  226. background-color: rgba(0, 0, 0, 0.6);
  227. backdrop-filter: blur(12px) brightness(100%);
  228. display: flex;
  229. justify-content: space-between;
  230. align-items: center;
  231. padding: 0 10px;
  232. >img {
  233. width: 50px;
  234. flex-shrink: 0;
  235. }
  236. >span {
  237. text-align: left;
  238. display: inline-block;
  239. flex: auto;
  240. font-size: 20px;
  241. color: rgba(255, 255, 255, 0.5);
  242. }
  243. }
  244. .zhan-con {
  245. width: 100%;
  246. position: relative;
  247. height: calc(100vh - 60px);
  248. padding-bottom: 0;
  249. >ul {
  250. width: 100%;
  251. align-items: center;
  252. >li {
  253. width: 58%;
  254. max-height: 90%;
  255. padding: 16px;
  256. background-color: rgba(255, 255, 255, 1);
  257. box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.16);
  258. background-image: url("~@/assets/images/proj2022/mobile/bg_shu.png");
  259. background-size: 100% auto;
  260. background-position: bottom left;
  261. background-repeat: no-repeat;
  262. display: flex;
  263. .img {
  264. flex: 2;
  265. width: auto;
  266. text-align: center;
  267. position: relative;
  268. overflow: hidden;
  269. >img {
  270. position: absolute;
  271. left: 50%;
  272. transform: translateX(-50%);
  273. width: auto;
  274. height: 100%;
  275. }
  276. }
  277. >div {
  278. color: #000;
  279. text-align: center;
  280. margin-top: 0;
  281. width: 24%;
  282. flex-shrink: 0;
  283. margin-left: 16px;
  284. >h3 {
  285. position: absolute;
  286. top: 16px;
  287. right: 16px;
  288. margin-left: 20px;
  289. font-size: 20px;
  290. writing-mode: vertical-lr;
  291. margin-bottom: 10px;
  292. display: inline-block;
  293. text-align: left;
  294. height: 100%;
  295. }
  296. >span {
  297. font-size: 18px;
  298. line-height: 1.2;
  299. margin-left: 10px;
  300. writing-mode: vertical-lr;
  301. text-align: left;
  302. display: inline-block;
  303. height: 100%;
  304. width: 100%;
  305. letter-spacing: 2px;
  306. }
  307. }
  308. }
  309. }
  310. }
  311. }
  312. }
  313. </style>