提交 cf148611 编写于 作者: fxy060608's avatar fxy060608

feat(v3): hot reload

上级 78c79a17
...@@ -670,7 +670,6 @@ var serviceContext = (function () { ...@@ -670,7 +670,6 @@ var serviceContext = (function () {
}]; }];
var require_context_module_0_0 = /*#__PURE__*/Object.freeze({ var require_context_module_0_0 = /*#__PURE__*/Object.freeze({
__proto__: null,
base64ToArrayBuffer: base64ToArrayBuffer, base64ToArrayBuffer: base64ToArrayBuffer,
arrayBufferToBase64: arrayBufferToBase64 arrayBufferToBase64: arrayBufferToBase64
}); });
...@@ -682,7 +681,6 @@ var serviceContext = (function () { ...@@ -682,7 +681,6 @@ var serviceContext = (function () {
}]; }];
var require_context_module_0_1 = /*#__PURE__*/Object.freeze({ var require_context_module_0_1 = /*#__PURE__*/Object.freeze({
__proto__: null,
canIUse: canIUse canIUse: canIUse
}); });
...@@ -713,7 +711,6 @@ var serviceContext = (function () { ...@@ -713,7 +711,6 @@ var serviceContext = (function () {
}]; }];
var require_context_module_0_2 = /*#__PURE__*/Object.freeze({ var require_context_module_0_2 = /*#__PURE__*/Object.freeze({
__proto__: null,
$on: $on, $on: $on,
$once: $once, $once: $once,
$off: $off, $off: $off,
...@@ -728,7 +725,6 @@ var serviceContext = (function () { ...@@ -728,7 +725,6 @@ var serviceContext = (function () {
const removeInterceptor$1 = addInterceptor$1; const removeInterceptor$1 = addInterceptor$1;
var require_context_module_0_3 = /*#__PURE__*/Object.freeze({ var require_context_module_0_3 = /*#__PURE__*/Object.freeze({
__proto__: null,
addInterceptor: addInterceptor$1, addInterceptor: addInterceptor$1,
removeInterceptor: removeInterceptor$1 removeInterceptor: removeInterceptor$1
}); });
...@@ -740,7 +736,6 @@ var serviceContext = (function () { ...@@ -740,7 +736,6 @@ var serviceContext = (function () {
}]; }];
var require_context_module_0_4 = /*#__PURE__*/Object.freeze({ var require_context_module_0_4 = /*#__PURE__*/Object.freeze({
__proto__: null,
upx2px: upx2px upx2px: upx2px
}); });
...@@ -877,7 +872,6 @@ var serviceContext = (function () { ...@@ -877,7 +872,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_5 = /*#__PURE__*/Object.freeze({ var require_context_module_0_5 = /*#__PURE__*/Object.freeze({
__proto__: null,
canvasGetImageData: canvasGetImageData, canvasGetImageData: canvasGetImageData,
canvasPutImageData: canvasPutImageData, canvasPutImageData: canvasPutImageData,
canvasToTempFilePath: canvasToTempFilePath, canvasToTempFilePath: canvasToTempFilePath,
...@@ -903,7 +897,6 @@ var serviceContext = (function () { ...@@ -903,7 +897,6 @@ var serviceContext = (function () {
}]; }];
var require_context_module_0_6 = /*#__PURE__*/Object.freeze({ var require_context_module_0_6 = /*#__PURE__*/Object.freeze({
__proto__: null,
createAudioContext: createAudioContext, createAudioContext: createAudioContext,
createVideoContext: createVideoContext, createVideoContext: createVideoContext,
createMapContext: createMapContext, createMapContext: createMapContext,
...@@ -923,7 +916,6 @@ var serviceContext = (function () { ...@@ -923,7 +916,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_7 = /*#__PURE__*/Object.freeze({ var require_context_module_0_7 = /*#__PURE__*/Object.freeze({
__proto__: null,
makePhoneCall: makePhoneCall makePhoneCall: makePhoneCall
}); });
...@@ -938,7 +930,6 @@ var serviceContext = (function () { ...@@ -938,7 +930,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_8 = /*#__PURE__*/Object.freeze({ var require_context_module_0_8 = /*#__PURE__*/Object.freeze({
__proto__: null,
setClipboardData: setClipboardData setClipboardData: setClipboardData
}); });
...@@ -953,7 +944,6 @@ var serviceContext = (function () { ...@@ -953,7 +944,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_9 = /*#__PURE__*/Object.freeze({ var require_context_module_0_9 = /*#__PURE__*/Object.freeze({
__proto__: null,
openDocument: openDocument openDocument: openDocument
}); });
...@@ -964,7 +954,6 @@ var serviceContext = (function () { ...@@ -964,7 +954,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_10 = /*#__PURE__*/Object.freeze({ var require_context_module_0_10 = /*#__PURE__*/Object.freeze({
__proto__: null,
chooseLocation: chooseLocation chooseLocation: chooseLocation
}); });
...@@ -988,7 +977,6 @@ var serviceContext = (function () { ...@@ -988,7 +977,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_11 = /*#__PURE__*/Object.freeze({ var require_context_module_0_11 = /*#__PURE__*/Object.freeze({
__proto__: null,
getLocation: getLocation getLocation: getLocation
}); });
...@@ -1018,7 +1006,6 @@ var serviceContext = (function () { ...@@ -1018,7 +1006,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_12 = /*#__PURE__*/Object.freeze({ var require_context_module_0_12 = /*#__PURE__*/Object.freeze({
__proto__: null,
openLocation: openLocation openLocation: openLocation
}); });
...@@ -1080,7 +1067,6 @@ var serviceContext = (function () { ...@@ -1080,7 +1067,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_13 = /*#__PURE__*/Object.freeze({ var require_context_module_0_13 = /*#__PURE__*/Object.freeze({
__proto__: null,
chooseImage: chooseImage chooseImage: chooseImage
}); });
...@@ -1108,7 +1094,6 @@ var serviceContext = (function () { ...@@ -1108,7 +1094,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_14 = /*#__PURE__*/Object.freeze({ var require_context_module_0_14 = /*#__PURE__*/Object.freeze({
__proto__: null,
chooseVideo: chooseVideo chooseVideo: chooseVideo
}); });
...@@ -1201,7 +1186,6 @@ var serviceContext = (function () { ...@@ -1201,7 +1186,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_15 = /*#__PURE__*/Object.freeze({ var require_context_module_0_15 = /*#__PURE__*/Object.freeze({
__proto__: null,
getImageInfo: getImageInfo getImageInfo: getImageInfo
}); });
...@@ -1237,7 +1221,6 @@ var serviceContext = (function () { ...@@ -1237,7 +1221,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_16 = /*#__PURE__*/Object.freeze({ var require_context_module_0_16 = /*#__PURE__*/Object.freeze({
__proto__: null,
previewImage: previewImage previewImage: previewImage
}); });
...@@ -1255,7 +1238,6 @@ var serviceContext = (function () { ...@@ -1255,7 +1238,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_17 = /*#__PURE__*/Object.freeze({ var require_context_module_0_17 = /*#__PURE__*/Object.freeze({
__proto__: null,
downloadFile: downloadFile downloadFile: downloadFile
}); });
...@@ -1358,7 +1340,6 @@ var serviceContext = (function () { ...@@ -1358,7 +1340,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_18 = /*#__PURE__*/Object.freeze({ var require_context_module_0_18 = /*#__PURE__*/Object.freeze({
__proto__: null,
request: request request: request
}); });
...@@ -1412,7 +1393,6 @@ var serviceContext = (function () { ...@@ -1412,7 +1393,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_19 = /*#__PURE__*/Object.freeze({ var require_context_module_0_19 = /*#__PURE__*/Object.freeze({
__proto__: null,
connectSocket: connectSocket, connectSocket: connectSocket,
sendSocketMessage: sendSocketMessage, sendSocketMessage: sendSocketMessage,
closeSocket: closeSocket closeSocket: closeSocket
...@@ -1449,7 +1429,6 @@ var serviceContext = (function () { ...@@ -1449,7 +1429,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_20 = /*#__PURE__*/Object.freeze({ var require_context_module_0_20 = /*#__PURE__*/Object.freeze({
__proto__: null,
uploadFile: uploadFile uploadFile: uploadFile
}); });
...@@ -1474,7 +1453,6 @@ var serviceContext = (function () { ...@@ -1474,7 +1453,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_21 = /*#__PURE__*/Object.freeze({ var require_context_module_0_21 = /*#__PURE__*/Object.freeze({
__proto__: null,
getProvider: getProvider getProvider: getProvider
}); });
...@@ -1623,7 +1601,6 @@ var serviceContext = (function () { ...@@ -1623,7 +1601,6 @@ var serviceContext = (function () {
)); ));
var require_context_module_0_22 = /*#__PURE__*/Object.freeze({ var require_context_module_0_22 = /*#__PURE__*/Object.freeze({
__proto__: null,
redirectTo: redirectTo, redirectTo: redirectTo,
reLaunch: reLaunch, reLaunch: reLaunch,
navigateTo: navigateTo, navigateTo: navigateTo,
...@@ -1667,7 +1644,6 @@ var serviceContext = (function () { ...@@ -1667,7 +1644,6 @@ var serviceContext = (function () {
const removeStorageSync = getStorageSync; const removeStorageSync = getStorageSync;
var require_context_module_0_23 = /*#__PURE__*/Object.freeze({ var require_context_module_0_23 = /*#__PURE__*/Object.freeze({
__proto__: null,
getStorage: getStorage, getStorage: getStorage,
getStorageSync: getStorageSync, getStorageSync: getStorageSync,
setStorage: setStorage, setStorage: setStorage,
...@@ -1704,7 +1680,6 @@ var serviceContext = (function () { ...@@ -1704,7 +1680,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_24 = /*#__PURE__*/Object.freeze({ var require_context_module_0_24 = /*#__PURE__*/Object.freeze({
__proto__: null,
loadFontFace: loadFontFace loadFontFace: loadFontFace
}); });
...@@ -1747,7 +1722,6 @@ var serviceContext = (function () { ...@@ -1747,7 +1722,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_25 = /*#__PURE__*/Object.freeze({ var require_context_module_0_25 = /*#__PURE__*/Object.freeze({
__proto__: null,
setNavigationBarColor: setNavigationBarColor, setNavigationBarColor: setNavigationBarColor,
setNavigationBarTitle: setNavigationBarTitle setNavigationBarTitle: setNavigationBarTitle
}); });
...@@ -1767,7 +1741,6 @@ var serviceContext = (function () { ...@@ -1767,7 +1741,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_26 = /*#__PURE__*/Object.freeze({ var require_context_module_0_26 = /*#__PURE__*/Object.freeze({
__proto__: null,
pageScrollTo: pageScrollTo pageScrollTo: pageScrollTo
}); });
...@@ -1885,7 +1858,6 @@ var serviceContext = (function () { ...@@ -1885,7 +1858,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_27 = /*#__PURE__*/Object.freeze({ var require_context_module_0_27 = /*#__PURE__*/Object.freeze({
__proto__: null,
showModal: showModal, showModal: showModal,
showToast: showToast, showToast: showToast,
showLoading: showLoading, showLoading: showLoading,
...@@ -1970,7 +1942,6 @@ var serviceContext = (function () { ...@@ -1970,7 +1942,6 @@ var serviceContext = (function () {
}; };
var require_context_module_0_28 = /*#__PURE__*/Object.freeze({ var require_context_module_0_28 = /*#__PURE__*/Object.freeze({
__proto__: null,
setTabBarItem: setTabBarItem, setTabBarItem: setTabBarItem,
setTabBarStyle: setTabBarStyle, setTabBarStyle: setTabBarStyle,
hideTabBar: hideTabBar, hideTabBar: hideTabBar,
...@@ -2539,7 +2510,6 @@ var serviceContext = (function () { ...@@ -2539,7 +2510,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_0 = /*#__PURE__*/Object.freeze({ var require_context_module_1_0 = /*#__PURE__*/Object.freeze({
__proto__: null,
base64ToArrayBuffer: base64ToArrayBuffer$1, base64ToArrayBuffer: base64ToArrayBuffer$1,
arrayBufferToBase64: arrayBufferToBase64$1 arrayBufferToBase64: arrayBufferToBase64$1
}); });
...@@ -2556,7 +2526,6 @@ var serviceContext = (function () { ...@@ -2556,7 +2526,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_1 = /*#__PURE__*/Object.freeze({ var require_context_module_1_1 = /*#__PURE__*/Object.freeze({
__proto__: null,
canIUse: canIUse$1 canIUse: canIUse$1
}); });
...@@ -2565,7 +2534,6 @@ var serviceContext = (function () { ...@@ -2565,7 +2534,6 @@ var serviceContext = (function () {
}; };
var require_context_module_1_2 = /*#__PURE__*/Object.freeze({ var require_context_module_1_2 = /*#__PURE__*/Object.freeze({
__proto__: null,
interceptors: interceptors, interceptors: interceptors,
addInterceptor: addInterceptor, addInterceptor: addInterceptor,
removeInterceptor: removeInterceptor removeInterceptor: removeInterceptor
...@@ -2614,7 +2582,6 @@ var serviceContext = (function () { ...@@ -2614,7 +2582,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_3 = /*#__PURE__*/Object.freeze({ var require_context_module_1_3 = /*#__PURE__*/Object.freeze({
__proto__: null,
upx2px: upx2px$1 upx2px: upx2px$1
}); });
...@@ -2641,7 +2608,6 @@ var serviceContext = (function () { ...@@ -2641,7 +2608,6 @@ var serviceContext = (function () {
} }
var eventApis = /*#__PURE__*/Object.freeze({ var eventApis = /*#__PURE__*/Object.freeze({
__proto__: null,
$on: $on$1, $on: $on$1,
$off: $off$1, $off: $off$1,
$once: $once$1, $once: $once$1,
...@@ -4310,7 +4276,6 @@ var serviceContext = (function () { ...@@ -4310,7 +4276,6 @@ var serviceContext = (function () {
} }
var webview = /*#__PURE__*/Object.freeze({ var webview = /*#__PURE__*/Object.freeze({
__proto__: null,
SCAN_ID: SCAN_ID, SCAN_ID: SCAN_ID,
SCAN_PATH: SCAN_PATH, SCAN_PATH: SCAN_PATH,
scanCode: scanCode scanCode: scanCode
...@@ -4522,7 +4487,6 @@ var serviceContext = (function () { ...@@ -4522,7 +4487,6 @@ var serviceContext = (function () {
} }
var weex$1 = /*#__PURE__*/Object.freeze({ var weex$1 = /*#__PURE__*/Object.freeze({
__proto__: null,
scanCode: scanCode$1 scanCode: scanCode$1
}); });
...@@ -5288,7 +5252,6 @@ var serviceContext = (function () { ...@@ -5288,7 +5252,6 @@ var serviceContext = (function () {
} }
var webview$1 = /*#__PURE__*/Object.freeze({ var webview$1 = /*#__PURE__*/Object.freeze({
__proto__: null,
chooseLocation: chooseLocation$1 chooseLocation: chooseLocation$1
}); });
...@@ -5352,7 +5315,6 @@ var serviceContext = (function () { ...@@ -5352,7 +5315,6 @@ var serviceContext = (function () {
} }
var weex$2 = /*#__PURE__*/Object.freeze({ var weex$2 = /*#__PURE__*/Object.freeze({
__proto__: null,
chooseLocation: chooseLocation$2 chooseLocation: chooseLocation$2
}); });
...@@ -5473,7 +5435,6 @@ var serviceContext = (function () { ...@@ -5473,7 +5435,6 @@ var serviceContext = (function () {
} }
var webview$2 = /*#__PURE__*/Object.freeze({ var webview$2 = /*#__PURE__*/Object.freeze({
__proto__: null,
openLocation: openLocation$1 openLocation: openLocation$1
}); });
...@@ -5493,7 +5454,6 @@ var serviceContext = (function () { ...@@ -5493,7 +5454,6 @@ var serviceContext = (function () {
} }
var weex$3 = /*#__PURE__*/Object.freeze({ var weex$3 = /*#__PURE__*/Object.freeze({
__proto__: null,
openLocation: openLocation$2 openLocation: openLocation$2
}); });
...@@ -6592,7 +6552,7 @@ var serviceContext = (function () { ...@@ -6592,7 +6552,7 @@ var serviceContext = (function () {
code: err.code, code: err.code,
errMsg: 'login:fail:' + err.message errMsg: 'login:fail:' + err.message
}); });
}, { scope: 'email' }); }, provider === 'apple' ? { scope: 'email' } : {});
} }
// 先注销再登录 // 先注销再登录
// apple登录logout之后无法重新触发获取email,fullname // apple登录logout之后无法重新触发获取email,fullname
...@@ -7178,15 +7138,15 @@ var serviceContext = (function () { ...@@ -7178,15 +7138,15 @@ var serviceContext = (function () {
uni.hideToast(); // 后退时,关闭 toast,loading uni.hideToast(); // 后退时,关闭 toast,loading
// 当前页面是 condition 进入 if (currentPage.$page.meta.isQuit) {
if (currentPage.$page.id === 1 && __uniConfig.realEntryPagePath) { quit();
} else if (currentPage.$page.id === 1 && __uniConfig.realEntryPagePath) {
// condition
uni.reLaunch({ uni.reLaunch({
url: '/' + __uniConfig.realEntryPagePath url: '/' + __uniConfig.realEntryPagePath
}); });
} else { } else {
currentPage.$page.meta.isQuit back(delta, animationType, animationDuration);
? quit()
: back(delta, animationType, animationDuration);
} }
return { return {
errMsg: 'navigateBack:ok' errMsg: 'navigateBack:ok'
...@@ -7365,7 +7325,11 @@ var serviceContext = (function () { ...@@ -7365,7 +7325,11 @@ var serviceContext = (function () {
const titleNView = parseTitleNView(routeOptions); const titleNView = parseTitleNView(routeOptions);
if (titleNView) { if (titleNView) {
if (id === 1 && __uniConfig.realEntryPagePath) { if (
id === 1 &&
__uniConfig.realEntryPagePath &&
!routeOptions.meta.isQuit // 可能是tabBar
) {
titleNView.autoBackButton = true; titleNView.autoBackButton = true;
} }
webviewStyle.titleNView = titleNView; webviewStyle.titleNView = titleNView;
...@@ -7882,8 +7846,13 @@ var serviceContext = (function () { ...@@ -7882,8 +7846,13 @@ var serviceContext = (function () {
}) { }) {
const routeOptions = JSON.parse(JSON.stringify(__uniRoutes.find(route => route.path === path))); const routeOptions = JSON.parse(JSON.stringify(__uniRoutes.find(route => route.path === path)));
if (openType === 'reLaunch' || pages.length === 0) { if (
// pages.length===0 表示首页触发 redirectTo openType === 'reLaunch' ||
(
openType === 'redirect' &&
pages.length === 0
) // 首页 redirect
) {
routeOptions.meta.isQuit = true; routeOptions.meta.isQuit = true;
} else if (!routeOptions.meta.isTabBar) { } else if (!routeOptions.meta.isTabBar) {
routeOptions.meta.isQuit = false; routeOptions.meta.isQuit = false;
...@@ -8709,7 +8678,6 @@ var serviceContext = (function () { ...@@ -8709,7 +8678,6 @@ var serviceContext = (function () {
var api = /*#__PURE__*/Object.freeze({ var api = /*#__PURE__*/Object.freeze({
__proto__: null,
startPullDownRefresh: startPullDownRefresh, startPullDownRefresh: startPullDownRefresh,
stopPullDownRefresh: stopPullDownRefresh, stopPullDownRefresh: stopPullDownRefresh,
$on: $on$1, $on: $on$1,
...@@ -9032,7 +9000,6 @@ var serviceContext = (function () { ...@@ -9032,7 +9000,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_4 = /*#__PURE__*/Object.freeze({ var require_context_module_1_4 = /*#__PURE__*/Object.freeze({
__proto__: null,
createInnerAudioContext: createInnerAudioContext createInnerAudioContext: createInnerAudioContext
}); });
...@@ -9177,7 +9144,6 @@ var serviceContext = (function () { ...@@ -9177,7 +9144,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_5 = /*#__PURE__*/Object.freeze({ var require_context_module_1_5 = /*#__PURE__*/Object.freeze({
__proto__: null,
getBackgroundAudioManager: getBackgroundAudioManager getBackgroundAudioManager: getBackgroundAudioManager
}); });
...@@ -10036,7 +10002,6 @@ var serviceContext = (function () { ...@@ -10036,7 +10002,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_6 = /*#__PURE__*/Object.freeze({ var require_context_module_1_6 = /*#__PURE__*/Object.freeze({
__proto__: null,
CanvasContext: CanvasContext, CanvasContext: CanvasContext,
createCanvasContext: createCanvasContext$1, createCanvasContext: createCanvasContext$1,
canvasGetImageData: canvasGetImageData$1, canvasGetImageData: canvasGetImageData$1,
...@@ -10087,7 +10052,6 @@ var serviceContext = (function () { ...@@ -10087,7 +10052,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_7 = /*#__PURE__*/Object.freeze({ var require_context_module_1_7 = /*#__PURE__*/Object.freeze({
__proto__: null,
MapContext: MapContext, MapContext: MapContext,
createMapContext: createMapContext$1 createMapContext: createMapContext$1
}); });
...@@ -10151,7 +10115,6 @@ var serviceContext = (function () { ...@@ -10151,7 +10115,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_8 = /*#__PURE__*/Object.freeze({ var require_context_module_1_8 = /*#__PURE__*/Object.freeze({
__proto__: null,
VideoContext: VideoContext, VideoContext: VideoContext,
createVideoContext: createVideoContext$1 createVideoContext: createVideoContext$1
}); });
...@@ -10198,7 +10161,6 @@ var serviceContext = (function () { ...@@ -10198,7 +10161,6 @@ var serviceContext = (function () {
}); });
var require_context_module_1_9 = /*#__PURE__*/Object.freeze({ var require_context_module_1_9 = /*#__PURE__*/Object.freeze({
__proto__: null,
EditorContext: EditorContext EditorContext: EditorContext
}); });
...@@ -10243,7 +10205,6 @@ var serviceContext = (function () { ...@@ -10243,7 +10205,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_10 = /*#__PURE__*/Object.freeze({ var require_context_module_1_10 = /*#__PURE__*/Object.freeze({
__proto__: null,
onAccelerometerChange: onAccelerometerChange, onAccelerometerChange: onAccelerometerChange,
startAccelerometer: startAccelerometer, startAccelerometer: startAccelerometer,
stopAccelerometer: stopAccelerometer stopAccelerometer: stopAccelerometer
...@@ -10267,7 +10228,6 @@ var serviceContext = (function () { ...@@ -10267,7 +10228,6 @@ var serviceContext = (function () {
const onBLECharacteristicValueChange$1 = on('onBLECharacteristicValueChange'); const onBLECharacteristicValueChange$1 = on('onBLECharacteristicValueChange');
var require_context_module_1_11 = /*#__PURE__*/Object.freeze({ var require_context_module_1_11 = /*#__PURE__*/Object.freeze({
__proto__: null,
onBluetoothDeviceFound: onBluetoothDeviceFound$1, onBluetoothDeviceFound: onBluetoothDeviceFound$1,
onBluetoothAdapterStateChange: onBluetoothAdapterStateChange$1, onBluetoothAdapterStateChange: onBluetoothAdapterStateChange$1,
onBLEConnectionStateChange: onBLEConnectionStateChange$1, onBLEConnectionStateChange: onBLEConnectionStateChange$1,
...@@ -10315,7 +10275,6 @@ var serviceContext = (function () { ...@@ -10315,7 +10275,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_12 = /*#__PURE__*/Object.freeze({ var require_context_module_1_12 = /*#__PURE__*/Object.freeze({
__proto__: null,
onCompassChange: onCompassChange, onCompassChange: onCompassChange,
startCompass: startCompass, startCompass: startCompass,
stopCompass: stopCompass stopCompass: stopCompass
...@@ -10334,7 +10293,6 @@ var serviceContext = (function () { ...@@ -10334,7 +10293,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_13 = /*#__PURE__*/Object.freeze({ var require_context_module_1_13 = /*#__PURE__*/Object.freeze({
__proto__: null,
onNetworkStatusChange: onNetworkStatusChange onNetworkStatusChange: onNetworkStatusChange
}); });
...@@ -10412,7 +10370,6 @@ var serviceContext = (function () { ...@@ -10412,7 +10370,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_14 = /*#__PURE__*/Object.freeze({ var require_context_module_1_14 = /*#__PURE__*/Object.freeze({
__proto__: null,
getRecorderManager: getRecorderManager getRecorderManager: getRecorderManager
}); });
...@@ -10501,7 +10458,6 @@ var serviceContext = (function () { ...@@ -10501,7 +10458,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_15 = /*#__PURE__*/Object.freeze({ var require_context_module_1_15 = /*#__PURE__*/Object.freeze({
__proto__: null,
downloadFile: downloadFile$1 downloadFile: downloadFile$1
}); });
...@@ -10607,7 +10563,6 @@ var serviceContext = (function () { ...@@ -10607,7 +10563,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_16 = /*#__PURE__*/Object.freeze({ var require_context_module_1_16 = /*#__PURE__*/Object.freeze({
__proto__: null,
request: request$1 request: request$1
}); });
...@@ -10782,7 +10737,6 @@ var serviceContext = (function () { ...@@ -10782,7 +10737,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_17 = /*#__PURE__*/Object.freeze({ var require_context_module_1_17 = /*#__PURE__*/Object.freeze({
__proto__: null,
connectSocket: connectSocket$1, connectSocket: connectSocket$1,
sendSocketMessage: sendSocketMessage$1, sendSocketMessage: sendSocketMessage$1,
closeSocket: closeSocket$1, closeSocket: closeSocket$1,
...@@ -10877,7 +10831,6 @@ var serviceContext = (function () { ...@@ -10877,7 +10831,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_18 = /*#__PURE__*/Object.freeze({ var require_context_module_1_18 = /*#__PURE__*/Object.freeze({
__proto__: null,
uploadFile: uploadFile$1 uploadFile: uploadFile$1
}); });
...@@ -10987,7 +10940,6 @@ var serviceContext = (function () { ...@@ -10987,7 +10940,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_19 = /*#__PURE__*/Object.freeze({ var require_context_module_1_19 = /*#__PURE__*/Object.freeze({
__proto__: null,
setStorage: setStorage$1, setStorage: setStorage$1,
setStorageSync: setStorageSync$1, setStorageSync: setStorageSync$1,
getStorage: getStorage$1, getStorage: getStorage$1,
...@@ -11079,7 +11031,6 @@ var serviceContext = (function () { ...@@ -11079,7 +11031,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_20 = /*#__PURE__*/Object.freeze({ var require_context_module_1_20 = /*#__PURE__*/Object.freeze({
__proto__: null,
createAnimation: createAnimation createAnimation: createAnimation
}); });
...@@ -11144,7 +11095,6 @@ var serviceContext = (function () { ...@@ -11144,7 +11095,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_21 = /*#__PURE__*/Object.freeze({ var require_context_module_1_21 = /*#__PURE__*/Object.freeze({
__proto__: null,
createIntersectionObserver: createIntersectionObserver createIntersectionObserver: createIntersectionObserver
}); });
...@@ -11285,7 +11235,6 @@ var serviceContext = (function () { ...@@ -11285,7 +11235,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_22 = /*#__PURE__*/Object.freeze({ var require_context_module_1_22 = /*#__PURE__*/Object.freeze({
__proto__: null,
createSelectorQuery: createSelectorQuery createSelectorQuery: createSelectorQuery
}); });
...@@ -11302,7 +11251,6 @@ var serviceContext = (function () { ...@@ -11302,7 +11251,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_23 = /*#__PURE__*/Object.freeze({ var require_context_module_1_23 = /*#__PURE__*/Object.freeze({
__proto__: null,
onKeyboardHeightChange: onKeyboardHeightChange onKeyboardHeightChange: onKeyboardHeightChange
}); });
...@@ -11327,7 +11275,6 @@ var serviceContext = (function () { ...@@ -11327,7 +11275,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_24 = /*#__PURE__*/Object.freeze({ var require_context_module_1_24 = /*#__PURE__*/Object.freeze({
__proto__: null,
loadFontFace: loadFontFace$1 loadFontFace: loadFontFace$1
}); });
...@@ -11340,7 +11287,6 @@ var serviceContext = (function () { ...@@ -11340,7 +11287,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_25 = /*#__PURE__*/Object.freeze({ var require_context_module_1_25 = /*#__PURE__*/Object.freeze({
__proto__: null,
pageScrollTo: pageScrollTo$1 pageScrollTo: pageScrollTo$1
}); });
...@@ -11377,7 +11323,6 @@ var serviceContext = (function () { ...@@ -11377,7 +11323,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_26 = /*#__PURE__*/Object.freeze({ var require_context_module_1_26 = /*#__PURE__*/Object.freeze({
__proto__: null,
removeTabBarBadge: removeTabBarBadge$1, removeTabBarBadge: removeTabBarBadge$1,
showTabBarRedDot: showTabBarRedDot$1, showTabBarRedDot: showTabBarRedDot$1,
hideTabBarRedDot: hideTabBarRedDot$1, hideTabBarRedDot: hideTabBarRedDot$1,
...@@ -11403,7 +11348,6 @@ var serviceContext = (function () { ...@@ -11403,7 +11348,6 @@ var serviceContext = (function () {
} }
var require_context_module_1_27 = /*#__PURE__*/Object.freeze({ var require_context_module_1_27 = /*#__PURE__*/Object.freeze({
__proto__: null,
onWindowResize: onWindowResize, onWindowResize: onWindowResize,
offWindowResize: offWindowResize offWindowResize: offWindowResize
}); });
...@@ -11856,6 +11800,9 @@ var serviceContext = (function () { ...@@ -11856,6 +11800,9 @@ var serviceContext = (function () {
if (allowDefault) { // 返回默认实现 if (allowDefault) { // 返回默认实现
return defaultApp return defaultApp
} }
console.error(
'[warn]: getApp() 操作失败,v3模式加速了首页 nvue 的启动速度,当在首页 nvue 中使用 getApp() 不一定可以获取真正的 App 对象。详情请参考:https://uniapp.dcloud.io/collocation/frame/window?id=getapp'
);
} }
function initGlobalListeners () { function initGlobalListeners () {
...@@ -11944,6 +11891,31 @@ var serviceContext = (function () { ...@@ -11944,6 +11891,31 @@ var serviceContext = (function () {
}); });
} }
function initHotReload () {
const reloadUrl = weex.config.reloadUrl;
if (!reloadUrl) {
return
}
if (reloadUrl === __uniConfig.entryPagePath) {
return
}
const reloadPath = '/' + reloadUrl;
const routeOptions = __uniRoutes.find(route => route.path === reloadPath);
if (!routeOptions) {
return
}
if (routeOptions.meta.isNVue) { // 暂不处理 nvue
return
}
if (!routeOptions.meta.isTabBar) {
__uniConfig.realEntryPagePath = __uniConfig.realEntryPagePath || __uniConfig.entryPagePath;
}
__uniConfig.entryPagePath = reloadUrl;
if (process.env.NODE_ENV !== 'production') {
console.log(`[uni-app] reloadUrl(${reloadUrl})`);
}
}
function registerApp (appVm) { function registerApp (appVm) {
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
console.log(`[uni-app] registerApp`); console.log(`[uni-app] registerApp`);
...@@ -11962,6 +11934,8 @@ var serviceContext = (function () { ...@@ -11962,6 +11934,8 @@ var serviceContext = (function () {
getCurrentPages: getCurrentPages$1 getCurrentPages: getCurrentPages$1
}); });
initHotReload();
initTabBar(); initTabBar();
initGlobalListeners(); initGlobalListeners();
...@@ -12175,8 +12149,8 @@ var serviceContext = (function () { ...@@ -12175,8 +12149,8 @@ var serviceContext = (function () {
hideKeyboardTimeout = null; hideKeyboardTimeout = null;
} }
} else { } else {
// 仅安卓收起键盘时通知view层失去焦点 // 安卓/iOS13收起键盘时通知view层失去焦点
if (isAndroid) { if (isAndroid || parseInt(plus.os.version) >= 13) {
hideKeyboardTimeout = setTimeout(function () { hideKeyboardTimeout = setTimeout(function () {
hideKeyboardTimeout = null; hideKeyboardTimeout = null;
var pageId = getCurrentPageId(); var pageId = getCurrentPageId();
......
...@@ -16,22 +16,36 @@ const { ...@@ -16,22 +16,36 @@ const {
const definePages = require('./define-pages') const definePages = require('./define-pages')
const appConfigService = require('./app-config-service') const appConfigService = require('./app-config-service')
function getTabBarPages (appJson) {
return appJson.tabBar &&
appJson.tabBar.list &&
appJson.tabBar.list.length &&
appJson.tabBar.list
}
function isTabBarPage (pathName, tabBarPages) {
return tabBarPages.find(item => item.pagePath === pathName)
}
function parseEntryPagePath (appJson, manifestJson) { function parseEntryPagePath (appJson, manifestJson) {
const argsJsonStr = manifestJson.plus.arguments const argsJsonStr = manifestJson.plus.arguments
if (argsJsonStr) { if (argsJsonStr) {
try { try {
const args = JSON.parse(argsJsonStr) const args = JSON.parse(argsJsonStr)
const pathName = args.path || args.pathName const pathName = args.path || args.pathName
if (pathName && pathName !== appJson.pages[0]) { if (pathName && appJson.pages[0] !== pathName) {
appJson.entryPagePath = pathName appJson.entryPagePath = pathName
if (!isTabBarPage(pathName, getTabBarPages(appJson))) {
appJson.realEntryPagePath = appJson.pages[0] appJson.realEntryPagePath = appJson.pages[0]
} }
}
} catch (e) {} } catch (e) {}
} }
if (!appJson.entryPagePath) { if (!appJson.entryPagePath) {
appJson.entryPagePath = appJson.pages[0] appJson.entryPagePath = appJson.pages[0]
} }
} }
module.exports = function (appJson, manifestJson, { module.exports = function (appJson, manifestJson, {
pagesJson, pagesJson,
manifest, manifest,
...@@ -61,7 +75,7 @@ module.exports = function (appJson, manifestJson, { ...@@ -61,7 +75,7 @@ module.exports = function (appJson, manifestJson, {
manifestJson.permissions.UniNView = { manifestJson.permissions.UniNView = {
'description': 'UniNView原生渲染' 'description': 'UniNView原生渲染'
} }
// TODO 需要考虑 condition
manifestJson.plus.launchwebview.id = '1' // 首页 id 固定 为 1 manifestJson.plus.launchwebview.id = '1' // 首页 id 固定 为 1
// 删除首页 style 中的 uni-app 配置(不注入 app-view.js) // 删除首页 style 中的 uni-app 配置(不注入 app-view.js)
delete manifestJson.plus.launchwebview['uni-app'] delete manifestJson.plus.launchwebview['uni-app']
......
...@@ -100,15 +100,15 @@ export function navigateBack ({ ...@@ -100,15 +100,15 @@ export function navigateBack ({
uni.hideToast() // 后退时,关闭 toast,loading uni.hideToast() // 后退时,关闭 toast,loading
// 当前页面是 condition 进入 if (currentPage.$page.meta.isQuit) {
if (currentPage.$page.id === 1 && __uniConfig.realEntryPagePath) { quit()
} else if (currentPage.$page.id === 1 && __uniConfig.realEntryPagePath) {
// condition
uni.reLaunch({ uni.reLaunch({
url: '/' + __uniConfig.realEntryPagePath url: '/' + __uniConfig.realEntryPagePath
}) })
} else { } else {
currentPage.$page.meta.isQuit back(delta, animationType, animationDuration)
? quit()
: back(delta, animationType, animationDuration)
} }
return { return {
errMsg: 'navigateBack:ok' errMsg: 'navigateBack:ok'
......
...@@ -49,7 +49,9 @@ export function getApp ({ ...@@ -49,7 +49,9 @@ export function getApp ({
if (allowDefault) { // 返回默认实现 if (allowDefault) { // 返回默认实现
return defaultApp return defaultApp
} }
console.error('[warn]: getApp() 操作失败,v3模式加速了首页 nvue 的启动速度,当在首页 nvue 中使用 getApp() 不一定可以获取真正的 App 对象。详情请参考:https://uniapp.dcloud.io/collocation/frame/window?id=getapp') console.error(
'[warn]: getApp() 操作失败,v3模式加速了首页 nvue 的启动速度,当在首页 nvue 中使用 getApp() 不一定可以获取真正的 App 对象。详情请参考:https://uniapp.dcloud.io/collocation/frame/window?id=getapp'
)
} }
function initGlobalListeners () { function initGlobalListeners () {
...@@ -138,6 +140,31 @@ function initTabBar () { ...@@ -138,6 +140,31 @@ function initTabBar () {
}) })
} }
function initHotReload () {
const reloadUrl = weex.config.reloadUrl
if (!reloadUrl) {
return
}
if (reloadUrl === __uniConfig.entryPagePath) {
return
}
const reloadPath = '/' + reloadUrl
const routeOptions = __uniRoutes.find(route => route.path === reloadPath)
if (!routeOptions) {
return
}
if (routeOptions.meta.isNVue) { // 暂不处理 nvue
return
}
if (!routeOptions.meta.isTabBar) {
__uniConfig.realEntryPagePath = __uniConfig.realEntryPagePath || __uniConfig.entryPagePath
}
__uniConfig.entryPagePath = reloadUrl
if (process.env.NODE_ENV !== 'production') {
console.log(`[uni-app] reloadUrl(${reloadUrl})`)
}
}
export function registerApp (appVm) { export function registerApp (appVm) {
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
console.log(`[uni-app] registerApp`) console.log(`[uni-app] registerApp`)
...@@ -156,6 +183,8 @@ export function registerApp (appVm) { ...@@ -156,6 +183,8 @@ export function registerApp (appVm) {
getCurrentPages getCurrentPages
}) })
initHotReload()
initTabBar() initTabBar()
initGlobalListeners() initGlobalListeners()
......
...@@ -32,8 +32,13 @@ export function registerPage ({ ...@@ -32,8 +32,13 @@ export function registerPage ({
}) { }) {
const routeOptions = JSON.parse(JSON.stringify(__uniRoutes.find(route => route.path === path))) const routeOptions = JSON.parse(JSON.stringify(__uniRoutes.find(route => route.path === path)))
if (openType === 'reLaunch' || pages.length === 0) { if (
// pages.length===0 表示首页触发 redirectTo openType === 'reLaunch' ||
(
openType === 'redirect' &&
pages.length === 0
) // 首页 redirect
) {
routeOptions.meta.isQuit = true routeOptions.meta.isQuit = true
} else if (!routeOptions.meta.isTabBar) { } else if (!routeOptions.meta.isTabBar) {
routeOptions.meta.isQuit = false routeOptions.meta.isQuit = false
......
...@@ -44,7 +44,11 @@ export function parseWebviewStyle (id, path, routeOptions = {}) { ...@@ -44,7 +44,11 @@ export function parseWebviewStyle (id, path, routeOptions = {}) {
const titleNView = parseTitleNView(routeOptions) const titleNView = parseTitleNView(routeOptions)
if (titleNView) { if (titleNView) {
if (id === 1 && __uniConfig.realEntryPagePath) { if (
id === 1 &&
__uniConfig.realEntryPagePath &&
!routeOptions.meta.isQuit // 可能是tabBar
) {
titleNView.autoBackButton = true titleNView.autoBackButton = true
} }
webviewStyle.titleNView = titleNView webviewStyle.titleNView = titleNView
......
...@@ -67,8 +67,8 @@ export default function parsePage (vuePageOptions) { ...@@ -67,8 +67,8 @@ export default function parsePage (vuePageOptions) {
}, },
events: { events: {
// 支付宝小程序有些页面事件只能放在events下 // 支付宝小程序有些页面事件只能放在events下
onBack(){ onBack () {
this.$vm.__call_hook('onBackPress'); this.$vm.__call_hook('onBackPress')
} }
}, },
__r: handleRef, __r: handleRef,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册