|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- <template>
- <view class="content">
- <view class="head">
- <view class="text">
- <view class="text1">
- <view style="color: #666666;">输入短信验证码</view>
- <view style="color: #303030;margin-top: 20rpx;">短信已发送至{{phone}},请在下方输入框内输入4位数字验证码</view>
- </view>
- </view>
- </view>
- <view class="sction">
- <view class="mama">
- <view class="mamaz">
- <input type="text" v-model="msg" maxlength="4" placeholder="请输入验证码" placeholder-class="input-class" class="input" />
- </view>
- <view class="mamay">
- <view class="sada" v-if="sendAuthCode" style="font-size: 35rpx;" @click="getAuthCode">获取验证码</view>
- <text class="sada" v-if="!sendAuthCode">
- 重新发送
- <text>({{ auth_time }})</text>
- </text>
- </view>
- </view>
- <view class="login-btn" :style="{ background: msg == '' ? '#F2F2F2' : '#2671E2' }" @click="denglu"><text
- class="">确认</text></view>
- <view class="code-login" @click="passwordlogin"><text>密码登录</text></view>
- </view>
- </view>
- </template>
-
- <script>
- var util = require("../../utils/util.js");
- var config = require("../../config");
- var app = getApp();
- export default {
- data() {
- return {
- sendAuthCode: true,
- auth_time: 0,
- msg: '',
- phonecet: '',
- role:'',
- phone:'',
- msgs:''
- };
- },
- onLoad: function(options) {
- var phonese = options.username;
- var phonexxz = phonese.substring(0, 3) + '****' + phonese.substring(7);
- this.phone = phonexxz;
- this.phonecet = options.username;
- this.role = options.role;
- this.msgs=options.msg;
- this.sendAuthCode = false;
- this.auth_time = 60;
- var auth_timetimer = setInterval(() => {
- this.auth_time--;
- if (this.auth_time <= 0) {
- this.sendAuthCode = true;
- clearInterval(auth_timetimer);
- }
- }, 1000);
- },
- methods: {
- //跳转密码登录页面
- passwordlogin() {
- uni.reLaunch({
- url: '/pages/login/index',
- })
- },
- //获取验证码
- getAuthCode() {
- this.sendAuthCode = false;
- this.auth_time = 60;
- var auth_timetimer = setInterval(() => {
- this.auth_time--;
- if (this.auth_time <= 0) {
- this.sendAuthCode = true;
- clearInterval(auth_timetimer);
- }
- }, 1000);
- },
- //登录
- denglu() {
- if (this.msg=='') {
- uni.showToast({
- title: '验证码不能为空',
- icon: 'none'
- });
- return
- }
- if (this.msg.length == 4) {
-
- if(this.msgs==this.msg){
- uni.navigateTo({
- url: '/pages/login/Setthepassword?username='+this.phonecet,
- })
- }else{
- this.msg='';
- uni.showToast({
- title: '验证码错误',
- icon: 'none'
- });
- }
- } else {
- uni.showToast({
- title: '验证码位数不正确',
- icon: 'none'
- });
- }
-
- },
- }
- };
- </script>
-
- <style lang="scss">
- .head {
- width: 750rpx;
- height:400rpx;
- position: relative;
- .text{
- width: 100%;
- position: absolute;
- top: 180rpx;
- left: 0rpx;
- .text1{
- width: 80%;
- margin: 0 auto;
- }
- }
- }
- .mama {
- width: 620rpx;
- display: flex;
- border-bottom: 1px solid #E1E1E1;
- margin: 60rpx auto;
- }
-
- .sadsadasdasdsadasd {
- font-size: 34rpx;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #008EF2;
- width: 100%;
- text-align: center;
- padding-top: 340rpx;
- }
-
- .mamaz {
- width: 50%;
- height: 90rpx;
- }
-
- .mamay {
- width: 50%;
- height: 90rpx;
- }
-
- .input {
- width: 350rpx;
- color: #78DFB0;
- height: 100%;
- line-height: 90rpx;
- font-size: 17px;
- color: #171717;
- }
-
- .sada {
- width: 70%;
- line-height: 90rpx;
- color: #2B6EFF;
- text-align: right;
- font-size: 35rpx;
- margin-left: 100rpx;
- display: block;
- }
- .content {
- margin: 0;
- padding: 0;
- border-top: 1rpx solid #E0E0E0;
- }
- .login-text {
- font-size: 60rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: rgba(23, 23, 23, 1);
- letter-spacing: 8rpx;
- margin-left: 75rpx;
- font-weight: bold;
- }
-
- .login-input {
- border-bottom: 1px solid #e1e1e1;
- color: #c9cac9;
- margin: 98rpx 64rpx 200rpx 75rpx;
- font-size: 17px;
-
- }
-
- .login-btn {
- margin: 0 auto;
- margin-top: 240rpx;
- width: 630rpx;
- height: 86rpx;
- border-radius: 49rpx;
- font-size: 17px;
- font-weight: bold;
- border: none;
- display: flex;
- justify-content: center;
- align-items: center;
- color: #ffffff;
- }
-
- .code-login {
- display: flex;
- justify-content: center;
- margin-top: 40rpx;
- color: #D6D7D6;
- margin-bottom: 200rpx;
- font-size: 30rpx;
- }
-
- .log-box {
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- font-size: 28rpx;
- color: #bfc0bf;
- margin-bottom: 65rpx;
- }
-
- .hengx {
- margin: 0 20rpx 0 20rpx;
- height: 2rpx;
- width: 232rpx;
- background: #e1e1e1;
- }
-
- .wechat {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 93rpx;
- height: 93rpx;
- background: rgba(255, 255, 255, 1);
- box-shadow: 0px 10rpx 30rpx rgba(120, 223, 176, 0.22);
- border-radius: 50%;
- margin: 0 auto;
- }
-
- .btn-get {
- width: 250rpx;
- font-size: 17px;
- color: #c9cac9;
- position: relative;
- top: -290rpx;
- right: -450rpx;
- }
-
- .input-class {
- color: #D6D7D6;
- font-size: 17px;
- letter-spacing: 1rpx;
- }
- </style>
|