| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <template>
- <view class="page-bg container">
- <view class="back-container">
- <navigator url="/pages/index/index">
- <uni-icons type="back" size="40" color="#FFFFFF"></uni-icons>
- </navigator>
- </view>
- <view class="login-container">
- <view class="avator-container">
- <uni-icons type="person" size="130" color="#FFFFFF"></uni-icons>
- </view>
- <view class="btn-container" @click="login">登录</view>
- </view>
- </view>
- </template>
- <script setup>
- import { loginApi } from '@/service/apis.js';
- const login = () => {
- uni.getProvider({
- service: 'oauth'
- }).then((res) => {
- return uni.login({
- provider: res.provider[0]
- });
- }).then((res) => {
- return loginApi.login({"code": res.code});
- }).then((res) => {
- uni.setStorageSync('token', res);
- // uni.setStorageSync('userInfo', res.data.userInfo);
- // uni.switchTab({
- // url: '/pages/index/index'
- // });
- }).catch((err) => {
- console.log(err);
- });
- }
- </script>
- <style lang="scss" scoped>
- .container {
- width: 100vw;
- height: 100vh;
- padding: 16rpx;
-
- .back-container {
- left: 16rpx;
- top: 39px;
- width: 90rpx;
- height: 90rpx;
- border-radius: 50%;
- background-color: rgba(0, 0, 0, 0.1);
-
- display: flex;
- justify-content: center;
- align-items: center;
- }
-
- .login-container {
- width: 100%;
- height: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
-
- .avator-container {
- left: 222rpx;
- top: 254rpx;
- width: 307rpx;
- height: 307rpx;
- background: #D2EFF3;
- border-radius: 50%;
- box-shadow: 0px 2px 2px 0px #DBDBDB;
-
- display: flex;
- justify-content: center;
- align-items: center;
- }
-
- .btn-container {
- margin-top: 57rpx;
-
- width: 500rpx;
- height: 100rpx;
- border-radius: 20rpx;
- background: #2A82E4;
-
- font-size: 48rpx;
- font-weight: 700;
- letter-spacing: 0rpx;
- line-height: 69.5rpx;
- color: #FFFFFF;
-
- display: flex;
- justify-content: center;
- align-items: center;
- }
- }
- }
- </style>
|