|
- //Created by HBuilder.
- //User: Miracle~
- //Date: 2016/11/15
- //Time: 17:00
- //切换出发地
- //页面加载
- var pro_id = getPar("pro_id");
-
-
- window.onload = function() {
-
- if(pro_id == '') {
- alert("未获取产品ID!");
- return;
- }
- baseInfo(pro_id);
- $(document).ready(function() {
- var navHeight = $("#navHeight").offset().top;
- var navFix = $("#nav-wrap");
- $(window).scroll(function() {
- if($(this).scrollTop() > navHeight) {
- navFix.addClass("navFix");
- } else {
- navFix.removeClass("navFix");
- }
- })
- })
- //
- // $('.nav-wrap').navScroll({
- // mobileDropdown: true,
- // mobileBreakpoint: 768,
- // scrollSpy: true
- // });
-
- $('.click-me').navScroll({
- navHeight: 0
- });
-
- $('.nav-wrap').on('click', '.nav-mobile', function(e) {
- e.preventDefault();
- $('.nav-wrap ul').slideToggle('fast');
- });
- }
-
- function baseInfo(pro_id) {
-
- if(pro_id == '') {
- alert("未获取产品ID!");
- return;
- }
- var param = {
- pro_id: pro_id, //产品id
- }
- ZZLog(base_api + "around/getDetaile&" + JSON.stringify(param));
- $.ajax({
- type: "post",
- url: base_api + "around/getDetaile",
- data: param,
- async:false,
- dataType: 'json',
- success: function(res_data) {
- ZZLog(res_data);
- if(res_data.flag == true) {
- base_html(res_data.data);
- } else {
- alert(res_data.mag);
- }
- },
- error: function(e) {
- ZZLog(e);
- }
- });
- }
-
- function base_html(data) {
-
- //加载轮播
- var temp_swiper = '';
- $("#loading_html").show();
- for(var i = 0, j = data.topimg.length; i < j; i++) {
- temp_swiper += '<div class="swiper-slide"><img style="width: 100%; height: 1.4rem;" src="' + data.topimg[i] + '" /></div>';
- }
- $("#swiper").html(temp_swiper);
-
- var swiper = new Swiper('.swiper-container', {
- loop: true,
- paginationClickable: true,
- centeredSlides: true,
- autoplay: 2500,
- pagination: '.swiper-pagination',
- paginationType: 'fraction',
- });
-
- $("#zname").text(data.zname); //加载产品名字
- $("#tickdes").text(data.tickdes); //加载产品信息
- $("#price").text(data.price); //加载产品价格
- var temp_section1 = '';
- var temp_section2 = '';
- for(var i = 0; i < data.otherimg.length; i++) {
- temp_section1 += '<img id="img_0' + i + '" style="width: 3.75rem;display: block;" src= "' + data.otherimg[i] + '"/>';
- }
- // var temp_section1 = '<img id="img_01" style="width: 3.75rem;display: block;" src= "' + data.otherimg[0] + '"/>' +
- // '<img id="img_02" style="width: 3.75rem;display: block;" src= "' + data.otherimg[1] + '"/>' +
- // '<img id="img_03" style="width: 3.75rem;display: block;" src= "' + data.otherimg[2] + '"/>' +
- // '<img id="img_04" style="width: 3.75rem;display: block;" src= "' + data.otherimg[3] + '"/>' +
- // '<img id="img_05" style="width: 3.75rem;display: block;" src= "' + data.otherimg[4] + '"/>';
- $("#section1").html(temp_section1);
-
- for(var i = 0; i < data.notice.length; i++) {
- temp_section2 += '<img id="img_0' + i + '" style="width: 3.75rem;display: block;" src= "' + data.notice[i] + '"/>';
- }
- // var temp_section2 = '<img id="img_06" style="width: 3.75rem;display: block;" src= "' + data.otherimg[5] + '"/>' +
- // '<img id="img_07" style="width: 3.75rem;display: block;" src= "' + data.otherimg[6] + '"/>';
- $("#section2").html(temp_section2);
-
- }
- //预订
- function reserve_pro() {
- var temp_id = getPar("pro_id");
- if(temp_id == '') {
- alert("未获取产品ID!");
- return;
- }
- window.location.href = 'calendar_side.html?pro_id=' + temp_id; //日期选择
-
- }
|