Commit ee99b701 authored by hujun's avatar hujun

去除js

parent 152e9159
......@@ -135,109 +135,4 @@
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
</div>
<script>
// 手机检索姓名
var ldHtml = $('.phone_list');
var stopstatus = true;
var valueCurrent = '';
var ajaxObj;
$(function() {
// $('.phone_jia').on('input', function(e) {
$(document).on('input','.phone_jia', function(e) {
e.preventDefault();
e.stopPropagation();
var _this = $(this);
_this.next().css("display","block");
valueCurrent = _this.val();
if(valueCurrent != ''){
resetLoad();
loadMain(valueCurrent,_this.next());
}else{
ldHtml.html('');
return false;
}
});
});
function resetLoad(){
if(ajaxObj){
ajaxObj.abort();
}
ldHtml.html('');
stopstatus = true;
}
function loadMain(phone, obj) {
ajaxObj=$.ajax({
type: "GET",
url: '/agents/get_user_info?' ,
data: {
'phone': phone
},
timeout: 10000,
dataType: "json",
beforeSend: function() {
},
success: function(data) {
if(data.status === 1){
var _html = '';
$.each(data.data, function(i,data) {
_html += '<li onclick="addphone(this)"><span class="id">'+data['id']+'-</span><span class="phone_name">'+data['realname']+'</span><span class="phone_span">-</span><span class="phone-phone">'+data['phone']+'</span> </li>';
});
obj.html(_html);
}
},
error: function() {
},
complete: function(xhr, textStatus) {
if(textStatus === "timeout") {
//处理超时的逻辑
alert("请求超时");
}
}
});
}
function addphone(n){
var phone_name= $(n).find(".phone_name").html();
var phone_phone= $(n).find(".phone-phone").html();
var phone_span= $(n).find(".phone_span").html();
var id= $(n).find(".id").html();
$(n).parent().prev().val(id+phone_name+phone_span+phone_phone);
$(n).parent().hide();
ldHtml.html('');
return false;
}
function jiabox() {
boxphoto = '<input name="phone[]" placeholder="请输入" type="tel" style="margin-left: 10px;float: left" class="phone_add">' +
'<ul class="phone_list1"></ul>'+
'<img src="/mobile4.0/images/qdao-sha.png" class="jian">';
$(".jian_class").append(boxphoto);//写入
jianbox();
}
function jiabox_data(id,name,phone) {
boxphoto = '<input name="phone[]" placeholder="请输入" value='+id+'-'+name+'-'+phone+' type="tel" style="margin-left: 10px;float: left" class="phone_add">' +
'<ul class="phone_list1"></ul>'+
'<img src="/mobile4.0/images/qdao-sha.png" class="jian" onclick="jianbox()"><input type="hidden" value="'+id+'">';
$(".jian_class").append(boxphoto);//写入
jianbox();
}
function jianbox() {
$(".jian").click(function () {
$(this).prev().prev().remove();
$(this).prev().remove();
$(this).remove();
});
}
jianbox();
</script>
\ No newline at end of file
</div>
\ No newline at end of file
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