Ajax请求绑定电话号码弹窗实现代码片段

Ajax请求绑定电话号码弹窗实现代码片段

 

Ajax请求绑定手机号码弹出实现代码片段,以下代码为项目开发代码片段,实现方法思路仅供参考。

 

 

// 绑定手机号弹窗

$(“.get-phone”).on(“click”, “.c-btn,.close,.phone-bg”, function () {

$(“.get-phone”).hide();

});

/**

* ajax方法封装

* @param url

* @param data

* @param type

* @param success

* @param error

* @param beforeSend

* @param async

*/

var ajax = function (url, data, type, success, error, beforeSend, async) {

$.ajax({

url: url,

data: data,

dataType: ‘JSON’,

type: type,

success: function (res) {

layer.closeAll();

success(res);

},

error: function () {

if (typeof error === ‘function’) {

error();

} else {

layer.msg(‘请求错误’);

}

},

beforeSend: function () {

if (typeof beforeSend === ‘function’) {

beforeSend();

} else {

var index = layer.load(1, {

shade: [0.1, ‘#fff’] //0.1透明度的白色背景

});

}

}

});

};

 

$(‘#registerBtn’).on(‘click’, function () {

$(‘#registerModal’).removeClass(‘hide’);

});

//隐藏模态框

$(‘span[data-bind-bs=”hideModal”]’).on(‘click’, function () {

var _this = $(this);

_this.parents(‘div.hkt-win’).addClass(‘hide’);

});

 

$(‘.show-input > span’).click(function () {

$(‘.show-input’).hide();

$(‘.nav’).fadeIn(800);

$(‘.click-seek’).show();

});

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容