演示项目-图书馆
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.3 KiB

  1. <template>
  2. <div id="book">
  3. <!-- <div class="top-bg"></div> -->
  4. <div class="online-active">
  5. <div class="qrcode" id="qrCodeUrl"></div>
  6. </div>
  7. </div>
  8. </template>
  9. <script>
  10. import QRCode from "qrcodejs2";
  11. export default {
  12. name: 'OnlineBookSelection',
  13. components: {
  14. QRCode
  15. },
  16. data() {
  17. return {
  18. QRCode: '',
  19. activeId: ''
  20. }
  21. },
  22. created() {
  23. this.activeId = this.$route.query.activeId
  24. console.log(this.$route.query.activeId)
  25. },
  26. mounted(){
  27. this.creatQrCode()
  28. },
  29. methods: {
  30. creatQrCode() {
  31. const that = this;
  32. console.log(window.location.href);
  33. if(this.isLocal){
  34. that.QRCode = 'http://192.168.99.50:8089/BookList?activeId?activeId='+ this.activeId
  35. }else{
  36. that.QRCode = window.location.origin +'/web/#/BookList?activeId?activeId='+ this.activeId
  37. }
  38. console.log(that.QRCode)
  39. that.$nextTick(function () {
  40. let q = new QRCode("qrCodeUrl", {
  41. text: that.QRCode,
  42. width: 180,
  43. height: 180,
  44. colorDark: "#000000",
  45. colorLight: "#ffffff",
  46. })
  47. })
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. @import "~@/assets/styles/index.scss";
  54. </style>