forget.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view style="position: relative;">
  3. <view class="bg"></view>
  4. <view class="bg1"></view>
  5. <view class="back" @click="$back">
  6. <u-icon name="arrow-left" size="50" color="#919191"></u-icon>
  7. </view>
  8. <view class="content">
  9. <view class="top">
  10. <view class="title">
  11. <text>忘记登录密码</text>
  12. <text>输入手机号进行找回密码</text>
  13. </view>
  14. </view>
  15. <view style="width: 76%;margin-top: 80rpx;">
  16. <u-form >
  17. <u-form-item label="手机号" prop="phone" label-width="150">
  18. <u-input :border="false" placeholder="请输入手机号" v-model="phone" type="number"></u-input>
  19. </u-form-item>
  20. <u-form-item label="验证码" prop="code" label-width="150">
  21. <view class="flex" >
  22. <u-input style="width: 100%;" :border="false" placeholder="请输入验证码" v-model="code" type="text"></u-input>
  23. <u-button shape="circle" slot="right" :custom-style="customStyle" size="mini" @click="getCode">{{codeTips}}</u-button>
  24. </view>
  25. </u-form-item>
  26. <u-form-item label="密码" prop="phone" label-width="150">
  27. <u-input :border="false" placeholder="请设置新的登录密码" v-model="phone" type="number"></u-input>
  28. </u-form-item>
  29. <u-form-item label="确认密码" prop="phone" label-width="150">
  30. <u-input :border="false" placeholder="请再次输入密码" v-model="phone" type="number"></u-input>
  31. </u-form-item>
  32. </u-form>
  33. </view>
  34. <view style="width: 86%;margin-top: 80rpx;">
  35. <view @click="login" class="btn cu-btn round" style="width:100%;height: 90rpx;font-size: 34rpx;">
  36. 确认修改并登录
  37. </view>
  38. </view>
  39. </view>
  40. <u-verification-code seconds="60" ref="uCode" @change="codeChange"></u-verification-code>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. data() {
  46. return {
  47. customStyle:{
  48. 'backgroundColor':'#d18c42',
  49. 'color':'#ffffff'
  50. },
  51. codeTips: '',
  52. phone:'',
  53. code:'',
  54. }
  55. },
  56. methods: {
  57. login(){
  58. uni.reLaunch({
  59. url:"/pages/index/index"
  60. })
  61. },
  62. codeChange(text) {
  63. this.codeTips = text;
  64. },
  65. // 获取验证码
  66. getCode() {
  67. if(this.$refs.uCode.canGetCode) {
  68. // 模拟向后端请求验证码
  69. uni.showLoading({
  70. title: '正在获取验证码',
  71. mask: true
  72. })
  73. setTimeout(() => {
  74. uni.hideLoading();
  75. // 这里此提示会被this.start()方法中的提示覆盖
  76. this.$u.toast('验证码已发送');
  77. // 通知验证码组件内部开始倒计时
  78. this.$refs.uCode.start();
  79. }, 2000);
  80. } else {
  81. this.$u.toast('倒计时结束后再发送');
  82. }
  83. },
  84. }
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. $color:#d18c42;
  89. page{
  90. background-color: #FFFFFF;
  91. }
  92. .btn{
  93. background-color: $color;
  94. color:#FFFFFF;
  95. }
  96. .btn{
  97. background-color: $color;
  98. color:#FFFFFF;
  99. }
  100. .bg{
  101. z-index: 99;
  102. height: 400rpx;
  103. width: 400rpx;
  104. position: absolute;
  105. right: -240rpx;
  106. top: -240rpx;
  107. background-color: #d18c42;
  108. border-radius: 50%;
  109. box-shadow: 0rpx 0rpx 50rpx #c5803b;
  110. }
  111. .bg1{
  112. height: 460rpx;
  113. width: 460rpx;
  114. position: absolute;
  115. right: -240rpx;
  116. top: -240rpx;
  117. background-color: #d18c42;
  118. border-radius: 50%;
  119. box-shadow: #c6813b;
  120. }
  121. .back{
  122. position: absolute;
  123. top: var(--status-bar-height);
  124. left: 20rpx;
  125. padding-top: var(--status-bar-height);
  126. }
  127. .content{
  128. height: 90vh;
  129. display: flex;
  130. flex-direction: column;
  131. justify-content: center;
  132. align-items: center;
  133. .top{
  134. width: 76%;
  135. display: flex;
  136. .title{
  137. margin-right: 20rpx;
  138. display: flex;
  139. flex-direction: column;
  140. justify-content: center;
  141. align-items: flex-start;
  142. text-align: left;
  143. text:first-child{
  144. font-weight: 800;
  145. font-size: 60rpx;
  146. color: #000;
  147. margin-bottom: 20rpx;
  148. }
  149. text:last-child{
  150. font-size: 28rpx;
  151. color: #7f7f7f;
  152. }
  153. }
  154. }
  155. }
  156. </style>