|
- var temp_orderno;
-
- function init_page() {
- // 得到订单号
- var orderno = getPar('orderno');
- temp_orderno = orderno;
- // 我的订单详细
- // var url = "http://xmwx.zhizhuchuxing.cn/core/my_order.asp";
- var url = "http://xmwx.zhizhuchuxing.cn/core/order_detail.asp?orderno=" + orderno;
- // var url = "http://xmwx.zhizhuchuxing.cn/wechat/Core/getOpenid.php";
- get_virtual_user_list(url);
- }
-
- function click_orderlist() {
- var listURL = "http://xmwx.zhizhuchuxing.cn/core/my_order.asp";
- // 跳转前将URL编码
- listURL = encodeURI(listURL);
- window.location.href = listURL;
- }
- var temp_ticket_list;
- var interval = 1000;
- var time = 0;
-
- function reload_Info(httpData) {
- temp_ticket_list = httpData.ticket_list;
-
- if(httpData.code!="0"){
- alert(httpData.info);
- return;
- }
-
- // 单元格开始
- var wrapper = document.getElementById("header");
- // 单元格HTML
- var wrapper_HTML = '';
- wrapper_HTML += '<div style="margin-top:10px; border-top:1px solid #dadada; position:relative; width:100%;background:#fff;overflow:hidden;">';
- // wrapper_HTML += '<img style="position:absolute;top:24px;left:4%;width:9px;height: 39px;" src="../img/smalllogo.png" alt="">';
- wrapper_HTML += '<div style="float:left;width:100%;">';
- wrapper_HTML += '<div style="float:left;width:75%;margin-top:11px;margin-left:10.5%;">';
- wrapper_HTML += '<div style="height:32px; line-height: 32px; width:100%;">';
- // wrapper_HTML += '<span id="start_area" style="font-size:16px;color:#343434;">'+httpData.start_area+'</span>';
- wrapper_HTML += '<div id="start_area" style="font-size:16px;color:#343434;margin-left:-11.5%;">'+httpData.prod_name+'</div>';
- wrapper_HTML += '<div id="go_info" style="float:left;color:#808080;font-size:14px;margin-left:-8.5%;">'+httpData.go_info+' 游玩</div>';
- wrapper_HTML += '</div>';
- wrapper_HTML += '<div style="height:32px;width:100%; line-height: 32px;">';
- wrapper_HTML += '<span id="end_area" style="font-size:16px;color:#343434;">'+httpData.end_area+'</span>';
- // wrapper_HTML += '<span id="back_info" style="float:right;color:#808080;font-size:14px;">'+httpData.back_info+' 返回</span>';
- wrapper_HTML += '</div>';
- wrapper_HTML += '</div>';
- wrapper_HTML += '<div style="float:left;overflow:hidden;margin-top: 10px; padding-bottom:12px; border-bottom:1px solid #ECEBEE;width:98.7%;margin-left:2.89%;">';
- wrapper_HTML += '<div id="prod_name" style="float:left;color:#808080;font-size:13px;"></div>';
- wrapper_HTML += '<div style="float:left;margin-left:1.5%;">';
- // 是否包含车子
- // var car = httpData.if_bus;
- // if (car == "1") {
- // wrapper_HTML += '<img id="if_bus" style="width:14px; height:15px;margin-right:2px;" src="../img/car2.png" alt="">';
- // }
- // 是否包含宾馆
- // var hotel = httpData.if_hotel;
- // if (hotel == "1") {
- // wrapper_HTML += '<img id="if_hotel" style="width:14px; height:15px;margin-right:2px;" src="../img/hotel2.png" alt="">';
- // }
- // 是否包含景点
- // var sightspot = httpData.if_sightspot;
- // if (sightspot == "1") {
- // wrapper_HTML += '<img id="if_sightspot" style="width:15px; height:15px;" src="../img/ticket.png" alt="">';
- // }
- // 单元格结束
- wrapper.innerHTML = wrapper_HTML;
-
- // 金额
- var left_center = document.getElementById("left-center");
- var centerHTML = '';
- // centerHTML += '<span class="z">金额:</span>';
- // centerHTML += '<span class="price-p z">¥'+httpData.price+'</span>';
- // centerHTML += '<span class="y">^</span>';
- centerHTML += '<div class="ticketprice">';
- centerHTML += '<span class="balance z">金额:</span>';
- centerHTML += '<span class="z">¥</span>';
- centerHTML += '<span class="z">' + httpData.price + '</span>';
- centerHTML += '<img id="rr" class="y" src="../img/down_arrow.png" />';
- centerHTML += '</div>';
- //
- left_center.innerHTML = centerHTML;
-
- // 支付时间
- var right_time = document.getElementById("right-time");
- var timeHTML = '';
- // ' + second_change_min(httpData.pay_second) + '
- time = httpData.pay_second;
- setInterval("ShowCountDown()", 1000); //1000为1秒钟
- timeHTML += '<span id="time" class="y" style="margin-right: -3;font-size: 14px;"> '+second_change_min(time)+'</span>';
- right_time.innerHTML = timeHTML;
- }
- //var time=document.getElementById('time')
- // var m=time.innerHTML;
- // var tim=null;
- // tim=setInterval(function(){
- // m--;
- // if (m==0) {
- // clearInterval(tim);
- // };
- // time.innerHTML=second_change_min(m);
- // },1000)
- // 将秒的时间转变成分钟+秒
- function second_change_min(times) {
- var min = Math.floor(times / 60);
- var second = times % 60;
- var minStr = '';
- if(second<=9){
- minStr=min + ':0' + second;
- }else{
- minStr=min + ':' + second;
- }
- return minStr;
- }
- var minute = 0;
- var cc = 0;
-
- function ShowCountDown() {
- time = Math.floor(time - 1);
- var leftsecond = time;
- minute = Math.floor((leftsecond) / 60);
- var second = Math.floor(leftsecond - minute * 60);
- cc = document.getElementById("time");
- if (time <= 0) {
- return;
- }
- if (second < 10) {
- cc.innerHTML = ''+minute + ":0" + second;
- } else {
- cc.innerHTML = ''+minute + ":" + second;
- }
- }
- // 占击支付方式最大的div--payway
- function click_payway(way) {
- cancel_checkbox_checked();
-
- if(temp_httpData.second<=0){
- alert("支付时间超过15分钟");
- return;
- }
- if (way == "wxpay") {
- var checkbox = document.getElementById("wxcheckbox");
- checkbox.checked = true;
- } else if (way == "qqpay") {
- // var checkbox = document.getElementById("qqcheckbox");
- // checkbox.checked=true;
- }
- }
- // 取消两个复选框
- function cancel_checkbox_checked() {
- var wxcheckbox = document.getElementById("wxcheckbox");
- // var qqcheckbox = document.getElementById("qqcheckbox");
- wxcheckbox.checked = false;
- // qqcheckbox.checked=false;
- }
- // 点击金额
- var isUp = true;
-
- function click_amount() {
- var ticket_list = temp_ticket_list;
- var rr = document.getElementById("rr");
- if (isUp == true) {
- rr.src = "../img/up_arrow.png";
- } else {
- rr.src = "../img/down_arrow.png";
- }
- isUp = !isUp;
-
- // 显示订单
- var order_list = document.getElementById("order-list");
- var listHTML = '';
- for (var i = 0; i < ticket_list.length; i++) {
- listHTML += '<div class="xorderone" style="background:white;overflow:hidden;width:96.2%;height:45px;line-height:45px; border:1px solid #f1f1f1;padding-left:3.8%;color:#616161;font-size:14px;font-family:‘黑体’;">';
- listHTML += '<span style="float:left;">' + ticket_list[i].ticket_name + '</span>';
- listHTML += '<span style="float:right;color:#adadad;font-size:14px;margin-right:3.3%;">× ' + ticket_list[i].ticket_count + '</span>';
- listHTML += '<span style="float:right;color:#ff8800;margin-right:2.5%;font-weight:bold;"><span style="margin-right:2px;font-size:13px">¥</span><span style="font-size:17px">' + ticket_list[i].ticket_price + '</span></span>';
- listHTML += '</div>';
- }
- order_list.innerHTML = listHTML;
- if (order_list.style.display == 'block') {
- order_list.style.display = 'none';
- } else {
- order_list.style.display = 'block';
- }
- }
- // 点击支付
- function click_pay() {
- // name == prod_code
- // orderid == orderno
- // money == price 按分计算,,传值的时候 *100
- var payURL = "http://xmwx.zhizhuchuxing.cn/wechat/WxPay/realpay/onlinePay.php?orderid=" + temp_orderno;
- // var payURL = "http://xmwx.zhizhuchuxing.cn/wechat/WxPay/pay/onlinePay.php?name=上海-舟山&orderid=qw111111&money=11";
- // var payURL = "http://xmwx.zhizhuchuxing.cn/wechat/WxPay/pay/onlinePay.php?orderid=" + temp_orderno;
- // 跳转前将URL编码
- payURL = encodeURI(payURL);
- window.location.href = payURL;
- }
-
- // 从上一页的链接上获取参数
- function getPar(par) {
- //获取当前URL
- var local_url = document.location.href;
- // 接收的时候将URL 解码
- local_url = decodeURI(local_url);
- //获取要取得的get参数位置
- var get = local_url.indexOf(par + "=");
- if (get == -1) {
- return false;
- }
- //截取字符串
- var get_par = local_url.slice(par.length + get + 1);
- //判断截取后的字符串是否还有其他get参数
- var nextPar = get_par.indexOf("&");
- if (nextPar != -1) {
- get_par = get_par.slice(0, nextPar);
- }
- return get_par;
- }
- /*======================网络请求的Ajax的代码=======================*/
-
- // 创建一个Ajax对象
- if (window.ActiveXObject) {
- var myreq = new ActiveXObject("Microsoft.XMLHTTP");
- } else {
- var myreq = new XMLHttpRequest();
- }
- // 请求方法,传入URL
- function get_virtual_user_list(myURL) {
- var tnowtime = getDateTime(4);
- // m_url = 接口
-
- // var myURL = m_url + 'op=userlink&vuser=' + cvuserid + '&tt=' + tnowtime;
- // var myURL = "http://xmwx.zhizhuchuxing.cn/core/area_target.asp?keyword=";
- myreq.open("get", myURL, true);
- // 接收的数据交给哪个函数处理
- myreq.onreadystatechange = show_user_list;
- myreq.send();
- }
-
- function show_user_list() {
- if (myreq.readyState == 4) {
- // newstr 就是接收到的数据
- var newstr = myreq.responseText;
- var httpData = JSON.parse(newstr);
- //
- reload_Info(httpData);
- }
- }
-
- function getDateTime(nTypeFlag) {
- var tNowTime = new Date();
- var myYear = ';' + tNowTime.getFullYear() + ';';
- var myMonth = ';' + (tNowTime.getMonth() + 1 - 0) + ';';
- var myDay = ';' + tNowTime.getDate() + ';';
- var myHour = ';' + tNowTime.getHours() + ';';
- var myMinu = ';' + tNowTime.getMinutes() + ';';
- var mySecond = ';' + tNowTime.getSeconds() + ';';
-
- if (myMonth.length < 4) myMonth = '0' + myMonth;
- if (myDay.length < 4) myDay = '0' + myDay;
- if (myHour.length < 4) myHour = '0' + myHour;
- if (myMinu.length < 4) myMinu = '0' + myMinu;
- if (mySecond.length < 4) mySecond = '0' + mySecond;
-
- var cNewTimeStr;
- //alert(tNowTime);
- switch (nTypeFlag + 1 - 1) {
- case 0:
- cNewTimeStr = myYear + '-' + myMonth + '-' + myDay;
- break;
- case 1:
- cNewTimeStr = myYear + myMonth + myDay;
- break;
- case 2:
- cNewTimeStr = myHour + ':' + myMinu + ':' + mySecond;
- break;
- case 3:
- cNewTimeStr = myHour + myMinu + mySecond;
- break;
- case 4:
- cNewTimeStr = myYear + myMonth + myDay + myHour + myMinu + mySecond;
- break;
- case 5:
- cNewTimeStr = myYear + '年' + myMonth + '月' + myDay + '日';
- break;
- case 6:
- cNewTimeStr = myYear;
- break;
- case 7:
- cNewTimeStr = myYear + '-' + myMonth;
- break;
- default:
- cNewTimeStr = myYear + '-' + myMonth + '-' + myDay + ' ' + myHour + ':' + myMinu + ':' + mySecond;
- break;
- }
-
- cNewTimeStr = cNewTimeStr.replace(/;/g, "");
-
- return cNewTimeStr;
-
- }
-
- //////////////////////////////////////
|