123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- $('.qwpuic').hide();
- $(function(){
-
- $('#demo06').navbarscroll({
- defaultSelect:0,
- scrollerWidth:6,
- fingerClick:1,
- endClickScroll:function(obj){
-
- }
- });
- });
- $.getUrlParam = function (name) {
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
- var r = window.location.search.substr(1).match(reg);
- if (r != null) return unescape(r[2]); return null;
- }
- var _lpStyleId = $.getUrlParam('lpStyleId');
- window.onload = function(){
-
- if (_lpStyleId == 2) {
- $('.m_albumtnav_box ul li[styleid="'+_lpStyleId+'"]').eq(0).click();
-
- }else{
- $('.m_albumtnav_box ul li[styleid="'+_lpStyleId+'"]').click();
-
- }
- }
- var _styleid = $('.scroller ul li').eq(0).attr('styleid');
- var _dataid = $('.scroller ul li').eq(0).attr('dataid');
- var _dataHid = $('.scroller ul li').eq(0).attr('datahid');
- SWitchStyleApi(_styleid);
- _xcajax();
- $('.scroller ul li').on('click',function(){
- _styleid = $(this).attr('styleid');
- _dataHid = $(this).attr('datahid');
- _dataid = $(this).attr('dataid');
- SWitchStyleApi(_styleid);
- _xcajax();
- })
- function SWitchStyleApi(_styleid) {
- switch(_styleid)
- {
- case '1':
- Interface = "/housecategory/video";
- break;
- case '3':
- Interface = "/housecategory/housetypeimg";
- break;
- case '2':
- Interface = "/housecategory/albumimg";
- break;
- case '4':
- Interface = "/housecategory/live";
- break;
- default:
- PublicAction.hint('未提交成功!');
- break;
- }
- }
- function _xcajax(){
- var html = '';
- $.ajax({
- url: Interface,
- data:{aid:_dataid,hid:_dataHid,csrf_token_m:csrfToken},
- type: "POST",
- dataType: "json",
- success: function(data) {
- if(data.code == '200'){
- var _data =data.data;
- html+='<div class="m_albumlb_box swiper-container" id="swiper1">';
- html+='<ul class="swiper-wrapper">';
- console.log(_styleid);
- switch(_styleid)
- {
- case '1':
- case '4':
- html+='<li class="swiper-slide">';
- html+='<div class="m_video">';
- html+='<video class="m_video_sp" id="myVideo" src="'+data.data.video+'" poster="'+data.data.thumb+'" width="100%" height="100%" autobuffer style="object-fit:fill" preload="none">';
- html+='</video>';
- html+='<div class="m_video_img"><img src="/image/housealbum/m_xc2.png" alt=""/></div>';
- html+='</div>';
- html+='</li>';
- break;
- case '3':
- $.each(data.data, function (i, data) {
- html+='<li class="swiper-slide">';
- html+='<img src="'+data.img+'" alt="">';
- html+='<div class="m_album_text">';
- html+='<div class="m_album_textTop">';
- if (data.title != "" && data.title != undefined & data.title != null) {
- html+='<span>'+data.title+'</span>';
- };
- if (data.area != "" && data.area != undefined & data.area != null) {
- html+='<span>约¥'+data.area+'</span>';
- };
- html+='</div>';
- html+='<div class="m_album_textTop">';
- html+='<span>'+data.indoor_info+'</span>';
-
- html+='</div>';
- html+='</div>';
- html+='</li>';
- })
- break;
- case '2':
- $.each(data.data, function (i, data) {
- html+='<li class="swiper-slide">';
- html+='<img src="'+data.img+'" alt="">';
- html+='</li>';
- })
- break;
- default:
- PublicAction.hint('未提交成功!');
- break;
- }
- html+='</ul>';
- html+='<div class="swiper-pagination"></div>';
- html+='</div>';
- $('.m_swiper_box').html("");
- $('.m_swiper_box').html(html);
- $('.m_video_img').on('click',function(){
- var _video = document.getElementById("myVideo");
- myVideo.play();
- $('.m_video_sp').attr('controls','controls');
- $(this).hide();
- })
- var _lirWidth = $('#swiper1 ul li').outerWidth();
- var _ulWidth= $('#swiper1 ul').outerWidth();
- var _lilength = $('#swiper1 ul li').length;
- var Swiper_length = _lirWidth * _lilength + 25 - _ulWidth;
- console.log(Swiper_length);
- var _nexttj = true;
- function _next(){
- if(_nexttj){
-
- $('.wrapper02 .scroller li.cur').next().click();
- _nexttj = false;
- }
- }
- var _prevtj = true;
- function _prev(){
- if(_prevtj){
-
- $('.wrapper02 .scroller li.cur').prev().click();
- _prevtj = false;
- }
- }
- var mySwiper1 = new Swiper('.swiper-container',{
-
- loop : false,
- pagination: '.swiper-pagination',
- paginationType : 'fraction',
- paginationFractionRender: function (swiper, currentClassName, totalClassName) {
- return '<span class="' + currentClassName + '"></span>' +
- ' / ' +
- '<span class="' + totalClassName + '"></span>';
- },
- onTouchMove: function(swiper){
- TR=swiper.translate
- console.log(TR);
- if(TR > 25){
- _prev();
- }else if(TR < -Swiper_length){
- _next();
- }
- }
- })
- }
- }
- });
- }
|