Преглед изворни кода

qq玩一玩排行榜开发

sa пре 6 година
родитељ
комит
ef8dc8cfd6

+ 77 - 98
assets/Script/Home/HomeSence.js

@@ -45,14 +45,14 @@ cc.Class({
         cc.audioEngine.playMusic(this.gamebgMusic, true);
 
         if (CC_WECHATGAME) {
-            this.WxLogin();
-            this.initShare();
+            // this.initShare();
             // wx.setPreferredFramesPerSecond(30);
-			this.listenGame();
+			// this.listenGame();
 		}
 		
 		if (CC_QQPLAY) {
-			// this.QQLogin();
+			this.QQLogin();
+			this.initShare();
 		}
     },
 
@@ -72,21 +72,6 @@ cc.Class({
 		}
 	},
 
-    WxLogin() {
-        if (UserInfo.platform != 1) {
-            return;
-        }
-        wx.login({
-            success: function (res) {
-                if (res.code) {
-                    var js_code = res.code;
-                } else {
-                    console.log('登录失败!' + res.errMsg)
-                }
-            }
-        });
-    },
-
     initShare(data) {
         let datavalue = UserInfo.getString('allscore');
         let key = UserInfo.getCurWeekScoreValue();
@@ -106,62 +91,58 @@ cc.Class({
         if (removeIndex != -1) {
             datalist.splice(removeIndex, 1);
         }
-        WxCommon.RemoveUserCloudStorage(datalist, this, this.RemoveScoreKey);
+        // WxCommon.RemoveUserCloudStorage(datalist, this, this.RemoveScoreKey);
         // this.RemoveScoreKey(datalist, true);
     },
 
-    listenGame() {
-		// var date = UserInfo.GetNowFormatDate();
-		this.OnUpdateGame();
-		WxCommon.SetEnableDebug(false);
-		WxCommon.OnShow(null, this, null);
-		WxCommon.ShowShareMenu();
-		WxCommon.OnShareAppMessage(null, this, this.shareCallback);
-		WxCommon.GetSystemInfo(null, this, null);
-    },
-
-    OnUpdateGame() {
-        const updateManager = wx.getUpdateManager()
-
-        updateManager.onCheckForUpdate(function (res) {
-            // 请求完新版本信息的回调
-            console.log(res.hasUpdate)
-        })
-
-        updateManager.onUpdateReady(function () {
-            wx.showModal({
-                title: '更新提示',
-                content: '新版本已经准备好,是否重启应用?',
-                success: function (res) {
-                    if (res.confirm) {
-                        // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
-                        updateManager.applyUpdate()
-                    }
-                }
-            })
-
-        })
-
-        updateManager.onUpdateFailed(function () {
-            // 新的版本下载失败
-        })
-    },
+    // listenGame() {
+	// 	// var date = UserInfo.GetNowFormatDate();
+	// 	this.OnUpdateGame();
+	// 	WxCommon.SetEnableDebug(false);
+	// 	WxCommon.OnShow(null, this, null);
+	// 	WxCommon.ShowShareMenu();
+	// 	WxCommon.OnShareAppMessage(null, this, this.shareCallback);
+	// 	WxCommon.GetSystemInfo(null, this, null);
+    // },
+
+    // OnUpdateGame() {
+    //     const updateManager = wx.getUpdateManager()
+
+    //     updateManager.onCheckForUpdate(function (res) {
+    //         // 请求完新版本信息的回调
+    //         console.log(res.hasUpdate)
+    //     })
+
+    //     updateManager.onUpdateReady(function () {
+    //         wx.showModal({
+    //             title: '更新提示',
+    //             content: '新版本已经准备好,是否重启应用?',
+    //             success: function (res) {
+    //                 if (res.confirm) {
+    //                     // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+    //                     updateManager.applyUpdate()
+    //                 }
+    //             }
+    //         })
+
+    //     })
+
+    //     updateManager.onUpdateFailed(function () {
+    //         // 新的版本下载失败
+    //     })
+    // },
 
     onRankBtn: function (event, optData) {
         console.log('onrankbtn:', optData)
-        if (UserInfo.platform != 1 || !cc.vv.isRank) {
-            return;
-        }
-
-        wx.postMessage({
-            method: 'showFriendRank',
-            data: optData
-        });
+        // wx.postMessage({
+        //     method: 'showFriendRank',
+        //     data: optData
+        // });
 
         cc.find("Canvas/PHB").getChildByName("BtnPHBClose").active = (optData == "true");
         cc.find("Canvas/PHB").getChildByName("emptyBtn").active = (optData == "true");
         cc.find("Canvas/PHB").getChildByName("bg").active = (optData == "true");
-
+		
         if (this.node.active) {
             if ("true" == optData) {
                 // window.indexBanner.hide();
@@ -170,10 +151,10 @@ cc.Class({
             }
             if ("false" == optData) {
                 // window.indexBanner.show();
-                wx.postMessage({
-                    method: 'hideRank',
-                    data: optData
-                });
+                // wx.postMessage({
+                //     method: 'hideRank',
+                //     data: optData
+                // });
                 cc.find("Canvas/PHB").active = false;
             }
         } else {
@@ -184,27 +165,25 @@ cc.Class({
     },
 
     showRank() {
-        if (UserInfo.platform == 1 && cc.vv.isRank) {
-            this.myRankNode.active = false;
-            this.rankNode.active = true;
-            if (this.rankScene.status == 1) {
-                let openDataContext = wx.getOpenDataContext();
-                let sharedCanvas = openDataContext.canvas;
-                this.feiendtex.initWithElement(sharedCanvas);
-                this.feiendtex.handleLoadedTexture();
-                this.friendContentNode.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.feiendtex);
-                var scale = Math.min(750 / this.feiendtex.width, 1334 / this.feiendtex.height);
-                this.friendContentNode.setContentSize(this.feiendtex.width * scale, this.feiendtex.height * scale);
-            }
-            this.PHB.active = true;
-        }
+		this.myRankNode.active = false;
+		this.rankNode.active = true;
+		// if (this.rankScene.status == 1) {
+		// 	let openDataContext = wx.getOpenDataContext();
+		// 	let sharedCanvas = openDataContext.canvas;
+		// 	this.feiendtex.initWithElement(sharedCanvas);
+		// 	this.feiendtex.handleLoadedTexture();
+		// 	this.friendContentNode.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.feiendtex);
+		// 	var scale = Math.min(750 / this.feiendtex.width, 1334 / this.feiendtex.height);
+		// 	this.friendContentNode.setContentSize(this.feiendtex.width * scale, this.feiendtex.height * scale);
+		// }
+		this.PHB.active = true;
     },
 
 
     update: function () {
-        if (cc.find("Canvas/PHB").active) {
-            this.showRank();
-        }
+        // if (cc.find("Canvas/PHB").active) {
+        //     this.showRank();
+        // }
     },
 
     onGameStartBtn: function () {
@@ -224,21 +203,14 @@ cc.Class({
                 this.node.parent.getChildByName("Game").getComponent("GameSence").onRestartBtn();
             }
         }
-
-
     },
 
     showGuide() {
         if (!this.showGuideValue) return false;
         console.log('show guide');
-        var getStorage = function (key) {
-            return window.wx ? window.wx.getStorageSync(key) : localStorage.getItem(key);
-        }
-        var setStorage = function (key, value) {
-            return window.wx ? window.wx.setStorageSync(key, value) : localStorage.setItem(key, value);
-        }
+        
         var key = 'guideTime';
-        var guideTime = getStorage(key);
+        var guideTime = cc.sys.localStorage.getItem(key);
         var now = new Date();
         var year = now.getFullYear();
         var month = now.getMonth() + 1;
@@ -246,7 +218,7 @@ cc.Class({
         var guideTimeValue = [year, month, date].join('/');
 
         if (!guideTime || guideTime != guideTimeValue) {
-            setStorage(key, guideTimeValue);
+            cc.sys.localStorage.setItem(key, guideTimeValue);
             return true;
         } else {
             this.GuideNode && this.GuideNode.destroy();
@@ -393,7 +365,6 @@ cc.Class({
         }
     },
 
-    //微信分享
     onShareBtn: function () {
         if (CC_WECHATGAME) {
             var data = {
@@ -401,7 +372,15 @@ cc.Class({
                 imgurlData: UserInfo.shareUrl
             }
             WxCommon.ShareAppMessage(data, this, null);
-        }
+		}
+		
+		if (CC_QQPLAY) {
+			var data = {
+                titleData: UserInfo.shareDesc,
+                imgurlData: UserInfo.shareUrl
+			}
+			QQCommon.ShareAppMessage(data, null);
+		}
     },
 
     createTimer: function () {

+ 0 - 7
assets/Script/duowansdk.meta

@@ -1,7 +0,0 @@
-{
-  "ver": "1.0.1",
-  "uuid": "835a29e2-d466-49b3-b5bc-073718648f5a",
-  "isSubpackage": false,
-  "subpackageName": "",
-  "subMetas": {}
-}

+ 0 - 257
assets/Script/duowansdk/DwSdk.js

@@ -1,257 +0,0 @@
-import lib from './library'
-import GameLife from './GameLife'
-import md5 from './md5'
-let timer
-
-
-function _renderIcon(gameName, adList, name, x, y, pNode) {
-    var curAd = { id: -1 }
-
-    //定时切换
-    _randomImage()
-    timer = setInterval(() => {
-        _randomImage()
-    }, 3000)
-
-    /**
-     * 随机渲染一张图片
-     */
-    function _randomImage() {
-        let index = (new Date()).getTime() % adList.length
-
-        //不渲染和上一个一样的图标
-        if (curAd.id === adList[index].id) {
-            index = (index + 1) % adList.length
-        }
-
-        curAd = adList[index]
-
-        let icon = curAd['small_icon'];
-        // icon = 'http://ben.wiki.webdev2.duowan.com/house.png';
-        let options = curAd['small_icon_options'] || {}
-        options['pNode'] = pNode
-        // options['rows'] = 4
-        // options['cols'] = 2
-        // options['num'] = 8
-        // options['interval'] = 10
-
-        lib.drawImage(name, icon, x, y, function () {
-            // 点击后,更换图标广告
-            // _randomImage();
-            // 打开这个广告
-            _openMp(gameName, curAd)
-        }, options);
-    }
-}
-
-
-//加载Prefab
-function _loadPrefab(data,gameName) {
-    cc.loader.loadRes("duowansdk/prefab/homeAd", function (err, prefab) {
-        var newNode = cc.instantiate(prefab);
-        cc.director.getScene().addChild(newNode);
-
-        let head = newNode.getChildByName('head')
-        head.getComponent(cc.Label).string = data.title
-        newNode.getChildByName('content').getChildByName('desc').getComponent(cc.Label).string = data.content
-        newNode.getChildByName('content').getChildByName('time').getComponent(cc.Label).string = `时间:${data.start_time}-${data.end_time}`
-        let closeBtn = newNode.getChildByName('icon-close').addComponent(cc.Button)
-        closeBtn.node.on(cc.Node.EventType.TOUCH_START,() => {
-            newNode.destroy()
-        })
-        let detailBtn = newNode.getChildByName('btn').addComponent(cc.Button)
-        detailBtn.node.on(cc.Node.EventType.TOUCH_START,() => {
-            wx.navigateToMiniProgram({
-                appId: data.app_id,
-                path: '',
-                extraData: {}
-            })
-        })
-    });
-}
-
-
-
-/**
- * 尝试直接访问,失败则打开图片的方式
- * @param {*} gameName 
- * @param {*} curAd 
- */
-function _openMp(gameName, curAd) {
-    console.log(curAd)
-    if (lib.wx) {
-        // 优先直接打开小程序
-        if (curAd.app_id) {
-            wx.navigateToMiniProgram({
-                appId: curAd.app_id,
-                path: curAd.path,
-                extraData: {},
-                success() {
-                    // 上报跳转成功数据 
-                    lib.get(`${lib.host}hz/static?field=navigate&name=${gameName}`)
-                },
-                fail() {
-                    // 打开失败,则打开图片
-                    _previewImage(gameName, curAd)
-                }
-            })
-        } else {
-             _previewImage(gameName, curAd)
-        }
-    } else {
-        console.debug("点击了图标广告,显示图片:" + curAd['big_image'])
-        // 上报打开图片数据 
-        lib.get(`${lib.host}hz/static?field=img&name=${curAd.name}`)
-        window.open(curAd['big_image'])
-    }
-}
-
-function _previewImage(gameName, curAd) {
-    if(!curAd) {
-        return
-    }
-    // 上报打开图片数据 
-    lib.get(`${lib.host}hz/static?field=img&name=${curAd.name}`)
-
-    // 打开失败,则打开图片
-    wx.previewImage({
-        urls: [curAd['big_image']]
-    })
-}
-
-export default class DwSdk {
-    constructor(name, debug = false) {
-        this.name = name
-        lib.setDebug(debug)
-
-        // 游戏的生命周期
-        this.objGameLife = new GameLife(name)
-        this.objGameLife.initEvent()
-    }
-
-    /**
-     * 显示小图标广告
-     * @param {int} x  X轴位置,默认0
-     * @param {int} y  Y轴位置,默认0
-     * @param {object} node 可选参数(Cocos引擎的节点) 
-     */
-    showAdIcon(x = 0, y = 0, node = null) {
-        let self = this
-        //装配启动参数
-        let lunchData = wx.getLaunchOptionsSync()
-        let sdkParam = {}
-        try {
-            lunchData.query = JSON.parse(lunchData.query)
-            lunchData.referrerInfo = JSON.parse(lunchData.referrerInfo)
-            delete lunchData.__public
-        } catch (error) {
-            
-        }
-        sdkParam.query = lunchData.query
-        sdkParam.referrerInfo = lunchData.referrerInfo
-        let sdkStr = JSON.stringify(sdkParam)
-        console.log(sdkStr)
-        lib.get(`${lib.host}hz/showAd?name=${self.name}&ips=1&sdk_param=${sdkStr}`, function (ret) {
-            _renderIcon(self.name, ret.data, "DwSdk_AdIcon", x, y, node)
-        });
-    }
-
-    /**
-     * 隐藏小图标广告
-     * @param {object} node 可选参数(Cocos引擎的节点) 
-     */
-    hideAdIcon(node = null) {
-        lib.hideImage("DwSdk_AdIcon", node);
-        clearInterval(timer)
-    }
-
-    showHomeAd() {
-        let self = this
-
-        if (lib.cc) {
-            lib.get(`${lib.host}hz/mainAd?name=${self.name}`, (ret) => {
-                let data = ret.data
-
-                //无数据
-                if (!data.app_id) {
-                    return
-                }
-                //根据时长判断是否加载首屏广告
-                let lastTime = lib.getStorage("showAdTime");
-                let interval = data.interval_time * 60 * 1000;
-                let ts = new Date().getTime();
-                if (lastTime && interval > ts - lastTime) {
-                    return
-                } else {
-                    _loadPrefab(data,'多玩游戏中心')
-                    lib.setStorage("showAdTime",ts)
-                    
-                }
-
-            })
-        }
-    }
-
-    /**
-     * 打开多玩游戏中心
-     */
-    openGameCenter() {
-        let app_id = 'wxa72e774364b4e06c';
-        let gameName = '多玩游戏中心';
-
-        if (lib.wx) {
-            wx.navigateToMiniProgram({
-                appId: app_id,
-                extraData: {},
-                success() {
-                    // 上报跳转成功数据 
-                    lib.get(`${lib.host}hz/static?field=navigate&name=${gameName}`)
-                },
-                fail() {
-                    // 打开失败,则打开图片
-                    lib.get(`${lib.host}hz/common`, function ({ data }) {
-                        // 上报打开图片数据 
-                        // lib.get(`${lib.host}hz/static?field=img&name=${gameName}`)
-                        wx.previewImage({
-                            urls: [data.hz_picture]
-                        })
-                    });
-                }
-            })
-        } else {
-            // 打开失败,则打开图片
-            lib.get(`${lib.host}hz/common`, function ({ data }) {
-                window.open(data.hz_picture)
-            });
-        }
-    }
-
-    setCanvasTranslate(dx, dy) {
-        lib.setCanvasTranslate(dx, dy)
-    }
-
-    update() {
-        lib.updateImage();
-    }
-
-    //获取广告图标列表
-    getAdList(cb) {
-        lib.get(`${lib.host}hz/showAd?name=${self.name}&ips=1`, (ret) => {
-            if(ret.data) {
-                cb(ret.data)
-            }
-            
-        })
-        
-    }
-
-    
-    /**
-     * 点击图标上报
-     * @param {string} name 被点击的图标的游戏的名称
-     */
-    reportClickAdIcon(name) {
-        lib.get(`${lib.host}hz/static?field=img&name=${name}`)
-    }
-
-}

+ 0 - 9
assets/Script/duowansdk/DwSdk.js.meta

@@ -1,9 +0,0 @@
-{
-  "ver": "1.0.5",
-  "uuid": "9d69ebd8-b82f-4867-af57-ac3d2a66bd2f",
-  "isPlugin": false,
-  "loadPluginInWeb": true,
-  "loadPluginInNative": true,
-  "loadPluginInEditor": false,
-  "subMetas": {}
-}

+ 0 - 206
assets/Script/duowansdk/GameLife.js

@@ -1,206 +0,0 @@
-import lib from './library'
-import md5 from './md5'
-
-let _interval = 30000
-let _yyuid = 0
-let gh_id = ''
-let loginData = ''
-let appid = ''
-
-
-let M = {
-    launchOptions: function (name) {
-        let param = wx.getLaunchOptionsSync()
-
-        _yyuid = param['query']['_yyuid']  ? param['query']['_yyuid'] : ''
-        // let _md5 = param['query']['_md5']
-        //gh_id格式:`gh${跳转的appid}_${昵称}_${自定义appid}`
-        
-        if(param['query']['scene']) {
-            gh_id = param['query']['scene'].startsWith('gh') ? param['query']['scene'] : ''
-            appid = gh_id ? gh_id.split('_')[2] : ''
-        }
-        console.log(gh_id)
-        console.log(appid)
-
-        param['query'] = JSON.stringify(param['query'])
-        param['referrerInfo'] = JSON.stringify(param['referrerInfo'])
-        param['name'] = name
-        
-
-        let url = `${lib.host}sdk/launchOptions`
-        lib.post(url, param, function (objResult) {
-            if (objResult.result) {
-                console.debug(url + ':' + objResult.msg);
-            } else {
-                // lib.showErrorTip(objResult.msg);
-                console.error(objResult.msg);
-            }
-        });
-    },
-    gameAction: function (name, action) {
-        if (!_yyuid) {
-            console.debug('没有yyuid,无需上报');
-            return;
-        }
-
-        let param = { name, _yyuid, gh_id  }
-
-        let url = `${lib.host}sdk/${action}`
-        param['_sign'] = M.getSign(param)
-        lib.get(url, param, function (objResult) {
-            if (objResult.result) {
-                console.debug(url + ':' + objResult.msg);
-            } else {
-                // lib.showErrorTip(objResult.msg);
-                console.error(objResult.msg);
-            }
-        })
-    },
-    getSign(param) {
-        let str = ''
-        for (let key in param) {
-            str += `&${key}=${param[key]}`
-        }   
-        str = str.substr(1);
-        str = encodeURI(str)
-
-        let sign = md5.hexMD5(str)
-        // console.log(`str:${str}, sign:${sign}`)
-
-        return sign
-    },
-    reportDw() {
-
-    }
-}
-
-export default class GameLife {
-    constructor(name) {
-        this.name = name
-        this.gameEchoHandler = 0
-    }
-
-    initEvent() {
-        let self = this
-        if (lib.wx) {
-            let loginCache = wx.getStorageSync('loginData')
-            M.launchOptions(self.name);
-            if(_yyuid) {
-                _invoked()
-                return
-            }
-
-            if(loginCache) {
-                _yyuid = loginCache
-                _invoked()
-            } else {
-                if(!appid) return
-                // 已经授权,可以直接调用 getUserInfo 获取头像昵称
-                _getLoginCode()
-            }
-            
-
-        }
-
-        /**
-         * 获取yyuid后的回调
-         */
-        function _invoked() {
-            // 上报启动参数
-            
-
-            // 防止重复绑定,先解绑
-            wx.offShow(_show)
-            wx.offHide(_hide)
-            // 绑定事件
-            wx.onShow(_show)
-            wx.onHide(_hide)
-        }
-
-        /**
-         * 获取登录js_code
-         */
-
-        function _getLoginCode() {
-            wx.login({
-                success(res) {
-                    let postData = {
-                        appid,
-                        js_code: res.code,
-                        simple: 1
-                    }
-                    _getLoginData(postData)
-                },
-                fail(){
-                    console.log('获取js_code失败')
-                }
-            })
-        }
-
-        /**
-         * 请求接口获取登录信息
-         */
-        function _getLoginData(postData) {
-            let url = 'https://wxserver.duowan.com/auth/wxaGetUserInfo'
-            lib.get(url,postData,(ret) => {
-                loginData = ret.data.openid
-                console.log('```````````````setStorage```````````````')
-                console.log(loginData)
-                wx.setStorage({
-                    key: 'loginData',
-                    data: loginData
-                })
-                
-                _yyuid = loginData
-                _invoked()
-            })
-        }
-    
-
-        /**
-         * 开始小游戏心跳响应
-         */
-        function _startEcho() {
-            _stopEcho()
-
-            if (!_yyuid) {
-                console.debug('没有yyuid,无需上报');
-                return;
-            }
-
-            // 没30秒心跳一次
-            self.gameEchoHandler = setInterval(function () {
-                M.gameAction(self.name, 'gameEcho')
-            }, _interval)
-        }
-
-        /**
-         * 停止小游戏心跳响应
-         */
-        function _stopEcho() {
-            if (self.gameEchoHandler) {
-                clearTimeout(self.gameEchoHandler)
-                self.gameEchoHandler = 0
-            }
-        }
-
-        /**
-         *  监听小游戏回到前台的事件
-         */
-        function _show() {
-            M.gameAction(self.name, 'gameStart')
-            _startEcho()
-        }
-
-        /**
-         *  监听小游戏隐藏到后台事件。锁屏、按 HOME 键退到桌面、显示在聊天顶部等操作会触发此事件。
-         */
-        function _hide() {
-            M.gameAction(self.name, 'gameEnd')
-            _stopEcho()
-        }
-    }
-
-
-}

+ 0 - 9
assets/Script/duowansdk/GameLife.js.meta

@@ -1,9 +0,0 @@
-{
-  "ver": "1.0.5",
-  "uuid": "748ac3b3-d521-4326-9e21-867a5ba193a9",
-  "isPlugin": false,
-  "loadPluginInWeb": true,
-  "loadPluginInNative": true,
-  "loadPluginInEditor": false,
-  "subMetas": {}
-}

+ 0 - 606
assets/Script/duowansdk/library.js

@@ -1,606 +0,0 @@
-import md5 from './md5'
-
-/**
- * 是否启用cocos的api
- */
-let enabelCC = true
-
-let _global = typeof window === 'undefined' ? global : window;
-
-
-let translate = { dx : 0, dy : 0 };
-let eventMap = {};
-let ccEventMap = {};
-let displayMap = {};
-
-/**
- * 对外接口
- */
-module.exports = {
-    // 基础UI
-    showLoading,
-    hideLoading,
-    showTip,
-    showSuccessTip,
-    showErrorTip,
-
-    // 网络相关
-    get,
-    post,
-
-    // 小游戏独特UI
-    drawImage,
-    hideImage,
-    updateImage,
-    // download,
-
-    cc : _global.cc,
-    wx : _global.wx,
-    setCanvasTranslate,
-    getCanvas,
-    getCanvasCtx,
-    setDebug,
-
-    //本地存储
-    getStorage,
-    setStorage,
-
-    //签名构造
-    encodePwd
-}
-
-Object.defineProperty(module.exports, "host", { 
-    get: function() { 
-        if (this.debug) {
-            return 'https://test-xyxbox.duowan.com/'
-        } else {
-            return 'https://xyxbox.duowan.com/'
-        }
-    } 
-}); 
-
-function setDebug(debug) {
-    module.exports.debug = debug
-}
-
-function getCanvas() {
-    return _global.canvas || cc.game.canvas
-}
-
-function getCanvasCtx() {
-    let gameCanvas = getCanvas()
-    return gameCanvas.getContext('2d')
-}
-
-/**
- * 设置canvas的原点
- * @param {int} dx The distance to translate in X
- * @param {int} dy The distance to translate in Y
- */
-function setCanvasTranslate(dx, dy) {
-    translate.dx = dx;
-    translate.dy = dy;
-}
-
-function drawImage(name, src, x, y, callback, options) {
-    // 图片地址补齐http
-    if (src.indexOf('http') !== 0) {
-        src += 'http:'
-    }
-
-    // 微信里面只能用https的图片
-    if (_global.wx) {
-        src = src.replace(/http\:\/\//, 'https://')
-    }
-
-    if (enabelCC && _global.cc) {
-        download(src, function(texture2D) {
-            let pNode = options['pNode']
-            let node = pNode.getChildByName(name)
-            let sp = null
-            let btn = null
-            // 判断是否加过这个node了
-            if (!node) {
-                node = new cc.Node(name)
-                node.zIndex = options['zIndex'] || 66666
-                sp = node.addComponent(cc.Sprite)
-                btn = node.addComponent(cc.Button)
-
-                // node.x = x
-                // node.y = y
-                var widget = node.addComponent(cc.Widget)
-                widget.isAlignTop = true
-                widget.isAlignLeft = true
-                widget.left = x
-                widget.top = y
-                node.parent = pNode
-            } else {
-                sp = node.getComponent(cc.Sprite)
-                btn = node.getComponent(cc.Button)
-                if (ccEventMap[name]) {
-                    btn.node.off(cc.Node.EventType.TOUCH_START, ccEventMap[name])
-                    delete ccEventMap[name]
-                }
-            }
-            
-            // 如果是多张图的情况
-            if (options['num'] && options['num'] > 1) {
-                options['texture2D'] = texture2D;
-                displayMap[name] = [sp, x, y, options]
-                if (!sp.spriteFrame) {
-                    updateImage();
-                }
-            } else {
-                sp.spriteFrame = new cc.SpriteFrame(texture2D);
-            }
-
-            if (callback) {
-                ccEventMap[name] = callback
-                btn.node.on(cc.Node.EventType.TOUCH_START, callback)
-            }            
-        });
-    } else {
-        let ctx = getCanvasCtx()
-        if (!ctx) {
-            console.log('目前不支持WebGL引擎渲染')
-            return
-        }
-
-        let image = _global.wx ? wx.createImage() : new Image;
-        image.onload = function () {
-            displayMap[name] = [image, x, y, options]
-            // updateImage()
-            // 绑定事件
-            if (callback) {
-                _bindEvent(name, 'touchstart', image, x, y, options, callback)
-            }
-        }
-        image.src = src
-    }
-}
-
-let i = 0;
-function updateImage() {
-    let ctx = null;
-    for (var name in displayMap) {
-        let value = displayMap[name]
-        let image = value[0]
-        let options = value[3]
-        let texture2D = options.texture2D;
-        let orginSize = texture2D || image;
-
-        let info = null;
-        if (options && options['num'] && options['num'] > 1) {
-            let cur = options['cur'] || 0;
-            let curFrame  = options['curFrame'] || 0;
-            let num = options['num']
-            let interval = options['interval']
-
-            if (++curFrame == interval) {
-                curFrame = 0;
-                cur = (cur + 1) % num;
-            }
-            
-            let rows = options['rows'] || 1
-            let cols = options['cols'] || 1
-            let cur_rows = parseInt(cur / cols);
-            let cur_cols = cur - cur_rows * cols;
-            
-            let img_width = orginSize.width / cols
-            let img_height = orginSize.height / rows
-            info = [img_width * cur_cols, img_height * cur_rows, img_width, img_height]
-
-            // 设置显示列表
-            displayMap[name][3]['curFrame'] = curFrame;
-            displayMap[name][3]['cur'] = cur;
-        } else {
-            info = [value[1], value[2], orginSize.width, orginSize.height]
-        }
-
-        if (texture2D) {
-            let sf = new cc.SpriteFrame(texture2D)
-            sf.setRect(new cc.Rect(info[0], info[1], info[2], info[3]))
-            image.spriteFrame = sf
-        } else {
-            let x = value[1] - translate.dx
-            let y = value[2] - translate.dy
-            ctx = ctx || getCanvasCtx();
-            ctx.drawImage(image, info[0], info[1], info[2], info[3], x, y, info[2], info[3])
-        }
-    }
-}
-
-function hideImage(name, pNode = null) {
-    _unbindEvent(name);
-    if (displayMap[name]) {
-        delete displayMap[name]
-    }
-
-    if (pNode) {
-        let child = pNode.getChildByName(name)
-        if (child) {
-            child.removeFromParent(true)
-        }
-    }
-}
-
-function _unbindEvent(name) {
-    eventMap[name] = eventMap[name] || {}
-    for (let eventType in eventMap[name]) {
-        _unbindOneEvent(name, eventType)
-    }
-}
-
-function _unbindOneEvent(name, eventType) {
-    eventMap[name] = eventMap[name] || {}
-    if (eventMap[name][eventType]) {
-        getCanvas().removeEventListener(eventType, eventMap[name][eventType])
-        delete eventMap[name][eventType]
-    }
-}
-
-// jquery offset原生实现
-function _offset(target) {
-    var top = 0,
-        left = 0
-
-    while(target.offsetParent) {
-        top += target.offsetTop
-        left += target.offsetLeft
-        target = target.offsetParent
-    }
-
-    return {
-        top: top,
-        left: left,
-    }
-}
-
-function _bindEvent(name, eventType, image, x, y, options, callback) {
-    eventMap[name] = eventMap[name] || {}
-    if (eventMap[name][eventType]) {
-        _unbindOneEvent(name, eventType);
-    }
-
-    eventMap[name][eventType] = function(event) {
-       var _x, _y;
-        var touches = event.touches;
-        if (touches) {
-            var canvas = getCanvas();
-            let offset = _offset(canvas);
-            _x = touches[0].clientX - offset.left,
-            _y = touches[0].clientY - offset.top;
-        } else if (event.layerX || event.layerX == 0) {
-           _x = event.layerX;
-           _y = event.layerY;
-       } else if (event.offsetX || event.offsetX == 0) { // Opera
-           _x = event.offsetX;
-           _y = event.offsetY;
-       }
-         _checkRange(_x, _y, options)
-    };
-
-    function _checkRange(_x, _y, options) {
-        let radio = _global.wx ?  0.67 : 1.5;
-        let rows = options['rows'] || 1
-        let cols = options['cols'] || 1
-        let flag = _x > x && _x < x + image.width * radio / cols
-        flag &= _y > y && _y < y + image.height * radio / rows
-        if (flag && !self.isHide) { 
-            callback && callback();
-        }
-    }
-
-    getCanvas().addEventListener(eventType, eventMap[name][eventType]);
-}
-
-function download(src, callback) {
-    if (enabelCC && _global.cc) {
-        cc.loader.load(src, function (err, tex) {
-            if (err) {
-                cc.error(err);
-            } else {
-                callback(tex);
-            }
-        });
-    } 
-    else {
-        wx.downloadFile({
-          url: src,
-          header: {},
-          filePath: '',
-          success: function (ret) {
-              callback(ret.tempFilePath);
-          }
-        })
-    }
-}
-
-
-// --------------  通用UI ----------------
-let loadingTimeoutHandler = 0
-function showLoading(title, timeout, cancelable) {
-    let option = { title }
-    if (!cancelable) {
-        option['mask'] = true
-    }
-
-    if (_global.wx) {
-        wx.showLoading(option)
-    } else {
-        console.log(`showLoading, title:${title}, timeout:${timeout}, cancelable:${cancelable}`)
-    }
-    
-    // 超时时间为15s
-    timeout = timeout || 15000;
-    loadingTimeoutHandler = setTimeout(function(){
-        hideLoading()
-        showTip("加载超时,请稍后再试")
-    }, timeout);
-}
-
-function hideLoading() {
-    loadingTimeoutHandler && clearTimeout(loadingTimeoutHandler);
-    loadingTimeoutHandler = 0;
-    if (_global.wx) {
-        wx.hideLoading()
-    } else {
-        console.log(`hideLoading`)
-    }
-}
-
-function showSuccessTip(title, timeout) {
-    showTip(title, timeout, {
-        'icon' : 'success'
-    });
-}
-
-function showErrorTip(title, timeout) {
-    showTip(title, timeout, {
-        'icon' : 'loading'
-    });
-}
-
-function showTip(title, timeout, option) {
-    option = option || {}
-    option['title'] = title
-    option['duration'] = timeout || 3000
-
-    if (_global.wx) {
-        wx.showToast(option)
-    } else {
-        console.log(`showTip:${title}, ${timeout}`)
-    }
-}
-
-// --------------  网络相关接口 ------------
-function _get(url, data, callback) {
-    if (_global.wx) {
-        wx.request({
-            method:'GET',
-            url: url,  
-            data: data,
-            dataType: 'text',
-            success: function(ret) {
-                callback(ret.data)
-            }
-        });
-    } else {
-        let query = _buildData(data);
-        if (url.indexOf('?') >= 0) {
-            url += '&' + query;
-        } else {
-            url += '?' + query;
-        }
-
-        var xhr = new XMLHttpRequest();
-        xhr.onreadystatechange = function () {
-            if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {
-                var text = xhr.responseText;
-                callback(text);
-            }
-        };
-        xhr.open("GET", url, true);
-        xhr.send();
-    }
-}
-
-function _post(url, data, callback) {
-    if (_global.wx) {
-        wx.request({
-            method:'POST',
-            url: url,  
-            data: data,
-            dataType: 'text',
-            header: {
-                //设置参数内容类型为x-www-form-urlencoded
-                'content-type':'application/x-www-form-urlencoded',
-            },
-            success: function(ret) {
-                callback(ret.data)
-            }
-        });
-    } else {
-        var xhr = new XMLHttpRequest();
-        xhr.onreadystatechange = function () {
-            if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {
-                var text = xhr.responseText;
-                callback(text);
-            }
-        };
-        xhr.open("POST", url, true);
-        xhr.send(_buildData(data));
-    }
-}
-
-function _buildData(data) {
-    let query = '';
-    for (let key in data) {
-        query += key + '=' + data[key] + '&';
-    }
-
-    if (query) {
-        query = query.substr(0, query.length - 1);
-    }
-
-    return query;
-}
-
-function get(url, data, callback, option) {
-    option = option || {};
-
-    // 支持post(url, callback)的写法;
-    if (typeof data === 'function') {
-        option = callback || {};
-        callback = data;
-        data = {};
-    }
-
-    option['loading'] && showLoading();
-    _get(url, data, function(text) {
-        option['loading'] && hideLoading();
-        if (option['type'] === 'text' && typeof text == 'string') {
-            callback && callback(text);
-        } else {
-            var objResult = _getAjaxResult(text);
-            callback && callback(objResult);
-        }
-    });
-}
-
-/**
- * option object {'cache', 'loading', 'onTimeout'}
- * cache为true、every、once
- */
-function post(url, data, callback, option) {
-    option = option || {};
-    // 支持postCross(url, callback)的写法;
-    if ( typeof data == 'function') {
-        option = callback || {};
-        callback = data;
-        data = {};
-    }
-
-    data['_from'] = 'ajax';
-    //获取cache的key
-    if (option['cache'] && window.localStorage) {
-        var cacheKey = 'ajaxCache-' + url + '?' + $.param(data);
-        //如果有cache则不出现loading
-        var isCached = _loadAjaxCache(cacheKey, callback);
-        if (isCached) {
-            option['loading'] = false;
-            if (option['cache'] == "must") {
-                return;
-            }
-        }
-    }
-
-    if (option['loading']) {
-        showLoading();
-    }
-
-    _post(url, data, function (text) {
-        option['loading'] && hideLoading();
-        if (option['type'] === 'text') {
-            callback(text);
-        } else {
-            var objResult = _getAjaxResult(text);
-            if (objResult['result'] && option['cache']) {
-                var cache = getStorage(cacheKey);
-                if (cache && cache == text) {
-                    // 网络返回跟缓存一致
-                    return;
-                } else {
-                    setStorage(cacheKey, xhr.responseText);
-                }
-            }
-
-            _handleResult(callback, objResult);
-        }
-    });
-}
-
-function _getAjaxResult(text) {
-    var objResult = {};
-    var objError = {
-        result : 0,
-        msg : "系统繁忙,请稍后再试!"
-    };
-
-    try {
-        objResult = JSON.parse(text);
-        if (typeof objResult !== 'object' || objResult === null) {
-            objResult = objError;
-        }
-    } catch (ex) {
-        //非json的处理
-        objResult = objError;
-    }
-
-    return objResult;
-}
-
-function _loadAjaxCache(cacheKey, callback) {
-    var cache = getStorage(cacheKey); 
-    if (cache) {
-        var objResult = JSON.parse(cache);
-        objResult._fromCache = true;
-        _handleResult(callback, objResult);
-
-        return true;
-    } else {
-        return false;
-    }
-}
-
-function _handleResult(callback, objResult) {
-    //session_id失效,重新验证登录
-    if(!objResult.result && objResult.code === -5) {
-        openLogin();
-    } else {
-        callback && callback(objResult);
-    }
-}
-
-
-function getStorage(key) {
-    if(_global.wx) {
-        return wx.getStorageSync(key)
-    }else {
-        let str = localStorage.getItem(key)
-        let data
-        try{
-            data = JSON.parse(str)
-        } catch(e) {
-            data = str
-        }   
-        
-        return data
-    }
-}
-
-
-function setStorage(key,value) {
-    if(_global.wx) {
-        wx.setStorage({
-            key,
-            data: value
-        });
-    }else {
-        let str 
-        try {
-            str = JSON.stringify(value)
-        } catch (error) {
-            str = value
-        }
-        localStorage.setItem(key,str)
-    }
-}
-
-function encodePwd(random, pwd) {
-    var k1 = md5.sha1(random);
-    var k2 = md5.sha1(k1);
-
-    var v = md5.xor(md5.xor(pwd, k2), k1);
-    return md5.base64encode(v);
-}

+ 0 - 9
assets/Script/duowansdk/library.js.meta

@@ -1,9 +0,0 @@
-{
-  "ver": "1.0.5",
-  "uuid": "76e43976-a102-4d56-93ad-a3afaf25ab0a",
-  "isPlugin": false,
-  "loadPluginInWeb": true,
-  "loadPluginInNative": true,
-  "loadPluginInEditor": false,
-  "subMetas": {}
-}

+ 0 - 327
assets/Script/duowansdk/md5.js

@@ -1,327 +0,0 @@
-/* 
- * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message 
- * Digest Algorithm, as defined in RFC 1321. 
- * Version 1.1 Copyright (C) Paul Johnston 1999 - 2002. 
- * Code also contributed by Greg Holt 
- * See http://pajhome.org.uk/site/legal.html for details. 
- */
-
-/* 
- * Add integers, wrapping at 2^32. This uses 16-bit operations internally 
- * to work around bugs in some JS interpreters. 
- */
-function safe_add(x, y)
-{
-    var lsw = (x & 0xFFFF) + (y & 0xFFFF)
-    var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
-    return (msw << 16) | (lsw & 0xFFFF)
-}
-
-/* 
- * Bitwise rotate a 32-bit number to the left.  
- */
-function rol(num, cnt)
-{
-    return (num << cnt) | (num >>> (32 - cnt))
-}
-
-/* 
- * These functions implement the four basic operations the algorithm uses. 
- */
-function cmn(q, a, b, x, s, t)
-{
-    return safe_add(rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)
-}
-function ff(a, b, c, d, x, s, t)
-{
-    return cmn((b & c) | ((~b) & d), a, b, x, s, t)
-}
-function gg(a, b, c, d, x, s, t)
-{
-    return cmn((b & d) | (c & (~d)), a, b, x, s, t)
-}
-function hh(a, b, c, d, x, s, t)
-{
-    return cmn(b ^ c ^ d, a, b, x, s, t)
-}
-function ii(a, b, c, d, x, s, t)
-{
-    return cmn(c ^ (b | (~d)), a, b, x, s, t)
-}
-
-/* 
- * Calculate the MD5 of an array of little-endian words, producing an array 
- * of little-endian words. 
- */
-function coreMD5(x)
-{
-    var a =  1732584193
-    var b = -271733879
-    var c = -1732584194
-    var d =  271733878
-
-    for(var i = 0; i < x.length; i += 16)
-    {
-        var olda = a
-        var oldb = b
-        var oldc = c
-        var oldd = d
-
-        a = ff(a, b, c, d, x[i+ 0], 7 , -680876936)
-        d = ff(d, a, b, c, x[i+ 1], 12, -389564586)
-        c = ff(c, d, a, b, x[i+ 2], 17,  606105819)
-        b = ff(b, c, d, a, x[i+ 3], 22, -1044525330)
-        a = ff(a, b, c, d, x[i+ 4], 7 , -176418897)
-        d = ff(d, a, b, c, x[i+ 5], 12,  1200080426)
-        c = ff(c, d, a, b, x[i+ 6], 17, -1473231341)
-        b = ff(b, c, d, a, x[i+ 7], 22, -45705983)
-        a = ff(a, b, c, d, x[i+ 8], 7 ,  1770035416)
-        d = ff(d, a, b, c, x[i+ 9], 12, -1958414417)
-        c = ff(c, d, a, b, x[i+10], 17, -42063)
-        b = ff(b, c, d, a, x[i+11], 22, -1990404162)
-        a = ff(a, b, c, d, x[i+12], 7 ,  1804603682)
-        d = ff(d, a, b, c, x[i+13], 12, -40341101)
-        c = ff(c, d, a, b, x[i+14], 17, -1502002290)
-        b = ff(b, c, d, a, x[i+15], 22,  1236535329)
-
-        a = gg(a, b, c, d, x[i+ 1], 5 , -165796510)
-        d = gg(d, a, b, c, x[i+ 6], 9 , -1069501632)
-        c = gg(c, d, a, b, x[i+11], 14,  643717713)
-        b = gg(b, c, d, a, x[i+ 0], 20, -373897302)
-        a = gg(a, b, c, d, x[i+ 5], 5 , -701558691)
-        d = gg(d, a, b, c, x[i+10], 9 ,  38016083)
-        c = gg(c, d, a, b, x[i+15], 14, -660478335)
-        b = gg(b, c, d, a, x[i+ 4], 20, -405537848)
-        a = gg(a, b, c, d, x[i+ 9], 5 ,  568446438)
-        d = gg(d, a, b, c, x[i+14], 9 , -1019803690)
-        c = gg(c, d, a, b, x[i+ 3], 14, -187363961)
-        b = gg(b, c, d, a, x[i+ 8], 20,  1163531501)
-        a = gg(a, b, c, d, x[i+13], 5 , -1444681467)
-        d = gg(d, a, b, c, x[i+ 2], 9 , -51403784)
-        c = gg(c, d, a, b, x[i+ 7], 14,  1735328473)
-        b = gg(b, c, d, a, x[i+12], 20, -1926607734)
-
-        a = hh(a, b, c, d, x[i+ 5], 4 , -378558)
-        d = hh(d, a, b, c, x[i+ 8], 11, -2022574463)
-        c = hh(c, d, a, b, x[i+11], 16,  1839030562)
-        b = hh(b, c, d, a, x[i+14], 23, -35309556)
-        a = hh(a, b, c, d, x[i+ 1], 4 , -1530992060)
-        d = hh(d, a, b, c, x[i+ 4], 11,  1272893353)
-        c = hh(c, d, a, b, x[i+ 7], 16, -155497632)
-        b = hh(b, c, d, a, x[i+10], 23, -1094730640)
-        a = hh(a, b, c, d, x[i+13], 4 ,  681279174)
-        d = hh(d, a, b, c, x[i+ 0], 11, -358537222)
-        c = hh(c, d, a, b, x[i+ 3], 16, -722521979)
-        b = hh(b, c, d, a, x[i+ 6], 23,  76029189)
-        a = hh(a, b, c, d, x[i+ 9], 4 , -640364487)
-        d = hh(d, a, b, c, x[i+12], 11, -421815835)
-        c = hh(c, d, a, b, x[i+15], 16,  530742520)
-        b = hh(b, c, d, a, x[i+ 2], 23, -995338651)
-
-        a = ii(a, b, c, d, x[i+ 0], 6 , -198630844)
-        d = ii(d, a, b, c, x[i+ 7], 10,  1126891415)
-        c = ii(c, d, a, b, x[i+14], 15, -1416354905)
-        b = ii(b, c, d, a, x[i+ 5], 21, -57434055)
-        a = ii(a, b, c, d, x[i+12], 6 ,  1700485571)
-        d = ii(d, a, b, c, x[i+ 3], 10, -1894986606)
-        c = ii(c, d, a, b, x[i+10], 15, -1051523)
-        b = ii(b, c, d, a, x[i+ 1], 21, -2054922799)
-        a = ii(a, b, c, d, x[i+ 8], 6 ,  1873313359)
-        d = ii(d, a, b, c, x[i+15], 10, -30611744)
-        c = ii(c, d, a, b, x[i+ 6], 15, -1560198380)
-        b = ii(b, c, d, a, x[i+13], 21,  1309151649)
-        a = ii(a, b, c, d, x[i+ 4], 6 , -145523070)
-        d = ii(d, a, b, c, x[i+11], 10, -1120210379)
-        c = ii(c, d, a, b, x[i+ 2], 15,  718787259)
-        b = ii(b, c, d, a, x[i+ 9], 21, -343485551)
-
-        a = safe_add(a, olda)
-        b = safe_add(b, oldb)
-        c = safe_add(c, oldc)
-        d = safe_add(d, oldd)
-    }
-    return [a, b, c, d]
-}
-
-/* 
- * Convert an array of little-endian words to a hex string. 
- */
-function binl2hex(binarray)
-{
-    var hex_tab = "0123456789abcdef"
-    var str = ""
-    for(var i = 0; i < binarray.length * 4; i++)
-    {
-        str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
-            hex_tab.charAt((binarray[i>>2] >> ((i%4)*8)) & 0xF)
-    }
-    return str
-}
-
-/* 
- * Convert an array of little-endian words to a base64 encoded string. 
- */
-function binl2b64(binarray)
-{
-    var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
-    var str = ""
-    for(var i = 0; i < binarray.length * 32; i += 6)
-    {
-        str += tab.charAt(((binarray[i>>5] << (i%32)) & 0x3F) |
-            ((binarray[i>>5+1] >> (32-i%32)) & 0x3F))
-    }
-    return str
-}
-
-/* 
- * Convert an 8-bit character string to a sequence of 16-word blocks, stored 
- * as an array, and append appropriate padding for MD4/5 calculation. 
- * If any of the characters are >255, the high byte is silently ignored. 
- */
-function str2binl(str)
-{
-    var nblk = ((str.length + 8) >> 6) + 1 // number of 16-word blocks  
-    var blks = new Array(nblk * 16)
-    for(var i = 0; i < nblk * 16; i++) blks[i] = 0
-    for(var i = 0; i < str.length; i++)
-        blks[i>>2] |= (str.charCodeAt(i) & 0xFF) << ((i%4) * 8)
-    blks[i>>2] |= 0x80 << ((i%4) * 8)
-    blks[nblk*16-2] = str.length * 8
-    return blks
-}
-
-/* 
- * Convert a wide-character string to a sequence of 16-word blocks, stored as 
- * an array, and append appropriate padding for MD4/5 calculation. 
- */
-function strw2binl(str)
-{
-    var nblk = ((str.length + 4) >> 5) + 1 // number of 16-word blocks  
-    var blks = new Array(nblk * 16)
-    for(var i = 0; i < nblk * 16; i++) blks[i] = 0
-    for(var i = 0; i < str.length; i++)
-        blks[i>>1] |= str.charCodeAt(i) << ((i%2) * 16)
-    blks[i>>1] |= 0x80 << ((i%2) * 16)
-    blks[nblk*16-2] = str.length * 16
-    return blks
-}
-
-
-
-function sha1(e) {
-	function t(e, t) {
-		var n = e << t | e >>> 32 - t;
-		return n
-	}
-
-	function n(e) {
-		var t = "",
-			n, r, i;
-		for (n = 0; n <= 6; n += 2) r = e >>> n * 4 + 4 & 15, i = e >>> n * 4 & 15, t += r.toString(16) + i.toString(16);
-		return t
-	}
-
-	function r(e) {
-		var t = "",
-			n, r;
-		for (n = 7; n >= 0; n--) r = e >>> n * 4 & 15, t += r.toString(16);
-		return t
-	}
-
-	function i(e) {
-		e = e.replace(/\r\n/g, "\n");
-		var t = "";
-		for (var n = 0; n < e.length; n++) {
-			var r = e.charCodeAt(n);
-			r < 128 ? t += String.fromCharCode(r) : r > 127 && r < 2048 ? (t += String.fromCharCode(r >> 6 | 192), t += String.fromCharCode(r & 63 | 128)) : (t += String.fromCharCode(r >> 12 | 224), t += String.fromCharCode(r >> 6 & 63 | 128), t += String.fromCharCode(r & 63 | 128))
-		}
-		return t
-	}
-	var s, o, u, a = new Array(80),
-		f = 1732584193,
-		l = 4023233417,
-		c = 2562383102,
-		h = 271733878,
-		p = 3285377520,
-		d, v, m, g, y, b;
-	e = i(e);
-	var w = e.length,
-		E = new Array;
-	for (o = 0; o < w - 3; o += 4) u = e.charCodeAt(o) << 24 | e.charCodeAt(o + 1) << 16 | e.charCodeAt(o + 2) << 8 | e.charCodeAt(o + 3), E.push(u);
-	switch (w % 4) {
-		case 0:
-			o = 2147483648;
-			break;
-		case 1:
-			o = e.charCodeAt(w - 1) << 24 | 8388608;
-			break;
-		case 2:
-			o = e.charCodeAt(w - 2) << 24 | e.charCodeAt(w - 1) << 16 | 32768;
-			break;
-		case 3:
-			o = e.charCodeAt(w - 3) << 24 | e.charCodeAt(w - 2) << 16 | e.charCodeAt(w - 1) << 8 | 128
-	}
-	E.push(o);
-	while (E.length % 16 != 14) E.push(0);
-	E.push(w >>> 29), E.push(w << 3 & 4294967295);
-	for (s = 0; s < E.length; s += 16) {
-		for (o = 0; o < 16; o++) a[o] = E[s + o];
-		for (o = 16; o <= 79; o++) a[o] = t(a[o - 3] ^ a[o - 8] ^ a[o - 14] ^ a[o - 16], 1);
-		d = f, v = l, m = c, g = h, y = p;
-		for (o = 0; o <= 19; o++) b = t(d, 5) + (v & m | ~v & g) + y + a[o] + 1518500249 & 4294967295, y = g, g = m, m = t(v, 30), v = d, d = b;
-		for (o = 20; o <= 39; o++) b = t(d, 5) + (v ^ m ^ g) + y + a[o] + 1859775393 & 4294967295, y = g, g = m, m = t(v, 30), v = d, d = b;
-		for (o = 40; o <= 59; o++) b = t(d, 5) + (v & m | v & g | m & g) + y + a[o] + 2400959708 & 4294967295, y = g, g = m, m = t(v, 30), v = d, d = b;
-		for (o = 60; o <= 79; o++) b = t(d, 5) + (v ^ m ^ g) + y + a[o] + 3395469782 & 4294967295, y = g, g = m, m = t(v, 30), v = d, d = b;
-		f = f + d & 4294967295, l = l + v & 4294967295, c = c + m & 4294967295, h = h + g & 4294967295, p = p + y & 4294967295
-	}
-	var b = r(f) + r(l) + r(c) + r(h) + r(p);
-	return b.toLowerCase()
-}
-
-function xor(e, t) {
-	var n = "";
-	for (var r = 0, i = e.length, s = t.length; r < i; r++) {
-		if (r >= s) break;
-		n += String.fromCharCode(e.charCodeAt(r) ^ t.charCodeAt(r))
-	}
-	return n
-}
-
-function base64encode(e) {
-	var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
-		n, r, i, s, o, u;
-	i = e.length, r = 0, n = "";
-	while (r < i) {
-		s = e.charCodeAt(r++) & 255;
-		if (r == i) {
-			n += t.charAt(s >> 2), n += t.charAt((s & 3) << 4), n += "==";
-			break
-		}
-		o = e.charCodeAt(r++);
-		if (r == i) {
-			n += t.charAt(s >> 2), n += t.charAt((s & 3) << 4 | (o & 240) >> 4), n += t.charAt((o & 15) << 2), n += "=";
-			break
-		}
-		u = e.charCodeAt(r++), n += t.charAt(s >> 2), n += t.charAt((s & 3) << 4 | (o & 240) >> 4), n += t.charAt((o & 15) << 2 | (u & 192) >> 6), n += t.charAt(u & 63)
-	}
-	return n
-}
-
-/* 
- * External interface 
- */
-function hexMD5 (str) { return binl2hex(coreMD5( str2binl(str))) }
-function hexMD5w(str) { return binl2hex(coreMD5(strw2binl(str))) }
-function b64MD5 (str) { return binl2b64(coreMD5( str2binl(str))) }
-function b64MD5w(str) { return binl2b64(coreMD5(strw2binl(str))) }
-/* Backward compatibility */
-function calcMD5(str) { return binl2hex(coreMD5( str2binl(str))) }
-module.exports = {
-  hexMD5,
-  hexMD5w,
-  b64MD5,
-  b64MD5w,
-  sha1,
-  xor,
-  base64encode
-} 

+ 0 - 9
assets/Script/duowansdk/md5.js.meta

@@ -1,9 +0,0 @@
-{
-  "ver": "1.0.5",
-  "uuid": "4112fd70-3103-4084-88a5-5054b408f6c0",
-  "isPlugin": false,
-  "loadPluginInWeb": true,
-  "loadPluginInNative": true,
-  "loadPluginInEditor": false,
-  "subMetas": {}
-}

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
build-templates/qqplay/libs/qqPlayCore.js


Неке датотеке нису приказане због велике количине промена