updatePassword.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="content">
  3. <view class="updatePassword-wrap">
  4. <view class="username item">
  5. <text>旧密码:</text>
  6. <uni-easyinput :inputBorder="false" v-model="oldPassword"
  7. class="input"
  8. type="text"
  9. placeholder="请输入旧密码" />
  10. </view>
  11. <view class="password item">
  12. <text>新密码:</text>
  13. <uni-easyinput v-model="password"
  14. :inputBorder="false"
  15. class="input"
  16. type="text" placeholder="请输入新密码">
  17. </uni-easyinput>
  18. </view>
  19. <button type="primary" @click="submit" class="submit-BT">提交</button>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. oldPassword: "",
  28. password: "",
  29. }
  30. },
  31. methods: {
  32. submit() {
  33. let oldPassword = (this.oldPassword).trim();
  34. let password = (this.password).trim();
  35. if (oldPassword.length < 1) {
  36. uni.showToast({
  37. title: '请填写旧密码',
  38. icon: "error"
  39. })
  40. return;
  41. }
  42. if (password.length < 1) {
  43. uni.showToast({
  44. title: '请填写新密码',
  45. icon: "error"
  46. })
  47. return;
  48. }
  49. uni.showToast({
  50. title:'修改成功',
  51. complete() {
  52. uni.reLaunch({
  53. url:'/pages/login/index'
  54. })
  55. }
  56. })
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss" scoped>
  62. .content {
  63. .head {
  64. font-size: 50upx;
  65. text-align: center;
  66. padding: 40upx 0;
  67. letter-spacing: 2upx;
  68. }
  69. .updatePassword-wrap {
  70. margin: 100upx auto 0;
  71. box-sizing: border-box;
  72. padding: 20upx 30upx;
  73. border-radius: 8upx;
  74. .item {
  75. display: flex;
  76. justify-content: flex-start;
  77. align-items: center;
  78. height: 90upx;
  79. font-size: 32upx;
  80. line-height: 90upx;
  81. background-color: #fff;
  82. border-radius: 50upx;
  83. padding: 0 20upx;
  84. .input{
  85. width: 520upx;
  86. border: none;
  87. }
  88. &.password {
  89. margin-top: 40upx;
  90. }
  91. }
  92. .tip {
  93. text-align: right;
  94. padding: 18upx 0;
  95. font-size: 28upx;
  96. }
  97. .submit-BT {
  98. width: 424rpx;
  99. height: 72rpx;
  100. line-height: 72rpx;
  101. text-align: center;
  102. background:#3D90F4;
  103. border-radius: 42rpx;
  104. font-size: 32rpx;
  105. font-family: PingFang SC;
  106. font-weight: 400;
  107. color: #FFFFFF;
  108. z-index: 999;
  109. margin: 0 auto;
  110. }
  111. }
  112. }
  113. </style>