setmima.vue
3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<template>
<view class="content">
<view class="loginbox loginboxmima">
<view class="bangdingmima">重置密码后你就可以使用新密码登录了</view>
<view class="setpassword flextwo">
<view class="flexone inputk">
<view class="setpasswordleft">密码</view>
<view class="setpasswordright">
<input type="password" placeholder="6-16个字符以内,区分大小写" @input="enterfirstcode" v-if="passtrue">
<input type="text" placeholder="6-16个字符以内,区分大小写" @input="enterfirstcode" v-else>
</view>
</view>
<view class="eye" @click="chosepassword">
<image src="../../static/closeeye.png" mode="" v-if="passtrue"></image>
<image src="../../static/openeye.png" mode="" v-else></image>
</view>
</view>
<view class="setpassword flextwo">
<view class="flexone inputk">
<view class="setpasswordleft">确认密码</view>
<view class="setpasswordright">
<input type="password" placeholder="请再次输入" @input="entersecondcode" v-if="passtruek">
<input type="text" placeholder="请再次输入" @input="entersecondcode" v-else>
</view>
</view>
<view class="eye" @click="chosepasswordk">
<image src="../../static/closeeye.png" mode="" v-if="passtruek"></image>
<image src="../../static/openeye.png" mode="" v-else></image>
</view>
</view>
</view>
<view class="loginbtn finish" @click="finish">完成</view>
</view>
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
firstcode: '',
secondcode: '',
phone: '',
passtrue:true,
passtruek:true
}
},
onLoad(options) {
this.phone = options.phone
},
methods: {
chosepassword(){
this.passtrue=!this.passtrue
},
chosepasswordk(){
this.passtruek=!this.passtruek
},
enterfirstcode(e) {
this.firstcode = e.detail.value
},
entersecondcode(e) {
this.secondcode = e.detail.value
},
finish() {
let that = this;
if(that.firstcode==''){
uni.showToast({
title:'请输入密码',
icon:"none"
})
return false
}
if(this.secondcode==''){
uni.showToast({
title:'请输入确认密码',
icon:"none"
})
return false
}
if(this.firstcode!=this.secondcode){
uni.showToast({
title:'两次输入密码不一致',
icon:'none'
})
return false
}
var url = 'user/setting_password';
var params = {
mobile: that.phone,
password: that.firstcode,
affirm_password: that.secondcode
}
console.log('988765',params)
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title:"重置密码成功",
icon:'none'
})
setTimeout(function(){
uni.reLaunch({
url:'/pages/login/accountpassword'
})
},1500)
}).catch((err) => {
uni.showToast({
title:err.msg,
icon:'none'
})
})
}
}
}
</script>
<style>
@import url('../../base/login');
page {
overflow-y: hidden;
}
</style>