<template>
|
<view class="address-form" :data-theme='theme()' :class="theme() || ''">
|
<view class="bg-white p-0-30 f30">
|
<view class="d-b-c p-30-0 border-b">
|
<text class="key-name">账号</text>
|
<view class="flex-1">
|
{{detail.user_name}}
|
</view>
|
</view>
|
<view class="d-b-c p-30-0 border-b">
|
<text class="key-name">新密码</text>
|
<view class="flex-1">
|
<input type="password" v-model="password" placeholder='请输入新密码' />
|
</view>
|
</view>
|
<view class="d-b-c p-30-0 border-b">
|
<text class="key-name">重复新密码</text>
|
<view class="flex-1">
|
<input type="password" v-model="confirmPass" placeholder='请再输入一次新密码' />
|
</view>
|
</view>
|
<view class="p-30-0">
|
<view class="setup-btn" @tap="onSubmit()">确认修改</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
password: '',
|
confirmPass: '',
|
detail:{},
|
};
|
},
|
onShow() {
|
this.getData();
|
},
|
methods: {
|
getData() {
|
let self = this;
|
self._get('supplier.index/editPass', {
|
|
},(res)=>{
|
self.detail = res.data.model;
|
})
|
},
|
|
onSubmit() {
|
let self = this;
|
if (self.loading) {
|
return
|
}
|
if (self.password == '') {
|
uni.showToast({
|
title: '请输入新密码',
|
duration: 1000,
|
icon: "none"
|
});
|
return;
|
}
|
if (self.password != self.confirmPass) {
|
uni.showToast({
|
title: '两次输入的密码不一致',
|
duration: 1000,
|
icon: "none"
|
});
|
return;
|
}
|
uni.showLoading({
|
title:'加载中'
|
})
|
self.loading = true;
|
self._post('supplier.index/editPass', {password: self.password, confirmPass: self.confirmPass}, function(res) {
|
self.showSuccess('修改成功', function() {
|
self.loading = false;
|
uni.hideLoading();
|
uni.navigateBack({});
|
},
|
function(err) {
|
uni.hideLoading();
|
self.loading = false;
|
}
|
)
|
|
});
|
},
|
}
|
};
|
</script>
|
|
<style lang="scss">
|
.address-form .key-name {
|
width: 200rpx;
|
}
|
|
.address-form .btn-red {
|
height: 88rpx;
|
line-height: 88rpx;
|
border-radius: 44rpx;
|
}
|
|
.setup-btn {
|
height: 80rpx;
|
line-height: 80rpx;
|
border-radius: 80rpx;
|
@include background_color('background_color');
|
color: #fff;
|
font-size: 30rpx;
|
display: flex;
|
justify-content: center;
|
margin: 0 auto;
|
}
|
|
.make-item {
|
height: 60rpx;
|
|
}
|
|
.btn-red.code-btn {
|
height: 54rpx;
|
line-height: 54rpx;
|
}
|
|
.btn-red.code-btn.issend {
|
background: #666666;
|
border: none;
|
color: #FFFFFF;
|
box-shadow: none;
|
}
|
|
.sub-box {
|
padding: 40rpx 0;
|
|
.setup-btn {
|
width: 686rpx;
|
height: 84rpx;
|
@include background_color('background_color');
|
border-radius: 6rpx;
|
line-height: 84rpx;
|
color: #fff;
|
font-size: 30rpx;
|
display: flex;
|
justify-content: center;
|
margin: 0 auto;
|
}
|
}
|
</style>
|