提交 1b84793c 编写于 作者: 雪洛's avatar 雪洛

update: mp-alipay getOpenUserInfo

上级 60baaa85
...@@ -198,12 +198,12 @@ const protocols = { // 需要做转换的 API 列表 ...@@ -198,12 +198,12 @@ const protocols = { // 需要做转换的 API 列表
returnValue: { returnValue: {
apFilePath: 'tempFilePath' apFilePath: 'tempFilePath'
} }
}, },
chooseVideo: { chooseVideo: {
// 支付宝小程序文档中未找到(仅在getSetting处提及),但实际可用 // 支付宝小程序文档中未找到(仅在getSetting处提及),但实际可用
returnValue: { returnValue: {
apFilePath: 'tempFilePath' apFilePath: 'tempFilePath'
} }
}, },
connectSocket: { connectSocket: {
args: { args: {
...@@ -287,22 +287,22 @@ const protocols = { // 需要做转换的 API 列表 ...@@ -287,22 +287,22 @@ const protocols = { // 需要做转换的 API 列表
}, },
scanCode: { scanCode: {
name: 'scan', name: 'scan',
args (fromArgs) { args (fromArgs) {
if (fromArgs.scanType === 'qrCode') { if (fromArgs.scanType === 'qrCode') {
fromArgs.type = 'qr' fromArgs.type = 'qr'
return {
onlyFromCamera: 'hideAlbum'
}
} else if (fromArgs.scanType === 'barCode') {
fromArgs.type = 'bar'
return { return {
onlyFromCamera: 'hideAlbum' onlyFromCamera: 'hideAlbum'
} }
} else if (fromArgs.scanType === 'barCode') { } else {
fromArgs.type = 'bar'
return { return {
onlyFromCamera: 'hideAlbum' scanType: false,
} onlyFromCamera: 'hideAlbum'
} else { }
return {
scanType: false,
onlyFromCamera: 'hideAlbum'
}
} }
}, },
returnValue: { returnValue: {
...@@ -334,14 +334,14 @@ const protocols = { // 需要做转换的 API 列表 ...@@ -334,14 +334,14 @@ const protocols = { // 需要做转换的 API 列表
}, },
getUserInfo: { getUserInfo: {
name: my.canIUse('getOpenUserInfo') ? 'getOpenUserInfo' : 'getAuthUserInfo', name: my.canIUse('getOpenUserInfo') ? 'getOpenUserInfo' : 'getAuthUserInfo',
returnValue (result) { returnValue (result) {
if (my.canIUse('getOpenUserInfo')) { if (my.canIUse('getOpenUserInfo')) {
let response = {} let response = {}
try { try {
response = JSON.parse(result.response).response response = JSON.parse(result.response).response
} catch (e) {} } catch (e) {}
result.nickName = response.nickName result.nickName = response.nickName
result.avatar = response.avatar result.avatar = response.avatar
} }
result.userInfo = { result.userInfo = {
nickName: result.nickName, nickName: result.nickName,
...@@ -361,18 +361,18 @@ const protocols = { // 需要做转换的 API 列表 ...@@ -361,18 +361,18 @@ const protocols = { // 需要做转换的 API 列表
item.uuid = item.serviceId item.uuid = item.serviceId
}) })
} }
}, },
createBLEConnection: { createBLEConnection: {
name: 'connectBLEDevice', name: 'connectBLEDevice',
args: { args: {
timeout: false timeout: false
} }
}, },
closeBLEConnection: { closeBLEConnection: {
name: 'disconnectBLEDevice' name: 'disconnectBLEDevice'
}, },
onBLEConnectionStateChange: { onBLEConnectionStateChange: {
name: 'onBLEConnectionStateChanged' name: 'onBLEConnectionStateChanged'
}, },
makePhoneCall: { makePhoneCall: {
args: { args: {
...@@ -404,35 +404,35 @@ const protocols = { // 需要做转换的 API 列表 ...@@ -404,35 +404,35 @@ const protocols = { // 需要做转换的 API 列表
returnValue: { returnValue: {
brightness: 'value' brightness: 'value'
} }
}, },
showShareMenu: { showShareMenu: {
name: 'showSharePanel' name: 'showSharePanel'
}, },
hideHomeButton: { hideHomeButton: {
name: 'hideBackHome' name: 'hideBackHome'
}, },
saveImageToPhotosAlbum: { saveImageToPhotosAlbum: {
name: 'saveImage', name: 'saveImage',
args: { args: {
filePath: 'url' filePath: 'url'
} }
}, },
saveVideoToPhotosAlbum: { saveVideoToPhotosAlbum: {
args: { args: {
filePath: 'src' filePath: 'src'
} }
}, },
chooseAddress: { chooseAddress: {
name: 'getAddress', name: 'getAddress',
returnValue (result) { returnValue (result) {
let info = result.result || {} let info = result.result || {}
result.userName = info.fullname result.userName = info.fullname
result.provinceName = info.prov result.provinceName = info.prov
result.cityName = info.city result.cityName = info.city
result.detailInfo = info.address result.detailInfo = info.address
result.telNumber = info.mobilePhone result.telNumber = info.mobilePhone
result.errMsg = result.resultStatus result.errMsg = result.resultStatus
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册