login.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view class="ezy-login-page">
  3. <view class="ezy-login-wrap" >
  4. <view class="login-body-box">
  5. <view class="login-title-img"></view>
  6. <view class="phone-prefix">验证码已发送至:{{data.phoneNumber}}</view>
  7. <view class="phone-input-box">
  8. <input class="phone-input" type="text" v-model="data.yzmNumber" placeholder="请输入验证码"
  9. maxlength="6" @input="clearYzmInput" />
  10. <view class="close-btn" v-if="data.clearYzmIcon" @click="clearYzm"></view>
  11. </view>
  12. <view class="yzm-btn-disabled" @click="loginBtn" :class="data.yzmStatus"></view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script setup>
  18. import {
  19. ref,
  20. reactive
  21. } from "vue"
  22. const data = reactive({
  23. phoneNumber: null,
  24. yzmNumber: null,
  25. clearYzmIcon: false,
  26. yzmStatus:'',
  27. })
  28. /********* 验证码 *********/
  29. const loginBtn = () => {
  30. uni.switchTab({
  31. url: '/pages/study/index'
  32. });
  33. /* uni.navigateTo({
  34. url: `/pages/study/index?gradeId=${options.grade}&termId=${options.term}&text=${text1}${text2}`
  35. }) */
  36. }
  37. const clearYzmInput = (event) => {
  38. if (event.detail.value.length > 0) {
  39. data.clearYzmIcon = true;
  40. } else {
  41. data.clearYzmIcon = false;
  42. }
  43. }
  44. const clearYzm = () => {
  45. data.yzmNumber = '';
  46. data.clearYzmIcon = false;
  47. }
  48. </script>