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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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" focus 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" focus 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" focus 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 {stringToJson} from "@/utils/network/encryption";
  31. import {reactive} from "vue";
  32. import {onLoad} from "@dcloudio/uni-app";
  33. import {msg} from "@/utils/utils";
  34. const state = reactive({
  35. password: "",
  36. newPassword: "",
  37. affirmNewPassword: "",
  38. });
  39. onLoad(() => {});
  40. const savaHandle = () => {
  41. const options = {
  42. type: 2,
  43. data: state,
  44. method: "POST",
  45. showLoading: true,
  46. };
  47. request(changePassword, options).then((res) => {
  48. msg("登录成功!");
  49. uni.navigateBack();
  50. });
  51. };
  52. </script>
  53. <style lang="scss" scoped>
  54. .content {
  55. padding: 80rpx 30rpx 30rpx 30rpx;
  56. .flex {
  57. display: flex;
  58. justify-content: space-between;
  59. align-items: center;
  60. }
  61. .item {
  62. border-bottom: 1px solid #dcdcdc;
  63. .title {
  64. font-size: 28rpx;
  65. font-family: Microsoft YaHei;
  66. font-weight: 400;
  67. color: #777777;
  68. line-height: 58rpx;
  69. }
  70. .uni-input {
  71. height: 60rpx;
  72. }
  73. .resetPassword {
  74. font-size: 28rpx;
  75. font-family: Microsoft YaHei;
  76. font-weight: 400;
  77. color: #00b38b;
  78. line-height: 28rpx;
  79. }
  80. }
  81. .action {
  82. margin-top: 60rpx;
  83. padding-left: 20rpx;
  84. padding-right: 20rpx;
  85. padding-bottom: 30rpx;
  86. .button {
  87. height: 80rpx;
  88. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  89. border-radius: 40rpx;
  90. font-size: 32rpx;
  91. font-weight: 400;
  92. color: #ffffff;
  93. line-height: 80rpx;
  94. }
  95. }
  96. }
  97. </style>