qrcode.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div class="qrcode">
  3. <img
  4. class="qrcodebg"
  5. :src="require(`@/assets/images/project/kuangti/qrcode_${theme}.png`)"
  6. alt=""
  7. />
  8. <div class="brightness"></div>
  9. <div class="qrcodecon">
  10. <h3>扫描二维码,手机观展</h3>
  11. <div class="ul">
  12. <div class="li">
  13. <p v-html="currentPano.name || ''"></p>
  14. <!-- <div class="xiala" v-else>
  15. <span @click="isShowUl=!isShowUl">
  16. {{currentPano.name}}
  17. <img :src="require(`@/assets/images/project/icon/jiantour.png`)" alt="">
  18. </span>
  19. <ul class="brightness" v-if="isShowUl">
  20. <li @click="isShowUl=false,currentPano.name='四川省返乡创业'" v-for="(item,i) in 2" :key="i">
  21. 四川省返乡创业
  22. </li>
  23. </ul>
  24. </div> -->
  25. <img :src="require(`@/assets/images/project/qrcode.jpg`)" alt="" />
  26. <div @click="download" class="download">下载二维码</div>
  27. </div>
  28. <div class="li">
  29. <p v-html="currentItem.name"></p>
  30. <img :src="require(`@/assets/images/project/qrcode.jpg`)" alt="" />
  31. <div @click="download" class="download">下载二维码</div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. export default {
  39. props: ["currentPano", "currentItem"],
  40. data() {
  41. return {
  42. isShowUl:false
  43. };
  44. },
  45. methods:{
  46. download(){
  47. let elink = document.createElement("a");
  48. elink.href = require(`@/assets/images/project/qrcode.jpg`);
  49. elink.download = `qecode.png`;
  50. elink.click();
  51. document.body.removeChild(elink);
  52. }
  53. }
  54. };
  55. </script>
  56. <style lang="less" scoped>
  57. @w: 900px;
  58. @fixw: 8px;
  59. .qrcode {
  60. width: @w;
  61. position: relative;
  62. .qrcodebg {
  63. width: @w + @fixw * 2;
  64. position: relative;
  65. transform: translateX(-@fixw);
  66. }
  67. .brightness {
  68. position: absolute;
  69. width: 100%;
  70. height: 100%;
  71. left: 0;
  72. top: 0;
  73. z-index: -1;
  74. clip-path: polygon(0 11%, 10% 2%, 100% 2%, 100% 90%, 92% 98%, 0 98%);
  75. }
  76. .qrcodecon {
  77. position: absolute;
  78. top: 0;
  79. transform: translateX(-50%);
  80. left: 50%;
  81. width: 100%;
  82. height: 100%;
  83. text-align: center;
  84. padding: 80px 0 0;
  85. > h3 {
  86. font-weight: normal;
  87. font-size: 26px;
  88. position: absolute;
  89. top: 14px;
  90. left: 8%;
  91. text-shadow: 0 2px 15px rgba(0, 0, 0, 0.8);
  92. }
  93. .ul {
  94. display: flex;
  95. justify-content: center;
  96. width: 100%;
  97. padding-top: 18px;
  98. .li {
  99. text-align: center;
  100. width: 220px;
  101. &:first-of-type {
  102. margin-right: 15%;
  103. }
  104. > p, .xiala {
  105. font-size: 18px;
  106. line-height: 1.5;
  107. height: 80px;
  108. display: flex;
  109. align-items: center;
  110. justify-content: center;
  111. }
  112. .xiala{
  113. position: relative;
  114. >span{
  115. border: 1px solid #fff;
  116. display: inline-block;
  117. border-radius: 4px;
  118. width: 100%;
  119. padding: 10px 30px 10px 10px;
  120. position: relative;
  121. cursor: pointer;
  122. overflow: hidden;
  123. text-overflow:ellipsis;
  124. white-space: nowrap;
  125. >img{
  126. position: absolute;
  127. right: 12px;
  128. transform: rotate(90deg);
  129. top: 33%;
  130. width: 8px;
  131. }
  132. }
  133. >ul{
  134. position: absolute;
  135. top: 90%;
  136. padding: 0 10px;
  137. width: 100%;
  138. z-index: 99;
  139. clip-path:none!important;
  140. border-radius: 4px;
  141. overflow: hidden;
  142. height: auto;
  143. >li{
  144. text-align: left;
  145. line-height: 1.5;
  146. border-bottom: dashed 1px #fff;
  147. padding: 10px 0;
  148. cursor: pointer;
  149. font-size: 16px;
  150. &:last-of-type{
  151. border-bottom: none;
  152. }
  153. }
  154. }
  155. }
  156. > img {
  157. width: 100%;
  158. margin: 10px 0 40px;
  159. }
  160. .download {
  161. border: 1px solid #fff;
  162. background-color: rgba(255, 255, 255, 0.29);
  163. line-height: 60px;
  164. height: 60px;
  165. width: 100%;
  166. border-radius: 4px;
  167. cursor: pointer;
  168. }
  169. }
  170. }
  171. }
  172. }
  173. </style>