|
- var run_date=getPar('run_date'); //出发日期
- var run_date_str=getPar('run_date_str');
- var month = new Date().getMonth();
- var today = new Date().getDate();
- //var today = 15;
- var year = new Date().getFullYear();
-
- var startarea = '';
-
-
- $(document).ready(function(){
-
- ifattention();
-
- startarea = getStorage("start_add");
- if(startarea=="nj"){
- $('#nanjingimg').attr('src','public/images/ic_select_nor2.png');
- $('#nantongimg').attr('src','public/images/ic_select_dis.png');
- }else if(startarea=="nt"){
- $('#nantongimg').attr('src','public/images/ic_select_nor2.png');
- $('#nanjingimg').attr('src','public/images/ic_select_dis.png');
- }else{
- $('#nantongimg').attr('src','public/images/ic_select_dis.png');
- $('#nanjingimg').attr('src','public/images/ic_select_dis.png');
- }
- if(run_date){
- //alert(run_date)
- $('#run_date').text(run_date_str);
- }else{
- //alert(run_date)
- var cur_date_m_d=getDateTime(0);
- cur_date_m_d=cur_date_m_d.substring(5);
- cur_date_m_d=cur_date_m_d.replace('-','月');
- cur_date_m_d=cur_date_m_d+'日';
- run_date=getDateTime(0);
- //run_date = "2016-09-15";
- $('#run_date').text(cur_date_m_d);
- //$('#run_date').text("09月15日");
- }
- var year = getMonthAndDayByDate(run_date,'year');
- var month = getMonthAndDayByDate(run_date,'month');
- var day = getMonthAndDayByDate(run_date,'day');
- var str = year+ '/' +month +'/'+day;
- var week = getWeekDay(str);
- $('#run_day').text(run_date==getDateTime(0)?'今天':week);
- })
-
- $("#select_time").click(function(){
- setStorage("start_add",startarea);
- window.location.href="calendar.html?from=index";
- })
-
- //$("#query").click(function(){
- // var go_add = $("#start_add").text();
- // var prod_id = "";
- // var go_date = "";
- // if(run_date==""){
- // go_date = year+'-'+month+'-15';
- // // go_date = year+'-'+month+'-'+today;
- //
- // }else{
- // go_date = run_date;
- // }
- // if(go_add=="南京"){
- // prod_id = "449860";
- // }else if(go_add=="南通"){
- // prod_id = "449865";
- // }
- // window.location.href="query_result.html?prod_id="+prod_id+"&time="+go_date;
- //
- //})
-
- function selectNanjing(nanjing){
- startarea = nanjing;
- $('#nanjingimg').attr('src','public/images/ic_select_nor2.png');
- $('#nantongimg').attr('src','public/images/ic_select_dis.png');
- $('#line1').addClass('high_light');
- $('#line2').removeClass('high_light');
- }
-
- function selectNantong(nantong){
- startarea = nantong;
- $('#nantongimg').attr('src','public/images/ic_select_nor2.png');
- $('#nanjingimg').attr('src','public/images/ic_select_dis.png');
- $('#line1').removeClass('high_light');
- $('#line2').addClass('high_light');
- }
-
-
- function searchInfo(){
- if (startarea != 'nj'&&startarea != 'nt') {
- alert('请选择出发线路');
- return;
- }else{
- var prod_id = startarea;
- var go_date = "";
- if(run_date==""){
- go_date = year+'-'+month+'-15';
- // go_date = year+'-'+month+'-'+today;
-
- }else{
- go_date = run_date;
- }
- clearStorage("start_add");
- window.location.href="query_result.html?prod_id="+prod_id+"&time="+go_date;
- }
-
-
- }
-
- $("#close_btn").click(function(){
- $("#code").hide();
- });
-
- $("#code_show").click(function(){
- $("#code").show();
- });
-
- function ifattention(){
- $.ajax({
- url:"http://wx.zhizhuchuxing.com/ZZDZ2/application/custom_made/control.php", //请求地址
- data:{type:"order_isregister"},
- type: "post",
- dataType: "json",
- success: function (data) {
- console.log(data);
- if(data.code == 0){
-
- if(data.if_attention == 0){
- var guanzhu = getStorage('guanzhu');
-
- if(guanzhu==1){
-
- }else{
- setStorage("guanzhu","1")
- $("#code").show();
-
- }
-
- $("#code_show").show();
-
- }else{
- $("#code").hide();
- $("#code_show").hide();
- }
-
- }else{
- alert(data.info);
- }
-
- }
- });
- }
|