php 微信jssdk 微信分享一直报config:fail,Error: invalid signature(签名生成是一致的)

php 微信jssdk 微信分享一直报config:fail,Error: invalid signature(签名生成是一致的)

里面url必须是当前的url
比方说在A地址 请求获取jssdk参数 那地址就是A地址 而不是请求的地址

egret开发方法(最笨的方法)

egret开发方法(最笨的方法)
1 1个精灵1个对象名字 获取精灵设置属性也是直接获取对象设置属性 (不用想的少些代码 因为没有jquery好用) ps:如果要设置很多个精灵属性 那可以添加到数组 然后循环遍历数组里面的精灵进行操作
2 显示隐藏 用visible=true visible=false

ps:设置深度有点问题 能不能就不要用

egret常用功能

egret常用功能

//////////////////////////////////////////////////////////////////////////////////////
//
//  Copyright (c) 2014-present, Egret Technology.
//  All rights reserved.
//  Redistribution and use in source and binary forms, with or without
//  modification, are permitted provided that the following conditions are met:
//
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//     * Neither the name of the Egret nor the
//       names of its contributors may be used to endorse or promote products
//       derived from this software without specific prior written permission.
//
//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////////////////
var offsetX:number;
var offsetY;
var panel;
class Main extends eui.UILayer {


    protected createChildren(): void {
        super.createChildren();

        egret.lifecycle.addLifecycleListener((context) => {
            // custom lifecycle plugin
        })

        egret.lifecycle.onPause = () => {
            egret.ticker.pause();
        }

        egret.lifecycle.onResume = () => {
            egret.ticker.resume();
        }

        //inject the custom material parser
        //注入自定义的素材解析器
        let assetAdapter = new AssetAdapter();
        egret.registerImplementation("eui.IAssetAdapter", assetAdapter);
        egret.registerImplementation("eui.IThemeAdapter", new ThemeAdapter());


        this.runGame().catch(e => {
            console.log(e);
        })
    }

    private async runGame() {
        await this.loadResource()
        this.createGameScene();
        const result = await RES.getResAsync("description_json")
        this.startAnimation(result);
        await platform.login();
        const userInfo = await platform.getUserInfo();
        console.log(userInfo);

    }

    private async loadResource() {
        try {
            const loadingView = new LoadingUI();
            this.stage.addChild(loadingView);
            await RES.loadConfig("resource/default.res.json", "resource/");
            await this.loadTheme();
            await RES.loadGroup("preload", 0, loadingView);
            this.stage.removeChild(loadingView);
        }
        catch (e) {
            console.error(e);
        }
    }

    private loadTheme() {
        return new Promise((resolve, reject) => {
            // load skin theme configuration file, you can manually modify the file. And replace the default skin.
            //加载皮肤主题配置文件,可以手动修改这个文件。替换默认皮肤。
            let theme = new eui.Theme("resource/default.thm.json", this.stage);
            theme.addEventListener(eui.UIEvent.COMPLETE, () => {
                resolve();
            }, this);

        })
    }

    private textfield: egret.TextField;
    /**
     * 创建场景界面
     * Create scene interface
     */
    protected createGameScene(): void {

        let sky = this.createBitmapByName("bg_jpg");
        this.addChild(sky);
        let stageW = this.stage.stageWidth;
        let stageH = this.stage.stageHeight;
        sky.width = stageW;
        sky.height = stageH;

  

        let topMask = new egret.Shape();
        topMask.graphics.beginFill(0x000000, 0.5);
        topMask.graphics.drawRect(0, 0, stageW, 172);
        topMask.graphics.endFill();
        topMask.y = 33;
        this.addChild(topMask);

        let icon: egret.Bitmap = this.createBitmapByName("egret_icon_png");
        this.addChild(icon);
        var icon_width=icon.width;
        console.log(icon.width);
        icon.anchorOffsetX = 52;
        icon.x = 0;
        icon.y = 0;
//手指触摸移动
        //手指按到屏幕,触发 startMove 方法
icon.touchEnabled = true;
 icon.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onButtonClick, this);
icon.addEventListener(egret.TouchEvent.TOUCH_BEGIN,startMove,this);
//手指离开屏幕,触发 stopMove 方法
icon.addEventListener(egret.TouchEvent.TOUCH_END,stopMove,this);
function startMove(e:egret.TouchEvent):void{
  //计算手指和圆形的距离
  offsetX = e.stageX - icon.x;
  offsetY = e.stageY - icon.y;
  //手指在屏幕上移动,会触发 onMove 方法
  this.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,onMove,this);
}
function stopMove(e:egret.TouchEvent) {console.log(22);
   //手指离开屏幕,移除手指移动的监听
   this.stage.removeEventListener(egret.TouchEvent.TOUCH_MOVE,onMove,this);
}
function onMove(e:egret.TouchEvent):void{
   //通过计算手指在屏幕上的位置,计算当前对象的坐标,达到跟随手指移动的效果
   icon.x = e.stageX - offsetX;
   icon.y = e.stageY - offsetY;
}

        let line = new egret.Shape();
        line.graphics.lineStyle(2, 0xffffff);
        line.graphics.moveTo(0, 0);
        line.graphics.lineTo(0, 117);
        line.graphics.endFill();
        line.x = 172;
        line.y = 61;
        this.addChild(line);


        let colorLabel = new egret.TextField();
        colorLabel.textColor = 0xffffff;
        colorLabel.width = stageW - 172;
        colorLabel.textAlign = "center";
        colorLabel.text = "Hello Egret";
        colorLabel.size = 24;
        colorLabel.x = 172;
        colorLabel.y = 80;
        this.addChild(colorLabel);

        let textfield = new egret.TextField();
        this.addChild(textfield);
        textfield.alpha = 0;
        textfield.width = stageW - 172;
        textfield.textAlign = egret.HorizontalAlign.CENTER;
        textfield.size = 24;
        textfield.textColor = 0xffffff;
        textfield.x = 172;
        textfield.y = 135;
        this.textfield = textfield;

        
      

        let button = new eui.Button();
        button.label = "Click!";
        button.horizontalCenter = 0;
        button.verticalCenter = 0;
        this.addChild(button);
        button.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onButtonClick, this);
