The one touch dialing function of Baidu applet needs to be coded in swan and js. The industrial monitoring station is taken as an example to illustrate how to use one touch dialing.
First bind the dialing function in swan, and then write the dialing function in the corresponding js. Note that the first contact number in the background set contact method is called in js. You need to fill in the phone number first, or you cannot dial.
Swan section:

Js section:
calling: function (e) {
let mobile = e.currentTarget.dataset.id;
if (!mobile) {
mobil = app.globaldata.settings.cfg_kefu_tel;
}
swan.makePhoneCall({
phoneNumber: mobile,
success: function () {
Console. log ("Call succeeded! ")
},
fail: function () {
Console. log ("Call failed! ")
}
})
}


This article is edited by the Fuwei team. If any error is found, please give feedback through customer service WeChat.
Fu Wei will stop Baidu SEO research and training in December 2024. Goodbye letter: Fu Wei: Goodbye Baidu SEO!
In January 2025, the Google SEO training course will be officially launched, leading everyone to go to sea together in the thousand and one nights.
Interested students, please add the enrollment customer service Xiaomo WeChat: seowy2021.
WeChat code scanning to add customer service personnel
Our goal: Let everyone stand alone and go to sea no longer "sighing".