123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- <template>
- <view class="page">
- <view class="p-header flex-col align-center justify-center">
- <image src="/static/log_logo.png" mode="widthFix" class="img"></image>
- <text class="txt">盲go小程序</text>
- <!-- <image src="/static/home_logo.png" mode="widthFix" class="ic"></image> -->
- </view>
-
- <view class="p-form">
- <view class="c-item align-center">
- <image src="/static/log_tel.png" mode="widthFix" class="i-ic"></image>
- <view class="i-inpt">
- <input type="number" class="inpt" placeholder="请输入手机号" v-model="mobile"/>
- </view>
- </view>
-
- <view class="c-item align-center last-c-item">
- <image src="/static/log_yan.png" mode="widthFix" class="i-ic"></image>
- <view class="i-inpt">
- <input type="number" class="inpt" placeholder="请输入验证码" v-model="code"/>
- </view>
- <view class="code-wrap" @tap="chgeCode">
- <phoneCode ref="codeRef" :mobile="mobile" event="mobilelogin" />
- </view>
- </view>
- <!--
- <view class="c-pwd last-c-item" @tap="navTo('/pages/login/forget')">
- 忘记密码?
- </view>
- -->
- <!--
- <view class="c-item align-center last-c-item">
- <image src="/static/log_yao.png" mode="widthFix" class="i-ic"></image>
- <view class="i-inpt">
- <input type="text" class="inpt" placeholder="请输入邀请码(选填)" v-model="invite_no"/>
- </view>
- </view>
- -->
- </view>
- <submit-btn @submit="submit" ref="submitRef">
- <template v-slot:btns="{isSubmitted}">
- <view class="p-btn" :class="{'disabled':isSubmitted}">
- 登录
- </view>
- </template>
- </submit-btn>
- <!--
- <view class="p-login" @tap="navTo('/pages/login/register')">
- <text class="stxt">还没有账号,请点击</text>
- <text class="mtxt">注册</text>
- </view>
- -->
- </view>
- </template>
- <script>
- import phoneCode from './components/phoneCode.vue'
- export default {
- components:{
- phoneCode,
- },
- data() {
- return {
- // isAgree:true,
- mobile:'',
- code:'',
- // password:'',
- // repassword:'',
- // invite_no:'',
- };
- },
- onLoad(e) {
- // this.openid = this.$Route.query.openid;
- // this.accessToken = this.$Route.query.accessToken;
- this.toPath = e.toPath;
- },
- methods:{
- chgeCode(){
- this.$refs.codeRef.getCode();
- },
- async submit(){
- // console.log('submit---');
- // return;
- // if(! this.isAgree){
- // this.$tools.msg('您尚未同意协议')
- // return;
- // }else
- if(! this.$tools.match(this.mobile,'mobile')){
- return;
- }else if(!this.$tools.match(this.code,'code') ){
- return;
- }
- let sendData={
- mobile:this.mobile,
- code:this.code,
- user_type: 1,
- }
- let res=await this.$request('login.mobilelogin',sendData);
- let userInfo = res.data.userinfo || {};
- uni.setStorageSync("token",userInfo.token);
- this.$store.dispatch('userInfo/getinfo');
- this.$tools.msg(res.msg);
- this.$refs.submitRef.chgeStatus();
- setTimeout(()=>{
- if(this.toPath){
- uni.redirectTo({
- url:this.toPath
- })
- return;
- }
- this.goBack()
- },800)
- },
- },
- }
- </script>
- <style lang="scss">
- page{
- background-color: #fff;
- }
- .page{
- // min-height: 100vh;
- width: 100%;
- // padding-bottom: 100rpx;
- }
- .p-header{
- width: 750rpx;
- // height: 470rpx;
- height: 400rpx;
- position: relative;
- .img{
- 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;
- }
- }
- .p-form{
- width: 630rpx;
- margin: 0 auto;
- .c-pwd{
- height: 63rpx;
- line-height: 63rpx;
- width: 100%;
- text-align: right;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .c-item{
- width: 100%;
- height: 84rpx;
- background-color: #F1F1F1;
- padding: 0 26rpx;
- margin-bottom: 30rpx;
- border-radius: 8rpx;
- }
- .i-ic{
- width: 30rpx;
- height: 30rpx;
- margin-right: 17rpx;
- }
- .i-inpt{
- flex:1;
- .inpt{
- width: 100%;
- height: 84rpx;
- line-height: 84rpx;
- color:#333;
- font-size: 30rpx;
- }
- .code-inpt{
- flex:1;
- margin-right: 20rpx;
- height: 103rpx;
- line-height: 103rpx;
- color:#333;
- font-size: 26rpx;
- }
- .phone-code{
- width: 200rpx;
- height: 60rpx;
- background: #0D91FF;
- box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(13, 145, 255, 0.28);
- border-radius: 30rpx;
- line-height: 60rpx;
- text-align: center;
- font-size: 26rpx;
- color: #FFFFFF;
- }
- }
- // .i-code{
- // width: 180rpx;
- // height: 70rpx;
- // }
-
- }
- .last-c-item{
- margin-bottom: 100rpx !important;
- }
- .p-btn{
- margin: 0 auto;
- width: 630rpx;
- height: 84rpx;
- border-radius: 8rpx;
- line-height: 84rpx;
- text-align: center;
- font-size: 34rpx;
- font-family: PingFang SC;
- font-weight: 500;
- background-color: $base-color;
- color: #fff;
- border-radius: 8rpx;
- &.disabled{
- background-color: #eee;
- box-shadow: none;
- border: none;
- }
- }
- .p-login{
- font-size: 28rpx;
- height: 80rpx;
- line-height: 80rpx;
- text-align: right;
- width: 630rpx;
- margin:16rpx auto 0;
- font-weight: bold;
- padding-right: 10rpx;
- .stxt{
- color: #999999;
- }
- .mtxt{
- color: $base-color;
- padding: 0 10rpx;
- }
- }
- .p-reg{
- margin-top: 30rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- text-align: center;
- width: 100%;
- .stxt{
- color: #999999;
- }
- .mtxt{
- color: #333;
- }
- }
- .p-tips{
- position: absolute;
- z-index: 2;
- bottom: 30rpx;
- left: 0;
- width: 100%;
- .ic{
- width: 30rpx;
- height: 30rpx;
- margin-right: 22rpx;
- }
- .txt{
- color:#999999;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- }
- .link{
- color:#333333;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- }
- }
- </style>
|