1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <template>
- <view class="page align-center flex-col">
- <view class="header-sec align-center flex-col justify-center">
- <image src="/static/log_logo.png" mode="widthFix" class="logo"></image>
- <text class="txt">盲go小程序</text>
- </view>
- <button open-type="getPhoneNumber" class="btn-auth" @getphonenumber="getphonenumber">微信用户一键登录</button>
- <view class="btn-mobile" @tap="goMobileLogin">手机号码登录</view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
-
- };
- },
- async onLoad(e) {
- this.toPath = e.toPath;
- },
- methods:{
- async getphonenumber(e){
- if(!e.detail.code){
- return;
- }
- // this.code = e.detail.code
- let res = await this.$request('login.getPhoneNumber',{code:e.detail.code});
- uni.setStorageSync("token",res.data.userinfo.token);
- this.$store.dispatch('userInfo/getinfo');
- this.$tools.msg(res.msg);
- setTimeout(()=>{
- if(this.toPath){
- uni.redirectTo({
- url:this.toPath
- })
- return;
- }
- this.goBack();
- },800)
- },
- goMobileLogin(){
- this.navTo('/pages/login/mobileLogin',{toPath:this.toPath},{type:'replace'})
- },
- }
- }
- </script>
- <style lang="scss">
- page{
- background-color: #fff;
- }
- .header-sec{
- width: 100%;
- height: 832rpx;
- padding-top: 160rpx;
- .logo{
- width: 180rpx;
- height: 180rpx;
- // border-radius: 180rpx;
- // background-color: $base-color;
- }
- .txt{
- margin-top: 33rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #92B99C;
- }
- }
- .btn-auth{
- width: 630rpx;
- height: 84rpx;
- background: $base-color;
- border-radius: 8rpx;
- line-height: 84rpx;
- text-align: center;
-
- font-size: 34rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- }
- .btn-mobile{
- margin-top: 30rpx;
-
- width: 630rpx;
- height: 84rpx;
- border-radius: 8rpx;
- line-height: 84rpx;
- text-align: center;
-
- font-size: 34rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: $base-color;
- }
- </style>
|