scanLogin.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <div class="scanLogin">
  3. <div class="content">
  4. <div class="img">
  5. <img src="@/assets/img/other/user/compute@2x.png" alt="">
  6. </div>
  7. <div class="tips1">电脑端登陆确认</div>
  8. <div class="tips2">信息将自动会自动同步到APP</div>
  9. <div class="submitBtn" @click="submit">
  10. <p>登录</p>
  11. </div>
  12. <div class="cancle" @click="close">取消登录</div>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. /**
  18. * 扫码登录web端
  19. */
  20. export default {
  21. name: 'ScanLogin',
  22. asyncData({ }) {
  23. return {
  24. }
  25. },
  26. data() {
  27. },
  28. created() {
  29. this.code = this.$route.query.code
  30. },
  31. async mounted() {
  32. },
  33. methods: {
  34. submit() {
  35. this.$axios.$post('/api/user/qrcodeLoginSubmit', {
  36. code: this.code
  37. }).then(res=>{
  38. if (Number(res.status) === 1) {
  39. this.$toast('登录成功')
  40. setTimeout(()=>{
  41. window.close()
  42. })
  43. }
  44. })
  45. },
  46. close() {
  47. window.close()
  48. }
  49. },
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. @import "../../../assets/css/scssCommon";
  54. .scanLogin {
  55. height: 100%;
  56. overflow: hidden;
  57. margin-top: 0;
  58. .content {
  59. width: 100vw;
  60. height: 100%;
  61. min-height: calc(100vh - 50px);
  62. display: flex;
  63. justify-content: center;
  64. align-items: center;
  65. flex-direction: column;
  66. .img {
  67. width: pxtovw(125);
  68. height: pxtovw(125);
  69. font-size: 0;
  70. img {
  71. width: pxtovw(125);
  72. height: pxtovw(125);
  73. }
  74. }
  75. .tips1 {
  76. margin-top: pxtovw(22);
  77. height: pxtovw(22);
  78. font-size: pxtovw(16);
  79. font-weight: 600;
  80. text-align: left;
  81. color: #222222;
  82. line-height: pxtovw(22);
  83. }
  84. .tips2 {
  85. margin-top: pxtovw(3);
  86. height: pxtovw(17);
  87. font-size: pxtovw(12);
  88. font-weight: 400;
  89. text-align: center;
  90. color: #929aa4;
  91. line-height: pxtovw(17);
  92. }
  93. .submitBtn {
  94. margin-top: pxtovw(20);
  95. width: pxtovw(208);
  96. height: pxtovw(44);
  97. background: #308eff;
  98. border-radius: pxtovw(2);
  99. box-shadow: 0px 2px 6px 0px;
  100. display: flex;
  101. justify-content: center;
  102. align-items: center;
  103. p {
  104. font-size: pxtovw(14);
  105. font-weight: 500;
  106. text-align: center;
  107. color: #ffffff;
  108. line-height: pxtovw(20);
  109. }
  110. }
  111. .cancle {
  112. margin-top: pxtovw(17);
  113. height: pxtovw(20);
  114. font-size: pxtovw(14);
  115. font-weight: 400;
  116. text-align: center;
  117. color: #666666;
  118. line-height: pxtovw(20);
  119. }
  120. }
  121. }
  122. </style>