forget.vue 4.1 KB

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