1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| initHalfWhiteListByByPrefetchData(fetchedData) { console.log('预拉取数据', JSON.parse(fetchedData)); const jsonData = JSON.parse(fetchedData); const { Data = [] } = jsonData.Response; this.globalData.halfWhiteAppIds.MP_CERTIFICATION_TRUST_APPIDS = Data?.filter(item => item?.AuthType === 1)?.map(j => j?.SpAppId); this.globalData.halfWhiteAppIds.loaded = true; EventBus.emit('halfWhitelistLoaded'); }, onLaunch() { wx.onBackgroundFetchData((res) => { this.initHalfWhiteListByByPrefetchData(res?.fetchedData); }); wx.getBackgroundFetchData({ fetchType: "pre", success(res) { this.initHalfWhiteListByByPrefetchData(res?.fetchedData); }, }); }
|