function calculates another password based on one password and time. Two parameters, one is the original password, the other is the time. Return the new password.
executes it when BUTTON is clicked as follows: code in
wxml:
< input password type= "number" placeholder= "Please enter the password" bindinput= "passWdInput" maxlength="12"/ >
< button bindtap= "SetNumber" > generate temporary password < / button >
< input value= "{TmpPwd}}" / >
JS is as follows:
data: {
AdminPwd: "",
TmpPwd:""
},
/ / get the administrator password entered by the user
passWdInput: function (e) {
this.setData({
AdminPwd: e.detail.value
})
},
SetNumber () {
this.setData({
TmpPwd: this.getTempPasswd
})
},
getTempPasswd: function (password, time) {
/ / password this parameter should be equal to the value of AdminPwd,. How should it be passed? Exception, how is the return value of the function passed to TmpPwd? Also, the data AdminPwd read by input should be a string, but the PASSWORD in the function seems to be an array with different types. How to use it?
}