1. 程式人生 > >Appcan使用Mob短信驗證碼

Appcan使用Mob短信驗證碼

params can imu script width con ont -1 發送

<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
> <link rel="stylesheet" href="css/fonts/font-awesome.min.css"> <link rel="stylesheet" href="css/ui-box.css"> <link rel="stylesheet" href="css/ui-base.css"> <link rel="stylesheet" href="css/ui-color.css"> <link rel="stylesheet" href="css/appcan.icon.css"
> <link rel="stylesheet" href="css/appcan.control.css"> </head> <body class="um-vp bc-bg" ontouchstart> <div class="btn ub ub-ac bc-text-head ub-pc bc-btn" id="btn1"> 初始化已完成 </div> <br /> <div class="sc-bg-active uinput ub ub-f1 bc-border uba"
> <input type="text" class="ub-f1" placeholder="輸入手機號"id="phone"> </div> <div class="btn ub ub-ac bc-text-head ub-pc bc-btn" id="btn2"> 發送驗證碼 </div> <br /> <div class="sc-bg-active uinput ub ub-f1 bc-border uba"> <input type="text" class="ub-f1" placeholder="填寫驗證碼"id="yanzheng"> </div> <div class="btn ub ub-ac bc-text-head ub-pc bc-btn" id="btn3"> 提交驗證碼 </div> </body> <script src="js/appcan.js"></script> <script src="js/main.js"></script> <script src="js/appcan.control.js"></script> </body> <script> appcan.ready(function() { var params = { "uexMobSMS_APPKey" : "2154a551b5a28", "uexMobSMS_APPSecret" : "a6d511b5e2cdf78537731e0b1a4ca20b" }; uexMobSMS.init(JSON.stringify(params)); $toast("初始化成功", 2000) }); var phone = ""; // appcan.button("#btn1", "ani-act", function() { // $toast("初始化成功", 2000) // var params = { // "uexMobSMS_APPKey" : "2154a551b5a28", // "uexMobSMS_APPSecret" : "a6d511b5e2cdf78537731e0b1a4ca20b" // }; // uexMobSMS.init(JSON.stringify(params)); // }) appcan.button("#btn2", "ani-act", function() { phone = $(#phone).val(); //alert(phone) var params = { "phoneNum" : phone, "countryCode" : "86" }; uexMobSMS.sendCode(JSON.stringify(params)); uexMobSMS.cbSendClick = function(data) { if (JSON.stringify(data)) { $toast("驗證碼發送成功,請在120s內驗證", 2000) } else { $toast("驗證碼發送失敗", 2000) } } }) appcan.button("#btn3", "ani-act", function() { var yanzheng = $(#yanzheng).val(); //alert(yanzheng + "===" + phone) var params = { "phoneNum" : phone, "countryCode" : "86", "validCode" : yanzheng }; uexMobSMS.commitCode(JSON.stringify(params)); uexMobSMS.cbCommitClick = function(data) { if (JSON.stringify(data)) { $toast("驗證成功", 2000) } else { $toast("驗證失敗", 2000) } } }) </script> </html>

插件收藏。。

Appcan使用Mob短信驗證碼