Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

718 wiersze
23 KiB

  1. //导入常用JS
  2. writeJS('js/jquery-2.2.4.min.js');
  3. writeJS('js/date-time/bootstrap-datepicker.min.js');
  4. writeJS('js/date-time/bootstrap-timepicker.min.js');
  5. writeJS('My97DatePicker/WdatePicker.js');
  6. writeJS('js/master.js');
  7. writeJS('js/jquery.page.js');
  8. writeJS('js/jquery.cookie.js');
  9. writeJS('../js/base_path.js');
  10. writeJS('js/xm.js'); //判断登录
  11. writeJS('js/xcConfirm.js');
  12. writeCSS('css/xcConfirm.css');
  13. //导入CSS
  14. // 导入JS文件
  15. function writeJS(jsStr) {
  16. var cstr = '<script type="text/javascript" src="' + jsStr + '"></script>';
  17. document.write(cstr);
  18. }
  19. // 导入CSS
  20. function writeCSS(cssStr) {
  21. var cstr = '<link rel="stylesheet" type="text/css" href="' + cssStr + '" />';
  22. document.write(cstr);
  23. }
  24. var base_api = "http://127.0.0.1/ZZCX_HT_2.0/st-ht/HTcontrol.php";
  25. base_api = "http://temp.zhizhuchuxing.com/zz-jd/st-ht/HTcontrol.php";
  26. base_api = "../st-ht/HTcontrol.php";
  27. base_api = "/zz-jd/st-ht/HTcontrol.php";
  28. var _principal = [1, 33, 35, 160];
  29. // 打印日志
  30. function ZZLog() {
  31. var isLog = true; //是否打印
  32. var isSign = false; //是否签名
  33. if (isLog) {
  34. if (isSign) {
  35. //如果要加前缀
  36. var args = Array.prototype.slice.call(arguments);
  37. args.unshift('[ZZCX:DeBug:Log]');
  38. console.log.apply(console, args);
  39. } else {
  40. console.log.apply(console, arguments);
  41. }
  42. }
  43. }
  44. //需要成功回调的弹出框
  45. function ZZAlertInfo(info, callok) {
  46. window.wxc.xcConfirm(info, window.wxc.xcConfirm.typeEnum.info, {
  47. onOk: function () {
  48. if (callok) {
  49. callok();
  50. }
  51. }
  52. });
  53. }
  54. //确认框(提示信息,成功回调,取消回调,关闭回调)
  55. function ZZConfirm(info, callok, callcancel, callclose) {
  56. window.wxc.xcConfirm(info, window.wxc.xcConfirm.typeEnum.confirm, {
  57. onOk: function () {
  58. if (callok) {
  59. callok();
  60. }
  61. },
  62. onCancel: function () {
  63. if (callcancel) {
  64. callcancel();
  65. }
  66. },
  67. onClose: function () {
  68. if (callclose) {
  69. callclose();
  70. }
  71. }
  72. })
  73. }
  74. //输入框(输入的信息,成功回调,关闭的回调)
  75. function ZZInput(info, callok, callclose) {
  76. window.wxc.xcConfirm(info, window.wxc.xcConfirm.typeEnum.input, {
  77. onOk: function (ok) {
  78. if (callok) {
  79. callok(ok);
  80. }
  81. },
  82. onClose: function (close) {
  83. if (callclose) {
  84. callclose(close);
  85. }
  86. }
  87. });
  88. }
  89. //设置字符串类型的本地缓存
  90. function setStorage(objName, objValue) {
  91. var sto = window.localStorage;
  92. if (sto)
  93. sto.setItem(objName, objValue);
  94. }
  95. //读取字符串类型的本地缓存
  96. function getStorage(objName) {
  97. var ret = '';
  98. var sto = window.localStorage;
  99. if (sto)
  100. ret = sto.getItem(objName);
  101. return ret;
  102. }
  103. //清除本地缓存,如没指定名称则为清空所有缓存
  104. function clearStorage(objName) {
  105. var sto = window.localStorage;
  106. if (sto) {
  107. if (objName)
  108. sto.removeItem(objName);
  109. else
  110. sto.clear();
  111. }
  112. }
  113. //设置Json类型的本地缓存
  114. function setStorJson(objName, json) {
  115. if (json)
  116. setStorage(objName, JSON.stringify(json));
  117. }
  118. //读取Json类型的本地缓存
  119. function getStorJson(objName) {
  120. var ret = null;
  121. var str = getStorage(objName);
  122. if (str)
  123. ret = JSON.parse(str);
  124. return ret;
  125. }
  126. //js判断一个日期是星期几 传入 年/月/日
  127. function getWeekDay(day) {
  128. var a = new Array("日", "一", "二", "三", "四", "五", "六");
  129. var week = new Date(day).getDay();
  130. var str = "星期" + a[week];
  131. return str;
  132. }
  133. //获取前一天日期
  134. function before(d) {
  135. d = new Date(d);
  136. d = +d - 10006060 / 3 * 24;
  137. d = new Date(d);
  138. //return d;
  139. //格式化
  140. var year = ";" + d.getFullYear() + ";";
  141. var month = ";" + (d.getMonth() + 0 + 1) + ";";
  142. var day = ";" + d.getDate() + ";";
  143. if (year.length < 4) {
  144. year = "0" + year;
  145. }
  146. if (month.length < 4) {
  147. month = "0" + month;
  148. }
  149. if (day.length < 4) {
  150. day = "0" + day;
  151. }
  152. var datestr = year + "-" + month + "-" + day;
  153. datestr = datestr.replace(/;/g, "");
  154. return datestr;
  155. // return d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
  156. }
  157. // 获取指定日期的前后几天
  158. function getDateByDay(addDayCount, curDate) {
  159. var d = new Date(curDate);
  160. d.setDate(d.getDate() + addDayCount);//获取AddDayCount天后的日期
  161. //格式化
  162. var year = ";" + d.getFullYear() + ";";
  163. var month = ";" + (d.getMonth() + 0 + 1) + ";";
  164. var day = ";" + d.getDate() + ";";
  165. if (year.length < 4) {
  166. year = "0" + year;
  167. }
  168. if (month.length < 4) {
  169. month = "0" + month;
  170. }
  171. if (day.length < 4) {
  172. day = "0" + day;
  173. }
  174. var datestr = year + "-" + month + "-" + day;
  175. datestr = datestr.replace(/;/g, "");
  176. return datestr;
  177. }
  178. //获取后一天日期
  179. function after(d) {
  180. d = new Date(d);
  181. d = +d + 10006060 / 3 * 24;
  182. d = new Date(d);
  183. //return d;
  184. //格式化
  185. var year = ";" + d.getFullYear() + ";";
  186. var month = ";" + (d.getMonth() + 0 + 1) + ";";
  187. var day = ";" + d.getDate() + ";";
  188. if (year.length < 4) {
  189. year = "0" + year;
  190. }
  191. if (month.length < 4) {
  192. month = "0" + month;
  193. }
  194. if (day.length < 4) {
  195. day = "0" + day;
  196. }
  197. var datestr = year + "-" + month + "-" + day;
  198. datestr = datestr.replace(/;/g, "");
  199. return datestr;
  200. // return d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
  201. }
  202. // 从URL上获得参数
  203. function getPar(par) {
  204. //获取当前URL
  205. var local_url = document.location.href;
  206. local_url = decodeURI(local_url);
  207. //获取要取得的get参数位置
  208. var get = local_url.indexOf(par + "=");
  209. if (get == -1) {
  210. return "";
  211. }
  212. //截取字符串
  213. var get_par = local_url.slice(par.length + get + 1);
  214. //判断截取后的字符串是否还有其他get参数
  215. var nextPar = get_par.indexOf("&");
  216. if (nextPar != -1) {
  217. get_par = get_par.slice(0, nextPar);
  218. }
  219. return get_par;
  220. }
  221. //得到时间组合
  222. function getDateTime(nTypeFlag, DateTime) {
  223. var tNowTime;
  224. if(typeof DateTime == "undefined")
  225. tNowTime = new Date();
  226. else
  227. tNowTime = DateTime;
  228. var myYear = ';' + tNowTime.getFullYear() + ';';
  229. var myMonth = ';' + (tNowTime.getMonth() + 1 - 0) + ';';
  230. var myDay = ';' + tNowTime.getDate() + ';';
  231. var myHour = ';' + tNowTime.getHours() + ';';
  232. var myMinu = ';' + tNowTime.getMinutes() + ';';
  233. var mySecond = ';' + tNowTime.getSeconds() + ';';
  234. if (myMonth.length < 4) myMonth = '0' + myMonth;
  235. if (myDay.length < 4) myDay = '0' + myDay;
  236. if (myHour.length < 4) myHour = '0' + myHour;
  237. if (myMinu.length < 4) myMinu = '0' + myMinu;
  238. if (mySecond.length < 4) mySecond = '0' + mySecond;
  239. var cNewTimeStr;
  240. //alert(tNowTime);
  241. switch (nTypeFlag + 1 - 1) {
  242. case 0:
  243. cNewTimeStr = myYear + '-' + myMonth + '-' + myDay;
  244. break;
  245. case 1:
  246. cNewTimeStr = myYear + myMonth + myDay;
  247. break;
  248. case 2:
  249. cNewTimeStr = myHour + ':' + myMinu + ':' + mySecond;
  250. break;
  251. case 3:
  252. cNewTimeStr = myHour + myMinu + mySecond;
  253. break;
  254. case 4:
  255. cNewTimeStr = myYear + myMonth + myDay + myHour + myMinu + mySecond;
  256. break;
  257. case 5:
  258. cNewTimeStr = myYear + '年' + myMonth + '月' + myDay + '日';
  259. break;
  260. case 6:
  261. cNewTimeStr = myYear;
  262. break;
  263. case 7:
  264. cNewTimeStr = myYear + '-' + myMonth;
  265. break;
  266. case 8: //得到上一个月的今天
  267. var date = getDateTime(0);
  268. var arr = date.split('-');
  269. var year = arr[0]; //获取当前日期的年份
  270. var month = arr[1]; //获取当前日期的月份
  271. var day = arr[2]; //获取当前日期的日
  272. var days = new Date(year, month, 0);
  273. days = days.getDate(); //获取当前日期中月的天数
  274. var year2 = year;
  275. var month2 = parseInt(month) - 1;
  276. if (month2 == 0) {
  277. year2 = parseInt(year2) - 1;
  278. month2 = 12;
  279. }
  280. var day2 = day;
  281. var days2 = new Date(year2, month2, 0);
  282. days2 = days2.getDate();
  283. if (day2 > days2) {
  284. day2 = days2;
  285. }
  286. if (month2 < 10) {
  287. month2 = '0' + month2;
  288. }
  289. cNewTimeStr = year2 + '-' + month2 + '-' + day2;
  290. break;
  291. case 9: //得到下一个月的今天
  292. var date = getDateTime(0);
  293. var arr = date.split('-');
  294. var year = arr[0]; //获取当前日期的年份
  295. var month = arr[1]; //获取当前日期的月份
  296. var day = arr[2]; //获取当前日期的日
  297. var days = new Date(year, month, 0);
  298. days = days.getDate(); //获取当前日期中的月的天数
  299. var year2 = year;
  300. var month2 = parseInt(month) + 1;
  301. if (month2 == 13) {
  302. year2 = parseInt(year2) + 1;
  303. month2 = 1;
  304. }
  305. var day2 = day;
  306. var days2 = new Date(year2, month2, 0);
  307. days2 = days2.getDate();
  308. if (day2 > days2) {
  309. day2 = days2;
  310. }
  311. if (month2 < 10) {
  312. month2 = '0' + month2;
  313. }
  314. var t2 = year2 + '-' + month2 + '-' + day2;
  315. return t2;
  316. break;
  317. case 10: //昨日日期
  318. //获取前一天日期
  319. return before(getDateTime(0));
  320. function before(d) {
  321. d = new Date(d);
  322. d = +d - 10006060 / 3 * 24;
  323. d = new Date(d);
  324. //return d;
  325. //格式化
  326. var year = ";" + d.getFullYear() + ";";
  327. var month = ";" + (d.getMonth() + 0 + 1) + ";";
  328. var day = ";" + d.getDate() + ";";
  329. if (year.length < 4) {
  330. year = "0" + year;
  331. }
  332. if (month.length < 4) {
  333. month = "0" + month;
  334. }
  335. if (day.length < 4) {
  336. day = "0" + day;
  337. }
  338. var datestr = year + "-" + month + "-" + day;
  339. datestr = datestr.replace(/;/g, "");
  340. return datestr;
  341. // return d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
  342. }
  343. break;
  344. case 11: //明日日期
  345. //获取后一天日期
  346. return after(getDateTime(0));
  347. function after(d) {
  348. d = new Date(d);
  349. d = +d + 10006060 / 3 * 24;
  350. d = new Date(d);
  351. //return d;
  352. //格式化
  353. var year = ";" + d.getFullYear() + ";";
  354. var month = ";" + (d.getMonth() + 0 + 1) + ";";
  355. var day = ";" + d.getDate() + ";";
  356. if (year.length < 4) {
  357. year = "0" + year;
  358. }
  359. if (month.length < 4) {
  360. month = "0" + month;
  361. }
  362. if (day.length < 4) {
  363. day = "0" + day;
  364. }
  365. var datestr = year + "-" + month + "-" + day;
  366. datestr = datestr.replace(/;/g, "");
  367. return datestr;
  368. // return d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
  369. }
  370. break;
  371. case 12://本周起始日期
  372. return getWeekStartDate()
  373. function getWeekStartDate() {
  374. var now = new Date(); //当前日期
  375. var nowDayOfWeek = now.getDay(); //今天本周的第几天
  376. var nowDay = now.getDate(); //当前日
  377. var nowMonth = now.getMonth(); //当前月
  378. var nowYear = now.getYear(); //当前年
  379. nowYear += (nowYear < 2000) ? 1900 : 0; //
  380. var lastMonthDate = new Date(); //上月日期
  381. lastMonthDate.setDate(1);
  382. lastMonthDate.setMonth(lastMonthDate.getMonth() - 1);
  383. var lastYear = lastMonthDate.getYear();
  384. var lastMonth = lastMonthDate.getMonth();
  385. var weekStartDate = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek);
  386. return formatDate(weekStartDate);
  387. }
  388. break;
  389. case 13://本周结束日期
  390. return getWeekEndDate()
  391. function getWeekEndDate() {
  392. var now = new Date(); //当前日期
  393. var nowDayOfWeek = now.getDay(); //今天本周的第几天
  394. var nowDay = now.getDate(); //当前日
  395. var nowMonth = now.getMonth(); //当前月
  396. var nowYear = now.getYear(); //当前年
  397. nowYear += (nowYear < 2000) ? 1900 : 0; //
  398. var lastMonthDate = new Date(); //上月日期
  399. lastMonthDate.setDate(1);
  400. lastMonthDate.setMonth(lastMonthDate.getMonth() - 1);
  401. var lastYear = lastMonthDate.getYear();
  402. var lastMonth = lastMonthDate.getMonth();
  403. var weekEndDate = new Date(nowYear, nowMonth, nowDay + (6 - nowDayOfWeek));
  404. return formatDate(weekEndDate);
  405. }
  406. break;
  407. case 14://本月开始日期
  408. return getMonthStartDate()
  409. function getMonthStartDate() {
  410. var now = new Date(); //当前日期
  411. var nowDayOfWeek = now.getDay(); //今天本周的第几天
  412. var nowDay = now.getDate(); //当前日
  413. var nowMonth = now.getMonth(); //当前月
  414. var nowYear = now.getYear(); //当前年
  415. nowYear += (nowYear < 2000) ? 1900 : 0; //
  416. var lastMonthDate = new Date(); //上月日期
  417. lastMonthDate.setDate(1);
  418. lastMonthDate.setMonth(lastMonthDate.getMonth() - 1);
  419. var lastYear = lastMonthDate.getYear();
  420. var lastMonth = lastMonthDate.getMonth();
  421. var monthStartDate = new Date(nowYear, nowMonth, 1);
  422. return formatDate(monthStartDate);
  423. }
  424. break;
  425. case 15://本月结束日期
  426. return getMonthEndDate();
  427. function getMonthEndDate() {
  428. var now = new Date(); //当前日期
  429. var nowDayOfWeek = now.getDay(); //今天本周的第几天
  430. var nowDay = now.getDate(); //当前日
  431. var nowMonth = now.getMonth(); //当前月
  432. var nowYear = now.getYear(); //当前年
  433. nowYear += (nowYear < 2000) ? 1900 : 0; //
  434. var lastMonthDate = new Date(); //上月日期
  435. lastMonthDate.setDate(1);
  436. lastMonthDate.setMonth(lastMonthDate.getMonth() - 1);
  437. var lastYear = lastMonthDate.getYear();
  438. var lastMonth = lastMonthDate.getMonth();
  439. //获得某月的天数
  440. function getMonthDays(myMonth) {
  441. var monthStartDate = new Date(nowYear, myMonth, 1);
  442. var monthEndDate = new Date(nowYear, myMonth + 1, 1);
  443. var days = (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24);
  444. return days;
  445. }
  446. var monthEndDate = new Date(nowYear, nowMonth, getMonthDays(nowMonth));
  447. return formatDate(monthEndDate);
  448. }
  449. break;
  450. default:
  451. cNewTimeStr = myYear + '-' + myMonth + '-' + myDay + ' ' + myHour + ':' + myMinu + ':' + mySecond;
  452. break;
  453. }
  454. cNewTimeStr = cNewTimeStr.replace(/;/g, "");
  455. return cNewTimeStr;
  456. }
  457. //case 12,13的规整函数
  458. function formatDate(date) {
  459. var myyear = date.getFullYear();
  460. var mymonth = date.getMonth() + 1;
  461. var myweekday = date.getDate();
  462. if (mymonth < 10) {
  463. mymonth = "0" + mymonth;
  464. }
  465. if (myweekday < 10) {
  466. myweekday = "0" + myweekday;
  467. }
  468. return (myyear + "-" + mymonth + "-" + myweekday);
  469. }
  470. //html存入json
  471. function setJsonHtml(data) {
  472. if (typeof(data) == "object") {
  473. var jsonArrayFinal = JSON.stringify(data);
  474. jsonArrayFinal = jsonArrayFinal.replace(/ /g, '');
  475. jsonArrayFinal = jsonArrayFinal.replace(/"/g, '&quot;');
  476. return jsonArrayFinal;
  477. }
  478. }
  479. //取出html存入的json
  480. function getJsonHtml(data) {
  481. if (data && data.indexOf('[') == -1) {
  482. var data_info = JSON.parse(data);
  483. return data_info;
  484. }else{
  485. return 0
  486. }
  487. }
  488. function getCookie(c_name) {
  489. var i, x, y, ARRcookies = document.cookie.split(";");
  490. for (i = 0; i < ARRcookies.length; i++) {
  491. x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
  492. y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
  493. x = x.replace(/^\s+|\s+$/g, "");
  494. if (x == c_name) {
  495. return unescape(y);
  496. }
  497. }
  498. }
  499. // function setCookie(c_name, value, exdays) {
  500. // var exdate = new Date();
  501. // exdate.setDate(exdate.getDate() + exdays);
  502. // var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
  503. // document.cookie = c_name + "=" + c_value;
  504. // }
  505. //修改订单需要记录修改详细内容,保存好原数据
  506. function initOldData(order_data) {
  507. // var _old_data = {
  508. // order_id: '',
  509. // org_id: '',
  510. // org_num: '',
  511. // room_list: '',
  512. // cus_list: '',
  513. // checkin_time: '',
  514. // if_cancel: '',
  515. // benefit: '',
  516. // total_commission: ''
  517. // };
  518. var order_p = order_data.hotel_order_detail[0],
  519. order_c = order_data.hotel_child_order_detail;
  520. var amount = 0;
  521. // var cus_list = "{" + order_p.customer_name + "," + order_p.customer_mobile + "," + order_p.customer_memo + "}";
  522. _old_data['contact'] = order_p.customer_name;
  523. _old_data['mobile'] = order_p.customer_mobile;
  524. _old_data['memo'] = order_p.customer_memo;
  525. _old_data['org_id'] = org_id;
  526. _old_data['org_num'] = order_p.outside_order_no;
  527. // _old_data['org_name'] = $("#org_id option[value='"+ org_id.toString()+ "']").html()
  528. _old_data['start_date'] = order_p.start_date;
  529. // _old_data['end_date'] = order_p.end_date;
  530. //间夜数
  531. var count = 0;
  532. $.each(order_c, function (key, order) {
  533. count += parseInt(order.total);
  534. amount += order['order_price'] * order['total'];
  535. })
  536. _old_data['total'] = count;
  537. _old_data['amount'] = amount;
  538. }
  539. //对比数据,返回需要记录的字段
  540. function compareOldData(new_order_data) {
  541. var list = [];
  542. $.each(_old_data, function (key, item) {
  543. if ( key != 'amount' && item != new_order_data[key]) { //备注去除
  544. if (key == 'org_id') {// 修改渠道商
  545. var b = $("#org_id option[value='" + new_order_data[key] + "']").html()
  546. var a = $("#org_id option[value='" + item + "']").html();
  547. list.push({'name': key, 'old_val': a, 'new_val': b});
  548. } else
  549. list.push({'name': key, 'old_val': item, 'new_val': new_order_data[key]});
  550. }
  551. })
  552. return list;
  553. }
  554. function removeNote(obj, flag) {
  555. if(flag){
  556. ZZConfirm('确认要删除备注?', function () {
  557. $(obj).closest('.note').remove();
  558. })
  559. }else{
  560. $(obj).closest('.note').remove();
  561. }
  562. }
  563. //日期获取上周
  564. function getLastWeek(){
  565. var today = new Date();
  566. var lastWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 7);
  567. return lastWeek ;
  568. }
  569. //权限控制
  570. function playPermission(){
  571. var urlapi = base_api;
  572. var _hotel_id = getPar('hotel_id'),
  573. user_id = getCookie('user_id');
  574. var param = {
  575. type: "hotel_HotelList",
  576. hotel_id: _hotel_id,
  577. op: "getDetail"
  578. };
  579. ZZLog(urlapi + JSON.stringify(param));
  580. $.ajax({
  581. url: urlapi,
  582. data: param,
  583. type: "post",
  584. dataType: "json",
  585. success: function (res_data) {
  586. ZZLog(res_data);
  587. if (res_data['code'] != "0") {
  588. alert(res_data['info']);
  589. } else {
  590. var tmp = [],
  591. temp;
  592. temp = res_data['rowset'][0]['PRINCIPAL'];
  593. if(typeof temp == 'string')
  594. tmp = temp.split(',');
  595. var principal = $.merge(_principal, tmp);
  596. if($.inArray(user_id, principal.toString().split(',')) < 0){
  597. // $(".permission-display").hide();
  598. // $(".permission td.bday").unbind('click');
  599. // $(".permission td.cday").unbind('click');
  600. // $(".permission td.change").unbind('click');
  601. // $(".permission td.change").attr('onclick','');
  602. // $(".permission td img").attr('onclick','');
  603. }
  604. }
  605. },
  606. error: function (error) {
  607. alert('system ajax http error');
  608. ZZLog(error);
  609. }
  610. })
  611. }
  612. function all_sum() {
  613. all_yongj = 0;
  614. all_jiesuan = 0;
  615. all_profit = 0;
  616. var all_yongj1= 0;
  617. var all_jiesuan1 = 0;
  618. var all_profit1 = 0;
  619. $('.yongj_sum').each(function () {
  620. all_yongj += parseFloat($(this).text())
  621. });
  622. if (isNaN(all_yongj)) {
  623. all_yongj = 0
  624. }
  625. $('.jiesuan_sum').each(function () {
  626. all_jiesuan += parseFloat($(this).text())
  627. });
  628. if (isNaN(all_jiesuan)) {
  629. all_jiesuan = 0
  630. }
  631. $('.benefit_sum').each(function () {
  632. all_profit += parseFloat($(this).text())
  633. });
  634. if (isNaN(all_profit)) {
  635. all_profit = 0
  636. }
  637. all_yongj1 = all_yongj.toFixed(2);
  638. all_jiesuan1 = all_jiesuan.toFixed(2);
  639. all_profit1 = all_profit.toFixed(2);
  640. $('#all_yongj').text(all_yongj1 + '元');
  641. $('#all_jiesuan').text(all_jiesuan1 + '元');
  642. $('#all_profit').text(all_profit1 + '元');
  643. }
  644. /**
  645. * 加载时尽量考虑什么时候关闭,否则15秒后自动关闭
  646. */
  647. function loading(time) {
  648. var newDiv = '<div id="screen-cover" class="loader-inner ball-beat" style="width: 100%; height: 100%; position: absolute; top: 0; left: 0; background-color: rgba(0,0,0,0.5); text-align: center; z-index: 9999;' +
  649. '"><div class="on" style="border-radius: 100%!important;"></div><div class="off" style="border-radius: 100%!important;"></div><div class="on" style="border-radius: 100%!important;"></div>' +
  650. '</div>';
  651. if(typeof $("#screen-cover") != 'undefined')
  652. $("#screen-cover").remove();
  653. $("<link>")
  654. .attr({ rel: "stylesheet",
  655. type: "text/css",
  656. href: "/css/loader.css"
  657. })
  658. .appendTo("head");
  659. $("html").append(newDiv);
  660. $("#screen-cover").css('padding-top', $(window).height() / 2 - 55);
  661. // if(typeof time == 'undefined')
  662. // time = 15000;
  663. // setTimeout('closeLoading()',time);
  664. }
  665. function closeLoading() {
  666. if($("#screen-cover").length > 0)
  667. $("#screen-cover").remove();
  668. }