1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
| import {
| parseQuery
| } from 'uni-shared'
|
| import {
| showWebview,
| closeWebview
| } from './util'
|
| import {
| setStatusBarStyle,
| invoke
| } from '../../bridge'
|
| import {
| registerPage
| } from '../../framework/page'
|
| import tabBar from '../../../../app-plus/service/framework/tab-bar'
|
| import {
| navigate
| } from '../../framework/navigator'
|
| function _reLaunch ({
| url,
| path,
| query
| }, callbackId) {
| const pages = getCurrentPages(true).slice(0)
|
| const routeOptions = __uniRoutes.find(route => route.path === path)
|
| if (routeOptions.meta.isTabBar) {
| tabBar.switchTab(path.slice(1))
| }
|
| showWebview(
| registerPage({
| url,
| path,
| query,
| openType: 'reLaunch'
| }),
| 'none',
| 0,
| () => {
| pages.forEach(page => {
| page.$remove()
| closeWebview(page.$getAppWebview(), 'none')
| })
| invoke(callbackId, {
| errMsg: 'reLaunch:ok'
| })
| }
| )
|
| setStatusBarStyle()
| }
|
| export function reLaunch ({
| url
| }, callbackId) {
| const urls = url.split('?')
| const path = urls[0]
| const query = parseQuery(urls[1] || '')
| navigate(path, function () {
| _reLaunch({
| url,
| path,
| query
| }, callbackId)
| })
| }
|
|