| | |
| | |
|
| | | <div class="imgshow" style="display: none; background-color: black;position: fixed;left: 0;top: 0;width: 100%;height: 100%;z-index: 2019521;overflow-y:scroll;">
|
| | | <div class="swiper-container">
|
| | | <div class="swiper-wrapper" style="width: 100%;height: 100%;-webkit-flex;align-items: center;"></div>
|
| | | <div class="swiper-wrapper"></div>
|
| | | </div>
|
| | | </div>
|
| | | </body>
|
| | |
| | | var layerIndex = null;
|
| | | var isShowImg = false;
|
| | | var initialslide = 0;
|
| | | var swiper = null;
|
| | | var app;
|
| | |
|
| | | $(function() {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | var swiper = new Swiper('.swiper-container', {
|
| | | spaceBetween: 0,
|
| | | freeMode: false,
|
| | | initialSlide: initialslide,
|
| | | touchMoveStopPropagation: false,
|
| | | preventClicksPropagation: false,
|
| | | observer: true, //修改swiper自己或子元素时,自动初始化swiper
|
| | | observeParents: true, //修改swiper的父元素时,自动初始化swiper
|
| | | on: {
|
| | | click: function() { //点击事件
|
| | | app.openScroll();
|
| | | yesApp.toast('ss')
|
| | | $('.imgshow').css('display', 'none');
|
| | | $('.imgshow .swiper-wrapper').empty();
|
| | | setTimeout(function() {
|
| | | isShowImg = false;
|
| | | }, 300);
|
| | | // this = null;
|
| | | },
|
| | | },
|
| | | });
|
| | |
|
| | | app.setImageContent();
|
| | |
|
| | | } else {
|
| | |
| | | var screenWidth = window.screen.width * 2;
|
| | | var screenHeight = window.screen.height * 2;
|
| | |
|
| | |
|
| | | // 设置大图
|
| | | for (i = 0; i < imageLarge.length; i++) {
|
| | | var width = null;
|
| | |
| | | bigImageBG.append('<div class="div_largel" style="position: relative; "></div>');
|
| | |
|
| | | bigImageBG.find('.div_largel').eq(i).append(
|
| | | "<img style='margin-left: 0.75rem;' class='imgShow'>");
|
| | | "<img style='margin-left: 0.75rem;' class='imgShowlargel'>");
|
| | |
|
| | | bigImageBG.find('.div_largel').eq(i).append(
|
| | | '<img src="img/icon_play.png" style="position: absolute;left: 50%;top: 50%;margin-left: -0.4rem;margin-top: -0.4rem; width: 0.8rem;height: 0.8rem;" class="imagePlay"/>'
|
| | | );
|
| | |
|
| | | bigImageBG.find(".div_largel").eq(i).find('.imgShow').eq(0).attr("src", imageLarge[i].url);
|
| | | bigImageBG.find(".div_largel").eq(i).find('.imgShowlargel').eq(0).attr("src", imageLarge[i].url);
|
| | |
|
| | | var compare = parseFloat(imageLarge[i].h) / parseFloat(imageLarge[i].w);
|
| | |
|
| | |
| | | height = parseFloat(imageLarge[i].h) / parseFloat(imageLarge[i].w) * width;
|
| | | }
|
| | |
|
| | | bigImageBG.find(".div_largel").eq(i).find('.imgShow').eq(0).css({
|
| | | bigImageBG.find(".div_largel").eq(i).find('.imgShowlargel').eq(0).css({
|
| | | 'width': width + 'rem',
|
| | | 'height': height + 'rem',
|
| | | 'border-radius': '0.1rem'
|
| | |
| | | if (imageLarge[i].videoUrl != null && imageLarge[i].videoUrl != '') {
|
| | | bigImageBG.find(".div_largel").eq(i).find('.imagePlay').eq(0).css('display', 'block');
|
| | | }
|
| | |
|
| | | bigImageBG.find(".div_largel").eq(i).find('.imgShowlargel').eq(0).click(function() {
|
| | | var nowImgurl = $(this).attr('src');
|
| | | app.viewPicture(imageLarge, nowImgurl);
|
| | | });
|
| | | };
|
| | | // 设置小图
|
| | | if (parseInt(app.dataInfo.detailInfo.lineNum) == 2) {
|
| | |
| | |
|
| | | // 点击查看图片
|
| | | smallImageBG.find('.imgSmall').eq(k).click(function() {
|
| | |
|
| | | if (isShowImg) return;
|
| | | var nowImgurl = $(this).attr('src');
|
| | | for (var lll = 0; lll < imageSmall.length; lll++) { // 获取index
|
| | | if (nowImgurl == imageSmall[lll].url) {
|
| | | initialslide = lll;
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | isShowImg = true;
|
| | | app.stopScroll();
|
| | |
|
| | | $('.imgshow').css('display', 'block');
|
| | | for (var o = 0; o < imageSmall.length; o++) {
|
| | | var url = imageSmall[o].url
|
| | | $('.imgshow .swiper-wrapper').append(
|
| | | '<div class="swiper-slide" ><img class="smallImgs" style="width:100%;heught:2rem;background-color: #ffffff" src="' +
|
| | | url + '"></div>');
|
| | |
|
| | | $('.imgshow .swiper-wrapper').find('swiper-slide').eq(o).find('smallImgs').eq(0).css('height',
|
| | | parseFloat(imageSmall[o].h) / 100 + 'rem');
|
| | | }
|
| | |
|
| | |
|
| | | app.viewPicture(imageSmall, nowImgurl);
|
| | | });
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | // yesApp.toast(JSON.stringify(arrayComments.length + ''))
|
| | |
|
| | | // 设置尾部
|
| | | for (var j = 0; j < arrayComments.length; j++) {
|
| | |
| | |
|
| | | //右边箭头
|
| | | // divitemBg.find('.div_top_tag').eq(j).find('div_top_right').eq(0).append('<img src=img/icon_arrowRight.png" style="width: 0.48rem;height: 0.48rem;background-color: yellow;">');
|
| | |
|
| | |
|
| | | }
|
| | | },
|
| | | // 查看图片
|
| | | viewPicture: function(arrayImage, picture) {
|
| | | if (isShowImg) return;
|
| | | for (var lll = 0; lll < arrayImage.length; lll++) { // 获取index
|
| | | if (picture == arrayImage[lll].url) {
|
| | | initialslide = lll;
|
| | | break;
|
| | | }
|
| | | }
|
| | | isShowImg = true;
|
| | | app.stopScroll();
|
| | | swiper = new Swiper('.swiper-container', {
|
| | | spaceBetween: 0,
|
| | | freeMode: false,
|
| | | initialSlide: initialslide,
|
| | | touchMoveStopPropagation: false,
|
| | | preventClicksPropagation: false,
|
| | | observer: true, //修改swiper自己或子元素时,自动初始化swiper
|
| | | observeParents: true, //修改swiper的父元素时,自动初始化swiper
|
| | | on: {
|
| | | click: function() { //点击事件
|
| | | app.openScroll();
|
| | | $('.imgshow').css('display', 'none');
|
| | | // $('.imgshow .swiper-wrapper').empty();
|
| | | this.destroy(false);
|
| | | setTimeout(function() {
|
| | | isShowImg = false;
|
| | | }, 300);
|
| | | },
|
| | | },
|
| | | });
|
| | | $('.imgshow').css('display', 'block');
|
| | | for (var o = 0; o < arrayImage.length; o++) {
|
| | | var url = arrayImage[o].url;
|
| | | $('.imgshow .swiper-wrapper').append(
|
| | | '<div class="swiper-slide"><img class="smallImgs" style="width:100%;heught:2rem;background-color: #ffffff" src="' +
|
| | | url + '"></div>');
|
| | |
|
| | | $('.imgshow .swiper-wrapper').find('swiper-slide').eq(o).find('smallImgs').eq(0).css('height',
|
| | | parseFloat(arrayImage[o].h) / 100 + 'rem');
|
| | | }
|
| | | },
|
| | |
|
| | | // 禁止底部滑动
|
| | | stopScroll: function() {
|
| | | document.body.style.overflow = 'hidden'; //关闭滚动条
|