function getSwiper(itemWrap, groupNum, swiperOpt) {
  if (swiperOpt === void 0) {
    swiperOpt = {};
  }

  var $wrap = $(itemWrap);
  var $items = $wrap.children('.item');

  if (!$items.length) return;

  var swiperId = 'swiper-' + Date.now() + Math.random().toString(36).substr(2, 5);
  var paginationId = swiperId + '-pagination';

  var swiperHtml =
    '<div class="swiper-container ' + swiperId + '">' +
      '<div class="swiper-wrapper"></div>' +
      '<div class="swiper-pagination" id="' + paginationId + '"></div>' +
    '</div>';

  $wrap.after(swiperHtml);

  var $wrapper = $('.' + swiperId + ' .swiper-wrapper');

  for (var i = 0; i < $items.length; i += groupNum) {
    var $slide = $('<div class="swiper-slide"></div>');
    $items.slice(i, i + groupNum).appendTo($slide);
    $wrapper.append($slide);
  }
  var defaultOpt = {
    pagination: { el: '#' + paginationId, clickable: true },
    spaceBetween: 10,
    slidesPerView: 1
  };

  var finalOpt = {};
  for (var key in defaultOpt) {
    finalOpt[key] = defaultOpt[key];
  }
  for (var key in swiperOpt) {
    finalOpt[key] = swiperOpt[key];
  }

  $wrap.remove();

  new Swiper('.' + swiperId, finalOpt);
}
//调用
getSwiper('.slide-p1a', 4, {
      loop: true,
      autoplay: {delay: 6000,stopOnLastSlide: false,disableOnInteraction: false,},
      navigation: { nextEl: ".slide-p1ap .next", prevEl: ".slide-p1ap .prev" },
});
  

# 查看是否安装 Perl 版 rename
rename -v
# 未找到则安装:
# Ubuntu/Debian
sudo apt update && sudo apt install rename
# CentOS/RHEL(启用 EPEL 后)
sudo yum install prename
# Fedora
sudo dnf install perl-rename

#安装后
# 先预览(推荐,避免误操作)
rename -n 'y/A-Z/a-z/' *
# 确认无误后执行
rename -v 'y/A-Z/a-z/' *

 // 封装的Canvas视频播放器函数
        function createCanvasVideoPlayer(container, videoUrl) {
            const canvas = document.createElement('canvas');
            const ctx = canvas.getContext('2d');
            const video = document.createElement('video');
            video.src = videoUrl;
            video.crossOrigin = 'anonymous';
            video.loop = true;
            video.muted = true; 
            video.playsInline = true;

            function resizeCanvas() {
                canvas.width = container.clientWidth;
                canvas.height = container.clientHeight;
            }
            
            resizeCanvas();
            window.addEventListener('resize', resizeCanvas);
            
            container.appendChild(canvas);
            
            function drawVideoFrame() {
                if (video.paused || video.ended) return;
                ctx.clearRect(0, 0, canvas.width, canvas.height);
                const videoAspectRatio = video.videoWidth / video.videoHeight;
                const canvasAspectRatio = canvas.width / canvas.height;
                
                let renderWidth, renderHeight, offsetX, offsetY;
                if (videoAspectRatio > canvasAspectRatio) {
                    renderHeight = canvas.height;
                    renderWidth = video.videoWidth * (renderHeight / video.videoHeight);
                    offsetX = (canvas.width - renderWidth) / 2;
                    offsetY = 0;
                } else {
                    renderWidth = canvas.width;
                    renderHeight = video.videoHeight * (renderWidth / video.videoWidth);
                    offsetX = 0;
                    offsetY = (canvas.height - renderHeight) / 2;
                }
                
                ctx.drawImage(video, offsetX, offsetY, renderWidth, renderHeight);
                ctx.fillStyle = 'rgba(0, 0, 0, 0.3)';
                ctx.fillRect(0, 0, canvas.width, canvas.height);
                requestAnimationFrame(drawVideoFrame);
            }
            video.addEventListener('loadedmetadata', () => {
                video.play().then(() => {
                    drawVideoFrame();
                }).catch(e => {
                    console.error('自动播放失败:', e);
                    // 如果自动播放失败,用户交互后重新尝试
                    document.addEventListener('click', () => {
                        video.play();
                    }, { once: true });
                });
            });
            
            video.addEventListener('ended', () => {
                video.currentTime = 0;
                video.play();
            });
            return {
                play: function() {
                    video.play();
                    drawVideoFrame();
                },
                pause: function() {
                    video.pause();
                }
            };
        }
        
        // 使用示例
        const videoUrl = 'bg5.mp4';
        const player = createCanvasVideoPlayer(document.getElementById('videoBackground'), videoUrl);
        console.log(player)

//前台HomeController.php在function jizhi_details($id){}中使用
if(array_key_exists('attchment',$details)){
     $details['attchment']= ffix($details['attchment']) ;
}

//详情页单附件数据修正,函数加到conf/FunctionsExt.php
function ffix($url){
    if($url){
        $fres = M('pictures')->find(['litpic'=> $url]);
        $attchment=[];
        if($fres){
          $attchment['fid'] = $fres['id'];
          $attchment['url'] = $fres['litpic'];
          $attchment['ftype'] = $fres['filetype'];
          $attchment['ftime'] = date('Y-m-d',$fres['addtime']);
          $attchment['fsize'] =usize($fres['size']);
         }else{
         $attchment['fid'] = 0;  
        }
    }else{
       $attchment['fid'] = 0;     
    }
    return $attchment;
}

//详情页使用附件字段信息
{$jz['attchment']['fid']}
{$jz['attchment']['litpic']}