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.
 
 
 
 
 

533 lines
19 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://xmwx.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[4] = '乌镇';
  263. myArray2[5] = '同里';
  264. myArray2[6] = '留园';
  265. myArray2[7] = '灵山大佛';
  266. myArray2[8] = '甪直';
  267. myArray2[9] = '锦溪';
  268. myArray2[10] = '周庄';
  269. myArray2[11] = '萧山机场';
  270. myArray2[12] = '恐龙园';
  271. myArray2[13] = '嬉戏谷';
  272. myArray2[14] = '大明山';
  273. myArray2[15] = '青山湖';
  274. myArray2[16] = '西塘';
  275. myArray2[17] = '南浔';
  276. myArray2[18] = '桐庐';
  277. myArray2[19] = '莫干山';
  278. for (var i=0;i<myArray2.length;i++) {
  279. cstr2 = myArray2[i];
  280. if(area2==cstr2){
  281. 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>';
  282. }else{
  283. sightspot_listHTML +='<li class="m_button"><a id="m_dsn" onclick="m_get_target_area('+'\''+myArray2[i]+'\''+')">'+myArray2[i]+'</a></li>';
  284. }
  285. }
  286. // for (var i=0;i<sightspot_list.length;i++) {
  287. // if(area2==sightspot_list[i].sightspot){
  288. // 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>';
  289. // }else{
  290. // 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>';
  291. // }
  292. //
  293. // }
  294. // 执行
  295. m_scenery.innerHTML = sightspot_listHTML;
  296. }
  297. // 选中目的地层上的地点
  298. function m_get_target_area(area){
  299. // 选择了地点之后,将蒙板去掉、将该层隐藏
  300. hide_mask_type();
  301. var listURL = "list.html?area1="+area1+'&area2='+area;
  302. // 跳转前将URL编码
  303. listURL = encodeURI(listURL);
  304. window.location.href = listURL;
  305. // var center = document.getElementById("center");
  306. // center.innerHTML="";
  307. // var url = "http://xmwx.zhizhuchuxing.cn/core/query.asp?area1="+area1+"&area2="+area;
  308. // get_virtual_user_list(url);
  309. }
  310. // 点击了出发类型
  311. function clickType(){
  312. load_type_data(); // 动态加载出发类型的数据
  313. hide_mask_type();
  314. // 得到蒙板层
  315. var mask = document.getElementById("mask");
  316. // 出发类型
  317. var c_type = document.getElementById("c_type");
  318. // 得到出发类型按钮
  319. var type = document.getElementById("type");
  320. // type.style.background='url(../img/list_cir.png) no-repeat';
  321. type.style.backgroundColor='white';
  322. type.style.backgroundSize='7px';
  323. // type.style.backgroundPosition='67% 7px';
  324. mask.style.display = 'block';
  325. c_type.style.display = 'block';
  326. type.style.color = "#00CC9C";
  327. var img = document.getElementById("type2-arrow");
  328. img.src='../img/list_up.png';
  329. }
  330. // 动态加载出发类型上的数据
  331. function load_type_data(){
  332. if(temp_lino==0){
  333. var c_header_all = document.getElementById("c_header_all");
  334. c_header_all.style.backgroundImage='url(../img/list_check.png)';
  335. c_header_all.style.backgroundRepeat='no-repeat';
  336. c_header_all.style.backgroundSize='0px 0px';
  337. c_header_all.style.backgroundPosition='100%';
  338. }
  339. // 全部
  340. var num1 = myArray.length;
  341. if(myArray.length<1)return;
  342. var num2 = 0;
  343. var listArray = new Array();
  344. listArray[0] = ['全部',-1,-1,-1,0,0];
  345. listArray[1] = ['单程票',1,0,0,1,0];
  346. listArray[2] = ['往返程票',1,0,0,2,0];
  347. listArray[3] = ['单程票+酒店',1,1,0,1,0];
  348. listArray[4] = ['单程票+景点门票',1,0,1,1,0];
  349. listArray[5] = ['单程票+酒店+景点门票',1,1,1,1,0];
  350. listArray[6] = ['往返程票+酒店',1,1,0,2,0];
  351. listArray[7] = ['往返程票+景点门票',1,0,1,2,0];
  352. listArray[8] = ['往返程票+酒店+景点门票',1,1,1,2,0];
  353. for (var i=0;i<num1;i++)
  354. {
  355. listArray[0][5]++;
  356. if ((myArray[i][9]-1)==0 && (myArray[i][8]-1)==0 && (myArray[i][10]-0)==0 && (myArray[i][11]-0)==0) listArray[1][5]++;
  357. if ((myArray[i][9]-1)==0 && (myArray[i][8]-2)==0 && (myArray[i][10]-0)==0 && (myArray[i][11]-0)==0) listArray[2][5]++;
  358. if ((myArray[i][9]-1)==0 && (myArray[i][8]-1)==0 && (myArray[i][10]-1)==0 && (myArray[i][11]-0)==0) listArray[3][5]++;
  359. if ((myArray[i][9]-1)==0 && (myArray[i][8]-1)==0 && (myArray[i][10]-0)==0 && (myArray[i][11]-1)==0) listArray[4][5]++;
  360. if ((myArray[i][9]-1)==0 && (myArray[i][8]-1)==0 && (myArray[i][10]-1)==0 && (myArray[i][11]-1)==0) listArray[5][5]++;
  361. if ((myArray[i][9]-1)==0 && (myArray[i][8]-2)==0 && (myArray[i][10]-1)==0 && (myArray[i][11]-0)==0) listArray[6][5]++;
  362. if ((myArray[i][9]-1)==0 && (myArray[i][8]-2)==0 && (myArray[i][10]-0)==0 && (myArray[i][11]-1)==0) listArray[7][5]++;
  363. if ((myArray[i][9]-1)==0 && (myArray[i][8]-2)==0 && (myArray[i][10]-1)==0 && (myArray[i][11]-1)==0) listArray[8][5]++;
  364. }
  365. // var cstr1 = '<span class="type_title z">全部</span><span class="type_count y">' + listArray[0][5] + '条</span>';
  366. var cstr1 = '<span class="type_title z">全部</span><span class="z" style="margin-left:20px;color:#808080">' + listArray[0][5] + '条</span>';
  367. if(temp_lino==0){
  368. var c_header_all = document.getElementById("c_header_all");
  369. c_header_all.style.backgroundImage='url(../img/list_check.png)';
  370. c_header_all.style.backgroundRepeat='no-repeat';
  371. c_header_all.style.backgroundSize='20px 20px';
  372. c_header_all.style.backgroundPosition='100%';
  373. // cstr1 +='<img class="y" style="margin-top:7px;width:20px;height:20px;" src="../img/list_check.png"/>';
  374. }
  375. document.getElementById('c_header_all').innerHTML = cstr1;
  376. cstr1 = '<ul>';
  377. for (var i=1;i<9;i++)
  378. {
  379. if ((listArray[i][5] - 0) != 0){
  380. if(i==temp_lino){
  381. 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>';
  382. }else{
  383. // 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>';
  384. 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>';
  385. }
  386. }
  387. }
  388. cstr1 += '</ul>';
  389. var obj1 = document.getElementById('div_product_type_list');
  390. obj1.innerHTML = cstr1;
  391. }
  392. // 选中出发类型上的类型
  393. function c_get_type(lino){
  394. var li = document.getElementById("li"+lino);
  395. li.style.backgroundImage='url(../img/list_check.png)';
  396. li.style.backgroundRepeat='no-repeat';
  397. li.style.backgroundSize='20px 20px';
  398. li.style.backgroundPosition='100%';
  399. }
  400. // 隐藏蒙板和出发、目的地层
  401. function hide_mask_type(){
  402. // 蒙板
  403. var mask = document.getElementById("mask");
  404. // 出发类型层
  405. var c_type = document.getElementById("c_type");
  406. mask.style.display = 'none';
  407. c_type.style.display = 'none';
  408. // 目的地层
  409. var m_mudidi = document.getElementById("m_mudidi");
  410. m_mudidi.style.display = 'none';
  411. // 目的地按钮
  412. var toaddess = document.getElementById("toaddess");
  413. toaddess.style.color='#585858';
  414. toaddess.style.backgroundPosition='1000px';
  415. // 出发类型按钮
  416. var type = document.getElementById("type");
  417. type.style.color='#585858';
  418. type.style.backgroundPosition='1000px';
  419. var img1 = document.getElementById("type1-arrow");
  420. img1.src = '../img/list_down.png';
  421. var img2 = document.getElementById("type2-arrow");
  422. img2.src = '../img/list_down.png';
  423. }
  424. /*======================网络请求的Ajax的代码=======================*/
  425. // 创建一个Ajax对象
  426. if (window.ActiveXObject){
  427. var myreq = new ActiveXObject("Microsoft.XMLHTTP");
  428. }else{
  429. var myreq = new XMLHttpRequest();
  430. }
  431. // 请求方法,传入URL
  432. function get_virtual_user_list(myURL)
  433. {
  434. var tnowtime = getDateTime(4);
  435. // m_url = 接口
  436. // var myURL = m_url + 'op=userlink&vuser=' + cvuserid + '&tt=' + tnowtime;
  437. // var myURL = "http://xmwx.zhizhuchuxing.cn/core/area_target.asp?keyword=";
  438. myreq.open("get",myURL,true);
  439. // 接收的数据交给哪个函数处理
  440. myreq.onreadystatechange = show_user_list;
  441. myreq.send();
  442. }
  443. function show_user_list()
  444. {
  445. if (myreq.readyState == 4)
  446. {
  447. // newstr 就是接收到的数据
  448. var newstr = myreq.responseText;
  449. var httpData=JSON.parse(newstr);
  450. //
  451. reload_cell(httpData);
  452. }
  453. }
  454. function getDateTime(nTypeFlag)
  455. {
  456. var tNowTime = new Date();
  457. var myYear = ';' + tNowTime.getFullYear() + ';';
  458. var myMonth = ';' + (tNowTime.getMonth()+1-0) + ';';
  459. var myDay = ';' + tNowTime.getDate()+ ';';
  460. var myHour = ';' + tNowTime.getHours()+ ';';
  461. var myMinu = ';' + tNowTime.getMinutes()+ ';';
  462. var mySecond = ';' + tNowTime.getSeconds()+ ';';
  463. if (myMonth.length < 4) myMonth = '0' + myMonth;
  464. if (myDay.length < 4) myDay = '0' + myDay;
  465. if (myHour.length < 4) myHour = '0' + myHour;
  466. if (myMinu.length < 4) myMinu = '0' + myMinu;
  467. if (mySecond.length < 4) mySecond = '0' + mySecond;
  468. var cNewTimeStr;
  469. //alert(tNowTime);
  470. switch (nTypeFlag+1-1)
  471. {
  472. case 0:
  473. cNewTimeStr = myYear + '-' + myMonth + '-' + myDay;
  474. break;
  475. case 1:
  476. cNewTimeStr = myYear + myMonth + myDay;
  477. break;
  478. case 2:
  479. cNewTimeStr = myHour + ':' + myMinu + ':' + mySecond;
  480. break;
  481. case 3:
  482. cNewTimeStr = myHour + myMinu + mySecond;
  483. break;
  484. case 4:
  485. cNewTimeStr = myYear + myMonth + myDay + myHour + myMinu + mySecond;
  486. break;
  487. case 5:
  488. cNewTimeStr = myYear + '年' + myMonth + '月' + myDay + '日';
  489. break;
  490. case 6:
  491. cNewTimeStr = myYear;
  492. break;
  493. case 7:
  494. cNewTimeStr = myYear + '-' + myMonth;
  495. break;
  496. default:
  497. cNewTimeStr = myYear + '-' + myMonth + '-' + myDay + ' ' + myHour + ':' + myMinu + ':' + mySecond;
  498. break;
  499. }
  500. cNewTimeStr = cNewTimeStr.replace(/;/g,"");
  501. return cNewTimeStr;
  502. }