123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <template>
- <view class="page">
- <view class="title">身份验证</view>
- <view class="input u-flex" style="margin-top: 28rpx;">
- <u-input placeholder-style='font-size: 32rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- color: #222222;opacity: 0.5;' placeholder='手机号' v-model="resultPhone" type="text" :border="false"
- :clearable='false' />
- </view>
- <view class="input u-flex">
- <u-input placeholder-style='font-size: 32rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- color: #222222;opacity: 0.5;' placeholder='请输入验证码' v-model="code" type="text" :border="false" :clearable='false' />
- <view class="code" @click="getCode">
- {{tips}}
- </view>
- </view>
- <view class="button" @click="changePasswoed">
- 确认
- </view>
- <u-verification-code :seconds="seconds" ref="uCode" @change="codeChange"></u-verification-code>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- code: '',
- phone: '',
- resultPhone: '',
- tips: '',
- seconds: ''
- };
- },
- onLoad() {
- if (uni.getStorageSync('token')) {
- this.getUserinfo()
- }
- },
- methods: {
- codeChange(text) {
- this.tips = text;
- },
- changePasswoed() {
- uni.navigateTo({
- url: '/pages/login/changePasswoed?mobile=' + this.phone
- })
- },
- getUserinfo() {
- this.$u.post('api/user/getUserinfo').then(res => {
- this.phone = res.mobile
- this.resultPhone = res.phone_r
- })
- },
- getCode() {
- if (this.$refs.uCode.canGetCode) {
-
- uni.showLoading({
- title: '正在获取验证码',
- mask: true
- })
- this.$u.post('/api/sms/send', {
- mobile: this.phone,
- password: this.password
- }).then(res => {
- if (res.code == 1) {
- uni.hideLoading();
-
- this.$u.toast('验证码已发送');
-
- this.$refs.uCode.start();
- } else {
- this.$u.toast(res.msg)
- }
- })
- } else {
- this.$u.toast('倒计时结束后再发送');
- }
- },
- }
- }
- </script>
- <style lang="scss">
- .page {
- padding: 52rpx 36rpx 0;
- border-top: 2rpx solid rgba(235, 235, 235, 1);
- }
- .code {
- font-size: 32rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- color: #06A971;
- }
- .button {
- width: 678rpx;
- height: 84rpx;
- background: #06A971;
- border-radius: 8rpx;
- // opacity: 0.5;
- text-align: center;
- margin-top: 46rpx;
- line-height: 84rpx;
- font-size: 32rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- color: #FFFFFF;
- }
- .title {
- height: 74rpx;
- font-size: 52rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 500;
- color: #222222;
- line-height: 74rpx;
- }
- .input {
- height: 122rpx;
- display: flex;
- align-items: center;
- border-bottom: 2rpx solid rgba(0, 0, 0, 0.14);
- }
- </style>
|