1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- import Swiper from 'swiper/bundle'
- import gsap from 'gsap'
- import Common from '../common/js/Common'
- import {
- isMobile
- } from '../common/js/utils'
-
- export default class App {
- constructor() {
- let common = new Common(document.querySelector('.main'),4)
- this.isMobile = isMobile()
-
-
- let lazyDoms = document.querySelectorAll(".lazy");
- lazyDoms.forEach((item) => {
- console.log(item, 'item---1')
- if (item.nodeName == "PICTURE") {
- item.children[0].setAttribute("srcset", item.children[0].dataset.srcset);
- item.children[1].setAttribute("src", item.children[1].dataset.src);
- }
- if (item.nodeName == "IMG") {
- item.setAttribute("src", item.dataset.src);
- }
- if (item.nodeName == "VIDEO") {
- console.log(item, 'item---2')
- item.setAttribute("src", item.dataset.src);
-
- }
- });
- vx()
- function vx(){
- console.log('vx',wx)
- wx.config({
- debug: false,
- appId: 'YOUR_APP_ID',
- timestamp: 176565448486313,
- nonceStr: 'NONCESTR',
- signature: 'SIGNATURE',
- jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage']
- });
-
- wx.ready(function () {
-
- wx.onMenuShareTimeline({
- title: '分享标题',
- link: 'https://example.com',
- imgUrl: 'https://example.com/image.jpg',
- success: function () {
-
- },
- cancel: function () {
-
- }
- });
- const shareWx = document.querySelector('.shareWx');
- console.log(shareWx)
- shareWx.addEventListener('click',function(){
-
- wx.onMenuShareAppMessage({
- title: '分享标题',
- desc: '分享描述',
- type: 'link',
- success: function () {
-
-
- },
- cancel: function () {
-
- }
- });
- })
-
- });
- }
- }
-
-
-
-
- }
|