123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- $(function () {
- $('#yii-debug-toolbar').hide();
- $('img[alt="code"]').css({"width": "40%", "margin": "0 auto"}); //单独处理二维码的问题样式
- function getParams(url) {
- var theRequest = new Object();
- if (!url)
- url = location.href;
- if (url.indexOf("?") !== -1) {
- var str = url.substr(url.indexOf("?") + 1) + "&";
- var strs = str.split("&");
- for (var i = 0; i < strs.length - 1; i++) {
- var key = strs[i].substring(0, strs[i].indexOf("="));
- var val = strs[i].substring(strs[i].indexOf("=") + 1);
- theRequest[key] = val;
- }
- }
- return theRequest;
- }
- var objUrl = {}; //获取get参数
- var url = window.location.href;
- var searchParams = ''; //最后拼接的参数
- var urlParams = '';
- var params = getParams(url); //获取get请求的参数
- if (!$.isEmptyObject(params)) {
- $.each(params, function (key, val) {
- objUrl[key] = val;
- urlParams += key + '=' + val + '&';
- })
- urlParams = urlParams.substring(0, urlParams.length - 1);
- searchParams = '&' + urlParams;
- }
- // 相册ajax
- function index_lp() {
- var html = '';
- $('.hu_box ul').html('')
- $.ajax({
- url: "/json/albumlist",
- // url: "/overseas/js/index/index_lp.json",
- data: {hid: hid, album_id: album_id},
- type: "POST",
- dataType: "json",
- success: function (data) {//请求成功完成后要执行的方法
- if (data.code == 200) {
- html += '<ul class="c" id="lightgallery">';
- $.each(data.data, function (i, data) {
- if(data.path){
- html += '<li data-src="' + data.img + '" data-name="'+data.type_id+'" data-sub-html="' + data.title + '">';
- }else if(data.panorama){
- html += '<li data-src="' + data.img + '" data-name="'+data.album_id+'" data-sub-html="' + data.title + '">';
- }else{
- html += '<li data-src="' + data.img + '" data-sub-html="' + data.title + '">';
- }
- if(data.path){
- html += '<a href="/house/zhongqu/'+data.hid+'?h='+data.path+'">';
- }else if(data.panorama){
- html += '<a href="/house/zhongqu/'+data.hid+'?h='+data.panorama+'">';
- }else{
- html += '<a href="javascript:;">';
- }
- html += '<p class="hu_img"><img src="' + data.img + '" />';
- if(data.path || data.panorama){
- html += '<div class="vvid_pic_ico vr-animation-forever"></div>'
- }
- html += '</p>';
- if (data.title != 'null' && data.title != '') {
- html += '<span class="hu_font">' + data.title + '</span>';
- }
- html += '</a></li>';
- });
- html += '</ul>';
- }
- ;
- $('.hu_box').html(html);
- $('#zh_housetype-list ul li').eq(0).click();
- }
- });
- }
- var hid = $('.hu_main ul li').eq(0).attr('hid');
- // 入口三亚区域模块 判断
- if ($.isEmptyObject(params) != true) {
- album_id = params.tkid
- $('.hu_main ul li[value="' + params.tkid + '"]').click();
- $('.hu_main ul li[value="' + params.tkid + '"]').attr('class', 'in').siblings().attr('class', '')
- } else {
- $('.hu_main ul li').eq(0).attr('class', 'in');
- var album_id = $('.hu_main ul li').eq(0).attr('value');
- }
- ;
- index_lp();
- $('.hu_main ul li').on('click', function () {
- hid = $(this).attr('hid');
- album_id = $(this).attr('value');
- $(this).attr('class', 'in').siblings().attr('class', '')
- $('.am-pureview-slider li').remove();
- $('.am-pureview-nav li').remove();
- index_lp();
- $('.lg-outer').remove();
- $('.lg-backdrop').remove();
- $('body').removeClass('lg-on');
- })
- $('#zh_housetype-list').on('click', 'li', function () {
- if($(this).attr('data-name') =="vr" ){
- // console.log(1)
- }else{
- album_click();
- }
- })
- function album_click() {
- $("#lightgallery").lightGallery();
- $('.optionMore').html('');
- var Getoption = $('.find_nav_list');
- $('.optionMore').append(Getoption.clone(true));
- $('.optionMore').find('.find_nav_list').addClass('find_nav_list2');
- $('.find_nav_list2 ul li').on('click', function () {
- var _value = $(this).attr('value')
- $('.find_nav_list ul li').each(function () {
- var _vl = $(this).attr('value');
- if (_value == _vl) {
- $(this).addClass('in').siblings().removeClass('in');
- }
- })
- })
- }
- })
|