Commit 10d01568 authored by yanzg's avatar yanzg

输入手机号

parent 2cbe5ca4

17:28:18.061 未实现该方法或操作。:
在 LightFrame.Util.Converts.TypeConvert.XmlElementConvert.get_SourceType()
在 LightFrame.Util.Converts.ConvertCenter.<>c__DisplayClass6_0.<AddHandle>b__0()
在 LightFrame.Util.Threads.ThreadHelper.ExecuteCatch(DelegateEmpty vCode)
...@@ -45,7 +45,7 @@ $(function(){ ...@@ -45,7 +45,7 @@ $(function(){
cache.channelId =channels.channelId; cache.channelId =channels.channelId;
cache.saleId = channels.saleId; cache.saleId = channels.saleId;
cache.buyNum = $mnInput.val(); cache.buyNum = $mnInput.val();
cache.mobile = $mnInput2.val(); cache.mobile = getMobile();
$mnInput2.val("");//清空输入框的电话号码 $mnInput2.val("");//清空输入框的电话号码
$mnInput.val(1);//清空输入框的电话号码 $mnInput.val(1);//清空输入框的电话号码
showResPage(null,"/page/lhgj/workScanCode.html"); showResPage(null,"/page/lhgj/workScanCode.html");
...@@ -86,50 +86,46 @@ $(function(){ ...@@ -86,50 +86,46 @@ $(function(){
* @param mobile 手机号码 * @param mobile 手机号码
* @returns {string} * @returns {string}
*/ */
function getMobile(mobile) { function getMobile() {
return (mobile || "").split(" ").join(""); let mobile = $mnInput2.val();
return (mobile || "").split(" ").join("");
} }
/** /**
* 输入新得手机号码,并且显示出来 * 输入新得手机号码,并且显示出来
* @param mobile * @param mobile
*/ */
function inputMobile(mobile) { function setMobile(num) {
mobile = getMobile(mobile); if (num.length > 11) {
mobile = mobile || ""; num = num.substr(0, 11);
if (mobile.length > 11) { }
mobile = mobile.substr(0, 11); if (num.length > 7) {
} num = num.substr(0, 7) + " " + num.substr(7);
if (mobile.length > 7) { }
mobile = mobile.substr(0, 7) + " " + mobile.substr(7); if (num.length > 3) {
} num = num.substr(0, 3) + " " + num.substr(3);
if (mobile.length > 3) { }
mobile = mobile.substr(0, 3) + " " + mobile.substr(3); $mnInput2.val(num);
}
$mnInput2.val(mobile);
} }
/** /**
* 输入手机号按钮点击 * 输入手机号按钮点击
*/ */
$mnNum.click(function () { $mnNum.click(function () {
// 已经输入得手机号得值 let front = getMobile();
let mobile = $mnInput2.val(); let num = $(this).text();
// 新输入得数字 setMobile(front + num);
let num = $(this).text();
// 输入手机号码
inputMobile(mobile + num);
}); });
$mnKong.click(function () { $mnKong.click(function () {
inputMobile(""); setMobile("");
}); });
// 退格手机号 // 退格手机号
$mnBackspace.click(function () { $mnBackspace.click(function () {
let mobile = $mnInput2.val(); let num = getMobile();
mobile = mobile.substr(0, mobile.length - 1); num = num.substr(0, num.length - 1);
inputMobile(mobile); setMobile(num);
}); });
function loadChannel(){//加载购买渠道 function loadChannel(){//加载购买渠道
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment