pcLogin.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. console.log('扫描后得:', q, this.scanCode)
  28. // 扫描二维码后调用,小程序已扫码
  29. if (this.scanCode) {
  30. console.log('进入扫码后的接口')
  31. this.$api.scanhasCode({scanCode: this.scanCode}).then((res) => {
  32. console.log('调用扫码接口返回的:', res)
  33. if (res.data.code == 200) {
  34. console.log('扫码成功')
  35. }
  36. })
  37. }
  38. },
  39. methods: {
  40. pcLogin() {
  41. uni.navigateTo({
  42. url: '/pages4/login/login?scanCode=' + this.scanCode
  43. });
  44. },
  45. }
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. .contents {
  50. width: 100%;
  51. height: 100%;
  52. text-align: center;
  53. display: flex;
  54. flex-direction: column;
  55. align-items: center;
  56. .logo {
  57. margin: 90rpx 0rpx 250rpx;
  58. }
  59. >text {
  60. font-size: 22rpx;
  61. color: #666;
  62. }
  63. .login_bt {
  64. width: 400rpx;
  65. height: 70rpx;
  66. line-height: 70rpx;
  67. text-align: center;
  68. background: #09ba08;
  69. color: #fff;
  70. font-size: 28rpx;
  71. border-radius: 35rpx;
  72. margin-top: 20rpx;
  73. }
  74. }
  75. </style>