Skip to content

Commit

Permalink
Merge branch 'dev' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
zhetengbiji committed Feb 4, 2021
2 parents 6aab3e1 + 5d1465d commit b8e9442
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/uni-app-plus/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,20 @@ function createSubpackageApp (vm) {
app[name] = appOptions[name];
}
});
if (isFn(appOptions.onShow) && wx.onAppShow) {
wx.onAppShow((...args) => {
appOptions.onShow.apply(app, args);
});
}
if (isFn(appOptions.onHide) && wx.onAppHide) {
wx.onAppHide((...args) => {
appOptions.onHide.apply(app, args);
});
}
if (isFn(appOptions.onLaunch)) {
const args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
appOptions.onLaunch.call(app, args);
}
return vm
}

Expand Down
14 changes: 14 additions & 0 deletions packages/uni-mp-alipay/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2610,6 +2610,20 @@ function createSubpackageApp (vm) {
app[name] = appOptions[name];
}
});
if (isFn(appOptions.onShow) && my.onAppShow) {
my.onAppShow((...args) => {
appOptions.onShow.apply(app, args);
});
}
if (isFn(appOptions.onHide) && my.onAppHide) {
my.onAppHide((...args) => {
appOptions.onHide.apply(app, args);
});
}
if (isFn(appOptions.onLaunch)) {
const args = my.getLaunchOptionsSync && my.getLaunchOptionsSync();
appOptions.onLaunch.call(app, args);
}
return vm
}

Expand Down
14 changes: 14 additions & 0 deletions packages/uni-mp-baidu/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2096,6 +2096,20 @@ function createSubpackageApp (vm) {
app[name] = appOptions[name];
}
});
if (isFn(appOptions.onShow) && swan.onAppShow) {
swan.onAppShow((...args) => {
appOptions.onShow.apply(app, args);
});
}
if (isFn(appOptions.onHide) && swan.onAppHide) {
swan.onAppHide((...args) => {
appOptions.onHide.apply(app, args);
});
}
if (isFn(appOptions.onLaunch)) {
const args = swan.getLaunchOptionsSync && swan.getLaunchOptionsSync();
appOptions.onLaunch.call(app, args);
}
return vm
}

Expand Down
14 changes: 14 additions & 0 deletions packages/uni-mp-kuaishou/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1754,6 +1754,20 @@ function createSubpackageApp (vm) {
app[name] = appOptions[name];
}
});
if (isFn(appOptions.onShow) && ks.onAppShow) {
ks.onAppShow((...args) => {
appOptions.onShow.apply(app, args);
});
}
if (isFn(appOptions.onHide) && ks.onAppHide) {
ks.onAppHide((...args) => {
appOptions.onHide.apply(app, args);
});
}
if (isFn(appOptions.onLaunch)) {
const args = ks.getLaunchOptionsSync && ks.getLaunchOptionsSync();
appOptions.onLaunch.call(app, args);
}
return vm
}

Expand Down
14 changes: 14 additions & 0 deletions packages/uni-mp-qq/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1927,6 +1927,20 @@ function createSubpackageApp (vm) {
app[name] = appOptions[name];
}
});
if (isFn(appOptions.onShow) && wx.onAppShow) {
wx.onAppShow((...args) => {
appOptions.onShow.apply(app, args);
});
}
if (isFn(appOptions.onHide) && wx.onAppHide) {
wx.onAppHide((...args) => {
appOptions.onHide.apply(app, args);
});
}
if (isFn(appOptions.onLaunch)) {
const args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
appOptions.onLaunch.call(app, args);
}
return vm
}

Expand Down
14 changes: 14 additions & 0 deletions packages/uni-mp-toutiao/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2135,6 +2135,20 @@ function createSubpackageApp (vm) {
app[name] = appOptions[name];
}
});
if (isFn(appOptions.onShow) && tt.onAppShow) {
tt.onAppShow((...args) => {
appOptions.onShow.apply(app, args);
});
}
if (isFn(appOptions.onHide) && tt.onAppHide) {
tt.onAppHide((...args) => {
appOptions.onHide.apply(app, args);
});
}
if (isFn(appOptions.onLaunch)) {
const args = tt.getLaunchOptionsSync && tt.getLaunchOptionsSync();
appOptions.onLaunch.call(app, args);
}
return vm
}

Expand Down
14 changes: 14 additions & 0 deletions packages/uni-mp-weixin/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1679,6 +1679,20 @@ function createSubpackageApp (vm) {
app[name] = appOptions[name];
}
});
if (isFn(appOptions.onShow) && wx.onAppShow) {
wx.onAppShow((...args) => {
appOptions.onShow.apply(app, args);
});
}
if (isFn(appOptions.onHide) && wx.onAppHide) {
wx.onAppHide((...args) => {
appOptions.onHide.apply(app, args);
});
}
if (isFn(appOptions.onLaunch)) {
const args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
appOptions.onLaunch.call(app, args);
}
return vm
}

Expand Down
14 changes: 14 additions & 0 deletions packages/uni-quickapp-webview/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,20 @@ function createSubpackageApp (vm) {
app[name] = appOptions[name];
}
});
if (isFn(appOptions.onShow) && qa.onAppShow) {
qa.onAppShow((...args) => {
appOptions.onShow.apply(app, args);
});
}
if (isFn(appOptions.onHide) && qa.onAppHide) {
qa.onAppHide((...args) => {
appOptions.onHide.apply(app, args);
});
}
if (isFn(appOptions.onLaunch)) {
const args = qa.getLaunchOptionsSync && qa.getLaunchOptionsSync();
appOptions.onLaunch.call(app, args);
}
return vm
}

Expand Down
15 changes: 15 additions & 0 deletions src/core/runtime/wrapper/create-subpackage-app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'uni-platform/runtime/index'

import {
isFn,
hasOwn
} from 'uni-shared'

Expand All @@ -24,5 +25,19 @@ export default function createSubpackageApp (vm) {
app[name] = appOptions[name]
}
})
if (isFn(appOptions.onShow) && __GLOBAL__.onAppShow) {
__GLOBAL__.onAppShow((...args) => {
appOptions.onShow.apply(app, args)
})
}
if (isFn(appOptions.onHide) && __GLOBAL__.onAppHide) {
__GLOBAL__.onAppHide((...args) => {
appOptions.onHide.apply(app, args)
})
}
if (isFn(appOptions.onLaunch)) {
const args = __GLOBAL__.getLaunchOptionsSync && __GLOBAL__.getLaunchOptionsSync()
appOptions.onLaunch.call(app, args)
}
return vm
}

0 comments on commit b8e9442

Please sign in to comment.