$(document).ready(function(){
$('#ys div').on('click',function(){
$("#ys div").removeClass().addClass('ys');
$(this).removeClass().addClass('ys_on');
$("input[name='ys']").val($("#ys .ys_on").text());
})
$('#size div').on('click',function(){
$("#size div").removeClass().addClass('ys');
$(this).removeClass().addClass('ys_on');
$("input[name='size']").val($("#size .ys_on").text());
})
$('#add_sp').on('click',function(){
var cb_list= $('#movie ul li:first').clone();
cb_list.find('input').val('');
cb_list.find('i').html('');
cb_list.find('span').html('').append('删除');
$('#movie ul').append(cb_list);
})
$('#add_sp1').on('click',function(){
var cb_list= $('#movie1 #ys li:first').clone();
// console.log(cb_list);
cb_list.find('input').val('');
cb_list.find('i').html('');
cb_list.find('span').html('').append('删除');
// console.log(cb_list);
$('#movie1 ul').append(cb_list);
})
$('#add_sp2').on('click',function(){
var cb_list= $('#movie2 #size li:first').clone();
cb_list.find('input').val('');
cb_list.find('i').html('');
cb_list.find('span').html('').append('删除');
$('#movie2 ul').append(cb_list);
})
$('#add_pro').on('click',function(){
var cb_list= $('#shouquan ul li:first').clone();
console.log(cb_list);
cb_list.find('input').val('');
cb_list.find('i').html('');
cb_list.find('span').html('').append('删除');
$('#shouquan ul').append(cb_list);
})
$('#add_zl').on('click',function(){
var cb_list= $('#zhuli ul li:first').clone();
cb_list.find('input').val('');
cb_list.find('i').html('');
cb_list.find('span').html('').append('删除');
$('#zhuli ul').append(cb_list);
})
$(document).delegate(".del_contact",'click',function(){
$(this).parent('span').parent('li').remove();
})
})
function zf1(a)
{
$(a).submit();
}
function xs1(a,b,c){
$(a).slideToggle("slow");
$(b).slideUp("slow");
$(c).slideUp("slow");
}
function cpFy(nowPage,totalPages,count)
{
$("#dd_more").html("加载中...");
setTimeout(function () {
$.get(verifyURL + '/p/'+ nowPage,function(data){
// alert(data);
//$("#jiaoyi_content").html(data);
$("#xm").append(data)
})
if(nowPage==totalPages){
$("#dd_more").hide()
}
else{
newPage=nowPage+1
$("#dd_more").html("
点击查看更多
")
//alert($("#more").html() )
}
}, 1000);
}
function getRadio(){
var hyjb=$("input[name='hyjb']:checked").val();
if(hyjb==2){
total='680';
$("input[name='title']").val('开通正式学员');
}else{
total='100';
$("input[name='title']").val('开通体验学员');
}
$('#shifu').html(total);
$("input[name='total']").val(total);
$("input[name='shifu']").val(total);
}
function getRadio1(){
if($("input[name='xfnum']").val()==0){
$("input[name='xfnum']").val(1);
}
var xfnum=parseFloat($("input[name='xfnum']").val());
var total=xfnum*680;
var umoeny=parseFloat($("#umoeny").text());
if(parseFloat($("input[name='dikou']").val())>umoeny){
$("input[name='dikou']").val(umoeny);
}
if(totalumoeny){
$("input[name='dikou']").val(umoeny);
}
if(totaltotal){
$("input[name='txNum']").val(total);
}
if(txNum>20000){
$("input[name='txNum']").val('');
}
}
function sc(id,cate,user){
if(user==''){
openWithIframe('会员登录',"/index.php/Index/Member/loginSc/cate/"+cate+"/id/"+id,450,320,300);
}else{
$.get("/index.php/Index/User/getSc",{date:new Date(),id:id,cate:cate},function(data){
$("#sc").show();
$("#sc").html(" 收藏成功");
$("#sc1").html("已收藏");
setTimeout("$('#sc').hide()",2000)
});
}
}
function sc_js(id,cate,user){
if(user==''){
openWithIframe('会员登录',"/index.php/Index/Member/loginSc/cate/"+cate+"/id/"+id,450,320,300);
}else{
$.get("/index.php/Index/User/getSc",{date:new Date(),id:id,cate:cate},function(data){
$("#sc").show();
//$("#sc").html(" 收藏成功");
$("#collect_course").html("已收藏");
setTimeout("$('#sc').hide()",2000)
});
}
}
function check_pl(id,cate,user){
if(user==''){
var username=$("input[name='username']").val();
var pass=md5($("input[name='pass']").val());
if(username==''){
$("#err").show();
$("#err").html(" 用户名不能为空");
setTimeout("$('#err').hide()",2000);
return false;
}
else if(pass==''){
$("#err").show();
$("#err").html(" 请输入密码");
setTimeout("$('#err').hide()",2000);
return false;
}
else{
$.get("/index.php/Index/Member/checkZh",{date:new Date(),username:username,pass:pass},function(data){
if(data==0){
$("#err").show();
$("#err").html(" 账号和密码不配比");
setTimeout("$('#err').hide()",2000);
return false;
}else{
var content=$("textarea[name='C_Content']").val();
if(content==''){
$("#err").show();
$("#err").html(" 评论内容不能为空");
setTimeout("$('#err').hide()",2000);
return false;
}else{
$.get("/index.php/Index/Member/getPl",{date:new Date(),id:id,cate:cate,username:username,content:content},function(data){
$("#err").show();
$("#err").html(" 发布成功");
setTimeout("$('#err').hide()",2000);
$("textarea[name='C_Content']").val('');
$("#c_pl").html(data);
});
}
}
});
}
}else{
var username=user;
var content=$("textarea[name='C_Content']").val();
if(content==''){
$("#err").show();
$("#err").html(" 评论内容不能为空");
setTimeout("$('#err').hide()",2000);
return false;
}else{
$.get("/index.php/Index/Member/getPl",{date:new Date(),id:id,cate:cate,username:username,content:content},function(data){
$("#err").show();
$("#err").html(" 发布成功");
setTimeout("$('#err').hide()",2000);
$("textarea[name='C_Content']").val('');
$("#c_pl").html(data);
});
}
}
//var niming=$("input[name='niming']:checked").val();
// if(niming!=1){
// niming=0;
// }
}
function sure_del(msg,url)
{
var ok;
ok=confirm(msg);
if(ok!=0)
location.href=url;
}
//验证用户输入电话号码或手机号码是否符合规范
function telCheck(phone)
{
var pr = /^1[3|4|5|7|8]([0-9]{1})([0-9]{8})$/; //以13 14 15 18开头
return pr.test(phone);
}
function check_login()
{
if($("input[name='username']").val()=="")
{
$("#err").show();
$("#err").html(" 用户名不能为空");
setTimeout("$('#err').hide()",2000)
$("input[name='username']").focus();
return false;
}
if($("input[name='pass']").val()=="")
{
$("#err").show();
$("#err").html(" 密码不能为空");
setTimeout("$('#err').hide()",2000)
$("input[name='pass']").focus();
return false;
}
}
function check_reg()
{
if($("input[name='username']").val()=="")
{ $("#yhm").html(" 会员名称不能为空");
$("input[name='username']").removeClass().addClass("text_err");
//$("input[name='username']").focus();
return false;
}
// if($("input[name='username']").val().length!=11)
// {
// $("#yhm").html(" 手机号码为11位");
// $("input[name='username']").removeClass().addClass("text_err");
// $("input[name='username']").focus();
// return false;
// }
// if( !telCheck($("input[name='username']").val()) ) //--错误的手机号码
// {
// $("#yhm").html(" 手机号码格式不正确");
// $("input[name='username']").removeClass().addClass("text_err");
// $("input[name='username']").focus();
// }
if($("input[name='pass']").val().length<7)
{
$("#pass").html(" 请输入6位以上字符");
$("input[name='pass']").removeClass().addClass("text_err");
//$("input[name='pass']").focus();
return false;
}
if($("input[name='pass']").val()!=$("input[name='repass']").val())
{
$("#pass2").html(" 两次密码不一致");
$("input[name='repass']").removeClass().addClass("text_err");
//$("input[name='repass']").focus();
return false;
}
if($("input[name='name']").val()=="")
{
$("#xm").html(" 名称不能为空");
$("input[name='name']").removeClass().addClass("text_err");
//$("input[name='name']").focus();
return false;
}
}
function check_infor()
{
if($("input[name='name']").val()==""||$("input[name='mobil']").val()=="")
{
$("#err").show();
$("#err").html(" *号为必填项");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function check_pass()
{
if($("input[name='pass']").val()==""||$("input[name='repass']").val()=="")
{
$("#err").show();
$("#err").html(" *号为必填项");
setTimeout("$('#err').hide()",2000);
return false;
}
if($("input[name='pass']").val()!=$("input[name='repass']").val())
{
$("#err").show();
$("#err").html(" 两次密码不一致");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function check_shopinfor()
{
if($("input[name='shopname']").val()=="")
{
$("#err").show();
$("#err").html(" *号为必填项");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function check_kecheng()
{
if($("input[name='cate']").val()==""||$("input[name='title']").val()==""||$("textarea[name='content']").val()==""||$("#idimg1").val()==""||$("input[name='videourl[]']").val()=="")
{
$("#err").show();
$("#err").html(" *号为必填项");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function check_down()
{
if($("input[name='cate']").val()==""||$("input[name='jg']").val()==""||$("input[name='dj']").val()==""||$("textarea[name='url']").val()==""||$("textarea[name='content']").val()==""||$("#idimg1").val()=="")
{
$("#err").show();
$("#err").html(" *号为必填项");
setTimeout("$('#err').hide()",2000);
return false;
}
if(parseInt($("input[name='jg']").val()) *该资料不符合上架条件");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function check_down_e()
{
if($("input[name='cate']").val()==""||$("input[name='jg']").val()==""||$("input[name='dj']").val()==""||$("textarea[name='url']").val()==""||$("textarea[name='content']").val()=="")
{
$("#err").show();
$("#err").html(" *号为必填项");
setTimeout("$('#err').hide()",2000);
return false;
}
if(parseInt($("input[name='jg']").val()) *该资料不符合上架条件");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function check_cp()
{
if($("input[name='title']").val()==""||$("textarea[name='content']").val()=="")
{
$("#err").show();
$("#err").html(" *号为必填项");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function check_ser()
{
if($("input[name='key']").val()=="")
{
$("#err").show();
$("#err").html(" 请输入关键词");
setTimeout("$('#err').hide()",2000);
return false;
}
if(parseInt($("input[name='jg']").val())<=parseInt($("input[name='dj']").val())){
$("#err").show();
$("#err").html(" *该商品不符合上架条件");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function check_sfz()
{
if($("#idimg1").val()==""||$("#idimg2").val()=="")
{
$("#err").show();
$("#err").html(" *证件需全部提交");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function check_qykd()
{
if($("#idimg1").val()==""||$("#idimg2").val()==""||$("#idimg3").val()==""||$("#idimg4").val()=="")
{
$("#err").show();
$("#err").html(" *证件需全部提交");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function check_cp_e()
{
if($("input[name='title']").val()==""||$("textarea[name='content']").val()=="")
{
$("#err").show();
$("#err").html(" *号为必填项");
setTimeout("$('#err').hide()",2000);
return false;
}
if(parseInt($("input[name='jg']").val())<=parseInt($("input[name='dj']").val())){
$("#err").show();
$("#err").html(" *该商品不符合上架条件");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function check_kc_e()
{
if($("input[name='cate']").val()==""||$("textarea[name='content']").val()=="")
{
$("#err").show();
$("#err").html(" *号为必填项");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function checkTx()
{
if($("input[name='txNum']").val()==""||$("input[name='txNum']").val()==0||$("input[name='yzm_h']").val()=="")
{
$("#err").show();
$("#err").html(" *号为必填项");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function checkzfb()
{
if($("input[name='zfbxm']").val()==""||$("input[name='zfbzh']").val()=="")
{
$("#err").show();
$("#err").html(" *号为必填项");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function checkyhk()
{
if($("input[name='khyh']").val()==""||$("input[name='khxm']").val()==""||$("input[name='yhzh']").val()=="")
{
$("#err1").show();
$("#err1").html(" *号为必填项");
setTimeout("$('#err1').hide()",2000);
return false;
}
}
function check_goumai()
{
if($("input[name='username']").val()==""||$("input[name='pass']").val()==""||$("input[name='repass']").val()==""||$("input[name='name']").val()==""||$("input[name='diqu']").val()==""||$("input[name='mph']").val()==""||$("input[name='mobil']").val()=="")
{
$("#err").show();
$("#err").html(" *号为必填项");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function check_jsinfor()
{
if($("input[name='gsmc']").val()==""||$("textarea[name='content']").val()==""||$("textarea[name='contact']").val()=="")
{
$("#err").show();
$("#err").html(" *号为必填项");
setTimeout("$('#err').hide()",2000);
return false;
}
}
function checkuser(op)
{
// if($(op).val().length!=11)
// {
// $("#yhm").html(" 手机号码为11位");
// $(op).removeClass().addClass("text_err");
// $(op).val("");
// $(op).focus();
// return false;
// }
// if(!telCheck($(op).val())) //--错误的手机号码
// {
// $("#yhm").html(" 手机号码格式不正确");
// $(op).removeClass().addClass("text_err");
// $(op).val("");
// $(op).focus();
// return false;
// }
if (/[\u4E00-\u9FA5]/i.test($(op).val())) {
$("#yhm").html(" 用户名不能含有中文");
$(op).removeClass().addClass("text_err");
$(op).val("");
return false;
}
if($(op).val()=="")
{
$("#yhm").html(" 会员名称不能为空");
$(op).removeClass().addClass("text_err");
//$(op).val("");
//$(op).focus();
return false;
}
else{
$.get("/index.php/Index/Member/checkUser",{date:new Date(),username:$(op).val()},function(data){
if(data=="1")
{
$("#yhm").html(" 该账户已存在");
$(op).removeClass().addClass("text_err");
$(op).val("");
//$(op).focus();
return false;
}
else
{
$("#yhm").html("");
$(op).removeClass().addClass("text");
return true;
}
});
}
}
function checkpxs(op)
{
if($(op).val()!=""){
$.get("/index.php/Index/Member/checkpxs",{date:new Date(),xuhao:$(op).val()},function(data){
if(data=="0")
{alert('未配比到相关人员');
$(op).val("");
$(op).next().next().html("");
return false;
}
else
{
$(op).next().next().html(data);
//$(op).removeClass().addClass("text");
return true;
}
});
}
}
function check_kf(op)
{
if($(op).val()!=""){
$.get("/index.php/Index/Member/checkkf",{date:new Date(),username:$(op).val()},function(data){
if(data=="0")
{alert('未配比到相关人员');
$(op).val("");
$(op).next().next().html("");
return false;
}
else
{
$(op).next().next().html(data);
//$(op).removeClass().addClass("text");
return true;
}
});
}
}
function checkpoint(op)
{
if($(op).val()=="")
{
$("#err").show();
$("#err").html(" 会员名称不能为空");
setTimeout("$('#err').hide()",2000);
//$(op).removeClass().addClass("text_err");
//$(op).val("");
//$(op).focus();
return false;
}
else{
$.get("/index.php/Index/Member/checkUser",{date:new Date(),username:$(op).val()},function(data){
if(data=="1")
{$("#err").show();
$("#err").html(" 该账户已存在");
setTimeout("$('#err').hide()",2000);
//$(op).removeClass().addClass("text_err");
$(op).val("");
//$(op).focus();
return false;
}
else
{$("#err").show();
$("#err").html("");
setTimeout("$('#err').hide()",2000);
//$(op).removeClass().addClass("text");
return true;
}
});
}
}
function checkyzm(op)
{
if($(op).val()=="")
{
$("#yzm").html(" 验证码不能为空");
$(op).removeClass().addClass("text_yz_err");
$(op).val("");
$(op).focus();
return false;
}
else{
$.get("/index.php/Index/User/checkYzm",{date:new Date(),code:$(op).val()},function(data){
if(data=="0")
{
$("#yzm").html(" 验证码不正确");
$(op).removeClass().addClass("text_yz_err");
$(op).val("");
$(op).focus();
return false;
}
else
{
$("#yzm").html("");
$(op).removeClass().addClass("text_yz");
return true;
}
});
}
}
function checkpass(op)
{
if($(op).val().length<7)
{
$("#pass").html(" 请输入6位以上字符");
$(op).removeClass().addClass("text_err");
$(op).val("");
//$(op).focus();
return false;
}
else{
$("#pass").html("");
$(op).removeClass().addClass("text");
return true;
}
}
function checkrepass(op)
{
if($("input[name='pass']").val()!=$(op).val())
{
$("#pass2").html(" 两次密码不一致");
$(op).removeClass().addClass("text_err");
$(op).val("");
//$(op).focus();
return false;
}
else{
$("#pass2").html("");
$(op).removeClass().addClass("text");
return true;
}
}
function checkpass_p(op)
{
if($(op).val().length<7)
{ $("#err").show();
$("#err").html(" 请输入6位以上字符");
setTimeout("$('#err').hide()",2000);
//$(op).removeClass().addClass("text_err");
$(op).val("");
//$(op).focus();
return false;
}
else{
$("#err").show();
$("#err").html("");
setTimeout("$('#err').hide()",2000);
//$(op).removeClass().addClass("text");
return true;
}
}
function checkrepass_p(op)
{
if($("input[name='pass']").val()!=$(op).val())
{ $("#err").show();
$("#err").html(" 两次密码不一致");
setTimeout("$('#err').hide()",2000);
//$(op).removeClass().addClass("text_err");
$(op).val("");
//$(op).focus();
return false;
}
// else{$("#err").show();
// $("#err").html("");
// setTimeout("$('#err').hide()",2000);
//$(op).removeClass().addClass("text");
// return true;
// }
}
function sqjs(){
if(!confirm('您确认申请成为讲师吗?')) return false;
$.get("/index.php/Index/User/sqjs",{date:new Date()},function(data){
$("#cwjs").html("讲师身份审核中");
});
}
function test()
{
//if(!confirm('确认删除吗?')) return false;
var b="";
var r=document.getElementsByName("Del_id[]");
for(var i=0;i
b=b+r[i].value+",";
}
}
//console.log(b);
if(b==''){
alert('无选择项目');
return false;
}
if(!confirm('确认删除吗?')) return false;
}
function check_cate1(str,str1){
//alert(str);
$('#cateName').val(str);
$('#cateid').val(str1);
massage_box1.style.display="none";
hidebg.style.display="none";
}
function check_cate()
{
//if(!confirm('确认删除吗?')) return false;
var b="";
var c="";
var r=document.getElementsByName("cateid[]");
for(var i=0;i
b=b+n[0]+",";
c=c+n[1]+",";
}
}
//console.log(b);
if(b==''){
alert('您还没有选择类别');
return false;
}
$('#cateid').val(b);
$('#cateName').val(c);
massage_box1.style.display="none";
hidebg.style.display="none";
}
function mm(a)
{
var a = document.getElementsByName(a);
if(a[0].checked==true){
for (var i=0; i');
}else{
$('.big2').removeClass().addClass("big1");
$('.small2').removeClass().addClass("small1");
$('.more_type').attr('onclick','more(0)');
$('.more_type').html('更多');
}
}
function change_code(obj){
//alert($("#code").attr("src"));
$("#code").attr("src",verifyURL + '/' + Math.random());
return false;
}
function txtOf(a,b)
{
$(a).html(" "+b+"");
//$(op).removeClass().addClass(c);
}
function ialert(content,type){
var M = {
}
if(M.dialog1){
return M.dialog1.show();
}
if(type=='ok'){
M.dialog1 = jqueryAlert({
'style' : 'wap', //移动端和PC端
'content' : content,
'closeTime' : 2000,
'icon' : '/App/Modules/Wap/Tpl/Public/img/right.png',
})
}
else if(type=='error'){
M.dialog1 = jqueryAlert({
'style' : 'wap', //移动端和PC端
'content' : content,
'closeTime' : 2000,
'icon' : '/App/Modules/Wap/Tpl/Public/img/error.png',
})
}else{
M.dialog1 = jqueryAlert({
'style' : 'wap', //移动端和PC端
'content' : content,
'closeTime' : 2000,
})
}
}
function del(id){
var M = {
}
if(M.dialog3){
return M.dialog3.show();
}
M.dialog3 = jqueryAlert({
// 'title' : 'alertjs提示',
'content' : '你确定删除该信息?
',
'modal' : true,
'buttons' :{
'取消' : function(){
M.dialog3.close();
},
'确定' : function(){
window.location.href="/index.php/Index/Index/del/id/"+id+"";
}
}
})
}
function ddEdit(orderid){
var M = {
}
if(M.dialog3){
return M.dialog3.show();
}
M.dialog3 = jqueryAlert({
//'title' : '请选择你的操作',
'content' : '请选择你的操作
',
'modal' : true,
'width' : '60%',
'buttons' :{
'关闭' : function(){
M.dialog3.close();
},
'支付上门费' : function(){
window.location.href="/index.php/Index/Index/orderOk/out_trade_no/"+orderid+"";
},
'取消订单' : function(){
window.location.href="/index.php/Index/Index/qxdd/orderid/"+orderid+"";
}
}
})
}
function stateEdit(orderid){
var M = {
}
if(M.dialog3){
return M.dialog3.show();
}
M.dialog3 = jqueryAlert({
//'title' : '请选择你的操作',
'content' : '请选择订单状态
',
'modal' : true,
'width' : '70%',
'buttons' :{
'关闭' : function(){
M.dialog3.close();
},
'取件' : function(){
window.location.href="/index.php/Index/Index/stateEdit/orderid/"+orderid+"/zt/2";
},
'洗涤' : function(){
window.location.href="/index.php/Index/Index/stateEdit/orderid/"+orderid+"/zt/3";
},
'送返' : function(){
window.location.href="/index.php/Index/Index/stateEdit/orderid/"+orderid+"/zt/4";
},
'完成' : function(){
window.location.href="/index.php/Index/Index/stateEdit/orderid/"+orderid+"/zt/5";
},
}
})
}
function lqquan(id){
var M = {
}
if(M.dialog3){
return M.dialog3.show();
}
M.dialog3 = jqueryAlert({
//'title' : '请选择你的操作',
'content' : '你确定要使用该券?
',
'modal' : true,
'buttons' :{
'取消' : function(){
M.dialog3.close();
},
'确定' : function(){
window.location.href="/index.php/Index/Index/lqQuan/id/"+id+"";
}
}
})
}
function check_add(a)
{
if($("input[name='xm']").val()=="")
{
ialert("*姓名不能为空");
return false;
}
if($("input[name='tel']").val()=="")
{
ialert("*电话不能为空");
return false;
}
if($("input[name='qy']").val()=="")
{
ialert("*区域不能为空");
return false;
}
if($("input[name='mph']").val()=="")
{
ialert("*详细地址不能为空");
return false;
}
else{
$(a).submit();
}
}
function dd_add(a)
{
if($("input[name='shdz']").val()=="")
{
ialert("*地址不能为空");
return false;
}
if($("input[name='smsj']").val()=="")
{
ialert("*上门时间不能为空");
return false;
}
else{
$(a).submit();
}
}
function searchTabMore(id, obj){
var idObj = $('#' + id);
var height1 = idObj.attr('name');
var height2 = idObj.height();
if(height1 == ''){
idObj.attr('name',height2);
}
if(idObj.attr('name') == height2){
idObj.height('auto');
$(obj).addClass('more_toggle');
}else{
idObj.height(height1 + 'px');
$(obj).removeClass('more_toggle');
}
}
function zf(a)
{
$(a).submit();
}
function setImagePreview(n,avalue) {
var docObj=document.getElementById("idimg"+n);
var imgObjPreview=document.getElementById("preview"+n);
if(docObj.files &&docObj.files[0])
{
//火狐下,直接设img属性
imgObjPreview.style.display = 'block';
//imgObjPreview.src = docObj.files[0].getAsDataURL();
//火狐7以上版本不能用上面的getAsDataURL()方式获取,需要一下方式
imgObjPreview.src = window.URL.createObjectURL(docObj.files[0]);
}
else
{
//IE下,使用滤镜
docObj.select();
var imgSrc = document.selection.createRange().text;
var localImagId = document.getElementById("localImag"+n);
//必须设置初始大小
// localImagId.style.width = "150px";
// localImagId.style.height = "180px";
//图片异常的捕捉,防止用户修改后缀来伪造图片
try{
localImagId.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
}
catch(e)
{
alert("您上传的图片格式不正确,请重新选择!");
return false;
}
imgObjPreview.style.display = 'none';
document.selection.empty();
}
return true;
}
function check_lx()
{ var lx=$("#lx").val();
if(lx==57||lx==58)
{
$("#jssj").show();
$("#andio").hide();
$("#wzg").hide();
$("#xm").show();
}
else if(lx==69){
$("#andio").show();
$("#wzg").show();
$("#xm").hide();
}
else{
$("#jssj").hide();
$("#andio").hide();
$("#wzg").hide();
$("#xm").show();
}
}
function checktel(op,a)
{
//$(op).removeClass().addClass("input");
phoneNum = $(op).val();
//if($(op).val()=="")
// { $(a).show();
// $(a).html("*手机号不能为空");
// setTimeout("$('"+a+"').hide()",2000)
// $(op).val("");
// //$(op).removeClass().addClass("err_s");
// //document.all["liu_sm"].style.display = "none";
// //$("#Submit32").attr("disabled", true);
// return false;
// }else
if($(op).val().length!=11)
{ document.getElementById('Submit32').className='smsbut';
$("#Submit32").attr("onClick","");
$(a).show();
$(a).html("*手机号码为11位");
setTimeout("$('"+a+"').hide()",2000)
$(op).val("");
return false;
}else
if( !telCheck(phoneNum) ) //--错误的手机号码
{document.getElementById('Submit32').className='smsbut';
$("#Submit32").attr("onClick","");
$(a).show();
$(a).html("*请输入正确的手机号码");
setTimeout("$('"+a+"').hide()",2000)
$(op).val("");
return false;
}
else{
$.get("/index.php/Index/Member/checkTel",{date:new Date(),tel:$(op).val()},function(data){
if(data=="1")
{$(a).show();
$(a).html("*该手机号已被绑定");
$(op).val("");
document.getElementById('Submit32').className='smsbut';
$("#Submit32").attr("onClick","");
setTimeout("$('"+a+"').hide()",2000)
//$(a).html(" 该手机号已被注册");
// $(op).removeClass().addClass("err_s");
//$(op).val("");
con=false;
}
else
{
document.getElementById('Submit32').className='smsbut_on';
$("#Submit32").attr("onClick","sendSms('SMS_125116683')");
return true;
// $(a).html("该手机可注册");
// setTimeout("$('"+a+"').hide()",2000)
// return true;
//
}
});
}
}
var count;
var countdown;
var wait_seconds = 60; //等待60秒
function sendSms(code) //短信发送
{
var phone ;
phone = $("input[name='mobil']").val();
$("input[name='mobil']").attr("readonly",'readonly');
$.get("/index.php/Index/Member/getYzm",{date:new Date(),tel:phone,code:code},function(data){
console.log(data);
$("input[name='yzm_h']").val(data);
});
//开始倒计时
count = wait_seconds
countdown = setInterval(function(){ CountDown(code); }, 1000);
}
function CountDown(code) {
//$("#Submit32").attr("disabled", true);
document.getElementById('Submit32').className='smsbut';
$("#Submit32").attr("onClick","");
$("#Submit32").html("(" + count + "秒后)重新获取");
if ( count == 0 ) {
document.getElementById('Submit32').className='smsbut_on';
$("input[name='mobil']").removeAttr("readonly");
$("#Submit32").html("重新获取");
$("#Submit32").attr("onClick","sendSms('"+code+"')");
clearInterval(countdown);
}
count--;
}
function sjyzm(op)
{ var yzm;
num= $(op).val();
yzm= $("input[name='yzm_h']").val();
if(num==''){
$("#err").show();
$("#err").html(" *验证码不能为空");
setTimeout("$('#err').hide()",2000);
return false;
}
else if(num!=yzm){
$(op).val('');
$("#err").show();
$("#err").html(" *验证码输入有误");
setTimeout("$('#err').hide()",2000);
return false;
}
else{
$("#err").show();
$("#err").html("");
setTimeout("$('#err').hide()",2000);
return true;
}
}