forgetPwd.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="container">
  3. <view class="tui-page-title">找回密码</view>
  4. <view class="tui-form">
  5. <view class="tui-view-input">
  6. <tui-list-cell :hover="false" :lineLeft="false" backgroundColor="transparent">
  7. <view class="tui-cell-input">
  8. <tui-icon name="mobile" color="#6d7a87" :size="20"></tui-icon>
  9. <input :value="mobile" placeholder="请输入手机号" placeholder-class="tui-phcolor" type="number" maxlength="11" @input="inputMobile" />
  10. <view class="tui-icon-close" v-show="mobile" @tap="clearInput(1)"><tui-icon name="close-fill" :size="16" color="#bfbfbf"></tui-icon></view>
  11. </view>
  12. </tui-list-cell>
  13. <tui-list-cell :hover="false" :lineLeft="false" backgroundColor="transparent">
  14. <view class="tui-cell-input">
  15. <tui-icon name="shield" color="#6d7a87" :size="20"></tui-icon>
  16. <input placeholder="请输入验证码" placeholder-class="tui-phcolor" type="text" maxlength="6" @input="inputCode" />
  17. <view class="tui-btn-send" :class="{ 'tui-gray': isSend }" :hover-class="isSend ? '' : 'tui-opcity'" :hover-stay-time="150">{{ btnSendText }}</view>
  18. </view>
  19. </tui-list-cell>
  20. <tui-list-cell :hover="false" :lineLeft="false" backgroundColor="transparent">
  21. <view class="tui-cell-input">
  22. <tui-icon name="pwd" color="#6d7a87" :size="20"></tui-icon>
  23. <input :value="password" placeholder="请输入新密码" :password="true" placeholder-class="tui-phcolor" type="text" maxlength="40" @input="inputPwd" />
  24. <view class="tui-icon-close" v-show="password" @tap="clearInput(2)"><tui-icon name="close-fill" :size="16" color="#bfbfbf"></tui-icon></view>
  25. </view>
  26. </tui-list-cell>
  27. </view>
  28. <view class="tui-btn-box"><tui-button :disabledGray="true" :disabled="disabled" :shadow="true" shape="circle">确认修改</tui-button></view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. computed: {
  35. disabled: function() {
  36. let bool = true;
  37. if (this.mobile && this.code && this.password) {
  38. bool = false;
  39. }
  40. return bool;
  41. }
  42. },
  43. data() {
  44. return {
  45. mobile: '',
  46. password: '',
  47. code: '',
  48. isSend: false,
  49. btnSendText: '获取验证码' //倒计时格式:(60秒)
  50. };
  51. },
  52. methods: {
  53. inputCode(e) {
  54. this.code = e.detail.value;
  55. },
  56. inputMobile: function(e) {
  57. this.mobile = e.detail.value;
  58. },
  59. inputPwd: function(e) {
  60. this.password = e.detail.value;
  61. },
  62. clearInput(type) {
  63. if (type == 1) {
  64. this.mobile = '';
  65. } else {
  66. this.password = '';
  67. }
  68. }
  69. },
  70. /**
  71. * 页面相关事件处理函数--监听用户下拉动作
  72. */
  73. onPullDownRefresh: function() {
  74. setTimeout(() => {
  75. uni.stopPullDownRefresh()
  76. }, 200);
  77. },
  78. };
  79. </script>
  80. <style lang="scss">
  81. .container {
  82. .tui-page-title {
  83. width: 100%;
  84. font-size: 48rpx;
  85. font-weight: bold;
  86. color: $uni-text-color;
  87. line-height: 42rpx;
  88. padding: 110rpx 40rpx 40rpx 40rpx;
  89. box-sizing: border-box;
  90. }
  91. .tui-form {
  92. padding-top: 50rpx;
  93. .tui-view-input {
  94. width: 100%;
  95. box-sizing: border-box;
  96. padding: 0 40rpx;
  97. .tui-cell-input {
  98. width: 100%;
  99. display: flex;
  100. align-items: center;
  101. padding-top: 48rpx;
  102. padding-bottom: $uni-spacing-col-base;
  103. input {
  104. flex: 1;
  105. padding-left: $uni-spacing-row-base;
  106. }
  107. .tui-icon-close {
  108. margin-left: auto;
  109. }
  110. .tui-btn-send {
  111. width: 156rpx;
  112. text-align: right;
  113. flex-shrink: 0;
  114. font-size: $uni-font-size-base;
  115. color: $uni-color-primary;
  116. }
  117. .tui-gray {
  118. color: $uni-text-color-placeholder;
  119. }
  120. }
  121. }
  122. .tui-btn-box {
  123. width: 100%;
  124. padding: 0 $uni-spacing-row-lg;
  125. box-sizing: border-box;
  126. margin-top: 80rpx;
  127. }
  128. }
  129. }
  130. </style>