login.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="page align-center flex-col">
  3. <view class="header-sec align-center flex-col justify-center">
  4. <image src="/static/log_logo.png" mode="widthFix" class="logo"></image>
  5. <text class="txt">盲go小程序</text>
  6. </view>
  7. <button open-type="getPhoneNumber" class="btn-auth" @getphonenumber="getphonenumber">微信用户一键登录</button>
  8. <view class="btn-mobile" @tap="navTo('/pages/login/mobileLogin')">手机号码登录</view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. };
  16. },
  17. async onLoad() {
  18. },
  19. methods:{
  20. async getphonenumber(e){
  21. if(!e.detail.code){
  22. return;
  23. }
  24. // this.code = e.detail.code
  25. let res = await this.$request('login.getPhoneNumber',{code:e.detail.code});
  26. uni.setStorageSync("token",res.data.userinfo.token);
  27. this.$store.dispatch('userInfo/getinfo');
  28. this.$tools.msg(res.msg);
  29. setTimeout(()=>{
  30. this.goBack();
  31. },800)
  32. }
  33. }
  34. }
  35. </script>
  36. <style lang="scss">
  37. page{
  38. background-color: #fff;
  39. }
  40. .header-sec{
  41. width: 100%;
  42. height: 832rpx;
  43. padding-top: 160rpx;
  44. .logo{
  45. width: 180rpx;
  46. height: 180rpx;
  47. // border-radius: 180rpx;
  48. // background-color: $base-color;
  49. }
  50. .txt{
  51. margin-top: 33rpx;
  52. font-size: 28rpx;
  53. font-family: PingFang SC;
  54. font-weight: 500;
  55. color: #92B99C;
  56. }
  57. }
  58. .btn-auth{
  59. width: 630rpx;
  60. height: 84rpx;
  61. background: $base-color;
  62. border-radius: 8rpx;
  63. line-height: 84rpx;
  64. text-align: center;
  65. font-size: 34rpx;
  66. font-family: PingFang SC;
  67. font-weight: 500;
  68. color: #FFFFFF;
  69. }
  70. .btn-mobile{
  71. margin-top: 30rpx;
  72. width: 630rpx;
  73. height: 84rpx;
  74. border-radius: 8rpx;
  75. line-height: 84rpx;
  76. text-align: center;
  77. font-size: 34rpx;
  78. font-family: PingFang SC;
  79. font-weight: 500;
  80. color: $base-color;
  81. }
  82. </style>