Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

538 řádky
20 KiB

  1. //========================列表页的主页=============================//
  2. var myArray = new Array();
  3. var c_ifbus = -1;
  4. var c_ifhotel = -1;
  5. var c_ifsightspot = -1;
  6. var c_direction = 0;
  7. var is_show_cir = false; // 判断是否显示黄色小圆点
  8. var area1=getPar('area1');
  9. var area2=getPar('area2');
  10. //var endspan=getPar('endspan');
  11. function init_page(){
  12. // if(endspan!="false"){
  13. // var choosearea = document.getElementById(endspan);
  14. // choosearea.style.color='#FFFFFF';
  15. // choosearea.style.backgroundColor='#00cc9c';
  16. // choosearea.style.borderColor='#00cc9c';
  17. // choosearea.style.borderStyle='solid';
  18. // }
  19. if(area1!="false"){
  20. var url = "http://xmwxc.zhizhuchuxing.cn/core/query.asp?area1="+area1+"&area2="+area2;
  21. get_virtual_user_list(url);
  22. }
  23. }
  24. // 刷新表格
  25. var temp_httpData;
  26. function reload_cell(httpData){
  27. if(httpData.code!="0"){
  28. alert(httpData.info);return;
  29. }
  30. temp_httpData = httpData;
  31. // 得到center对象
  32. var center = document.getElementById("center");
  33. // 得到数据中的数据
  34. var product_list = httpData.product_list;
  35. var htmlStr="";
  36. for (var i=0;i<product_list.length;i++) {
  37. myArray[i] = new Array();
  38. myArray[i][0] = product_list[i].prod_code;
  39. myArray[i][1] = product_list[i].prod_name;
  40. myArray[i][2] = product_list[i].price;
  41. myArray[i][3] = product_list[i].start_area;
  42. myArray[i][4] = product_list[i].end_area;
  43. myArray[i][5] = product_list[i].run_info;
  44. myArray[i][6] = product_list[i].back_run_info;
  45. myArray[i][7] = product_list[i].run_count;
  46. myArray[i][8] = product_list[i].direction;
  47. myArray[i][9] = product_list[i].if_bus;
  48. myArray[i][10] = product_list[i].if_hotel;
  49. myArray[i][11] = product_list[i].if_sightspot;
  50. myArray[i][12] = product_list[i].run_days;
  51. }
  52. // 执行
  53. show_product_list(0,-1,-1,-1,0);
  54. }
  55. var temp_lino=0;
  56. function show_product_list(lino,c_ifbus,c_ifhotel,c_ifsightspot,c_direction)
  57. {
  58. temp_lino=lino;
  59. if(lino!=0){
  60. c_get_type(lino);
  61. var c_header_all = document.getElementById("c_header_all");
  62. c_header_all.style.backgroundSize='0px 0px';
  63. }
  64. var cstr1 = '';
  65. var cstr2 = '';
  66. var num1 = myArray.length;
  67. var num2 = 0;
  68. var cstr3 = '';
  69. for (var i=0;i<num1;i++)
  70. {
  71. num2 = 0;
  72. if (c_ifbus-0>=0 && myArray[i][9]-c_ifbus!=0) num2 = 1;
  73. if (c_ifhotel-0>=0 && myArray[i][10]-c_ifhotel!=0) num2 = 1;
  74. if (c_ifsightspot-0>=0 && myArray[i][11]-c_ifsightspot!=0) num2 = 1;
  75. if ((c_direction-0)>0 && (myArray[i][8]-c_direction)!=0) num2 = 1;
  76. if (num2 - 0 == 0)
  77. {
  78. if (cstr1 != '')
  79. {
  80. cstr2 += '<div class="cell-start zh" onclick="click_cell(\''+ cstr3 +'\')">';
  81. cstr2 += cstr1;
  82. cstr1 = '';
  83. }
  84. cstr3 = myArray[i][0];
  85. //if (i==(num1-1)) {
  86. // cstr1 += '<div class="cell-start-last cell-start zh" onclick="click_cell(\'' + myArray[i][0] + '\')">';
  87. //}else{
  88. // cstr1 += '<div class="cell-start zh" onclick="click_cell(\''+ myArray[i][0] +'\')">';
  89. //}
  90. cstr1 += '<div class="smallbox">';
  91. cstr1 += '<img style="position:absolute;top:23px;left:4%;width:9px;height: 39px;" class="smalllogo" src="../img/smalllogo.png">';
  92. cstr1 += '<div class="smallboxleft z">';
  93. cstr1 += '<div class="smallareainput z" style="margin-top:10px;">';
  94. cstr1 += '<div style="height:32px; line-height: 32px; width:100%; border-bottom:1px solid #ECEBEE;">';
  95. cstr1 +='<span id="start_area" style="font-size:16px;color:#343434;">'+myArray[i][3]+'</span>';
  96. cstr1 +='<span id="go_info" style="float:right;color:#808080;font-size:14px;">'+myArray[i][5]+'</span>';
  97. cstr1 +='</div>';
  98. cstr1 +='<div style="height:32px;width:100%; line-height: 32px;">';
  99. cstr1 +='<span id="end_area" style="font-size:16px;color:#343434;">'+myArray[i][4]+'</span>';
  100. cstr1 +='<span id="back_info" style="float:right;color:#808080;font-size:14px;">'+myArray[i][7]+'&nbsp;班&nbsp;/&nbsp;天</span>';
  101. cstr1 +='</div>';
  102. cstr1 +='</div>';
  103. var width = window.screen.width ;
  104. var name = myArray[i][1];
  105. if (width>320){
  106. if(name.length>19){
  107. name = name.substr(0,18)+'...';
  108. }else{
  109. name = name.substr(0,20);
  110. }
  111. }else if(width==320){
  112. if(name.length>17){
  113. name = name.substr(0,15)+'...';
  114. }else{
  115. name = name.substr(0,17);
  116. }
  117. }else if(width>=300 && width<320){
  118. if(name.length>15){
  119. name = name.substr(0,13)+'...';
  120. }else{
  121. name = name.substr(0,15);
  122. }
  123. }
  124. cstr1 += '<div class="tickettitle z" style="float:left;color:#808080;font-size:13px;margin-left:4.89%;margin-top:14px;">'+name+'</div>';
  125. cstr1 += '</div>';
  126. // 判断往返程信息
  127. if(myArray[i][8]=="1"){
  128. cstr1 += '<img class="exchangelogo" style="position:absolute;top:36px;right:6.8%;width:13px; height: 13px;" src="../img/single_arrow.png">';
  129. }else if(myArray[i][8]=="2"){
  130. cstr1 += '<img class="exchangelogo" style="position:absolute;top:36px;right:6.8%;width:13px; height: 13px;" src="../img/go_back.png">';
  131. }
  132. cstr1 += '<div class="smallboxright y" style="margin-right:-3px; text-align: center;">';
  133. cstr1 += '<div class="ticketprice" style="margin-right:0px;">';
  134. cstr1 += '<span style="margin-right:-2px;">¥&nbsp;</span>';
  135. cstr1 += '<span>'+myArray[i][2]+'</span>';
  136. cstr1 += '</div>';
  137. cstr1 += '<div class="tickettypeimage" style="width:100%;margin-top:29px;float:left;">';
  138. // 是否包含车子
  139. var car = myArray[i][9];
  140. if(car=="1"){
  141. cstr1 += '<img class="img car" style="" src="../img/car.png" alt="">';
  142. }
  143. // 是否包含宾馆
  144. var hotel = myArray[i][10];
  145. if (hotel=="1"){
  146. cstr1 += '<img class="img ticket" style="width: 15px;" src="../img/hotel.png" alt="">';
  147. }
  148. // 是否包含景点
  149. var sightspot = myArray[i][11];
  150. if (sightspot=="1") {
  151. cstr1 += '<img class="img hotel" style="width:16px;margin-right:0px;" src="../img/ticket.png" alt="">';
  152. }
  153. cstr1 += '</div>';
  154. cstr1 += '</div>';
  155. cstr1 += '</div>';
  156. cstr1 += '</div>';
  157. }
  158. }
  159. if (cstr1 != '')
  160. {
  161. cstr2 += '<div class="cell-start-last cell-start zh" onclick="click_cell(\'' + cstr3 + '\')">';
  162. cstr2 += cstr1;
  163. }
  164. var obj1 = document.getElementById('center');
  165. obj1.innerHTML = cstr2;
  166. hide_mask_type();
  167. }
  168. // 点击单元格
  169. function click_cell(prod_code){
  170. // var listURL = "details.html?prod_code="+prod_code;
  171. var listURL = "/core/prod_detail.asp?prod_code="+prod_code;
  172. // 跳转前将URL编码
  173. listURL = encodeURI(listURL);
  174. window.location.href = listURL;
  175. }
  176. // 从上一页的链接上获取参数
  177. function getPar(par){
  178. //获取当前URL
  179. var local_url = document.location.href;
  180. // 接收的时候将URL 解码
  181. local_url = decodeURI(local_url);
  182. //获取要取得的get参数位置
  183. var get = local_url.indexOf(par +"=");
  184. if(get == -1){
  185. return false;
  186. }
  187. //截取字符串
  188. var get_par = local_url.slice(par.length + get + 1);
  189. //判断截取后的字符串是否还有其他get参数
  190. var nextPar = get_par.indexOf("&");
  191. if(nextPar != -1){
  192. get_par = get_par.slice(0, nextPar);
  193. }
  194. return get_par;
  195. }
  196. //========================列表页的两个层=============================//
  197. // 点击了目的地
  198. function clickMudidi(){
  199. load_mudidi_citys_sightspot(); // 动态加载目的地的城市和景点
  200. hide_mask_type(); // 隐藏蒙板和出发、目的地层
  201. // 得到蒙板层
  202. var mask = document.getElementById("mask");
  203. // 目的地
  204. var mudidi = document.getElementById("m_mudidi");
  205. // 得到目的地按钮
  206. var toaddess = document.getElementById("toaddess");
  207. // toaddess.style.background='url(../img/list_cir.png) no-repeat';
  208. toaddess.style.backgroundColor='white';
  209. toaddess.style.backgroundSize='7px';
  210. toaddess.style.backgroundPosition='62% 7px';
  211. mask.style.display = 'block';
  212. mudidi.style.display = 'block';
  213. toaddess.style.color='#00CC9C';
  214. // 得到图片
  215. var img = document.getElementById("type1-arrow");
  216. img.src='../img/list_up.png';
  217. }
  218. // 动态加载目的地的城市和景点
  219. function load_mudidi_citys_sightspot(){
  220. var m_city = document.getElementById("m_city");
  221. var m_scenery = document.getElementById("m_scenery");
  222. var city_list = temp_httpData.city_list;
  223. var city_listHTML = '';
  224. var cstr1 = '';
  225. var myArray = new Array();
  226. myArray[0] = '上海';
  227. // myArray[1] = '苏州';
  228. // myArray[2] = '杭州';
  229. // myArray[3] = '常州';
  230. // myArray[4] = '嘉兴';
  231. // myArray[5] = '湖州';
  232. // myArray[6] = '扬州';
  233. for (var i=0;i<myArray.length;i++) {
  234. cstr1 = myArray[i];
  235. if (cstr1 == area2)
  236. {
  237. city_listHTML +='<li id="li'+(i+1)+'" class="m_button" style="background:#00cc9c;color:#ffffff;border-color:#00cc9c;" onclick="m_get_target_area('+'\''+myArray[i]+'\''+')">'+myArray[i]+'</li>';
  238. }else{
  239. city_listHTML +='<li id="li'+(i+1)+'" class="m_button" onclick="m_get_target_area('+'\''+myArray[i]+'\''+')">'+myArray[i]+'</li>';
  240. }
  241. }
  242. // for (var i=0;i<city_list.length;i++) {
  243. // cstr1 = city_list[i].city;
  244. //
  245. // if (cstr1 == area2)
  246. // {
  247. // city_listHTML +='<li id="li'+(i+1)+'" class="m_button" style="background:#00cc9c;color:#ffffff;border-color:#00cc9c;" onclick="m_get_target_area('+'\''+city_list[i].city+'\''+')">'+city_list[i].city+'</li>';
  248. // }else{
  249. // city_listHTML +='<li id="li'+(i+1)+'" class="m_button" onclick="m_get_target_area('+'\''+city_list[i].city+'\''+')">'+city_list[i].city+'</li>';
  250. // }
  251. // }
  252. // 执行
  253. m_city.innerHTML = city_listHTML;
  254. var sightspot_list = temp_httpData.sightspot_list;
  255. var sightspot_listHTML = '';
  256. var cstr2 = '';
  257. var myArray2 = new Array();
  258. myArray2[0] = '千岛湖';
  259. myArray2[1] = '乌镇';
  260. myArray2[2] = '萧山机场';
  261. myArray2[3] = '西塘';
  262. // myArray2[0] = '千岛湖';
  263. // myArray2[1] = '安吉';
  264. // myArray2[2] = '天目湖';
  265. // myArray2[3] = '南山竹海';
  266. // myArray2[4] = '乌镇';
  267. // myArray2[5] = '同里';
  268. // myArray2[6] = '留园';
  269. // myArray2[7] = '灵山大佛';
  270. // myArray2[8] = '甪直';
  271. // myArray2[9] = '锦溪';
  272. // myArray2[10] = '周庄';
  273. // myArray2[11] = '萧山机场';
  274. // myArray2[12] = '恐龙园';
  275. // myArray2[13] = '嬉戏谷';
  276. // myArray2[14] = '大明山';
  277. // myArray2[15] = '青山湖';
  278. // myArray2[16] = '西塘';
  279. // myArray2[17] = '南浔';
  280. // myArray2[18] = '桐庐';
  281. // myArray2[19] = '莫干山';
  282. for (var i=0;i<myArray2.length;i++) {
  283. cstr2 = myArray2[i];
  284. if(area2==cstr2){
  285. sightspot_listHTML +='<li class="m_button" style="color: #FFFFFF;background-color: #00CC9C;border-color: #00CC9C;border-style: solid;"><a id="m_dsn" onclick="m_get_target_area('+'\''+myArray2[i]+'\''+')">'+myArray2[i]+'</a></li>';
  286. }else{
  287. sightspot_listHTML +='<li class="m_button"><a id="m_dsn" onclick="m_get_target_area('+'\''+myArray2[i]+'\''+')">'+myArray2[i]+'</a></li>';
  288. }
  289. }
  290. // for (var i=0;i<sightspot_list.length;i++) {
  291. // if(area2==sightspot_list[i].sightspot){
  292. // sightspot_listHTML +='<li class="m_button" style="color: #FFFFFF;background-color: #00CC9C;border-color: #00CC9C;border-style: solid;"><a id="m_dsn" onclick="m_get_target_area('+'\''+sightspot_list[i].sightspot+'\''+')">'+sightspot_list[i].sightspot+'</a></li>';
  293. // }else{
  294. // sightspot_listHTML +='<li class="m_button"><a id="m_dsn" onclick="m_get_target_area('+'\''+sightspot_list[i].sightspot+'\''+')">'+sightspot_list[i].sightspot+'</a></li>';
  295. // }
  296. //
  297. // }
  298. // 执行
  299. m_scenery.innerHTML = sightspot_listHTML;
  300. }
  301. // 选中目的地层上的地点
  302. function m_get_target_area(area){
  303. // 选择了地点之后,将蒙板去掉、将该层隐藏
  304. hide_mask_type();
  305. var listURL = "list.html?area1="+area1+'&area2='+area;
  306. // 跳转前将URL编码
  307. listURL = encodeURI(listURL);
  308. window.location.href = listURL;
  309. // var center = document.getElementById("center");
  310. // center.innerHTML="";
  311. // var url = "http://xmwxc.zhizhuchuxing.cn/core/query.asp?area1="+area1+"&area2="+area;
  312. // get_virtual_user_list(url);
  313. }
  314. // 点击了出发类型
  315. function clickType(){
  316. load_type_data(); // 动态加载出发类型的数据
  317. hide_mask_type();
  318. // 得到蒙板层
  319. var mask = document.getElementById("mask");
  320. // 出发类型
  321. var c_type = document.getElementById("c_type");
  322. // 得到出发类型按钮
  323. var type = document.getElementById("type");
  324. // type.style.background='url(../img/list_cir.png) no-repeat';
  325. type.style.backgroundColor='white';
  326. type.style.backgroundSize='7px';
  327. // type.style.backgroundPosition='67% 7px';
  328. mask.style.display = 'block';
  329. c_type.style.display = 'block';
  330. type.style.color = "#00CC9C";
  331. var img = document.getElementById("type2-arrow");
  332. img.src='../img/list_up.png';
  333. }
  334. // 动态加载出发类型上的数据
  335. function load_type_data(){
  336. if(temp_lino==0){
  337. var c_header_all = document.getElementById("c_header_all");
  338. c_header_all.style.backgroundImage='url(../img/list_check.png)';
  339. c_header_all.style.backgroundRepeat='no-repeat';
  340. c_header_all.style.backgroundSize='0px 0px';
  341. c_header_all.style.backgroundPosition='100%';
  342. }
  343. // 全部
  344. var num1 = myArray.length;
  345. if(myArray.length<1)return;
  346. var num2 = 0;
  347. var listArray = new Array();
  348. listArray[0] = ['全部',-1,-1,-1,0,0];
  349. listArray[1] = ['单程票',1,0,0,1,0];
  350. listArray[2] = ['往返程票',1,0,0,2,0];
  351. listArray[3] = ['单程票+酒店',1,1,0,1,0];
  352. listArray[4] = ['单程票+景点门票',1,0,1,1,0];
  353. listArray[5] = ['单程票+酒店+景点门票',1,1,1,1,0];
  354. listArray[6] = ['往返程票+酒店',1,1,0,2,0];
  355. listArray[7] = ['往返程票+景点门票',1,0,1,2,0];
  356. listArray[8] = ['往返程票+酒店+景点门票',1,1,1,2,0];
  357. for (var i=0;i<num1;i++)
  358. {
  359. listArray[0][5]++;
  360. if ((myArray[i][9]-1)==0 && (myArray[i][8]-1)==0 && (myArray[i][10]-0)==0 && (myArray[i][11]-0)==0) listArray[1][5]++;
  361. if ((myArray[i][9]-1)==0 && (myArray[i][8]-2)==0 && (myArray[i][10]-0)==0 && (myArray[i][11]-0)==0) listArray[2][5]++;
  362. if ((myArray[i][9]-1)==0 && (myArray[i][8]-1)==0 && (myArray[i][10]-1)==0 && (myArray[i][11]-0)==0) listArray[3][5]++;
  363. if ((myArray[i][9]-1)==0 && (myArray[i][8]-1)==0 && (myArray[i][10]-0)==0 && (myArray[i][11]-1)==0) listArray[4][5]++;
  364. if ((myArray[i][9]-1)==0 && (myArray[i][8]-1)==0 && (myArray[i][10]-1)==0 && (myArray[i][11]-1)==0) listArray[5][5]++;
  365. if ((myArray[i][9]-1)==0 && (myArray[i][8]-2)==0 && (myArray[i][10]-1)==0 && (myArray[i][11]-0)==0) listArray[6][5]++;
  366. if ((myArray[i][9]-1)==0 && (myArray[i][8]-2)==0 && (myArray[i][10]-0)==0 && (myArray[i][11]-1)==0) listArray[7][5]++;
  367. if ((myArray[i][9]-1)==0 && (myArray[i][8]-2)==0 && (myArray[i][10]-1)==0 && (myArray[i][11]-1)==0) listArray[8][5]++;
  368. }
  369. // var cstr1 = '<span class="type_title z">全部</span><span class="type_count y">' + listArray[0][5] + '条</span>';
  370. var cstr1 = '<span class="type_title z">全部</span><span class="z" style="margin-left:20px;color:#808080">' + listArray[0][5] + '条</span>';
  371. if(temp_lino==0){
  372. var c_header_all = document.getElementById("c_header_all");
  373. c_header_all.style.backgroundImage='url(../img/list_check.png)';
  374. c_header_all.style.backgroundRepeat='no-repeat';
  375. c_header_all.style.backgroundSize='20px 20px';
  376. c_header_all.style.backgroundPosition='100%';
  377. // cstr1 +='<img class="y" style="margin-top:7px;width:20px;height:20px;" src="../img/list_check.png"/>';
  378. }
  379. document.getElementById('c_header_all').innerHTML = cstr1;
  380. cstr1 = '<ul>';
  381. for (var i=1;i<9;i++)
  382. {
  383. if ((listArray[i][5] - 0) != 0){
  384. if(i==temp_lino){
  385. cstr1 += '<li id="li'+i+'" style="background:url(../img/list_check.png) no-repeat;background-size: 20px 20px;background-position:100%; height:55px;line-height:55px;border-bottom: 1px solid #e5e5e5;" onclick="show_product_list('+ i + ','+ listArray[i][1] + ',' + listArray[i][2] + ',' + listArray[i][3] + ',' + listArray[i][4] + ')"><span class="z" style="color:#4d4d4d;">' + listArray[i][0] + '</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="z" style="margin-left:20px;color:#808080">' + listArray[i][5] + '条</span></li>';
  386. }else{
  387. // cstr1 += '<li onclick="show_product_list(' + listArray[i][1] + ',' + listArray[i][2] + ',' + listArray[i][3] + ',' + listArray[i][4] + ')">' + listArray[i][0] + '<span>' + listArray[i][5] + '条</span></li>';
  388. cstr1 += '<li id="li'+i+'" style="height:55px;line-height:55px;border-bottom: 1px solid #e5e5e5;" onclick="show_product_list('+ i + ','+ listArray[i][1] + ',' + listArray[i][2] + ',' + listArray[i][3] + ',' + listArray[i][4] + ')"><span class="z" style="color:#4d4d4d;">' + listArray[i][0] + '</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="z" style="margin-left:20px;color:#808080">' + listArray[i][5] + '条</span></li>';
  389. }
  390. }
  391. }
  392. cstr1 += '</ul>';
  393. var obj1 = document.getElementById('div_product_type_list');
  394. obj1.innerHTML = cstr1;
  395. }
  396. // 选中出发类型上的类型
  397. function c_get_type(lino){
  398. var li = document.getElementById("li"+lino);
  399. li.style.backgroundImage='url(../img/list_check.png)';
  400. li.style.backgroundRepeat='no-repeat';
  401. li.style.backgroundSize='20px 20px';
  402. li.style.backgroundPosition='100%';
  403. }
  404. // 隐藏蒙板和出发、目的地层
  405. function hide_mask_type(){
  406. // 蒙板
  407. var mask = document.getElementById("mask");
  408. // 出发类型层
  409. var c_type = document.getElementById("c_type");
  410. mask.style.display = 'none';
  411. c_type.style.display = 'none';
  412. // 目的地层
  413. var m_mudidi = document.getElementById("m_mudidi");
  414. m_mudidi.style.display = 'none';
  415. // 目的地按钮
  416. var toaddess = document.getElementById("toaddess");
  417. toaddess.style.color='#585858';
  418. toaddess.style.backgroundPosition='1000px';
  419. // 出发类型按钮
  420. var type = document.getElementById("type");
  421. type.style.color='#585858';
  422. type.style.backgroundPosition='1000px';
  423. var img1 = document.getElementById("type1-arrow");
  424. img1.src = '../img/list_down.png';
  425. var img2 = document.getElementById("type2-arrow");
  426. img2.src = '../img/list_down.png';
  427. }
  428. /*======================网络请求的Ajax的代码=======================*/
  429. // 创建一个Ajax对象
  430. if (window.ActiveXObject){
  431. var myreq = new ActiveXObject("Microsoft.XMLHTTP");
  432. }else{
  433. var myreq = new XMLHttpRequest();
  434. }
  435. // 请求方法,传入URL
  436. function get_virtual_user_list(myURL)
  437. {
  438. var tnowtime = getDateTime(4);
  439. // m_url = 接口
  440. // var myURL = m_url + 'op=userlink&vuser=' + cvuserid + '&tt=' + tnowtime;
  441. // var myURL = "http://xmwxc.zhizhuchuxing.cn/core/area_target.asp?keyword=";
  442. myreq.open("get",myURL,true);
  443. // 接收的数据交给哪个函数处理
  444. myreq.onreadystatechange = show_user_list;
  445. myreq.send();
  446. }
  447. function show_user_list()
  448. {
  449. if (myreq.readyState == 4)
  450. {
  451. // newstr 就是接收到的数据
  452. var newstr = myreq.responseText;
  453. var httpData=JSON.parse(newstr);
  454. //
  455. reload_cell(httpData);
  456. }
  457. }
  458. function getDateTime(nTypeFlag)
  459. {
  460. var tNowTime = new Date();
  461. var myYear = ';' + tNowTime.getFullYear() + ';';
  462. var myMonth = ';' + (tNowTime.getMonth()+1-0) + ';';
  463. var myDay = ';' + tNowTime.getDate()+ ';';
  464. var myHour = ';' + tNowTime.getHours()+ ';';
  465. var myMinu = ';' + tNowTime.getMinutes()+ ';';
  466. var mySecond = ';' + tNowTime.getSeconds()+ ';';
  467. if (myMonth.length < 4) myMonth = '0' + myMonth;
  468. if (myDay.length < 4) myDay = '0' + myDay;
  469. if (myHour.length < 4) myHour = '0' + myHour;
  470. if (myMinu.length < 4) myMinu = '0' + myMinu;
  471. if (mySecond.length < 4) mySecond = '0' + mySecond;
  472. var cNewTimeStr;
  473. //alert(tNowTime);
  474. switch (nTypeFlag+1-1)
  475. {
  476. case 0:
  477. cNewTimeStr = myYear + '-' + myMonth + '-' + myDay;
  478. break;
  479. case 1:
  480. cNewTimeStr = myYear + myMonth + myDay;
  481. break;
  482. case 2:
  483. cNewTimeStr = myHour + ':' + myMinu + ':' + mySecond;
  484. break;
  485. case 3:
  486. cNewTimeStr = myHour + myMinu + mySecond;
  487. break;
  488. case 4:
  489. cNewTimeStr = myYear + myMonth + myDay + myHour + myMinu + mySecond;
  490. break;
  491. case 5:
  492. cNewTimeStr = myYear + '年' + myMonth + '月' + myDay + '日';
  493. break;
  494. case 6:
  495. cNewTimeStr = myYear;
  496. break;
  497. case 7:
  498. cNewTimeStr = myYear + '-' + myMonth;
  499. break;
  500. default:
  501. cNewTimeStr = myYear + '-' + myMonth + '-' + myDay + ' ' + myHour + ':' + myMinu + ':' + mySecond;
  502. break;
  503. }
  504. cNewTimeStr = cNewTimeStr.replace(/;/g,"");
  505. return cNewTimeStr;
  506. }