QRcode.page.js 502 Bytes
let $ = require('yoho-jquery');
let Swiper = require('yoho-swiper');
let mySwiper;
let $swiperSlide = $('.swiper-wrapper .swiper-slide');
let $chanBtn = $('.qrcode-wrap .chan');

mySwiper = new Swiper('.swiper-container', {
    onSlideChangeStart: function(swiper) {
        $('.pagec').html(swiper.snapIndex + 1);
    }
});

if ($swiperSlide.length <= 1) {
    $chanBtn.hide();
}

$('.prev').click(function() {
    mySwiper.slidePrev();
});
$('.next').click(function() {
    mySwiper.slideNext();
});