index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view>
  3. <cu-custom :bgColor="'bg-'+theme.backgroundColor" :isBack="true">
  4. <block slot="backText">返回</block>
  5. <block slot="content">登录</block>
  6. </cu-custom>
  7. <view class="nav text-center login padding-top" style="" :class="'bg-'+theme.backgroundColor">
  8. <view :class="'cu-item '+ (1==TabCur?'text-white cur':'')" @click="tabSelect(1)" class="quick-login">
  9. <text class="">快速登录</text>
  10. </view>
  11. <view :class="'cu-item '+ (0==TabCur?'text-white cur':'')" @click="tabSelect(0)">
  12. <text class="">账号登录</text>
  13. </view>
  14. </view>
  15. <userLogin v-if="TabCur===0" :reUrl="reUrl"></userLogin>
  16. <codeLogin v-if="TabCur===1" :reUrl="reUrl"></codeLogin>
  17. </view>
  18. </template>
  19. <script>
  20. const app = getApp();
  21. const util = require("utils/util.js");
  22. import api from 'utils/api';
  23. import userLogin from "./userlogin";
  24. import codeLogin from "./codelogin";
  25. import register from "./register";
  26. export default {
  27. data() {
  28. return {
  29. theme: app.globalData.theme, //全局颜色变量
  30. CustomBar: this.CustomBar,
  31. TabCur: 1,
  32. reUrl: ''
  33. };
  34. },
  35. components: {
  36. userLogin,
  37. codeLogin,
  38. register
  39. },
  40. props: {
  41. },
  42. onLoad(options) {
  43. // 保存别人分享来的 userCode
  44. util.saveSharerUserCode(options);
  45. let reUrl = options.reUrl
  46. this.reUrl = reUrl
  47. },
  48. onShow() {
  49. // #ifdef MP-WEIXIN
  50. app.doLogin()
  51. // #endif
  52. },
  53. methods: {
  54. tabSelect(index){
  55. this.TabCur = index
  56. }
  57. }
  58. };
  59. </script>
  60. <style>
  61. .quick-login{
  62. margin-right: 150rpx !important;
  63. }
  64. .login{
  65. margin-left: -20rpx;
  66. }
  67. </style>