updatePassword.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. import {getDetailByIdApi,updateDoctor} from '@/api/doctor';
  25. export default {
  26. data() {
  27. return {
  28. oldPassword: "",
  29. password: "",
  30. }
  31. },
  32. methods: {
  33. submit() {
  34. let oldPassword = (this.oldPassword).trim();
  35. let password = (this.password).trim();
  36. if (oldPassword.length < 1) {
  37. uni.showToast({
  38. title: '请填写旧密码',
  39. icon: "error"
  40. })
  41. return;
  42. }
  43. if (password.length < 1) {
  44. uni.showToast({
  45. title: '请填写新密码',
  46. icon: "error"
  47. })
  48. return;
  49. }
  50. uni.showToast({
  51. title:'修改成功',
  52. complete() {
  53. uni.reLaunch({
  54. url:'/pages/login/index'
  55. })
  56. }
  57. })
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .content {
  64. .head {
  65. font-size: 50upx;
  66. text-align: center;
  67. padding: 40upx 0;
  68. letter-spacing: 2upx;
  69. }
  70. .updatePassword-wrap {
  71. margin: 100upx auto 0;
  72. box-sizing: border-box;
  73. padding: 20upx 30upx;
  74. border-radius: 8upx;
  75. .item {
  76. display: flex;
  77. justify-content: flex-start;
  78. align-items: center;
  79. height: 90upx;
  80. font-size: 32upx;
  81. line-height: 90upx;
  82. background-color: #fff;
  83. border-radius: 50upx;
  84. padding: 0 20upx;
  85. .input{
  86. width: 520upx;
  87. border: none;
  88. }
  89. &.password {
  90. margin-top: 40upx;
  91. }
  92. }
  93. .tip {
  94. text-align: right;
  95. padding: 18upx 0;
  96. font-size: 28upx;
  97. }
  98. .submit-BT {
  99. border-radius: 16upx;
  100. margin-top: 100upx;
  101. background-color: var(--sysblue);
  102. }
  103. }
  104. }
  105. </style>