You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

716 lines
24 KiB

  1. //json/jsonHotelWaitConfirm.html
  2. //订单备注-tr_str
  3. var cur_order_id = 0;
  4. var pay_end_time = '';
  5. var ht_tr_com_one_str = ''; //订单备注tr的str
  6. var ht_tr_mes_one_str = ''; //短信通知tr的str
  7. //详情
  8. var base_url = "./st-xm/Api/ht_get_order_detail.php";
  9. //my--moyan
  10. var my_base_url_ok = "./st-xm/Api/hotel_order_status.php";
  11. var my_base_url_cancel="./st-xm/Api/hotel_order_cancel_changeback.php";
  12. //页面加载的时候调用
  13. window.onload = function() {
  14. ht_tr_com_one_str = $('#ht_tr_com_one').prop('outerHTML');
  15. ht_tr_com_one_str = ht_tr_com_one_str.replace('none', 'table-row');
  16. ht_tr_mes_one_str = $('#ht_tr_mes_one').prop('outerHTML');
  17. ht_tr_mes_one_str = ht_tr_mes_one_str.replace('none', 'table-row');
  18. var order_id = getPar('order_id');
  19. cur_order_id=order_id;
  20. if (!order_id) {
  21. alert('缺少订单号');
  22. return;
  23. }
  24. //调用 函数
  25. var url = base_url + '?method=getOrderDetail&order_id=' + order_id;
  26. get_http_data_by_url(url);
  27. }
  28. // 请求方法,传入URL
  29. function get_http_data_by_url(myURL) {
  30. $.getJSON(myURL, function(httpData) {
  31. if (httpData['code'] != "0") {
  32. alert(httpData['info']);
  33. return;
  34. }
  35. if (httpData['order_detail'].length <= 0) {
  36. alert('没有符合条件的数据');
  37. return;
  38. }
  39. //头部左侧
  40. var order_detail = httpData['order_detail'][0];
  41. var current_status = order_detail["order_status_id"];
  42. var top_left_HTML = $('#chartLeftSpan').html();
  43. top_left_HTML = top_left_HTML.replace('[订单号]', getPar('order_id'));
  44. var st = order_detail['order_status_str'];
  45. top_left_HTML = top_left_HTML.replace('[是否入住]', st);
  46. top_left_HTML = top_left_HTML.replace('[分销商(上海驴妈妈)]', order_detail['org_name']);
  47. top_left_HTML = top_left_HTML.replace('[酒店]', '酒店');
  48. $('#chartLeftSpan').html(top_left_HTML);
  49. //头部右侧
  50. var or_st = httpData['order_status'];
  51. var new_or_st = new Array();
  52. if(or_st){
  53. for (var i = 0; i < or_st.length; i++) {
  54. var temp = or_st[i];
  55. new_or_st[temp['order_status_id']] = temp;
  56. }
  57. }
  58. if (new_or_st['145']) { //待支付
  59. var arr_date_time = new_or_st['145']['status_date'].split(' ');
  60. $('#one_date').html(arr_date_time[0]);
  61. $('#one_time').html(arr_date_time[1]);
  62. pay_end_time = order_detail['pay_end_time'];
  63. if(!new_or_st['198']){
  64. ShowCountDown();
  65. timer = setInterval('ShowCountDown()', 1000);
  66. }
  67. //变成支付,,添加支付剩余时间
  68. }
  69. if (new_or_st['198']) { //待确认
  70. var arr_date_time = new_or_st['198']['status_date'].split(' ');
  71. $('#two_date').html(arr_date_time[0]);
  72. $('#two_time').html(arr_date_time[1]);
  73. $('#two_cir').css('border', '3px solid greenyellow');
  74. $('#two_cir').css('border-radius', '15px;');
  75. $('#pay_time').html('');
  76. $('#downBtn1').html('确认');
  77. $('#downBtn3').css('width','100px');
  78. $('#downBtn3').html('退改申请');
  79. $('#downBtn2').css('display', 'none');
  80. $('#downBtn2').html('');
  81. }
  82. if (new_or_st['200']) { //待安排
  83. var arr_date_time = new_or_st['200']['status_date'].split(' ');
  84. $('#three_date').html(arr_date_time[0]);
  85. $('#three_time').html(arr_date_time[1]);
  86. $('#three_cir').css('border', '3px solid greenyellow');
  87. $('#three_cir').css('border-radius', '15px;');
  88. $('#downBtn1').css('width', '125px');
  89. $('#downBtn1').html('录入确认号');
  90. $('#downBtn2').css('display', 'none');
  91. $('#downBtn2').html('');
  92. $('#downBtn3').css('width', '100px');
  93. $('#downBtn3').html('退改申请');
  94. }
  95. if (new_or_st['199']) { //待通知
  96. var arr_date_time = new_or_st['199']['status_date'].split(' ');
  97. $('#four_date').html(arr_date_time[0]);
  98. $('#four_time').html(arr_date_time[1]);
  99. $('#four_cir').css('border', '3px solid greenyellow');
  100. $('#four_cir').css('border-radius', '15px;');
  101. $('#downBtn1').css('width', '150px');
  102. $('#downBtn1').html('人工确认通知');
  103. $('#downBtn2').css('display', 'none');
  104. $('#downBtn2').html('');
  105. }
  106. if (new_or_st['218']) { //已安排
  107. var arr_date_time = new_or_st['218']['status_date'].split(' ');
  108. $('#five_date').html(arr_date_time[0]);
  109. $('#five_time').html(arr_date_time[1]);
  110. $('#five_cir').css('border', '3px solid greenyellow');
  111. $('#five_cir').css('border-radius', '15px;');
  112. $('#downBtn1').css('display', 'none');
  113. $('#downBtn1').html('');
  114. $('#downBtn3').css('width', '100px');
  115. $('#downBtn3').html('退改申请');
  116. $('#downBtn2').css('display', 'none');
  117. $('#downBtn2').html('');
  118. }
  119. if (new_or_st['201']) { //退改中
  120. $('#pay_time').html('');
  121. // $('#pay_time').css('display','none');
  122. $('#six_cir').css('border', '3px solid darkgray');
  123. $('#downBtn1').css('display', 'none');
  124. $('#downBtn1').html('');
  125. $('#downBtn2').css('display', 'none');
  126. $('#downBtn2').html('');
  127. $('#downBtn3').css('width', '100px');
  128. $('#downBtn3').html('退单确认');
  129. }
  130. if (new_or_st['147']) { //已完成
  131. if(!new_or_st['201']){
  132. $('#pay_time').html('<img width="10px" height="10px" src="../img/timer.jpg"/>入住日期:' + order_detail['check_in_date']);
  133. $('#downBtn3').css('width', '100px');
  134. $('#downBtn3').html('退改申请');
  135. $('#six_cir').css('border', '3px solid greenyellow');
  136. $('#six_cir').css('border-radius', '15px;');
  137. $('#downBtn2').css('display', 'none');
  138. $('#downBtn2').html('');
  139. }
  140. }
  141. if (new_or_st['238'] || current_status == 238 ) { //已退单
  142. $('#downBtn1').css('display', 'none');
  143. $('#downBtn1').html('');
  144. $('#downBtn2').css('display', 'none');
  145. $('#downBtn2').html('');
  146. $('#downBtn3').css('display', 'none');
  147. $('#downBtn3').html('');
  148. }
  149. if (new_or_st['148'] || current_status == 148 ){//已取消
  150. $('#downBtn1').css('display','none');
  151. $('#downBtn2').css('display','none');
  152. $('#downBtn3').css('display','none');
  153. $('#downBtn1').html('');
  154. $('#downBtn2').html('');
  155. $('#downBtn3').html('');
  156. $('#pay_time').html('');
  157. clearInterval(timer);
  158. }
  159. // 订单备注短信通知
  160. $('#span_order_remark').html('订单备忘:' + order_detail['com_count'] + '条');
  161. $('#span_info_noti').html('短信通知:' + order_detail['mes_count'] + '条');
  162. // 1.预订信息
  163. $('#hotel_room').html(order_detail['prod_name']);
  164. var ruzhu = $('#ruzhu_date').html();
  165. ruzhu = ruzhu.replace('[开始日期]', order_detail['start_date']);
  166. ruzhu = ruzhu.replace('[结束日期]', order_detail['end_date']);
  167. ruzhu = ruzhu.replace('[num]', order_detail['all_day']);
  168. ruzhu = ruzhu.replace('[hour]', order_detail['latest_time']);
  169. $('#ruzhu_date').html(ruzhu);
  170. // 表格
  171. var detail_date_arr = httpData['detail_date_arr'];
  172. var tr_booking = $('#tr_booking_one').prop('outerHTML');
  173. var bookingHTML = '';
  174. for (var i = 0; i < detail_date_arr.length; i++) {
  175. var tempDict = detail_date_arr[i];
  176. var tempHTML = tr_booking;
  177. tempHTML = tempHTML.replace('[入住日期]', tempDict['check_in_date']);
  178. tempHTML = tempHTML.replace('[数量]', tempDict['count']);
  179. tempHTML = tempHTML.replace('[采购价]', tempDict['base_price']);
  180. tempHTML = tempHTML.replace('[结算价]', tempDict['mid_price']);
  181. tempHTML = tempHTML.replace('[零售价]', tempDict['order_price']);
  182. tempHTML = tempHTML.replace('[采购价金额]', tempDict['base_balance']);
  183. tempHTML = tempHTML.replace('[结算价金额]', tempDict['mid_balance']);
  184. tempHTML = tempHTML.replace('[销售利润]', tempDict['profits']);
  185. bookingHTML += tempHTML;
  186. }
  187. //支付金额
  188. $('#pay_money').html(order_detail['all_order_balance'] + " " + '元');
  189. //订单退单
  190. $('#order_return_pay_money1').html(order_detail['all_order_balance'] + " " + '元');
  191. //
  192. $('#order_return_pay_money2').html(order_detail['all_order_balance'] + " " + '元');
  193. //总计
  194. var tr_final = $('#tr_booking_final').prop('outerHTML');
  195. tr_final = tr_final.replace('[总零售价]', order_detail['all_order_balance']);
  196. tr_final = tr_final.replace('[采购价金额]', order_detail['all_base_balance']);
  197. tr_final = tr_final.replace('[结算价金额]', order_detail['all_mid_balance']);
  198. tr_final = tr_final.replace('[销售利润]', order_detail['all_profits']);
  199. bookingHTML += tr_final
  200. $('#booking_list').html(bookingHTML);
  201. // 2.客人信息
  202. $('#guest_name').html(order_detail['customer_name']);
  203. $('#guest_phone').html(order_detail['customer_mobile']);
  204. //显示整个页面
  205. $('.hotelWaitConfirm').css('display', 'block');
  206. //订单备注
  207. get_order_comment(base_url + '?method=getOrderRemark&order_id=' + cur_order_id);
  208. //短信通知
  209. get_order_send_message(base_url + '?method=getOrderSendMessage&order_id=' + cur_order_id);
  210. });
  211. }
  212. //请求订单备注
  213. function get_order_comment(com_url) {
  214. $.getJSON(com_url, function(res_data) {
  215. var ht_comment_list = $('#ht_comment_list');
  216. var order_remark_arr = res_data['order_remark_arr'];
  217. if(order_remark_arr==undefined){return;}
  218. var comHTML = '';
  219. for (var i = 0; i < order_remark_arr.length; i++) {
  220. var dict = order_remark_arr[i];
  221. var HTML = ht_tr_com_one_str;
  222. HTML = HTML.replace('[类型]', dict['comment_type_str']);
  223. HTML = HTML.replace('[内容]', dict['comment_txt']);
  224. HTML = HTML.replace('[添加人]', dict['user_name']);
  225. HTML = HTML.replace('[添加时间]', dict['create_time']);
  226. comHTML += HTML;
  227. }
  228. ht_comment_list.html(comHTML);
  229. });
  230. }
  231. //请求订单-短信通知
  232. function get_order_send_message(mes_url) {
  233. $.getJSON(mes_url, function(res_data) {
  234. var ht_send_message_list = $('#ht_send_message_list');
  235. var order_send_message_arr = res_data['order_send_message_arr'];
  236. if (order_send_message_arr==undefined) {return;}
  237. var mesHTML = '';
  238. for (var i = 0; i < order_send_message_arr.length; i++) {
  239. var dict = order_send_message_arr[i];
  240. var HTML = ht_tr_mes_one_str;
  241. HTML = HTML.replace('[内容]', dict['send_mobile'] + ":" + dict['message']);
  242. HTML = HTML.replace('[操作人]', dict['user_name']);
  243. HTML = HTML.replace('[发送时间]', dict['send_time']);
  244. mesHTML += HTML;
  245. }
  246. ht_send_message_list.html(mesHTML);
  247. });
  248. }
  249. //点击右下角三个按钮
  250. function click_OK(self_obj_id, btn_name) {
  251. var self_obj = $(self_obj_id);
  252. var ifStay = $('#ifStay');
  253. switch (btn_name) {
  254. case "确认":
  255. // self_obj.css('display','none');
  256. self_obj.html('');
  257. var ok_url = my_base_url_ok + "?method=confirm&order_id=" + cur_order_id;
  258. $.getJSON(ok_url, function(res_data) {
  259. if (res_data['code'] != "0") {
  260. alert(res_data['info']);
  261. self_obj.css('display','table-row');
  262. self_obj.html('确认');
  263. return;
  264. }
  265. location.replace(location.href);
  266. // var listURL = "hotelWaitConfirm.html?order_id=" + cur_order_id;
  267. // // 跳转前将URL编码
  268. // listURL = encodeURI(listURL);
  269. // window.location.href = listURL;
  270. });
  271. break;
  272. case "支付":
  273. center_show($('.order_pay'));
  274. $(document).ready(function() {
  275. $('#btn_order_pay_submit').click(function() {
  276. var pay_type = $("#select_order_pay").find("option:selected").val();
  277. if (pay_type == undefined || pay_type == "") {
  278. pay_type = "232";//天猫旗舰店支付
  279. }
  280. if ($('#pay_water_num').val().trim().length <= 0) {
  281. alert('请输入流水号!!!');
  282. return;
  283. }
  284. var wather_num = $('#pay_water_num').val();
  285. var url = my_base_url_ok + "?method=pay&order_id=" + cur_order_id + "&pay_type=" + pay_type + "&serial_number=" + wather_num;
  286. $.getJSON(url, function(res_data) {
  287. console.log('支付'+url);
  288. console.log(res_data);
  289. if (res_data['code'] != "0") {
  290. alert(res_data['info']);
  291. return;
  292. }
  293. location.replace(location.href);
  294. });
  295. });
  296. });
  297. break;
  298. case "修改":
  299. var listURL = "hotelModifyOrder.html?order_id=" + cur_order_id;
  300. // 跳转前将URL编码
  301. listURL = encodeURI(listURL);
  302. window.location.href = listURL;
  303. break;
  304. case "取消":
  305. bootbox.dialog({
  306. message: "是否真的要取消订单!",
  307. title: "温馨提示:",
  308. buttons: {
  309. Cancel: {
  310. label: "否",
  311. className: "btn-default",
  312. callback: function () {
  313. return;
  314. }
  315. }
  316. , OK: {
  317. label: "是",
  318. className: "btn-primary",
  319. callback: function () {
  320. var cancel_url=my_base_url_cancel+"?method=cancel&order_id="+cur_order_id;
  321. $.getJSON(cancel_url,function(res_data){
  322. console.log('取消'+cancel_url);
  323. console.log(res_data);
  324. if(res_data['code']!="0"){alert(res_data['info']);return;}
  325. location.replace(location.href);
  326. });
  327. }
  328. }
  329. }
  330. });
  331. //正确
  332. // var result = confirm("确定取消订单吗?")
  333. // if (result) {
  334. // var cancel_url=my_base_url_cancel+"?method=cancel&order_id="+cur_order_id;
  335. // $.getJSON(cancel_url,function(res_data){
  336. // console.log('取消'+cancel_url);
  337. // console.log(res_data);
  338. // if(res_data['code']!="0"){alert(res_data['info']);return;}
  339. // location.replace(location.href);
  340. // });
  341. // }
  342. // var cancel_url=my_base_url_cancel+"?method=cancel&order_id="+cur_order_id;
  343. // $.getJSON(cancel_url,function(res_data){
  344. // console.log('取消'+cancel_url);
  345. // console.log(res_data);
  346. // if(res_data['code']!="0"){alert(res_data['info']);return;}
  347. // location.replace(location.href);
  348. // });
  349. break;
  350. case "人工确认通知":
  351. //改变自己的文本
  352. self_obj.css('display','none');
  353. self_obj.html('');
  354. var people_confirm_url = my_base_url_ok + "?method=notice&order_id=" + cur_order_id;
  355. $.getJSON(people_confirm_url, function(res_data) {
  356. console.log('人工确认通知'+people_confirm_url);
  357. console.log(res_data);
  358. if(res_data['code']!="0"){
  359. alert(res_data['info']);
  360. self_obj.css('display','table-row');
  361. self_obj.html('人工确认通知');
  362. return;
  363. }
  364. location.replace(location.href);
  365. });
  366. break;
  367. case "录入确认号":
  368. center_show($('.hotel_OK'));
  369. $(document).ready(function() {
  370. $('#btn_hotel_ok_submit').click(function() {
  371. var ok_code = $('#ht_ok_code').val();
  372. var ok_comment = $('#ht_ok_comment').val();
  373. if (ok_code.trim().length <= 0 || ok_comment.trim().length <= 0) {
  374. alert('信息填写不完整!!!');
  375. return;
  376. }
  377. var ok_num_url = my_base_url_ok + "?method=confirmnum&order_id=" + cur_order_id + "&comment_code=" + ok_code + "&comment_text=" + ok_comment;
  378. $.getJSON(ok_num_url, function(res_data) {
  379. if (res_data['code'] != "0") {
  380. alert(res_data['info']);
  381. return;
  382. }
  383. location.replace(location.href);
  384. });
  385. });
  386. });
  387. break;
  388. case "退单确认":
  389. center_show($('.order_return'));
  390. var url =base_url + "?method=getOrderRefund&order_id="+cur_order_id;
  391. $.getJSON(url, function(res_data) {
  392. if (res_data['code'] != "0") {
  393. alert(res_data['info']);
  394. return;
  395. }
  396. console.log(res_data)
  397. var back_info = res_data['order_refund'];
  398. if (back_info.length > 0) {
  399. $('#payMoney').html(back_info[0]['refund_amount'] + " " + "元");
  400. $('#order_return_pay_money2').html(back_info[0]['org_back'] + " " + "元");
  401. $('#order_return_pay_time').html(back_info[0]['pay_time']);
  402. $('#order_return_pay_type1').html(back_info[0]['type_name']);
  403. $('#order_return_pay_type2').html(back_info[0]['type_name']);
  404. $('#order_return_comment').html(back_info[0]['reason']);
  405. }
  406. });
  407. $(document).ready(function() {
  408. $('#btn_order_return_submit').click(function() {
  409. var comment=$('#order_return_comment').val();
  410. if(comment.trim().length<=0){alert('请输入备注!!!');return;}
  411. var url=my_base_url_cancel+"?method=check&comment_text="+comment+"&order_id="+cur_order_id;
  412. $.getJSON(url,function(res_data){
  413. if(res_data['code']!="0"){alert(res_data['info']);return;}
  414. location.replace(location.href);
  415. });
  416. });
  417. });
  418. break;
  419. case "退改申请":
  420. center_show($('.back_apply'));
  421. $(document).ready(function() {
  422. $('#btn_back_apply_submit').click(function() {
  423. var balance = $("input[name='refund_balance']").val();
  424. var supplier = $("input[name='suppliers_return']").val();
  425. var refund_reason = $("textarea[name='refund_reason']").val();
  426. if (balance.trim().length <= 0) {
  427. alert('请输入退款金额!!!');
  428. return;
  429. }
  430. if (supplier.trim().length <= 0) {
  431. alert('请输入供应商!!!');
  432. return;
  433. }
  434. if (refund_reason.trim().length <= 0) {
  435. alert('请输入退改原因!!!');
  436. return;
  437. }
  438. //a,b,c
  439. var url = my_base_url_cancel + "?method=apply&apply="+balance+","+supplier+","+refund_reason+"&order_id="+cur_order_id;
  440. $.getJSON(url, function(res_data) {
  441. if (res_data['code'] != "0") {
  442. alert(res_data['info']);
  443. return;
  444. }
  445. location.replace(location.href);
  446. });
  447. });
  448. });
  449. break;
  450. default:
  451. break;
  452. }
  453. }
  454. //计时
  455. var timer = null;
  456. function ShowCountDown() {
  457. // pay_end_time
  458. var dt1 = getDateTime(0) + " " + getDateTime(2);
  459. var dt2 = pay_end_time;
  460. if(dt2==""){return;}
  461. var date1y = dt1.substring(0,4);
  462. var date1m = dt1.substring(5,7);
  463. var date1d = dt1.substring(8,10);
  464. var date1h = dt1.substring(11,13);
  465. var date1i = dt1.substring(14,16);
  466. var date1s = dt1.substring(17,19);
  467. var date2y = dt2.substring(0,4);
  468. var date2m = dt2.substring(5,7);
  469. var date2d = dt2.substring(8,10);
  470. var date2h = dt2.substring(11,13);
  471. var date2i = dt2.substring(14,16);
  472. var date2s = dt2.substring(17,19);
  473. var date1 = new Date(date1y,date1m,date1d,date1h,date1i,date1s);
  474. var date2 = new Date(date2y,date2m,date2d,date2h,date2i,date2s);
  475. var date3 = date2 - date1;
  476. //计算出相差天数
  477. var days = Math.floor(date3 / (24 * 3600 * 1000))
  478. //计算出小时数
  479. var leave1 = date3 % (24 * 3600 * 1000) //计算天数后剩余的毫秒数
  480. var hours = Math.floor(leave1 / (3600 * 1000))
  481. //计算相差分钟数
  482. var leave2 = leave1 % (3600 * 1000) //计算小时数后剩余的毫秒数
  483. var minutes = Math.floor(leave2 / (60 * 1000))
  484. //计算相差秒数
  485. var leave3 = leave2 % (60 * 1000) //计算分钟数后剩余的毫秒数
  486. var seconds = Math.round(leave3 / 1000);
  487. var str = days + "日" + hours + "时" + minutes + "分" + seconds + "秒";
  488. if (hours < 10) {
  489. str = str.replace('日', '日0');
  490. // str = days + "日0" + hours + "时" + minutes + "分" + seconds + "秒";
  491. }
  492. if (minutes < 10) {
  493. str = str.replace('时', '时0')
  494. // str = days + "日" + hours + "时0" + minutes + "分" + seconds + "秒";
  495. }
  496. if (seconds < 10) {
  497. str = str.replace('分', '分0');
  498. // str = days + "日" + hours + "时" + minutes + "分0" + seconds + "秒";
  499. }
  500. if(date2==date1){
  501. location.replace(location.href);
  502. }else if(date2<date1){
  503. str="0日00时00分00秒";
  504. str = '<img width="10px" height="10px" src="../img/timer.jpg"/>剩余时间:' + str;
  505. $('#pay_time').html(str);
  506. }else{
  507. str = '<img width="10px" height="10px" src="../img/timer.jpg"/>剩余时间:' + str;
  508. $('#pay_time').html(str);
  509. }
  510. }
  511. //点击了三个固定的
  512. function click_show_div(objName, self_obj) {
  513. var obj = $(objName);
  514. if (obj.css('display') == 'none') {
  515. center_show(obj);
  516. } else {
  517. obj.css('display', 'none');
  518. }
  519. }
  520. //点击了第二级
  521. function click_two_show_div(father_name, self_name) {
  522. var father = $(father_name);
  523. var self = $(self_name);
  524. father.css('display', 'none');
  525. center_show(self);
  526. }
  527. //订单备注的——提交
  528. $(document).ready(function() {
  529. $('#btn_comment_submit').click(function() {
  530. hide_all();
  531. var type = $('#add_com_sel').find("option:selected").val();
  532. var text = $('#or_remark_txt').val();
  533. if (type == "") {
  534. alert('请选择类型!!!');
  535. return;
  536. }
  537. if (text.trim().length <= 0) {
  538. alert('请输入备注信息!!!');
  539. return;
  540. }
  541. var ok_num_url = my_base_url_ok + "?method=addcomment&order_id=" + cur_order_id + "&comment_type=" + type + "&comment_text=" + text;
  542. $('#or_remark_txt').val();
  543. $.getJSON(ok_num_url, function(res_data) {
  544. if (res_data['code'] != "0") {
  545. alert(res_data['info']);
  546. return;
  547. }
  548. var listURL = "hotelWaitConfirm.html?order_id=" + cur_order_id;
  549. // 跳转前将URL编码
  550. listURL = encodeURI(listURL);
  551. window.location.href = listURL;
  552. });
  553. });
  554. });
  555. //短信通知——提交
  556. $(document).ready(function() {
  557. $('#btn_message_submit').click(function() {
  558. hide_all();
  559. $('#or_send_mes_txt').html('');
  560. // var mes_url="http://127.0.0.1/%E8%9C%98%E8%9B%9B2.0%E8%83%BD%E5%86%99PHP/st-xm/Api/ht_get_order_detail.php?method=getOrderSendMessage&order_id="+cur_order_id;
  561. get_order_send_message(mes_url + '?method=getOrderSendMessage&order_id=' + cur_order_id);
  562. });
  563. });
  564. //点击了关闭
  565. function click_cancel(father_name, self_name) {
  566. if (father_name) {
  567. var father = $(father_name);
  568. center_show(father);
  569. } else {
  570. $('.mask').css('display', 'none');
  571. }
  572. $(self_name).css('display', 'none');
  573. }
  574. //居中显示
  575. var tempDiv = null;
  576. function center_show(show_div) {
  577. tempDiv = show_div;
  578. //显示蒙板
  579. show_div.css('display', 'block');
  580. show_div.css('z-index', 10);
  581. show_div.css('background-color', 'white');
  582. show_div.css('position', 'fixed');
  583. var w = show_div.css('width');
  584. var h = show_div.css('height');
  585. w = w.substr(0, w.length - 2);
  586. h = h.substr(0, h.length - 2);
  587. // var s_left=(window.screen.availWidth-w)/2 +"px";
  588. // var s_top=(window.screen.availHeight-h)/2 +'px';
  589. var s_left = (window.innerWidth - w) / 2 + 'px';
  590. var s_top = (window.innerHeight - h) / 2 + 'px';
  591. show_div.css('left', s_left);
  592. show_div.css('top', s_top);
  593. $('.mask').css('display', 'block');
  594. }
  595. //点击蒙板
  596. function hide_all() {
  597. $('.mask').css('display', 'none');
  598. tempDiv.css('display', 'none');
  599. }
  600. //order_pay选择改变
  601. function select_pay_way(value) {
  602. if (value == '0') {
  603. $('#pay1').css('display', 'block');
  604. $('#pay2').css('display', 'none');
  605. } else {
  606. $('#pay1').css('display', 'none');
  607. $('#pay2').css('display', 'block');
  608. }
  609. }
  610. function getPar(par) {
  611. //获取当前URL
  612. var local_url = document.location.href;
  613. local_url = decodeURI(local_url);
  614. //获取要取得的get参数位置
  615. var get = local_url.indexOf(par + "=");
  616. if (get == -1) {
  617. return false;
  618. }
  619. //截取字符串
  620. var get_par = local_url.slice(par.length + get + 1);
  621. //判断截取后的字符串是否还有其他get参数
  622. var nextPar = get_par.indexOf("&");
  623. if (nextPar != -1) {
  624. get_par = get_par.slice(0, nextPar);
  625. }
  626. return get_par;
  627. }
  628. function getDateTime(nTypeFlag) {
  629. var tNowTime = new Date();
  630. var myYear = ';' + tNowTime.getFullYear() + ';';
  631. var myMonth = ';' + (tNowTime.getMonth() + 1 - 0) + ';';
  632. var myDay = ';' + tNowTime.getDate() + ';';
  633. var myHour = ';' + tNowTime.getHours() + ';';
  634. var myMinu = ';' + tNowTime.getMinutes() + ';';
  635. var mySecond = ';' + tNowTime.getSeconds() + ';';
  636. if (myMonth.length < 4) myMonth = '0' + myMonth;
  637. if (myDay.length < 4) myDay = '0' + myDay;
  638. if (myHour.length < 4) myHour = '0' + myHour;
  639. if (myMinu.length < 4) myMinu = '0' + myMinu;
  640. if (mySecond.length < 4) mySecond = '0' + mySecond;
  641. var cNewTimeStr;
  642. //alert(tNowTime);
  643. switch (nTypeFlag + 1 - 1) {
  644. case 0:
  645. cNewTimeStr = myYear + '-' + myMonth + '-' + myDay;
  646. break;
  647. case 1:
  648. cNewTimeStr = myYear + myMonth + myDay;
  649. break;
  650. case 2:
  651. cNewTimeStr = myHour + ':' + myMinu + ':' + mySecond;
  652. break;
  653. case 3:
  654. cNewTimeStr = myHour + myMinu + mySecond;
  655. break;
  656. case 4:
  657. cNewTimeStr = myYear + myMonth + myDay + myHour + myMinu + mySecond;
  658. break;
  659. case 5:
  660. cNewTimeStr = myYear + '年' + myMonth + '月' + myDay + '日';
  661. break;
  662. case 6:
  663. cNewTimeStr = myYear;
  664. break;
  665. case 7:
  666. cNewTimeStr = myYear + '-' + myMonth;
  667. break;
  668. default:
  669. cNewTimeStr = myYear + '-' + myMonth + '-' + myDay + ' ' + myHour + ':' + myMinu + ':' + mySecond;
  670. break;
  671. }
  672. cNewTimeStr = cNewTimeStr.replace(/;/g, "");
  673. return cNewTimeStr;
  674. }