// 截图
              var renderTexture:egret.RenderTexture = new egret.RenderTexture();
renderTexture.drawToTexture(this);

var base64img=renderTexture.toDataURL("image/png");
        console.log(base64img);
    }
    /**
     * 根据name关键字创建一个Bitmap对象。name属性请参考resources/resource.json配置文件的内容。
     * Create a Bitmap object according to name keyword.As for the property of name please refer to the configuration file of resources/resource.json.
     */
    private createBitmapByName(name: string): egret.Bitmap {
        let result = new egret.Bitmap();
        let texture: egret.Texture = RES.getRes(name);
        result.texture = texture;
        return result;
    }
    /**
     * 描述文件加载成功,开始播放动画
     * Description file loading is successful, start to play the animation
     */
    private startAnimation(result: Array<any>): void {
        let parser = new egret.HtmlTextParser();

        let textflowArr = result.map(text => parser.parse(text));
        let textfield = this.textfield;
        let count = -1;
        let change = () => {
            count++;
            if (count >= textflowArr.length) {
                count = 0;
            }
            let textFlow = textflowArr[count];

            // 切换描述内容
            // Switch to described content
            textfield.textFlow = textFlow;
            let tw = egret.Tween.get(textfield);
            tw.to({ "alpha": 1 }, 200);
            tw.wait(2000);
            tw.to({ "alpha": 0 }, 200);
            tw.call(change, this);
        };

        change();
    }

    /**
     * 点击按钮
     * Click the button
     */
    private onButtonClick(e: egret.TouchEvent) {
        panel = new eui.Panel();
        panel.title = "Title";
        panel.horizontalCenter = 0;
        panel.verticalCenter = 0;
        this.addChild(panel);
    }
}

jquery鼠标点击穿透的解决方法

jquery鼠标点击穿透的解决方法

<div class="showcontainer" style="background:#000;display: block;"> 
    <div class="dd" style="width:20%;height:3rem;background:#F00; position: absolute;left:20%;top:10%;">
      <div class="ddd" style="width:100%;height:100%;position: absolute;left:0px;top:0px;background:#FF0"></div>
      <div class="ss" style="width:20%;height:2rem;background:#0F0;position: absolute;left:20%;top:10%;">

      </div>              
    </div>
  </div>
    $('.dd').on(START_EV, function() {
        alert('dd')
    })
    $('.ss').on(START_EV, function() {
    
        return false;
    })

点击了ss就阻止后面的代码运行了 因为穿透也是按照顺序运行的

jquery翻页turnjs简单实例

jquery翻页turnjs简单实例

<div id="flipbook">
        <div class="hard" style="background: #000; color: #FFF">1</div>
                <div class="hard" style="background: #F00;color: #FFF">2</div>
                <div style="background: #000;color: #FFF">3</div>
                <div style="background: #F00;color: #FFF">4</div>
                <div style="background: #000;color: #FFF">5</div>
                <div class="hard" style="background: #F00;color: #FFF">6</div>
                <div class="hard" style="background: #000;color: #FFF">7</div>
    </div>

  var bodywidth=$('body').width();
    var bodyheight=$('body').height();
    $("#flipbook").turn({
        width: bodywidth,
        height: bodyheight,
        autoCenter: false,
        display: "single",
    });

如果要设置双页 直接把display: “single”,注释掉