You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

change-password.vue 2.4KB

2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view class="content">
  3. <view class="item">
  4. <view class="title"> 旧密码 </view>
  5. <view class="flex">
  6. <input v-model="state.password" class="uni-input" placeholder="请输入旧密码" />
  7. <view @click="$util.navTo('/login/forget-pwd-step1',true)" forget-password class="resetPassword">
  8. 忘记旧密码
  9. </view>
  10. </view>
  11. </view>
  12. <view style="margin-top: 80rpx" class="item">
  13. <view class="title"> 新密码 </view>
  14. <input v-model="state.newPassword" class="uni-input" placeholder="请输入新密码" />
  15. </view>
  16. <view style="margin-top: 80rpx" class="item">
  17. <view class="title"> 再次确认 </view>
  18. <input v-model="state.affirmNewPassword" class="uni-input" placeholder="请再次输入新密码" />
  19. </view>
  20. <view class="action">
  21. <button type="default" class="button" @click="savaHandle()">
  22. 确认修改
  23. </button>
  24. </view>
  25. </view>
  26. </template>
  27. <script setup lang="ts">
  28. import {changePassword} from "@/utils/network/api.js";
  29. import {request} from "@/utils/network/request.js";
  30. import {reactive} from "vue";
  31. import {onLoad} from "@dcloudio/uni-app";
  32. import {msg} from "@/utils/utils";
  33. const state = reactive({
  34. password: "",
  35. newPassword: "",
  36. affirmNewPassword: "",
  37. });
  38. onLoad(() => {});
  39. const savaHandle = () => {
  40. const options = {
  41. type: 2,
  42. data: state,
  43. method: "POST",
  44. showLoading: true,
  45. };
  46. request(changePassword, options).then((res) => {
  47. msg("登录成功!");
  48. uni.navigateBack();
  49. });
  50. };
  51. </script>
  52. <style lang="scss" scoped>
  53. .content {
  54. padding: 80rpx 30rpx 30rpx 30rpx;
  55. .flex {
  56. display: flex;
  57. justify-content: space-between;
  58. align-items: center;
  59. }
  60. .item {
  61. border-bottom: 1px solid #dcdcdc;
  62. .title {
  63. font-size: 28rpx;
  64. font-family: Microsoft YaHei;
  65. font-weight: 400;
  66. color: #777777;
  67. line-height: 58rpx;
  68. }
  69. .uni-input {
  70. height: 60rpx;
  71. }
  72. .resetPassword {
  73. font-size: 28rpx;
  74. font-family: Microsoft YaHei;
  75. font-weight: 400;
  76. color: #00b38b;
  77. line-height: 28rpx;
  78. }
  79. }
  80. .action {
  81. margin-top: 60rpx;
  82. padding-left: 20rpx;
  83. padding-right: 20rpx;
  84. padding-bottom: 30rpx;
  85. .button {
  86. height: 80rpx;
  87. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  88. border-radius: 40rpx;
  89. font-size: 32rpx;
  90. font-weight: 400;
  91. color: #ffffff;
  92. line-height: 80rpx;
  93. }
  94. }
  95. }
  96. </style>