pcLogin.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="pcLogins">
  3. <u-navbar :is-back="false" title="登录" :border-bottom="false" title-color="#333333" back-icon-color="#ffffff">
  4. <view class="slot-wrap">
  5. <image src="/static/logo2.png" style="width: 178rpx;height: 31rpx;margin-left: 30rpx;"></image>
  6. </view>
  7. </u-navbar>
  8. <u-line color="#D6D6DB" />
  9. <view class="contents">
  10. <!-- 正文内容 -->
  11. <image class="logo" src="/static/me/logo.png" style="width: 360rpx;height: 72rpx;"></image>
  12. <text>登录后您可在网页端继续浏览课程</text>
  13. <view class="login_bt" @click="pcLogin()">微信登录</view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. scanCode: '', // 获取扫码的路径最后面的6位标识码
  22. }
  23. },
  24. onLoad(query) {
  25. const q = decodeURIComponent(query.q)
  26. this.scanCode = q.substring(q.length - 6)
  27. // const time = parseInt(query.scancode_time)
  28. console.log('扫描后得:', q, this.scanCode)
  29. // 扫描二维码后调用,小程序已扫码
  30. if (this.scanCode) {
  31. console.log('进入扫码后的接口')
  32. this.$api.scanhasCode({scanCode: this.scanCode}).then((res) => {
  33. console.log('调用扫码接口返回的:', res)
  34. if (res.data.code == 200) {
  35. console.log('扫码成功')
  36. }
  37. })
  38. }
  39. },
  40. methods: {
  41. pcLogin() {
  42. uni.navigateTo({
  43. url: '/pages4/login/login?scanCode=' + this.scanCode
  44. });
  45. },
  46. }
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. .contents {
  51. width: 100%;
  52. height: 100%;
  53. text-align: center;
  54. display: flex;
  55. flex-direction: column;
  56. align-items: center;
  57. .logo {
  58. margin: 90rpx 0rpx 250rpx;
  59. }
  60. >text {
  61. font-size: 22rpx;
  62. color: #666;
  63. }
  64. .login_bt {
  65. width: 400rpx;
  66. height: 70rpx;
  67. line-height: 70rpx;
  68. text-align: center;
  69. background: #09ba08;
  70. color: #fff;
  71. font-size: 28rpx;
  72. border-radius: 35rpx;
  73. margin-top: 20rpx;
  74. }
  75. }
  76. </style>