|
发表于 2016-5-21 23:23:35
|
显示全部楼层
define(function(require) {
var $ = require("jquery");
var justep = require("$UI/system/lib/justep");
var Baas = justep.Baas;
require("cordova!com.justep.cordova.plugin.security.mob");
var Model = function() {
this.callParent();
this._deviceType = "pc"; // pc || wx || app
this._userID = justep.UUID.createUUID();
this._userDefaultName = "新用户";
this._fPhoneNumber = "";
this._userPasswd = "123456";
this._fType = "手机";
this._userDefaultAddress = "北京市";
};
//获取手机验证码
Model.prototype.sendsmsButton = function(event) {
if (!navigator.mobsms) {
justep.Util.hint("请安装最新版本(含插件)体验!");
return;
}
;
var phoneInput = this.comp("phonenumber").val();
var reg = /^0?1[3|4|5|7|8][0-9]\d{8}$/;
if (reg.test(phoneInput)) {
this.comp("sendsmsbutton").mytimer();
navigator.mobsms.send({
"zone" : "86",
"phoneNumber" : phoneInput
}, function(info) {
}, function(err) {
justep.Util.hint(err);
});
} else {
justep.Util.hint("手机号码不正确!")
}
}; |
|