|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <template>
- <view class="content">
- <view class="item">
- <view class="title"> 旧密码 </view>
- <view class="flex">
- <input v-model="state.password" class="uni-input" placeholder="请输入旧密码" />
- <view @click="$util.navTo('/login/forget-pwd-step1',true)" forget-password class="resetPassword">
- 忘记旧密码
- </view>
- </view>
- </view>
- <view style="margin-top: 80rpx" class="item">
- <view class="title"> 新密码 </view>
- <input v-model="state.newPassword" class="uni-input" placeholder="请输入新密码" />
- </view>
- <view style="margin-top: 80rpx" class="item">
- <view class="title"> 再次确认 </view>
- <input v-model="state.affirmNewPassword" class="uni-input" placeholder="请再次输入新密码" />
- </view>
-
- <view class="action">
- <button type="default" class="button" @click="savaHandle()">
- 确认修改
- </button>
- </view>
- </view>
- </template>
-
- <script setup lang="ts">
- import {changePassword} from "@/utils/network/api.js";
- import {request} from "@/utils/network/request.js";
- import {stringToJson} from "@/utils/network/encryption";
- import {reactive} from "vue";
- import {onLoad} from "@dcloudio/uni-app";
- import {msg} from "@/utils/utils";
-
- const state = reactive({
- password: "",
- newPassword: "",
- affirmNewPassword: "",
- });
-
- onLoad(() => {});
- const savaHandle = () => {
- const options = {
- type: 2,
- data: state,
- method: "POST",
- showLoading: true,
- };
- request(changePassword, options).then((res) => {
- msg("登录成功!");
- uni.navigateBack();
- });
- };
- </script>
-
- <style lang="scss" scoped>
- .content {
- padding: 80rpx 30rpx 30rpx 30rpx;
-
- .flex {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
-
- .item {
- border-bottom: 1px solid #dcdcdc;
-
- .title {
- font-size: 28rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #777777;
- line-height: 58rpx;
- }
-
- .uni-input {
- height: 60rpx;
- }
-
- .resetPassword {
- font-size: 28rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #00b38b;
- line-height: 28rpx;
- }
- }
-
- .action {
- margin-top: 60rpx;
- padding-left: 20rpx;
- padding-right: 20rpx;
- padding-bottom: 30rpx;
-
- .button {
- height: 80rpx;
- background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
- border-radius: 40rpx;
- font-size: 32rpx;
- font-weight: 400;
- color: #ffffff;
- line-height: 80rpx;
- }
- }
- }
- </style>
|