2a36cc3a by 任超

style:我的预约

1 parent e4ab9cf6
......@@ -140,7 +140,7 @@
}
.item_info {
padding: 30px;
height: 180px;
height: 193px;
}
.item_info li{
width: 100%;
......
......@@ -34,7 +34,7 @@ function _initData(currentPage = 1) {
if (records[i].state == '0') {
li += '<div class="item_title success">'
li += '<h3>预约成功</h3>'
li += '<a href="./yyjg.html?appointmentId='+records[i].appointmentId+'">查看<i class="layui-icon layui-icon-right"></i></a>'
li += '<a href="./yyjg.html?appointmentId=' + records[i].appointmentId + '">查看<i class="layui-icon layui-icon-right"></i></a>'
li += '</div>'
} else if (records[i].state == '1') {
li += '<div class="item_title success">'
......@@ -72,7 +72,16 @@ function _initData(currentPage = 1) {
// 用户取消预约
$(document).on("click", ".cancel_reservation", function (e) {
_cancleAppointment($(this).attr('appointmentId'), $(this).attr('jgid'), $(this).attr('periodRulesId'), getCookie('myCookie').userid)
let that = this;
layui.use('layer', function () {
layer.confirm('此操作将取消预约', {
btn: ['是', '否'] //按钮
}, function () {
_cancleAppointment($(that).attr('appointmentId'), $(that).attr('jgid'), $(that).attr('periodRulesId'), getCookie('myCookie').userid)
}, function () {
layer.msg('已取消');
});
})
})
function _cancleAppointment(appointmentId, jgid, periodRulesId, userid) {
......@@ -92,7 +101,10 @@ function _cancleAppointment(appointmentId, jgid, periodRulesId, userid) {
//数据,这里使用的是Json格式进行传输
success: function (result) {//返回数据根据结果进行相应的处理
if (result.code == 200) {
layui.use('layer', function () {
var layer = layui.layer;
layer.msg('取消预约成功');
})
_initData();
}
}
......@@ -118,10 +130,10 @@ function paged(pageCount, curr) {
}
});
})
if (pageCount == 0 ) {
if (pageCount == 0) {
$('#page').hide();
$('.noData').show();
}else {
} else {
$('#page').show();
$('.noData').hide();
}
......