提交 5b34a62a 编写于 作者: Q qiang

build v3

上级 4d3e494c
...@@ -120,7 +120,9 @@ var serviceContext = (function () { ...@@ -120,7 +120,9 @@ var serviceContext = (function () {
'getBLEDeviceServices', 'getBLEDeviceServices',
'getBLEDeviceCharacteristics', 'getBLEDeviceCharacteristics',
'createBLEConnection', 'createBLEConnection',
'closeBLEConnection', 'closeBLEConnection',
'setBLEMTU',
'getBLEDeviceRSSI',
'onBeaconServiceChange', 'onBeaconServiceChange',
'onBeaconUpdate', 'onBeaconUpdate',
'getBeacons', 'getBeacons',
...@@ -2137,6 +2139,9 @@ var serviceContext = (function () { ...@@ -2137,6 +2139,9 @@ var serviceContext = (function () {
}, },
selectedIconPath: { selectedIconPath: {
type: String type: String
},
pagePath: {
type: String
} }
}; };
...@@ -2995,7 +3000,11 @@ var serviceContext = (function () { ...@@ -2995,7 +3000,11 @@ var serviceContext = (function () {
let lastStatusBarStyle; let lastStatusBarStyle;
const oldSetStatusBarStyle = plus.navigator.setStatusBarStyle; let oldSetStatusBarStyle = plus.navigator.setStatusBarStyle;
function restoreOldSetStatusBarStyle (setStatusBarStyle) {
oldSetStatusBarStyle = setStatusBarStyle;
}
function newSetStatusBarStyle (style) { function newSetStatusBarStyle (style) {
lastStatusBarStyle = style; lastStatusBarStyle = style;
...@@ -3768,8 +3777,8 @@ var serviceContext = (function () { ...@@ -3768,8 +3777,8 @@ var serviceContext = (function () {
getCenterLocation (ctx, cbs) { getCenterLocation (ctx, cbs) {
return invokeVmMethodWithoutArgs(ctx, 'getCenterLocation', cbs) return invokeVmMethodWithoutArgs(ctx, 'getCenterLocation', cbs)
}, },
moveToLocation (ctx) { moveToLocation (ctx, args) {
return invokeVmMethodWithoutArgs(ctx, 'moveToLocation') return invokeVmMethod(ctx, 'moveToLocation', args)
}, },
translateMarker (ctx, args) { translateMarker (ctx, args) {
return invokeVmMethod(ctx, 'translateMarker', args, ['animationEnd']) return invokeVmMethod(ctx, 'translateMarker', args, ['animationEnd'])
...@@ -4302,6 +4311,14 @@ var serviceContext = (function () { ...@@ -4302,6 +4311,14 @@ var serviceContext = (function () {
function writeBLECharacteristicValue (data, callbackId) { function writeBLECharacteristicValue (data, callbackId) {
bluetoothExec('writeBLECharacteristicValue', callbackId, data); bluetoothExec('writeBLECharacteristicValue', callbackId, data);
}
function setBLEMTU (data, callbackId) {
bluetoothExec('setBLEMTU', callbackId, data);
}
function getBLEDeviceRSSI (data, callbackId) {
bluetoothExec('getBLEDeviceRSSI', callbackId, data);
} }
function getScreenBrightness () { function getScreenBrightness () {
...@@ -4407,28 +4424,14 @@ var serviceContext = (function () { ...@@ -4407,28 +4424,14 @@ var serviceContext = (function () {
} }
} }
let beaconUpdateState = false; function onBeaconUpdate (callbackId) {
plus.ibeacon.onBeaconUpdate(data => invoke$1(callbackId, data));
function onBeaconUpdate () {
if (!beaconUpdateState) {
plus.ibeacon.onBeaconUpdate(function (data) {
publish('onBeaconUpdated', data);
});
beaconUpdateState = true;
}
} }
let beaconServiceChangeState = false; function onBeaconServiceChange (callbackId) {
plus.ibeacon.onBeaconServiceChange(data => invoke$1(callbackId, data));
function onBeaconServiceChange () {
if (!beaconServiceChangeState) {
plus.ibeacon.onBeaconServiceChange(function (data) {
publish('onBeaconServiceChange', data);
publish('onBeaconServiceChanged', data);
});
beaconServiceChangeState = true;
}
} }
const onBeaconServiceChanged = onBeaconServiceChange;
function getBeacons (params, callbackId) { function getBeacons (params, callbackId) {
plus.ibeacon.getBeacons({ plus.ibeacon.getBeacons({
...@@ -6575,13 +6578,35 @@ var serviceContext = (function () { ...@@ -6575,13 +6578,35 @@ var serviceContext = (function () {
delete requestTasks[requestTaskId]; delete requestTasks[requestTaskId];
}; };
const cookiesPrase = header => {
let cookiesStr = header['Set-Cookie'];
let cookiesArr = [];
if (!cookiesStr) {
return []
}
if (cookiesStr[0] === '[' && cookiesStr[cookiesStr.length - 1] === ']') {
cookiesStr = cookiesStr.slice(1, -1);
}
const handleCookiesArr = cookiesStr.split(';');
for (let i = 0; i < handleCookiesArr.length; i++) {
if (handleCookiesArr[i].indexOf('Expires=') !== -1) {
cookiesArr.push(handleCookiesArr[i].replace(',', ''));
} else {
cookiesArr.push(handleCookiesArr[i]);
}
}
cookiesArr = cookiesArr.join(';').split(',');
return cookiesArr
};
function createRequestTaskById (requestTaskId, { function createRequestTaskById (requestTaskId, {
url, url,
data, data,
header, header,
method = 'GET', method = 'GET',
responseType, responseType,
sslVerify = true, sslVerify = true,
firstIpv4 = false firstIpv4 = false
} = {}) { } = {}) {
const stream = requireNativePlugin('stream'); const stream = requireNativePlugin('stream');
...@@ -6635,7 +6660,7 @@ var serviceContext = (function () { ...@@ -6635,7 +6660,7 @@ var serviceContext = (function () {
// weex 官方文档未说明实际支持 timeout,单位:ms // weex 官方文档未说明实际支持 timeout,单位:ms
timeout: timeout || 6e5, timeout: timeout || 6e5,
// 配置和weex模块内相反 // 配置和weex模块内相反
sslVerify: !sslVerify, sslVerify: !sslVerify,
firstIpv4: firstIpv4 firstIpv4: firstIpv4
}; };
if (method !== 'GET') { if (method !== 'GET') {
...@@ -6661,7 +6686,8 @@ var serviceContext = (function () { ...@@ -6661,7 +6686,8 @@ var serviceContext = (function () {
state: 'success', state: 'success',
data: ok && responseType === 'arraybuffer' ? base64ToArrayBuffer$2(data) : data, data: ok && responseType === 'arraybuffer' ? base64ToArrayBuffer$2(data) : data,
statusCode, statusCode,
header: headers header: headers,
cookies: cookiesPrase(headers)
}); });
} else { } else {
publishStateChange$1({ publishStateChange$1({
...@@ -7469,7 +7495,8 @@ var serviceContext = (function () { ...@@ -7469,7 +7495,8 @@ var serviceContext = (function () {
console.log(`[restoreGlobal][${Date.now()}]`); console.log(`[restoreGlobal][${Date.now()}]`);
} }
weex = newWeex; weex = newWeex;
plus = newPlus; plus = newPlus;
restoreOldSetStatusBarStyle(plus.navigator.setStatusBarStyle);
plus.navigator.setStatusBarStyle = newSetStatusBarStyle; plus.navigator.setStatusBarStyle = newSetStatusBarStyle;
/* eslint-disable no-global-assign */ /* eslint-disable no-global-assign */
setTimeout = newSetTimeout; setTimeout = newSetTimeout;
...@@ -8701,7 +8728,7 @@ var serviceContext = (function () { ...@@ -8701,7 +8728,7 @@ var serviceContext = (function () {
routeOptions.meta.visible = true; routeOptions.meta.visible = true;
} }
if (routeOptions.meta.isTabBar && webview.id !== '1') { if (routeOptions.meta.isTabBar) {
tabBar$1.append(webview); tabBar$1.append(webview);
} }
...@@ -9600,14 +9627,21 @@ var serviceContext = (function () { ...@@ -9600,14 +9627,21 @@ var serviceContext = (function () {
index, index,
text, text,
iconPath, iconPath,
selectedIconPath selectedIconPath,
pagePath
}) { }) {
if (!isTabBarPage()) { tabBar$1.setTabBarItem(index, text, iconPath, selectedIconPath);
return { const route = pagePath && __uniRoutes.find(({ path }) => path === pagePath);
errMsg: 'setTabBarItem:fail not TabBar page' if (route) {
const meta = route.meta;
meta.isTabBar = true;
meta.tabBarIndex = index;
meta.isQuit = true;
const tabBar = __uniConfig.tabBar;
if (tabBar && tabBar.list && tabBar.list[index]) {
tabBar.list[index].pagePath = pagePath.startsWith('/') ? pagePath.substring(1) : pagePath;
} }
} }
tabBar$1.setTabBarItem(index, text, iconPath, selectedIconPath);
return { return {
errMsg: 'setTabBarItem:ok' errMsg: 'setTabBarItem:ok'
} }
...@@ -9948,6 +9982,8 @@ var serviceContext = (function () { ...@@ -9948,6 +9982,8 @@ var serviceContext = (function () {
notifyBLECharacteristicValueChanged: notifyBLECharacteristicValueChanged, notifyBLECharacteristicValueChanged: notifyBLECharacteristicValueChanged,
readBLECharacteristicValue: readBLECharacteristicValue, readBLECharacteristicValue: readBLECharacteristicValue,
writeBLECharacteristicValue: writeBLECharacteristicValue, writeBLECharacteristicValue: writeBLECharacteristicValue,
setBLEMTU: setBLEMTU,
getBLEDeviceRSSI: getBLEDeviceRSSI,
getScreenBrightness: getScreenBrightness, getScreenBrightness: getScreenBrightness,
setScreenBrightness: setScreenBrightness, setScreenBrightness: setScreenBrightness,
setKeepScreenOn: setKeepScreenOn, setKeepScreenOn: setKeepScreenOn,
...@@ -9957,6 +9993,7 @@ var serviceContext = (function () { ...@@ -9957,6 +9993,7 @@ var serviceContext = (function () {
getNetworkType: getNetworkType, getNetworkType: getNetworkType,
onBeaconUpdate: onBeaconUpdate, onBeaconUpdate: onBeaconUpdate,
onBeaconServiceChange: onBeaconServiceChange, onBeaconServiceChange: onBeaconServiceChange,
onBeaconServiceChanged: onBeaconServiceChanged,
getBeacons: getBeacons, getBeacons: getBeacons,
startBeaconDiscovery: startBeaconDiscovery, startBeaconDiscovery: startBeaconDiscovery,
stopBeaconDiscovery: stopBeaconDiscovery, stopBeaconDiscovery: stopBeaconDiscovery,
...@@ -11908,7 +11945,8 @@ var serviceContext = (function () { ...@@ -11908,7 +11945,8 @@ var serviceContext = (function () {
data, data,
statusCode, statusCode,
header, header,
errMsg errMsg,
cookies
}) { }) {
const { const {
args, args,
...@@ -11925,7 +11963,8 @@ var serviceContext = (function () { ...@@ -11925,7 +11963,8 @@ var serviceContext = (function () {
data, data,
statusCode, statusCode,
header, header,
errMsg: 'request:ok' errMsg: 'request:ok',
cookies
}, args)); }, args));
break break
case 'fail': case 'fail':
...@@ -11957,16 +11996,16 @@ var serviceContext = (function () { ...@@ -11957,16 +11996,16 @@ var serviceContext = (function () {
} }
} }
function request$1 (args, callbackId) { function request$1 (args, callbackId) {
let contentType; let contentType;
for (const name in args.header) { for (const name in args.header) {
if (name.toLowerCase() === 'content-type') { if (name.toLowerCase() === 'content-type') {
contentType = args.header[name]; contentType = args.header[name];
break break
} }
} }
if (args.method !== 'GET' && contentType.indexOf('application/json') === 0 && isPlainObject(args.data)) { if (args.method !== 'GET' && contentType.indexOf('application/json') === 0 && isPlainObject(args.data)) {
args.data = JSON.stringify(args.data); args.data = JSON.stringify(args.data);
} }
const { const {
requestTaskId requestTaskId
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册