pcLogin.vue 2.1 KB

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