123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <template>
- <view class="changePwd">
- <u-navbar ref="uNavbar" :border-bottom="false" :back-icon-color="setNav.backColor" :is-back="setNav.isdisPlayNavTitle"
- :title-size="setNav.size" :title-bold="setNav.bold" :title="setNav.navTitle" :title-color="setNav.color" :background="setNav"></u-navbar>
-
- <view class="input">
- <view class="lable">旧密码</view>
- <input type="text" v-model="oldPassword" placeholder="请输入旧密码" />
- </view>
- <view class="input">
- <view class="lable">新密码</view>
- <input type="text" v-model="newPassword" placeholder="请输入新密码" />
- </view>
- <view class="input">
- <view class="lable">再次确认密码</view>
- <input type="text" v-model="newPassword1" placeholder="请再次输入新密码" />
- </view>
- <view class="btn" @click="getQueryList">确认修改</view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- setNav: {
- backgroundColor: '#fff', //背景色
- color: '##343434', //字体颜色
- bold: true,
- size: '36',
- backColor: '##343434',
- isdisPlayNavTitle: true, //是否显示返回按钮
- navTitle: '修改密码' //导航标题
- },
- oldPassword: '',
- newPassword: '',
- newPassword1: '',
- }
- },
- onLoad() {
-
- },
- computed: {
- },
- methods: {
- async getQueryList() {
- if (!this.oldPassword) {
- return uni.showToast({
- 'title': '请输入旧密码',
- icon: 'none'
- })
- }
- if (!this.newPassword) {
- return uni.showToast({
- 'title': '请输入新密码',
- icon: 'none'
- })
- }
- if (!this.newPassword1) {
- return uni.showToast({
- 'title': '请再次输入新密码',
- icon: 'none'
- })
- }
- if (this.newPassword != this.newPassword1) {
- return uni.showToast({
- 'title': '新密码不匹配',
- icon: 'none'
- })
- }
- let res = await this.$u.put(`system/user/profile/updatePwd?oldPassword=${this.oldPassword}&newPassword=${this.newPassword}`, {
- "oldPassword": this.oldPassword,
- "newPassword": this.newPassword
- })
- console.log(res)
- if (res.code ==500){
- uni.showToast({
- 'title': res.msg,
- icon: 'none'
- })
- } else {
- uni.showToast({
- 'title': res.msg
- })
- setTimeout(function(){
- uni.navigateBack({
-
- })
- }, 1000)
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .changePwd {
- height: 100%;
- background: #fff;
- .input {
- display: flex;
- align-items: center;
- padding: 22rpx 34rpx;
- font-size: 28rpx;
- font-weight: 500;
- color: #343434;
- input {
- font-size: 28rpx;
- font-weight: 400;
- color: #AAAAAA;
- flex: 1;
- text-align: right;
- }
- }
- .btn {
- width: 90%;
- height: 82rpx;
- background: #009FE8;
- border-radius: 6px;
- margin: 100rpx auto;
- color: #fff;
- text-align: center;
- line-height: 82rpx;
- font-size: 28rpx;
- }
- }
- </style>
|