loadSubpackage加载失败
过审的时候总是卡在加载分包这里,本地用iphone8和其它各种android机型测了都没有任何问题[代码]require([代码][代码]'./weapp-adapter.js'[代码][代码]);[代码][代码]require([代码][代码]'./platform.js'[代码][代码]);[代码][代码]require([代码][代码]'./manifest.js'[代码][代码]);[代码][代码]require([代码][代码]'./egret.wxgame.js'[代码][代码]);[代码] [代码]// 启动微信小游戏本地缓存,如果开发者不需要此功能,只需注释即可[代码][代码]require([代码][代码]'./library/image.js'[代码][代码]);[代码][代码]require([代码][代码]'./library/text.js'[代码][代码]);[代码] [代码]window.JSZip = require([代码][代码]'./js/jszip.js'[代码][代码]);[代码] [代码]let runOptions = {[代码][代码] [代码][代码]//以下为自动修改,请勿修改[代码][代码] [代码][代码]//The following is automatically modified, please do not modify[代码][代码] [代码][代码]//----auto option start----[代码][代码] [代码][代码]entryClassName: [代码][代码]"Main"[代码][代码],[代码][代码] [代码][代码]orientation: [代码][代码]"auto"[代码][代码],[代码][代码] [代码][代码]frameRate: 30,[代码][代码] [代码][代码]scaleMode: [代码][代码]"fixedWidth"[代码][代码],[代码][代码] [代码][代码]contentWidth: 720,[代码][代码] [代码][代码]contentHeight: 1280,[代码][代码] [代码][代码]showFPS: [代码][代码]false[代码][代码],[代码][代码] [代码][代码]fpsStyles: [代码][代码]"x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9"[代码][代码],[代码][代码] [代码][代码]showLog: [代码][代码]false[代码][代码],[代码][代码] [代码][代码]maxTouches: 2,[代码][代码] [代码][代码]//----auto option end----[代码][代码] [代码][代码]renderMode: [代码][代码]'webgl'[代码][代码],[代码][代码] [代码][代码]audioType: 0,[代码][代码] [代码][代码]calculateCanvasScaleFactor: [代码][代码]function[代码] [代码](context) {[代码][代码] [代码][代码]var[代码] [代码]backingStore = context.backingStorePixelRatio ||[代码][代码] [代码][代码]context.webkitBackingStorePixelRatio ||[代码][代码] [代码][代码]context.mozBackingStorePixelRatio ||[代码][代码] [代码][代码]context.msBackingStorePixelRatio ||[代码][代码] [代码][代码]context.oBackingStorePixelRatio ||[代码][代码] [代码][代码]context.backingStorePixelRatio || 1;[代码][代码] [代码][代码]return[代码] [代码](window.devicePixelRatio || 1) / backingStore;[代码][代码] [代码][代码]}[代码][代码]};[代码][代码]const runEgret = [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]egret.runEgret(runOptions);[代码][代码]}[代码][代码]if[代码] [代码](wx.loadSubpackage) {[代码][代码] [代码][代码]require([代码][代码]"./EgretSubPackageLoading.js"[代码][代码]);[代码][代码] [代码][代码]runOptions.entryClassName = [代码][代码]"EgretSubPackageLoading"[代码][代码];[代码][代码] [代码][代码]runEgret();[代码] [代码] [代码] [代码] [代码][代码]var[代码] [代码]first=[代码][代码]true[代码][代码];[代码][代码] [代码][代码]var[代码] [代码]retry = [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]if[代码][代码](first){[代码][代码] [代码][代码]EgretSubPackageLoading.instance.setTxt([代码][代码]"加载分包中..."[代码][代码]);[代码][代码] [代码][代码]}[代码][代码]else[代码][代码]{[代码][代码] [代码][代码]EgretSubPackageLoading.instance.setTxt([代码][代码]"再次加载分包中..."[代码][代码]);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]first=[代码][代码]false[代码][代码];[代码][代码] [代码] [代码] [代码][代码]let task = wx.loadSubpackage({[代码][代码] [代码][代码]// 开发者根据自身需求更改[代码][代码] [代码][代码]name: [代码][代码]"ceshistage1"[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码] [代码] [代码][代码]console.log([代码][代码]'加载成功'[代码][代码]);[代码][代码] [代码][代码]EgretSubPackageLoading.instance.onSuccess();[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]// 分包加载失败通过 fail 回调[代码][代码] [代码][代码]console.log([代码][代码]'加载失败'[代码][代码]);[代码][代码] [代码][代码]retry();[代码][代码] [代码][代码]},[代码][代码] [代码][代码]complete: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]// 分包加载失败通过 fail 回调[代码][代码] [代码][代码]console.log([代码][代码]'加载完成'[代码][代码]);[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]});[代码][代码] [代码] [代码] [代码] [代码] [代码][代码]task.onProgressUpdate(res => {[代码][代码] [代码][代码]console.log([代码][代码]'加ing'[代码][代码])[代码][代码] [代码][代码]EgretSubPackageLoading.instance.setProgress(res);[代码][代码] [代码][代码]})[代码][代码] [代码] [代码] [代码][代码]}[代码][代码] [代码][代码]retry();[代码][代码] [代码] [代码] [代码] [代码] [代码] [代码]}[代码][代码]else[代码] [代码]{[代码][代码] [代码] [代码] [代码][代码]console.log([代码][代码]'直接游戏'[代码][代码])[代码][代码] [代码][代码]require([代码][代码]"./stage1/game.js"[代码][代码]);[代码][代码] [代码][代码]runEgret();[代码][代码]}[代码][代码]// require("egret.min.js")[代码] [代码]{[代码][代码] [代码][代码]"deviceOrientation"[代码][代码]: [代码][代码]"portrait"[代码][代码],[代码][代码] [代码][代码]"networkTimeout"[代码][代码]: {[代码][代码] [代码][代码]"request"[代码][代码]: 5000,[代码][代码] [代码][代码]"connectSocket"[代码][代码]: 5000,[代码][代码] [代码][代码]"uploadFile"[代码][代码]: 5000,[代码][代码] [代码][代码]"downloadFile"[代码][代码]: 5000[代码][代码] [代码][代码]},[代码][代码] [代码][代码]"subpackages"[代码][代码]: [[代码][代码] [代码][代码]{[代码][代码] [代码][代码]"name"[代码][代码]:[代码][代码]"ceshistage1"[代码][代码],[代码][代码] [代码][代码]"root"[代码][代码]: [代码][代码]"stage1/"[代码][代码] [代码] [代码] [代码][代码]}[代码][代码] [代码] [代码] [代码] [代码] [代码][代码]][代码][代码]}[代码] ,[图片]