123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <template>
- <view class="content">
- <view class="line">
- <view class="input-label">新密码</view>
- <view>
- <input type="password" v-model="userPwd1" class="input-field" placeholder="请输入当前密码"/>
- </view>
- </view>
- <view class="line">
- <view class="input-label">新密码</view>
- <view>
- <input class="input-field" v-model="userPwd2" type="password" placeholder="请再次输入新密码"/>
- </view>
- </view>
- <view class="submit" @click="submitFn">提交</view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- userPwd1: '',
- userPwd2:'',
- userId:'',
- }
- },
- onLoad() {
- this.userId=uni.getStorageSync('users').userId
- },
- methods: {
- submitFn(){
- if(this.userPwd2!=this.userPwd1){
- uni.showToast({
- icon: 'none',
- title: '俩次密码不一致',
- duration: 3000
- });
- return false
- }
- this.$http('imSys/changePwd', {
- userId:this.userId,
- userPwd:this.userPwd1
- },'POST').then(res => {
- if(res.code==0){
- uni.showToast({
- icon: 'none',
- title: '修改成功',
- duration: 3000
- });
- /* uni.navigateTo({
- url: './login'
- }) */
- }
-
- })
- }
- }
- }
- </script>
- <style>
-
- .submit{
- width: 650rpx;
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
- background: #3F90F7;
- color: #ffffff;
- font-size: 30rpx;
- border-radius: 10rpx;
- position: fixed;
- bottom: 100rpx;
- left: 50rpx;
- }
- .line{
- display: flex;
- padding: 30rpx 20rpx;
- border-bottom: 1px solid #eee;
- color: #333333;
- }
- .input-field{
- padding-left: 50rpx;
- }
- </style>
|