| | |
| | | <view class="item"> |
| | | <view class="la">验证码</view> |
| | | <view class="df_sb"> |
| | | <input |
| | | v-model="form.code" |
| | | placeholder="请输入验证码" |
| | | placeholder-class="placeholder9" |
| | | :maxlength="6" |
| | | type="number" |
| | | /> |
| | | <text class="captcha" v-if="countDown == 0" @click="initCaptcha" |
| | | >获取验证码</text |
| | | > |
| | | <input v-model="form.code" placeholder="请输入验证码" placeholder-class="placeholder9" :maxlength="6"
|
| | | type="number" />
|
| | | <text class="captcha" v-if="countDown == 0" @click="initCaptcha">获取验证码</text>
|
| | | <text class="placeholder9" v-else>{{ countDown }}</text> |
| | | </view> |
| | | </view> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { sendSms, loginGkUserWithCode, wxAuthorizea, getUserInfo } from '@/api' |
| | | import {
|
| | | sendSms,
|
| | | loginGkUserWithCode,
|
| | | wxAuthorizea,
|
| | | getUserInfo
|
| | | } from '@/api'
|
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | }, |
| | | countDown: 0, |
| | | |
| | | code: '' |
| | | code: '111'
|
| | | }; |
| | | }, |
| | | onShow() { |
| | |
| | | }, |
| | | methods: { |
| | | onSubmit() { |
| | | const { code, phone } = this.form |
| | | const {
|
| | | code,
|
| | | phone
|
| | | } = this.form
|
| | | if (!phone) return this.showToast('手机号不能为空') |
| | | if (!code) return this.showToast('验证码不能为空') |
| | | loginGkUserWithCode({ |
| | | phone, code,openid: this.$store.state.openId, userType: 3 |
| | | phone,
|
| | | code,
|
| | | openid: this.$store.state.openId,
|
| | | userType: 3
|
| | | }).then(res => { |
| | | if (res && res.code == 200) { |
| | | this.$store.commit('setToken', res.data) |
| | |
| | | title: '手机号不能为空', |
| | | icon: 'none' |
| | | }) |
| | | sendSms({ phone: this.form.phone }).then(res => { |
| | | sendSms({
|
| | | phone: this.form.phone
|
| | | }).then(res => {
|
| | | if (res.code === 200) {
|
| | | this.countDown = 60 |
| | | setInterval(() => { |
| | | if (this.countDown == 0) return |
| | | this.countDown-- |
| | | }, 1000) |
| | | }
|
| | | }) |
| | | }, |
| | | } |
| | |
| | | <style lang="scss"> |
| | | .main_app{ |
| | | padding-top: 218rpx; |
| | |
|
| | | .bg{ |
| | | width: 750rpx; |
| | | position: absolute; |
| | |
| | | top: 0; |
| | | z-index: -1; |
| | | } |
| | |
|
| | | .login_wrap { |
| | | width: 690rpx; |
| | | height: 490rpx; |
| | |
| | | box-sizing: border-box; |
| | | margin-bottom: 30rpx; |
| | | border-bottom: 1px solid #E5E5E5; |
| | |
|
| | | &:last-child { |
| | | margin-bottom: 0 !important; |
| | | } |
| | |
| | | font-size: 28rpx; |
| | | color: #222222; |
| | | } |
| | |
|
| | | .captcha { |
| | | color: $uni-color-primary; |
| | | } |
| | |
|
| | | .df_sb{ |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | |
|
| | | input { |
| | | flex: 1; |
| | | height: 86rpx; |
| | |
| | | } |
| | | } |
| | | } |
| | |
|
| | | .login_btn { |
| | | width: 630rpx; |
| | | height: 88rpx; |
| | | box-sizing: border-box; |
| | | margin-top: 40rpx; |
| | |
|
| | | .login_btn_n { |
| | | width: 100%; |
| | | height: 98rpx; |