pcLogin.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. <text>登录后您可在网页端继续浏览课程</text>
  12. <view class="login_bt" @click="pcLogin()">微信登录</view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. scanCode: '', // 获取扫码的路径最后面的6位标识码
  21. }
  22. },
  23. onLoad(query) {
  24. console.log('扫描参数', 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. console.log('跳转')
  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. .login_bt {
  54. width: 180rpx;
  55. height: 80rpx;
  56. line-height: 80rpx;
  57. text-align: center;
  58. background: #ddd;
  59. }
  60. }
  61. </style>