Skip to content

Commit 4aa2063

Browse files
authored
Merge pull request #2244 from didi/feat-enhance-api
补充文档时盘点到的一些未拉齐的api
2 parents 73c56a9 + 7b6c099 commit 4aa2063

4 files changed

Lines changed: 20 additions & 6 deletions

File tree

packages/api-proxy/src/platform/api/action-sheet/index.ali.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { noop } from '@mpxjs/utils'
33

44
function showActionSheet (options = {}) {
55
const opts = changeOpts(options, {
6-
itemList: 'items'
6+
itemList: 'items',
7+
alertText: 'title'
78
})
89

910
const cacheSuc = opts.success || noop
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { ENV_OBJ, changeOpts } from '../../../common/js'
2+
3+
function createAnimation (options = {}) {
4+
const opts = changeOpts(options, {
5+
timingFunction: 'timeFunction'
6+
})
7+
8+
return ENV_OBJ.createAnimation(opts)
9+
}
10+
11+
export {
12+
createAnimation
13+
}

packages/api-proxy/src/platform/api/device/network/onNetworkStatusChange.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ const oldObserveList = new Set()
55

66
if (isBrowser) {
77
window.addEventListener('offline', () => {
8-
oldObserveList.forEach(fn => fn({ isConnected: false, type: 'none' }))
8+
oldObserveList.forEach(fn => fn({ isConnected: false, networkType: 'none' }))
99
})
1010
window.addEventListener('online', () => {
11-
oldObserveList.forEach(fn => fn({ isConnected: true, type: 'unknow' }))
11+
oldObserveList.forEach(fn => fn({ isConnected: true, networkType: 'unknow' }))
1212
})
1313
}
1414

@@ -22,7 +22,7 @@ export function onNetworkStatusChange (callbackFn) {
2222
const isConnected = navigator.onLine
2323
callbackFn({
2424
isConnected,
25-
type: isConnected ? evt.currentTarget.effectiveType : 'none'
25+
networkType: isConnected ? evt.currentTarget.effectiveType : 'none'
2626
})
2727
}
2828
fnMap.set(callbackFn, proxyCallback)

packages/api-proxy/src/platform/api/system/index.ios.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const getSystemInfoSync = function () {
1111
brand: DeviceInfo.getBrand(),
1212
model: DeviceInfo.getModel(),
1313
system: `${DeviceInfo.getSystemName()} ${DeviceInfo.getSystemVersion()}`,
14-
platform: DeviceInfo.isEmulatorSync() ? 'emulator' : DeviceInfo.getSystemName(),
14+
platform: DeviceInfo.isEmulatorSync() ? 'emulator' : DeviceInfo.getSystemName().toLowerCase(),
1515
deviceOrientation: screenWidth > screenHeight ? 'portrait' : 'landscape',
1616
fontSizeSetting: PixelRatio.getFontScale()
1717
}
@@ -68,7 +68,7 @@ const getDeviceInfo = function () {
6868
brand: DeviceInfo.getBrand(),
6969
model: DeviceInfo.getModel(),
7070
system: `${DeviceInfo.getSystemName()} ${DeviceInfo.getSystemVersion()}`,
71-
platform: DeviceInfo.isEmulatorSync() ? 'emulator' : DeviceInfo.getSystemName(),
71+
platform: DeviceInfo.isEmulatorSync() ? 'emulator' : DeviceInfo.getSystemName().toLowerCase(),
7272
memorySize: DeviceInfo.getTotalMemorySync() / (1024 * 1024)
7373
})
7474
return deviceInfo

0 commit comments

Comments
 (0)