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

update: mp-alipay getOpenUserInfo

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