| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <template>
- <div class="scanLogin">
- <div class="content">
- <div class="img">
- <img src="@/assets/img/other/user/compute@2x.png" alt="">
- </div>
- <div class="tips1">电脑端登陆确认</div>
- <div class="tips2">信息将自动会自动同步到APP</div>
- <div class="submitBtn" @click="submit">
- <p>登录</p>
- </div>
- <div class="cancle" @click="close">取消登录</div>
- </div>
- </div>
- </template>
- <script>
- import bridge from '../../../plugins/bridge';
- /**
- * 扫码登录web端
- */
- export default {
- name: 'ScanLogin',
- asyncData({}) {
- return {}
- },
- data() {
- },
- created() {
- this.code = this.$route.query.code
- },
- async mounted() {
- },
- methods: {
- submit() {
- this.$axios.$post('/api/user/qrcodeLoginSubmit', {
- code: this.code
- }).then(res => {
- if (Number(res.status) === 1) {
- this.$toast('登录成功')
- setTimeout(() => {
- this.appBackHandler()
- }, 500)
- }
- })
- },
- close() {
- this.appBackHandler()
- },
- appBackHandler() {
- if (!bridge.isInApp) {
- console.log("唤起APP退出Webview失败,appBridge不存在")
- return
- }
- bridge.close();
- }
- },
- }
- </script>
- <style lang="scss" scoped>
- @import "../../../assets/css/scssCommon";
- .scanLogin {
- height: 100%;
- overflow: hidden;
- margin-top: 0;
- .content {
- width: 100vw;
- height: 100%;
- min-height: calc(100vh - 50px);
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- .img {
- width: pxtovw(125);
- height: pxtovw(125);
- font-size: 0;
- img {
- width: pxtovw(125);
- height: pxtovw(125);
- }
- }
- .tips1 {
- margin-top: pxtovw(22);
- height: pxtovw(22);
- font-size: pxtovw(16);
- font-weight: 600;
- text-align: left;
- color: #222222;
- line-height: pxtovw(22);
- }
- .tips2 {
- margin-top: pxtovw(3);
- height: pxtovw(17);
- font-size: pxtovw(12);
- font-weight: 400;
- text-align: center;
- color: #929aa4;
- line-height: pxtovw(17);
- }
- .submitBtn {
- margin-top: pxtovw(20);
- width: pxtovw(208);
- height: pxtovw(44);
- background: #308eff;
- border-radius: pxtovw(2);
- box-shadow: 0px 2px 6px 0px;
- display: flex;
- justify-content: center;
- align-items: center;
- p {
- font-size: pxtovw(14);
- font-weight: 500;
- text-align: center;
- color: #ffffff;
- line-height: pxtovw(20);
- }
- }
- .cancle {
- margin-top: pxtovw(17);
- height: pxtovw(20);
- font-size: pxtovw(14);
- font-weight: 400;
- text-align: center;
- color: #666666;
- line-height: pxtovw(20);
- }
- }
- }
- </style>
|