<script>
import user_store from "@/store/index";
export default {
  name: "Welcome",
  methods: {
    /**
     * 去 注册/登录
     * @param $status 注册1，登录2
     */
    handleSign($status) {
      this.$emit("signStatus", $status);
    }
  },
  mounted() {
    wx.login({
      success (res) {
        if (res.code){
          // 这里可以把code传给后台，后台用此获取openid及session_key
          user_store.setters.setJsCode(res.code);
        }
      },
    })
  }
};
</script>

<template>
  <div id="index_login_container" class="animation-slide-right">
    <view class=" text-xl padding text-center">
      <text class=" text-bold title_color">欢迎来到水母星球！</text>
    </view>
    <view class="text-df text-center">在此将会体验到操控专注力的神奇感觉</view>
    <div class="welcome_txt text-center">现在，开始您的专注力旅程吧!</div>
    <div class="text-center padding-lr padding-top">
      <button class="cu-btn lg cu-btn-primary text-white text-center" @click="handleSign(1)">账号注册</button>
    </div>
    <view class="text-center welcome_note">
      <text class="text-gray">如果您在我们实体店，请在店员的指导下连接水母智脑机</text>
    </view>
    <view class="text-center text-lg padding-lr" @click="handleSign(2)">
      <text class="text-gray under_line">账号登录</text>
    </view>
  </div>
</template>

<style scoped>
.welcome_txt {
  font-size: 22px;
  margin-top: 110px;
  color: #4c4c4c;
}
.welcome_note {
  font-size: 11px;
  padding: 8px 0px;
}
</style>
