|
240精币
layui.use(['form', 'layer','element'], function () {
var $ = layui.jquery, form = layui.form(), layer = layui.layer, element = layui.element;
form.on('submit(success)', function (data) {
$.ajax({
url: 'order.php?type=success',
type: 'post',
data: {id:$(this).attr('data-uid')},
async:false,
dataType:'json',
success: function (data) {
console.log(data.code);
if(data.code == 0){
layer.msg(data.msg, {icon: 6, time: 500},function () {
location.reload();
});
}else {
layer.msg(data.msg, {icon: 5, time: 500});
}
}
});
return false;
})
form.on('submit(error)', function (data) {
$.ajax({
url: 'order.php?type=error',
type: 'post',
data: {id:$(this).attr('data-uid')},
async:false,
dataType:'json',
success: function (data) {
console.log(data.code);
if(data.code == 0){
layer.msg(data.msg, {icon: 6, time: 500},function () {
location.reload();
});
}else {
layer.msg(data.msg, {icon: 5, time: 500});
}
}
});
return false;
})
})
帮我套用下二次确定按钮把,这个点击直接提交了,套用下点击出现确定和取消按钮,点确定了在提交。取消就不提交。
|
|