How to transfer the values of the custom calculation function parameters in WeChat Mini Programs?

The

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}}" / >

Part of the code in

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?
}

Mar.20,2022

I don't quite understand what you mean. Now that you have setData adminPwd in the previous method, you can just use this.data.adminPwd in the later method. The description of the problem is too vague

Update: I am convinced. Write it in the method. Isn't that all right?

getTempPasswd: function (password, time) {
    password = this.data.adminPwd
}

var p = new Uint8Array
and how to convert "123456" into an array like the one above? Please give me some advice!
it is estimated that the above function does not work properly because of the data type mismatch. The PASSWORD parameter in the function should be an array.

Menu