2a36cc3a by 任超

style:我的预约

1 parent e4ab9cf6
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
140 } 140 }
141 .item_info { 141 .item_info {
142 padding: 30px; 142 padding: 30px;
143 height: 180px; 143 height: 193px;
144 } 144 }
145 .item_info li{ 145 .item_info li{
146 width: 100%; 146 width: 100%;
......
...@@ -34,7 +34,7 @@ function _initData(currentPage = 1) { ...@@ -34,7 +34,7 @@ function _initData(currentPage = 1) {
34 if (records[i].state == '0') { 34 if (records[i].state == '0') {
35 li += '<div class="item_title success">' 35 li += '<div class="item_title success">'
36 li += '<h3>预约成功</h3>' 36 li += '<h3>预约成功</h3>'
37 li += '<a href="./yyjg.html?appointmentId='+records[i].appointmentId+'">查看<i class="layui-icon layui-icon-right"></i></a>' 37 li += '<a href="./yyjg.html?appointmentId=' + records[i].appointmentId + '">查看<i class="layui-icon layui-icon-right"></i></a>'
38 li += '</div>' 38 li += '</div>'
39 } else if (records[i].state == '1') { 39 } else if (records[i].state == '1') {
40 li += '<div class="item_title success">' 40 li += '<div class="item_title success">'
...@@ -72,7 +72,16 @@ function _initData(currentPage = 1) { ...@@ -72,7 +72,16 @@ function _initData(currentPage = 1) {
72 72
73 // 用户取消预约 73 // 用户取消预约
74 $(document).on("click", ".cancel_reservation", function (e) { 74 $(document).on("click", ".cancel_reservation", function (e) {
75 _cancleAppointment($(this).attr('appointmentId'), $(this).attr('jgid'), $(this).attr('periodRulesId'), getCookie('myCookie').userid) 75 let that = this;
76 layui.use('layer', function () {
77 layer.confirm('此操作将取消预约', {
78 btn: ['是', '否'] //按钮
79 }, function () {
80 _cancleAppointment($(that).attr('appointmentId'), $(that).attr('jgid'), $(that).attr('periodRulesId'), getCookie('myCookie').userid)
81 }, function () {
82 layer.msg('已取消');
83 });
84 })
76 }) 85 })
77 86
78 function _cancleAppointment(appointmentId, jgid, periodRulesId, userid) { 87 function _cancleAppointment(appointmentId, jgid, periodRulesId, userid) {
...@@ -92,7 +101,10 @@ function _cancleAppointment(appointmentId, jgid, periodRulesId, userid) { ...@@ -92,7 +101,10 @@ function _cancleAppointment(appointmentId, jgid, periodRulesId, userid) {
92 //数据,这里使用的是Json格式进行传输 101 //数据,这里使用的是Json格式进行传输
93 success: function (result) {//返回数据根据结果进行相应的处理 102 success: function (result) {//返回数据根据结果进行相应的处理
94 if (result.code == 200) { 103 if (result.code == 200) {
104 layui.use('layer', function () {
105 var layer = layui.layer;
95 layer.msg('取消预约成功'); 106 layer.msg('取消预约成功');
107 })
96 _initData(); 108 _initData();
97 } 109 }
98 } 110 }
...@@ -118,10 +130,10 @@ function paged(pageCount, curr) { ...@@ -118,10 +130,10 @@ function paged(pageCount, curr) {
118 } 130 }
119 }); 131 });
120 }) 132 })
121 if (pageCount == 0 ) { 133 if (pageCount == 0) {
122 $('#page').hide(); 134 $('#page').hide();
123 $('.noData').show(); 135 $('.noData').show();
124 }else { 136 } else {
125 $('#page').show(); 137 $('#page').show();
126 $('.noData').hide(); 138 $('.noData').hide();
127 } 139 }
......