s_password.js
1.91 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
var util = require('../../utils/util.js')
var uri=require('../../utils/uri.js')
Page({
data:{
showpass:false,
pass:'',
closepass:'',
},
onLoad:function(opt){
util.setBarTitle('查看密码');
this.setData({
sellerid:util.cache('sellerid'),
account:opt.account,
id:opt.id,
totalheight:util.cache('system.info').windowHeight
})
},
onShow:function(){
this.resetpass();
this.alert=this.selectComponent('#alert');
var that=this;
util.postSuccessFun=function(json,uri_code){
switch(uri_code){
case uri.CGI_USER_GETPASSWORD__CODE:
if(json.ret==200){
var closepass='';
var pass=json.data;
for(var i=0;i<pass.length;i++){
if(i>0 && i<pass.length-1){
closepass+='*'
}else{
closepass+=pass[i]
}
}
that.setData({
pass:json.data,
closepass:closepass
})
}else{
that.alert.show('该账号已被移除');
}
break;
}
}
},
//查看密码
lookpass:function(){
this.setData({
showpass:!this.data.showpass
})
},
//重置密码
resetpassword:function(){
wx.navigateTo({
url:'s_repass?id='+this.data.id
})
},
resetpass:function(){
util.post(uri.CGI_USER_GETPASSWORD,{sellerid:this.data.sellerid,account:this.data.account,key:'xiaotao666'},uri.CGI_USER_GETPASSWORD__CODE)
},
netchange:function () {
this.onShow()
}
})