# wx.miniapp.bindPhone (Object object)
iOS >= 1.0.9,Android >= 1.0.5
Call the interface to bind the phone number while the system login state is in effect.
# Front preparation
use button Component Specification open-type
,sms-type
Trigger interface to send SMS verification code to the user.
# parameter
# Object object
attribute | type | Default value | Required | Introductions |
---|---|---|---|---|
phoneNumber | string | yes | Phone number | |
verifyCode | string | yes | Product Code: 6-digit character string | |
success | function | no | Interface calls a successful callback function | |
fail | function | no | Interface to call a failed callback function | |
complete | function | no | The callback function at the end of an interface call |
# object.fail callback
# parameter
# Object res
attribute | type | Introductions |
---|---|---|
errCode | number | Error code. 0: The request was successful |
errMsg | string | Error message |
**res.errCode **
errCode | Introductions |
---|---|
-1 | system error |
10001011 | System login status invalid |
10001006 | Verification code error |
10001023 | The phone number already exists, Binding failure |
-700000 | Front End Error, errMsg Will give detailed hints |
# sample code
wx.miniapp.bindPhone ({
phoneNumber: 'xxx', // Phone number
verifyCode: 'xxx', // verification code
success(res) {
// Binding success
}
})