提交 371d6c75 编写于 作者: 郭胜强

eslint fix

上级 a31633af
const TODOS = [ //不支持的 API 列表 const TODOS = [ // 不支持的 API 列表
'hideTabBar', 'hideTabBar',
'hideTabBarRedDot', 'hideTabBarRedDot',
'removeTabBarBadge', 'removeTabBarBadge',
...@@ -9,8 +9,8 @@ const TODOS = [ //不支持的 API 列表 ...@@ -9,8 +9,8 @@ const TODOS = [ //不支持的 API 列表
'showTabBarRedDot' 'showTabBarRedDot'
] ]
const protocols = { //需要做转换的 API 列表 const protocols = { // 需要做转换的 API 列表
returnValue(methodName, res) { // 通用 returnValue 解析 returnValue (methodName, res) { // 通用 returnValue 解析
if (res.error || res.errorMessage) { if (res.error || res.errorMessage) {
res.errMsg = `${methodName}:fail ${res.errorMessage || res.error}` res.errMsg = `${methodName}:fail ${res.errorMessage || res.error}`
delete res.error delete res.error
...@@ -20,12 +20,12 @@ const protocols = { //需要做转换的 API 列表 ...@@ -20,12 +20,12 @@ const protocols = { //需要做转换的 API 列表
}, },
request: { request: {
name: 'httpRequest', name: 'httpRequest',
args(fromArgs) { args (fromArgs) {
if (!fromArgs.header) { // 默认增加 header 参数,方便格式化 content-type if (!fromArgs.header) { // 默认增加 header 参数,方便格式化 content-type
fromArgs.header = {} fromArgs.header = {}
} }
return { return {
header(header = {}, toArgs) { header (header = {}, toArgs) {
const headers = { const headers = {
'content-type': 'application/json' 'content-type': 'application/json'
} }
...@@ -56,7 +56,7 @@ const protocols = { //需要做转换的 API 列表 ...@@ -56,7 +56,7 @@ const protocols = { //需要做转换的 API 列表
setNavigationBarTitle: { setNavigationBarTitle: {
name: 'setNavigationBar' name: 'setNavigationBar'
}, },
showModal({ showModal ({
showCancel = true showCancel = true
} = {}) { } = {}) {
if (showCancel) { if (showCancel) {
...@@ -68,7 +68,7 @@ const protocols = { //需要做转换的 API 列表 ...@@ -68,7 +68,7 @@ const protocols = { //需要做转换的 API 列表
cancelText: 'cancelButtonText', cancelText: 'cancelButtonText',
confirmText: 'confirmButtonText' confirmText: 'confirmButtonText'
}, },
returnValue(fromRes, toRes) { returnValue (fromRes, toRes) {
toRes.confirm = fromRes.confirm toRes.confirm = fromRes.confirm
toRes.cancel = !fromRes.confirm toRes.cancel = !fromRes.confirm
} }
...@@ -80,13 +80,13 @@ const protocols = { //需要做转换的 API 列表 ...@@ -80,13 +80,13 @@ const protocols = { //需要做转换的 API 列表
confirmColor: false, confirmColor: false,
confirmText: 'buttonText' confirmText: 'buttonText'
}, },
returnValue(fromRes, toRes) { returnValue (fromRes, toRes) {
toRes.confirm = true toRes.confirm = true
toRes.cancel = false toRes.cancel = false
} }
} }
}, },
showToast({ showToast ({
icon = 'success' icon = 'success'
} = {}) { } = {}) {
const args = { const args = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册