提交 69d41a17 编写于 作者: X xiaoyucoding

feat: mp api protocols

上级 16da3b7b
......@@ -35,7 +35,7 @@ function _handleNetworkInfo (result) {
result.networkType = result.networkType.toLowerCase()
break
}
return result
return {}
}
const protocols = { // 需要做转换的 API 列表
......@@ -171,16 +171,15 @@ const protocols = { // 需要做转换的 API 列表
},
previewImage: {
args (fromArgs) {
let current = 0
if (fromArgs.current) {
// 支付宝小程序的 current 是索引值,而非图片地址。
if (fromArgs.current && Array.isArray(fromArgs.urls)) {
const index = fromArgs.urls.indexOf(fromArgs.current)
current = ~index ? index : 0
fromArgs.current = ~index ? index : 0
}
return Object.assign(fromArgs, {
current: current,
return {
indicator: false,
loop: false
})
}
}
},
saveFile: {
......@@ -202,7 +201,7 @@ const protocols = { // 需要做转换的 API 列表
delete file.apFilePath
})
}
return result
return {}
}
},
removeSavedFile: {
......@@ -226,15 +225,6 @@ const protocols = { // 需要做转换的 API 列表
// TODO address 参数在阿里上是必传的
}
},
createMapContext: {
// TODO
returns: {
translateMarker: false,
includePoints: false,
getRegion: false,
getScale: false
}
},
getSystemInfo: {
returnValue: {
brand: false,
......
......@@ -16,7 +16,9 @@ const protocols = {
// data 不支持 ArrayBuffer
// method 不支持 TRACE, CONNECT
// dataType 可取值为 string/json
return fromArgs
return {
method: 'method'
}
}
},
connectSocket: {
......@@ -41,16 +43,6 @@ const protocols = {
fromRet.onNext = createTodoMethod('BackgroundAudioManager', 'onNext')
}
},
createInnerAudioContext: {
returnValue: {
buffered: false
}
},
createVideoContext: {
returnValue: {
playbackRate: false
}
},
scanCode: {
onlyFromCamera: false,
scanType: false
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册