project_room_order.js
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
define(['jquery', 'bootstrap', 'frontend', 'form', 'template', 'swiper', 'layer'], function($, undefined, Frontend, Form, Template, Swiper, Layer) {
var Controller = {
index: function() {
// console.log(true)
var first_swiper = new Swiper ('#first_swiper', {
loop: true, // 循环模式选项
// 如果需要分页器
autoplay:true,
pagination: {
el: '.swiper-pagination',
}
});
$(".del").on("click",function(){
var orderId = $(this).attr('data-id');
var status = $(this).attr('data-status');
var msg = '';
if(status == 1) {
msg = '确定取消预约吗?';
}else if(status == 2) {
msg = '删除记录代表预约取消,确认删除吗?';
} else {
msg = '确定删除吗?';
}
layer.confirm(msg, {
btn: ['确定','取消'] //按钮
}, function(){
Fast.api.ajax({
url:'project_room_order/update',
data:{id:orderId,status:status}
},function (i,ret) {
if(ret.code == 1) {
setTimeout(function () {
location.href = ret.url ? ret.url : "/";
}, 1000);
}else{
layer.msg(ret.msg);
}
},function (err) {
layer.msg(err);
});
});
});
}
}
return Controller;
});