login.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <div id="index_login_container" class="animation-slide-right">
  3. <view class="solid-bottom text-xl padding text-center">
  4. <text class=" text-bold title_color">欢迎来到水母星球!</text>
  5. </view>
  6. <view class="text-df text-center slogen">在此你将会体验到操控专注力的神奇感觉</view>
  7. <div class="sub_slogen text-center">
  8. 现在,开始你的专注力旅程吧!
  9. </div>
  10. <div class="text-center padding">
  11. <button class="cu-btn lg cu-btn-primary text-white text-center" @click="to_regist(0)">开始体验</button>
  12. </div>
  13. <view class="text-center text-xs">
  14. <text class="text-gray">如果您在我们的实体店,请在店员的指导下链接脑环</text>
  15. </view>
  16. <view class="text-center text-lg padding" @click="to_regist(1)">
  17. <text class="text-gray under_line">账号登录</text>
  18. </view>
  19. <van-toast id="van-toast"/>
  20. </div>
  21. </template>
  22. <script>
  23. import Toast from '../../../static/vant/toast/toast';
  24. export default {
  25. name: "login_container",
  26. methods: {
  27. to_regist($status) {
  28. this.$emit('changeStatus', 'regist')
  29. this.$emit('changeTitle', $status)
  30. },
  31. to_scan() {
  32. this.$emit('to_scan', 'scan')
  33. }
  34. },
  35. onLoad(options) {
  36. // 原有的code
  37. let $_code = wx.getStorageSync('code')
  38. if (options.q) {
  39. let url = decodeURIComponent(options.q)
  40. let $code = url.match(/\?code=(.*)/)[1];
  41. this.$store.commit('set_invite_code', $code)
  42. console.log('1---' + $_code, '2---' + $code)
  43. //判断新的code 和 旧的code 是否一致 不一致则重新登录
  44. if ($_code && $_code != $code) {
  45. Toast.fail('该用户已绑定邀请码')
  46. }
  47. }
  48. else {
  49. // 跳转到关于水母页面
  50. this.$emit('changeStatus', 'scan')
  51. }
  52. }
  53. }
  54. </script>
  55. <style>
  56. </style>