提交 9a4a8e7c 编写于 作者: Q qiang

chore: build

上级 5b3156ee
...@@ -461,6 +461,7 @@ var en = { ...@@ -461,6 +461,7 @@ var en = {
"uni.scanCode.flash.on": "Tap to turn light on", "uni.scanCode.flash.on": "Tap to turn light on",
"uni.scanCode.flash.off": "Tap to turn light off", "uni.scanCode.flash.off": "Tap to turn light off",
"uni.startSoterAuthentication.authContent": "Fingerprint recognition", "uni.startSoterAuthentication.authContent": "Fingerprint recognition",
"uni.startSoterAuthentication.waitingContent": "Unrecognizable",
"uni.picker.done": "Done", "uni.picker.done": "Done",
"uni.picker.cancel": "Cancel", "uni.picker.cancel": "Cancel",
"uni.video.danmu": "Danmu", "uni.video.danmu": "Danmu",
...@@ -497,6 +498,7 @@ var es = { ...@@ -497,6 +498,7 @@ var es = {
"uni.scanCode.flash.on": "Toque para encender la luz", "uni.scanCode.flash.on": "Toque para encender la luz",
"uni.scanCode.flash.off": "Toque para apagar la luz", "uni.scanCode.flash.off": "Toque para apagar la luz",
"uni.startSoterAuthentication.authContent": "Reconocimiento de huellas dactilares", "uni.startSoterAuthentication.authContent": "Reconocimiento de huellas dactilares",
"uni.startSoterAuthentication.waitingContent": "Irreconocible",
"uni.picker.done": "OK", "uni.picker.done": "OK",
"uni.picker.cancel": "Cancelar", "uni.picker.cancel": "Cancelar",
"uni.video.danmu": "Danmu", "uni.video.danmu": "Danmu",
...@@ -533,6 +535,7 @@ var fr = { ...@@ -533,6 +535,7 @@ var fr = {
"uni.scanCode.flash.on": "Appuyez pour activer l'éclairage", "uni.scanCode.flash.on": "Appuyez pour activer l'éclairage",
"uni.scanCode.flash.off": "Appuyez pour désactiver l'éclairage", "uni.scanCode.flash.off": "Appuyez pour désactiver l'éclairage",
"uni.startSoterAuthentication.authContent": "Reconnaissance de l'empreinte digitale", "uni.startSoterAuthentication.authContent": "Reconnaissance de l'empreinte digitale",
"uni.startSoterAuthentication.waitingContent": "Méconnaissable",
"uni.picker.done": "OK", "uni.picker.done": "OK",
"uni.picker.cancel": "Annuler", "uni.picker.cancel": "Annuler",
"uni.video.danmu": "Danmu", "uni.video.danmu": "Danmu",
...@@ -569,6 +572,7 @@ var zhHans = { ...@@ -569,6 +572,7 @@ var zhHans = {
"uni.scanCode.flash.on": "轻触照亮", "uni.scanCode.flash.on": "轻触照亮",
"uni.scanCode.flash.off": "轻触关闭", "uni.scanCode.flash.off": "轻触关闭",
"uni.startSoterAuthentication.authContent": "指纹识别中...", "uni.startSoterAuthentication.authContent": "指纹识别中...",
"uni.startSoterAuthentication.waitingContent": "无法识别",
"uni.picker.done": "完成", "uni.picker.done": "完成",
"uni.picker.cancel": "取消", "uni.picker.cancel": "取消",
"uni.video.danmu": "弹幕", "uni.video.danmu": "弹幕",
...@@ -605,6 +609,7 @@ var zhHant = { ...@@ -605,6 +609,7 @@ var zhHant = {
"uni.scanCode.flash.on": "輕觸照亮", "uni.scanCode.flash.on": "輕觸照亮",
"uni.scanCode.flash.off": "輕觸關閉", "uni.scanCode.flash.off": "輕觸關閉",
"uni.startSoterAuthentication.authContent": "指紋識別中...", "uni.startSoterAuthentication.authContent": "指紋識別中...",
"uni.startSoterAuthentication.waitingContent": "無法識別",
"uni.picker.done": "完成", "uni.picker.done": "完成",
"uni.picker.cancel": "取消", "uni.picker.cancel": "取消",
"uni.video.danmu": "彈幕", "uni.video.danmu": "彈幕",
...@@ -1857,15 +1862,10 @@ class EventChannel { ...@@ -1857,15 +1862,10 @@ class EventChannel {
const eventChannels = {}; const eventChannels = {};
const eventChannelStack = [];
function getEventChannel (id) { function getEventChannel (id) {
if (id) {
const eventChannel = eventChannels[id]; const eventChannel = eventChannels[id];
delete eventChannels[id]; delete eventChannels[id];
return eventChannel return eventChannel
}
return eventChannelStack.shift()
} }
const hooks = [ const hooks = [
...@@ -1923,7 +1923,10 @@ function parseBaseApp (vm, { ...@@ -1923,7 +1923,10 @@ function parseBaseApp (vm, {
delete this.$options.mpType; delete this.$options.mpType;
delete this.$options.mpInstance; delete this.$options.mpInstance;
if (this.mpType === 'page' && typeof getApp === 'function') { // hack vue-i18n if (
( this.mpType === 'page') &&
typeof getApp === 'function'
) { // hack vue-i18n
const app = getApp(); const app = getApp();
if (app.$vm && app.$vm.$i18n) { if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n; this._i18n = app.$vm.$i18n;
......
...@@ -687,8 +687,6 @@ class EventChannel { ...@@ -687,8 +687,6 @@ class EventChannel {
const eventChannels = {}; const eventChannels = {};
const eventChannelStack = [];
let id = 0; let id = 0;
function initEventChannel (events, cache = true) { function initEventChannel (events, cache = true) {
...@@ -696,31 +694,30 @@ function initEventChannel (events, cache = true) { ...@@ -696,31 +694,30 @@ function initEventChannel (events, cache = true) {
const eventChannel = new EventChannel(id, events); const eventChannel = new EventChannel(id, events);
if (cache) { if (cache) {
eventChannels[id] = eventChannel; eventChannels[id] = eventChannel;
eventChannelStack.push(eventChannel);
} }
return eventChannel return eventChannel
} }
function getEventChannel (id) { function getEventChannel (id) {
if (id) {
const eventChannel = eventChannels[id]; const eventChannel = eventChannels[id];
delete eventChannels[id]; delete eventChannels[id];
return eventChannel return eventChannel
}
return eventChannelStack.shift()
} }
var navigateTo = { function navigateTo () {
let eventChannel;
return {
args (fromArgs, toArgs) { args (fromArgs, toArgs) {
const id = initEventChannel(fromArgs.events).id; eventChannel = initEventChannel(fromArgs.events);
if (fromArgs.url) { if (fromArgs.url) {
fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + id; fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + eventChannel.id;
} }
}, },
returnValue (fromRes, toRes) { returnValue (fromRes, toRes) {
fromRes.eventChannel = getEventChannel(); fromRes.eventChannel = eventChannel;
} }
}; }
}
function findExistsPageIndex (url) { function findExistsPageIndex (url) {
const pages = getCurrentPages(); const pages = getCurrentPages();
...@@ -1010,7 +1007,7 @@ function _handleNetworkInfo (result) { ...@@ -1010,7 +1007,7 @@ function _handleNetworkInfo (result) {
} }
const protocols = { // 需要做转换的 API 列表 const protocols = { // 需要做转换的 API 列表
navigateTo, navigateTo: navigateTo(),
redirectTo, redirectTo,
returnValue (methodName, res = {}) { // 通用 returnValue 解析 returnValue (methodName, res = {}) { // 通用 returnValue 解析
if (res.error || res.errorMessage) { if (res.error || res.errorMessage) {
...@@ -2878,6 +2875,9 @@ const hooks = [ ...@@ -2878,6 +2875,9 @@ const hooks = [
function initEventChannel$1 () { function initEventChannel$1 () {
Vue.prototype.getOpenerEventChannel = function () { Vue.prototype.getOpenerEventChannel = function () {
{
if (my.canIUse('getOpenerEventChannel')) { return this.$scope.getOpenerEventChannel() }
}
if (!this.__eventChannel__) { if (!this.__eventChannel__) {
this.__eventChannel__ = new EventChannel(); this.__eventChannel__ = new EventChannel();
} }
...@@ -2996,7 +2996,10 @@ function parseBaseApp (vm, { ...@@ -2996,7 +2996,10 @@ function parseBaseApp (vm, {
delete this.$options.mpType; delete this.$options.mpType;
delete this.$options.mpInstance; delete this.$options.mpInstance;
if (this.mpType === 'page' && typeof getApp === 'function') { // hack vue-i18n if (
( this.mpType === 'page') &&
typeof getApp === 'function'
) { // hack vue-i18n
const app = getApp(); const app = getApp();
if (app.$vm && app.$vm.$i18n) { if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n; this._i18n = app.$vm.$i18n;
...@@ -3483,7 +3486,7 @@ if (typeof Proxy !== 'undefined' && "mp-alipay" !== 'app-plus') { ...@@ -3483,7 +3486,7 @@ if (typeof Proxy !== 'undefined' && "mp-alipay" !== 'app-plus') {
uni[name] = promisify(name, todoApis[name]); uni[name] = promisify(name, todoApis[name]);
}); });
Object.keys(extraApi).forEach(name => { Object.keys(extraApi).forEach(name => {
uni[name] = promisify(name, todoApis[name]); uni[name] = promisify(name, extraApi[name]);
}); });
} }
......
...@@ -687,8 +687,6 @@ class EventChannel { ...@@ -687,8 +687,6 @@ class EventChannel {
const eventChannels = {}; const eventChannels = {};
const eventChannelStack = [];
let id = 0; let id = 0;
function initEventChannel (events, cache = true) { function initEventChannel (events, cache = true) {
...@@ -696,31 +694,30 @@ function initEventChannel (events, cache = true) { ...@@ -696,31 +694,30 @@ function initEventChannel (events, cache = true) {
const eventChannel = new EventChannel(id, events); const eventChannel = new EventChannel(id, events);
if (cache) { if (cache) {
eventChannels[id] = eventChannel; eventChannels[id] = eventChannel;
eventChannelStack.push(eventChannel);
} }
return eventChannel return eventChannel
} }
function getEventChannel (id) { function getEventChannel (id) {
if (id) {
const eventChannel = eventChannels[id]; const eventChannel = eventChannels[id];
delete eventChannels[id]; delete eventChannels[id];
return eventChannel return eventChannel
}
return eventChannelStack.shift()
} }
var navigateTo = { function navigateTo () {
let eventChannel;
return {
args (fromArgs, toArgs) { args (fromArgs, toArgs) {
const id = initEventChannel(fromArgs.events).id; eventChannel = initEventChannel(fromArgs.events);
if (fromArgs.url) { if (fromArgs.url) {
fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + id; fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + eventChannel.id;
} }
}, },
returnValue (fromRes, toRes) { returnValue (fromRes, toRes) {
fromRes.eventChannel = getEventChannel(); fromRes.eventChannel = eventChannel;
} }
}; }
}
function findExistsPageIndex (url) { function findExistsPageIndex (url) {
const pages = getCurrentPages(); const pages = getCurrentPages();
...@@ -1022,7 +1019,7 @@ const protocols = { ...@@ -1022,7 +1019,7 @@ const protocols = {
method: false method: false
} }
}, },
navigateTo, navigateTo: navigateTo(),
redirectTo, redirectTo,
previewImage, previewImage,
getSystemInfo, getSystemInfo,
...@@ -2412,7 +2409,10 @@ function parseBaseApp (vm, { ...@@ -2412,7 +2409,10 @@ function parseBaseApp (vm, {
delete this.$options.mpType; delete this.$options.mpType;
delete this.$options.mpInstance; delete this.$options.mpInstance;
if (this.mpType === 'page' && typeof getApp === 'function') { // hack vue-i18n if (
( this.mpType === 'page') &&
typeof getApp === 'function'
) { // hack vue-i18n
const app = getApp(); const app = getApp();
if (app.$vm && app.$vm.$i18n) { if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n; this._i18n = app.$vm.$i18n;
...@@ -2945,7 +2945,7 @@ if (typeof Proxy !== 'undefined' && "mp-baidu" !== 'app-plus') { ...@@ -2945,7 +2945,7 @@ if (typeof Proxy !== 'undefined' && "mp-baidu" !== 'app-plus') {
uni[name] = promisify(name, todoApis[name]); uni[name] = promisify(name, todoApis[name]);
}); });
Object.keys(extraApi).forEach(name => { Object.keys(extraApi).forEach(name => {
uni[name] = promisify(name, todoApis[name]); uni[name] = promisify(name, extraApi[name]);
}); });
} }
......
...@@ -1940,15 +1940,10 @@ class EventChannel { ...@@ -1940,15 +1940,10 @@ class EventChannel {
const eventChannels = {}; const eventChannels = {};
const eventChannelStack = [];
function getEventChannel (id) { function getEventChannel (id) {
if (id) {
const eventChannel = eventChannels[id]; const eventChannel = eventChannels[id];
delete eventChannels[id]; delete eventChannels[id];
return eventChannel return eventChannel
}
return eventChannelStack.shift()
} }
const hooks = [ const hooks = [
...@@ -2080,7 +2075,10 @@ function parseBaseApp (vm, { ...@@ -2080,7 +2075,10 @@ function parseBaseApp (vm, {
delete this.$options.mpType; delete this.$options.mpType;
delete this.$options.mpInstance; delete this.$options.mpInstance;
if (this.mpType === 'page' && typeof getApp === 'function') { // hack vue-i18n if (
( this.mpType === 'page') &&
typeof getApp === 'function'
) { // hack vue-i18n
const app = getApp(); const app = getApp();
if (app.$vm && app.$vm.$i18n) { if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n; this._i18n = app.$vm.$i18n;
...@@ -2465,7 +2463,7 @@ if (typeof Proxy !== 'undefined' && "mp-jd" !== 'app-plus') { ...@@ -2465,7 +2463,7 @@ if (typeof Proxy !== 'undefined' && "mp-jd" !== 'app-plus') {
uni[name] = promisify(name, todoApis[name]); uni[name] = promisify(name, todoApis[name]);
}); });
Object.keys(extraApi).forEach(name => { Object.keys(extraApi).forEach(name => {
uni[name] = promisify(name, todoApis[name]); uni[name] = promisify(name, extraApi[name]);
}); });
} }
......
...@@ -687,8 +687,6 @@ class EventChannel { ...@@ -687,8 +687,6 @@ class EventChannel {
const eventChannels = {}; const eventChannels = {};
const eventChannelStack = [];
let id = 0; let id = 0;
function initEventChannel (events, cache = true) { function initEventChannel (events, cache = true) {
...@@ -696,31 +694,30 @@ function initEventChannel (events, cache = true) { ...@@ -696,31 +694,30 @@ function initEventChannel (events, cache = true) {
const eventChannel = new EventChannel(id, events); const eventChannel = new EventChannel(id, events);
if (cache) { if (cache) {
eventChannels[id] = eventChannel; eventChannels[id] = eventChannel;
eventChannelStack.push(eventChannel);
} }
return eventChannel return eventChannel
} }
function getEventChannel (id) { function getEventChannel (id) {
if (id) {
const eventChannel = eventChannels[id]; const eventChannel = eventChannels[id];
delete eventChannels[id]; delete eventChannels[id];
return eventChannel return eventChannel
}
return eventChannelStack.shift()
} }
var navigateTo = { function navigateTo () {
let eventChannel;
return {
args (fromArgs, toArgs) { args (fromArgs, toArgs) {
const id = initEventChannel(fromArgs.events).id; eventChannel = initEventChannel(fromArgs.events);
if (fromArgs.url) { if (fromArgs.url) {
fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + id; fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + eventChannel.id;
} }
}, },
returnValue (fromRes, toRes) { returnValue (fromRes, toRes) {
fromRes.eventChannel = getEventChannel(); fromRes.eventChannel = eventChannel;
} }
}; }
}
function findExistsPageIndex (url) { function findExistsPageIndex (url) {
const pages = getCurrentPages(); const pages = getCurrentPages();
...@@ -952,7 +949,7 @@ var getUserProfile = { ...@@ -952,7 +949,7 @@ var getUserProfile = {
}; };
const protocols = { const protocols = {
navigateTo, navigateTo: navigateTo(),
redirectTo, redirectTo,
previewImage, previewImage,
getSystemInfo, getSystemInfo,
...@@ -2176,7 +2173,10 @@ function parseBaseApp (vm, { ...@@ -2176,7 +2173,10 @@ function parseBaseApp (vm, {
delete this.$options.mpType; delete this.$options.mpType;
delete this.$options.mpInstance; delete this.$options.mpInstance;
if (this.mpType === 'page' && typeof getApp === 'function') { // hack vue-i18n if (
( this.mpType === 'page') &&
typeof getApp === 'function'
) { // hack vue-i18n
const app = getApp(); const app = getApp();
if (app.$vm && app.$vm.$i18n) { if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n; this._i18n = app.$vm.$i18n;
...@@ -2606,7 +2606,7 @@ if (typeof Proxy !== 'undefined' && "mp-kuaishou" !== 'app-plus') { ...@@ -2606,7 +2606,7 @@ if (typeof Proxy !== 'undefined' && "mp-kuaishou" !== 'app-plus') {
uni[name] = promisify(name, todoApis[name]); uni[name] = promisify(name, todoApis[name]);
}); });
Object.keys(extraApi).forEach(name => { Object.keys(extraApi).forEach(name => {
uni[name] = promisify(name, todoApis[name]); uni[name] = promisify(name, extraApi[name]);
}); });
} }
......
...@@ -687,8 +687,6 @@ class EventChannel { ...@@ -687,8 +687,6 @@ class EventChannel {
const eventChannels = {}; const eventChannels = {};
const eventChannelStack = [];
let id = 0; let id = 0;
function initEventChannel (events, cache = true) { function initEventChannel (events, cache = true) {
...@@ -696,31 +694,30 @@ function initEventChannel (events, cache = true) { ...@@ -696,31 +694,30 @@ function initEventChannel (events, cache = true) {
const eventChannel = new EventChannel(id, events); const eventChannel = new EventChannel(id, events);
if (cache) { if (cache) {
eventChannels[id] = eventChannel; eventChannels[id] = eventChannel;
eventChannelStack.push(eventChannel);
} }
return eventChannel return eventChannel
} }
function getEventChannel (id) { function getEventChannel (id) {
if (id) {
const eventChannel = eventChannels[id]; const eventChannel = eventChannels[id];
delete eventChannels[id]; delete eventChannels[id];
return eventChannel return eventChannel
}
return eventChannelStack.shift()
} }
var navigateTo = { function navigateTo () {
let eventChannel;
return {
args (fromArgs, toArgs) { args (fromArgs, toArgs) {
const id = initEventChannel(fromArgs.events).id; eventChannel = initEventChannel(fromArgs.events);
if (fromArgs.url) { if (fromArgs.url) {
fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + id; fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + eventChannel.id;
} }
}, },
returnValue (fromRes, toRes) { returnValue (fromRes, toRes) {
fromRes.eventChannel = getEventChannel(); fromRes.eventChannel = eventChannel;
} }
}; }
}
function findExistsPageIndex (url) { function findExistsPageIndex (url) {
const pages = getCurrentPages(); const pages = getCurrentPages();
...@@ -953,7 +950,7 @@ var getUserProfile = { ...@@ -953,7 +950,7 @@ var getUserProfile = {
// 需要做转换的 API 列表 // 需要做转换的 API 列表
const protocols = { const protocols = {
navigateTo, navigateTo: navigateTo(),
redirectTo, redirectTo,
previewImage, previewImage,
getSystemInfo, getSystemInfo,
...@@ -2214,7 +2211,11 @@ function parseBaseApp (vm, { ...@@ -2214,7 +2211,11 @@ function parseBaseApp (vm, {
delete this.$options.mpType; delete this.$options.mpType;
delete this.$options.mpInstance; delete this.$options.mpInstance;
if (this.mpType === 'page' && typeof getApp === 'function') { // hack vue-i18n if (
( this.mpType !== 'app'
) &&
typeof getApp === 'function'
) { // hack vue-i18n
const app = getApp(); const app = getApp();
if (app.$vm && app.$vm.$i18n) { if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n; this._i18n = app.$vm.$i18n;
...@@ -2716,7 +2717,7 @@ if (typeof Proxy !== 'undefined' && "mp-lark" !== 'app-plus') { ...@@ -2716,7 +2717,7 @@ if (typeof Proxy !== 'undefined' && "mp-lark" !== 'app-plus') {
uni[name] = promisify(name, todoApis[name]); uni[name] = promisify(name, todoApis[name]);
}); });
Object.keys(extraApi).forEach(name => { Object.keys(extraApi).forEach(name => {
uni[name] = promisify(name, todoApis[name]); uni[name] = promisify(name, extraApi[name]);
}); });
} }
......
...@@ -687,8 +687,6 @@ class EventChannel { ...@@ -687,8 +687,6 @@ class EventChannel {
const eventChannels = {}; const eventChannels = {};
const eventChannelStack = [];
let id = 0; let id = 0;
function initEventChannel (events, cache = true) { function initEventChannel (events, cache = true) {
...@@ -696,31 +694,30 @@ function initEventChannel (events, cache = true) { ...@@ -696,31 +694,30 @@ function initEventChannel (events, cache = true) {
const eventChannel = new EventChannel(id, events); const eventChannel = new EventChannel(id, events);
if (cache) { if (cache) {
eventChannels[id] = eventChannel; eventChannels[id] = eventChannel;
eventChannelStack.push(eventChannel);
} }
return eventChannel return eventChannel
} }
function getEventChannel (id) { function getEventChannel (id) {
if (id) {
const eventChannel = eventChannels[id]; const eventChannel = eventChannels[id];
delete eventChannels[id]; delete eventChannels[id];
return eventChannel return eventChannel
}
return eventChannelStack.shift()
} }
var navigateTo = { function navigateTo () {
let eventChannel;
return {
args (fromArgs, toArgs) { args (fromArgs, toArgs) {
const id = initEventChannel(fromArgs.events).id; eventChannel = initEventChannel(fromArgs.events);
if (fromArgs.url) { if (fromArgs.url) {
fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + id; fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + eventChannel.id;
} }
}, },
returnValue (fromRes, toRes) { returnValue (fromRes, toRes) {
fromRes.eventChannel = getEventChannel(); fromRes.eventChannel = eventChannel;
} }
}; }
}
function findExistsPageIndex (url) { function findExistsPageIndex (url) {
const pages = getCurrentPages(); const pages = getCurrentPages();
...@@ -952,7 +949,7 @@ var getUserProfile = { ...@@ -952,7 +949,7 @@ var getUserProfile = {
}; };
const protocols = { const protocols = {
navigateTo, navigateTo: navigateTo(),
redirectTo, redirectTo,
previewImage, previewImage,
getSystemInfo, getSystemInfo,
...@@ -2334,7 +2331,10 @@ function parseBaseApp (vm, { ...@@ -2334,7 +2331,10 @@ function parseBaseApp (vm, {
delete this.$options.mpType; delete this.$options.mpType;
delete this.$options.mpInstance; delete this.$options.mpInstance;
if (this.mpType === 'page' && typeof getApp === 'function') { // hack vue-i18n if (
( this.mpType === 'page') &&
typeof getApp === 'function'
) { // hack vue-i18n
const app = getApp(); const app = getApp();
if (app.$vm && app.$vm.$i18n) { if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n; this._i18n = app.$vm.$i18n;
...@@ -2725,7 +2725,7 @@ if (typeof Proxy !== 'undefined' && "mp-qq" !== 'app-plus') { ...@@ -2725,7 +2725,7 @@ if (typeof Proxy !== 'undefined' && "mp-qq" !== 'app-plus') {
uni[name] = promisify(name, todoApis[name]); uni[name] = promisify(name, todoApis[name]);
}); });
Object.keys(extraApi).forEach(name => { Object.keys(extraApi).forEach(name => {
uni[name] = promisify(name, todoApis[name]); uni[name] = promisify(name, extraApi[name]);
}); });
} }
......
...@@ -2406,7 +2406,11 @@ function parseBaseApp (vm, { ...@@ -2406,7 +2406,11 @@ function parseBaseApp (vm, {
delete this.$options.mpType; delete this.$options.mpType;
delete this.$options.mpInstance; delete this.$options.mpInstance;
if (this.mpType === 'page' && typeof getApp === 'function') { // hack vue-i18n if (
( this.mpType !== 'app'
) &&
typeof getApp === 'function'
) { // hack vue-i18n
const app = getApp(); const app = getApp();
if (app.$vm && app.$vm.$i18n) { if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n; this._i18n = app.$vm.$i18n;
......
...@@ -2073,7 +2073,10 @@ function parseBaseApp (vm, { ...@@ -2073,7 +2073,10 @@ function parseBaseApp (vm, {
delete this.$options.mpType; delete this.$options.mpType;
delete this.$options.mpInstance; delete this.$options.mpInstance;
if (this.mpType === 'page' && typeof getApp === 'function') { // hack vue-i18n if (
( this.mpType === 'page') &&
typeof getApp === 'function'
) { // hack vue-i18n
const app = getApp(); const app = getApp();
if (app.$vm && app.$vm.$i18n) { if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n; this._i18n = app.$vm.$i18n;
......
...@@ -687,8 +687,6 @@ class EventChannel { ...@@ -687,8 +687,6 @@ class EventChannel {
const eventChannels = {}; const eventChannels = {};
const eventChannelStack = [];
let id = 0; let id = 0;
function initEventChannel (events, cache = true) { function initEventChannel (events, cache = true) {
...@@ -696,31 +694,30 @@ function initEventChannel (events, cache = true) { ...@@ -696,31 +694,30 @@ function initEventChannel (events, cache = true) {
const eventChannel = new EventChannel(id, events); const eventChannel = new EventChannel(id, events);
if (cache) { if (cache) {
eventChannels[id] = eventChannel; eventChannels[id] = eventChannel;
eventChannelStack.push(eventChannel);
} }
return eventChannel return eventChannel
} }
function getEventChannel (id) { function getEventChannel (id) {
if (id) {
const eventChannel = eventChannels[id]; const eventChannel = eventChannels[id];
delete eventChannels[id]; delete eventChannels[id];
return eventChannel return eventChannel
}
return eventChannelStack.shift()
} }
var navigateTo = { function navigateTo () {
let eventChannel;
return {
args (fromArgs, toArgs) { args (fromArgs, toArgs) {
const id = initEventChannel(fromArgs.events).id; eventChannel = initEventChannel(fromArgs.events);
if (fromArgs.url) { if (fromArgs.url) {
fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + id; fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + eventChannel.id;
} }
}, },
returnValue (fromRes, toRes) { returnValue (fromRes, toRes) {
fromRes.eventChannel = getEventChannel(); fromRes.eventChannel = eventChannel;
} }
}; }
}
function findExistsPageIndex (url) { function findExistsPageIndex (url) {
const pages = getCurrentPages(); const pages = getCurrentPages();
...@@ -944,7 +941,7 @@ var getSystemInfo = { ...@@ -944,7 +941,7 @@ var getSystemInfo = {
}; };
const protocols = { const protocols = {
navigateTo, navigateTo: navigateTo(),
redirectTo, redirectTo,
previewImage, previewImage,
getSystemInfo, getSystemInfo,
...@@ -2084,7 +2081,10 @@ function parseBaseApp (vm, { ...@@ -2084,7 +2081,10 @@ function parseBaseApp (vm, {
delete this.$options.mpType; delete this.$options.mpType;
delete this.$options.mpInstance; delete this.$options.mpInstance;
if (this.mpType === 'page' && typeof getApp === 'function') { // hack vue-i18n if (
( this.mpType === 'page') &&
typeof getApp === 'function'
) { // hack vue-i18n
const app = getApp(); const app = getApp();
if (app.$vm && app.$vm.$i18n) { if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n; this._i18n = app.$vm.$i18n;
...@@ -2593,7 +2593,7 @@ if (typeof Proxy !== 'undefined' && "quickapp-webview" !== 'app-plus') { ...@@ -2593,7 +2593,7 @@ if (typeof Proxy !== 'undefined' && "quickapp-webview" !== 'app-plus') {
uni[name] = promisify(name, todoApis[name]); uni[name] = promisify(name, todoApis[name]);
}); });
Object.keys(extraApi).forEach(name => { Object.keys(extraApi).forEach(name => {
uni[name] = promisify(name, todoApis[name]); uni[name] = promisify(name, extraApi[name]);
}); });
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册