index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view class="reset-container">
  3. <!-- 顶部导航栏 -->
  4. <!-- 标题 "设置新密码" -->
  5. <view class="content">
  6. <view class="tip-text">请输入新密码,并重新登录验证</view>
  7. <view class="input-form">
  8. <view class="input-row">
  9. <input
  10. class="pwd-input"
  11. type="text"
  12. password
  13. placeholder="限12-20位字母和数字组合"
  14. placeholder-style="color:#ccc"
  15. v-model="pwd1"
  16. />
  17. </view>
  18. <view class="divider"></view>
  19. <view class="input-row">
  20. <input
  21. class="pwd-input"
  22. type="text"
  23. password
  24. placeholder="限12-20位字母和数字组合"
  25. placeholder-style="color:#ccc"
  26. v-model="pwd2"
  27. />
  28. </view>
  29. <view class="divider"></view>
  30. </view>
  31. <button class="confirm-btn" @click="confirmReset">确定</button>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. pwd1: '',
  40. pwd2: ''
  41. }
  42. },
  43. methods: {
  44. confirmReset() {
  45. if (!this.pwd1 || !this.pwd2) {
  46. uni.showToast({ title: '请输入密码', icon: 'none' });
  47. return;
  48. }
  49. if (this.pwd1 !== this.pwd2) {
  50. uni.showToast({ title: '两次密码不一致', icon: 'none' });
  51. return;
  52. }
  53. uni.showToast({ title: '重置成功', icon: 'success' });
  54. // 延迟跳转回登录页
  55. setTimeout(() => {
  56. uni.navigateBack({
  57. delta: 2 // 返回到登录页
  58. });
  59. }, 1500);
  60. }
  61. }
  62. }
  63. </script>
  64. <style>
  65. page {
  66. background-color: #fff;
  67. }
  68. .reset-container {
  69. padding: 40rpx;
  70. }
  71. .tip-text {
  72. font-size: 28rpx;
  73. color: #666;
  74. margin-bottom: 60rpx;
  75. }
  76. .input-form {
  77. margin-bottom: 80rpx;
  78. }
  79. .input-row {
  80. padding: 30rpx 0;
  81. }
  82. .pwd-input {
  83. font-size: 30rpx;
  84. width: 100%;
  85. color: #333;
  86. }
  87. .divider {
  88. height: 1px;
  89. background-color: #eee;
  90. }
  91. .confirm-btn {
  92. background: linear-gradient(90deg, #FF6F00 0%, #FF5722 100%);
  93. color: #fff;
  94. font-size: 32rpx;
  95. font-weight: bold;
  96. border-radius: 8rpx;
  97. height: 88rpx;
  98. line-height: 88rpx;
  99. }
  100. .confirm-btn::after {
  101. border: none;
  102. }
  103. </style>