Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tbcc-sdk-ts
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
qinhaitao
tbcc-sdk-ts
Commits
b6420d43
Commit
b6420d43
authored
Mar 24, 2021
by
mqf_0707
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
capiFn新增自定义错误信息提示
parent
23b1c8c7
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
64 additions
and
87 deletions
+64
-87
tb.d.ts
lib/core/tb.d.ts
+5
-3
tb.js
lib/core/tb.js
+12
-2
tb.js.map
lib/core/tb.js.map
+1
-1
index.d.ts
lib/index.d.ts
+5
-6
capiFn.d.ts
lib/request/capiFn.d.ts
+3
-3
capiFn.js
lib/request/capiFn.js
+15
-6
capiFn.js.map
lib/request/capiFn.js.map
+1
-1
tb.ts
src/core/tb.ts
+7
-1
capiFn.ts
src/request/capiFn.ts
+15
-4
yarn.lock
yarn.lock
+0
-60
No files found.
lib/core/tb.d.ts
View file @
b6420d43
...
...
@@ -108,13 +108,15 @@ export declare const setClipboard: (text: string) => Promise<unknown>;
* 调起分享面板
*/
export
declare
const
showSharePanel
:
()
=>
Promise
<
void
>
;
/**
* 隐藏分享面板
*/
export
declare
const
hideShareMenu
:
()
=>
Promise
<
void
>
;
/**
* 获取缓存数据
* @param key
*/
export
declare
const
getStorage
:
(
key
:
string
)
=>
Promise
<
string
|
{
data
?:
string
;
}
>
;
export
declare
const
getStorage
:
(
key
:
string
)
=>
Promise
<
string
>
;
/**
* 设置缓存数据
* @param key
...
...
lib/core/tb.js
View file @
b6420d43
...
...
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
}
};
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
exports
.
confirmCustomOrder
=
exports
.
hideSkuModal
=
exports
.
showSkuModal
=
exports
.
openMessage
=
exports
.
taobaoReportClick
=
exports
.
removeStorage
=
exports
.
setStorage
=
exports
.
getStorage
=
exports
.
showSharePanel
=
exports
.
setClipboard
=
exports
.
getImageInfo
=
exports
.
createAudio
=
exports
.
openDetail
=
exports
.
checkGoodsCollectedStatus
=
exports
.
collectGoods
=
exports
.
getServerTime
=
exports
.
redirectTo
=
exports
.
navigateBack
=
exports
.
navigateTo
=
exports
.
navigateToOutside
=
exports
.
checkShopFavoredStatus
=
exports
.
favorShop
=
exports
.
getSystemInfo
=
exports
.
commonConfirm
=
exports
.
simpleAlert
=
exports
.
commonToast
=
void
0
;
exports
.
confirmCustomOrder
=
exports
.
hideSkuModal
=
exports
.
showSkuModal
=
exports
.
openMessage
=
exports
.
taobaoReportClick
=
exports
.
removeStorage
=
exports
.
setStorage
=
exports
.
getStorage
=
exports
.
hideShareMenu
=
exports
.
showSharePanel
=
exports
.
setClipboard
=
exports
.
getImageInfo
=
exports
.
createAudio
=
exports
.
openDetail
=
exports
.
checkGoodsCollectedStatus
=
exports
.
collectGoods
=
exports
.
getServerTime
=
exports
.
redirectTo
=
exports
.
navigateBack
=
exports
.
navigateTo
=
exports
.
navigateToOutside
=
exports
.
checkShopFavoredStatus
=
exports
.
favorShop
=
exports
.
getSystemInfo
=
exports
.
commonConfirm
=
exports
.
simpleAlert
=
exports
.
commonToast
=
void
0
;
var
helpers_1
=
require
(
"../helpers"
);
/**
* 通用toast
...
...
@@ -328,6 +328,16 @@ var showSharePanel = function () { return __awaiter(void 0, void 0, void 0, func
});
});
};
exports
.
showSharePanel
=
showSharePanel
;
/**
* 隐藏分享面板
*/
var
hideShareMenu
=
function
()
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
return
__generator
(
this
,
function
(
_a
)
{
helpers_1
.
promisifyApiSimple
(
'hideShareMenu'
,
{});
return
[
2
/*return*/
];
});
});
};
exports
.
hideShareMenu
=
hideShareMenu
;
/**
* 获取缓存数据
* @param key
...
...
@@ -341,7 +351,7 @@ var getStorage = function (key) { return __awaiter(void 0, void 0, void 0, funct
result
=
_a
.
sent
();
if
(
result
===
null
||
result
===
void
0
?
void
0
:
result
.
data
)
return
[
2
/*return*/
,
result
.
data
];
return
[
2
/*return*/
,
result
];
return
[
2
/*return*/
,
undefined
];
}
});
});
};
...
...
lib/core/tb.js.map
View file @
b6420d43
This diff is collapsed.
Click to expand it.
lib/index.d.ts
View file @
b6420d43
...
...
@@ -33,10 +33,10 @@ declare const _default: {
};
};
capiFn
:
(
apiList
:
any
,
request
:
any
)
=>
{
receiveObjectPrize
(
params
:
any
):
Promise
<
boolean
>
;
receiveObjectPrize
(
params
:
any
,
failMessage
:
any
,
successMessage
:
any
):
Promise
<
boolean
>
;
getVipInfo
(
params
:
any
):
Promise
<
any
>
;
receiveEnamePrize
(
params
:
any
):
Promise
<
boolean
>
;
addStat
(
type
:
string
|
number
):
Promise
<
boolean
>
;
receiveEnamePrize
(
params
:
any
,
failMessage
:
any
,
successMessage
:
any
):
Promise
<
boolean
>
;
addStat
(
type
:
string
|
number
,
param
?:
{}
):
Promise
<
boolean
>
;
};
tb
:
{
getUserAddress
:
(
opts
?:
{})
=>
Promise
<
unknown
>
;
...
...
@@ -83,9 +83,8 @@ declare const _default: {
getImageInfo
:
(
src
:
string
)
=>
Promise
<
unknown
>
;
setClipboard
:
(
text
:
string
)
=>
Promise
<
unknown
>
;
showSharePanel
:
()
=>
Promise
<
void
>
;
getStorage
:
(
key
:
string
)
=>
Promise
<
string
|
{
data
?:
string
;
}
>
;
hideShareMenu
:
()
=>
Promise
<
void
>
;
getStorage
:
(
key
:
string
)
=>
Promise
<
string
>
;
setStorage
:
(
key
:
string
,
value
:
any
)
=>
Promise
<
unknown
>
;
removeStorage
:
(
key
:
string
)
=>
Promise
<
unknown
>
;
taobaoReportClick
:
(
eventType
:
string
,
logkey
:
string
)
=>
void
;
...
...
lib/request/capiFn.d.ts
View file @
b6420d43
declare
const
capiFn
:
(
apiList
:
any
,
request
:
any
)
=>
{
receiveObjectPrize
(
params
:
any
):
Promise
<
boolean
>
;
receiveObjectPrize
(
params
:
any
,
failMessage
:
any
,
successMessage
:
any
):
Promise
<
boolean
>
;
getVipInfo
(
params
:
any
):
Promise
<
any
>
;
receiveEnamePrize
(
params
:
any
):
Promise
<
boolean
>
;
addStat
(
type
:
number
|
string
):
Promise
<
boolean
>
;
receiveEnamePrize
(
params
:
any
,
failMessage
:
any
,
successMessage
:
any
):
Promise
<
boolean
>
;
addStat
(
type
:
number
|
string
,
param
?:
{}
):
Promise
<
boolean
>
;
};
export
default
capiFn
;
lib/request/capiFn.js
View file @
b6420d43
...
...
@@ -53,7 +53,7 @@ var utils_1 = require("../utils");
// 通用API封装方法
var
capiFn
=
function
(
apiList
,
request
)
{
return
{
receiveObjectPrize
:
function
(
params
)
{
receiveObjectPrize
:
function
(
params
,
failMessage
,
successMessage
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
_a
,
handle
,
method
,
ext
,
userAddress
,
_b
,
name
,
telNumber
,
provinceName
,
cityName
,
cityCode
,
countyName
,
detailInfo
,
streetName
;
return
__generator
(
this
,
function
(
_c
)
{
...
...
@@ -79,7 +79,12 @@ var capiFn = function (apiList, request) {
})];
case
1
:
result
=
_a
.
sent
();
if
(
result
&&
!
result
.
success
)
{
tb_1
.
commonToast
(
failMessage
||
'领取失败,前去“我的奖品”查看原因'
);
return
[
2
/*return*/
,
true
];
}
if
(
result
&&
result
.
success
)
{
successMessage
&&
tb_1
.
commonToast
(
successMessage
);
return
[
2
/*return*/
,
true
];
}
return
[
2
/*return*/
];
...
...
@@ -115,7 +120,7 @@ var capiFn = function (apiList, request) {
});
});
},
receiveEnamePrize
:
function
(
params
)
{
receiveEnamePrize
:
function
(
params
,
failMessage
,
successMessage
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
_a
,
handle
,
method
,
ext
,
result
;
return
__generator
(
this
,
function
(
_b
)
{
...
...
@@ -127,7 +132,12 @@ var capiFn = function (apiList, request) {
})];
case
1
:
result
=
_b
.
sent
();
if
(
result
&&
!
result
.
success
)
{
tb_1
.
commonToast
(
failMessage
||
'领取失败,前去“我的奖品”查看原因'
);
return
[
2
/*return*/
,
true
];
}
if
(
result
&&
result
.
success
)
{
successMessage
&&
tb_1
.
commonToast
(
successMessage
);
return
[
2
/*return*/
,
true
];
}
return
[
2
/*return*/
,
false
];
...
...
@@ -135,16 +145,15 @@ var capiFn = function (apiList, request) {
});
});
},
addStat
:
function
(
type
)
{
addStat
:
function
(
type
,
param
)
{
if
(
param
===
void
0
)
{
param
=
{};
}
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
_a
,
handle
,
method
,
ext
,
result
;
return
__generator
(
this
,
function
(
_b
)
{
switch
(
_b
.
label
)
{
case
0
:
_a
=
utils_1
.
getRequestParams
(
apiList
[
'addStat'
]),
handle
=
_a
.
handle
,
method
=
_a
.
method
,
ext
=
_a
.
ext
;
return
[
4
/*yield*/
,
request
(
handle
,
method
,
{
type
:
type
},
ext
).
catch
(
function
(
res
)
{
return
[
4
/*yield*/
,
request
(
handle
,
method
,
__assign
({
type
:
type
},
param
),
ext
).
catch
(
function
(
res
)
{
tb_1
.
commonToast
(
res
&&
res
.
message
);
})];
case
1
:
...
...
lib/request/capiFn.js.map
View file @
b6420d43
{"version":3,"file":"capiFn.js","sourceRoot":"","sources":["../../src/request/capiFn.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAwD;AACxD,qCAA8C;AAC9C,kCAA4C;AAE5C,YAAY;AACZ,IAAM,MAAM,GAAG,UAAC,OAAO,EAAE,OAAO;IAC9B,OAAO;QACC,kBAAkB,EAAxB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CACf,gBAAW,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;gCAClC,CAAC,CAAC,EAAA;;4BALI,MAAM,GAAG,SAKb;4BACF,IAAI,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE;gCAC5B,sBAAO,IAAI,EAAC;6BACb;4BACD,sBAAO,KAAK,EAAC;;;;SACd;KACF,CAAA;AACH,CAAC,CAAC;AAEF,kBAAe,MAAM,CAAC"}
\ No newline at end of file
src/core/tb.ts
View file @
b6420d43
...
...
@@ -202,6 +202,12 @@ export const setClipboard = async (text: string) => {
export
const
showSharePanel
=
async
()
=>
{
promisifyApiSimple
(
'showSharePanel'
,{})
}
/**
* 隐藏分享面板
*/
export
const
hideShareMenu
=
async
()
=>
{
promisifyApiSimple
(
'hideShareMenu'
,{})
}
/**
* 获取缓存数据
* @param key
...
...
@@ -209,7 +215,7 @@ export const showSharePanel = async () => {
export
const
getStorage
=
async
(
key
:
string
)
=>
{
const
result
:
{
data
?:
string
}
=
await
promisifyApi
(
'getStorage'
,
{
key
})
if
(
result
?.
data
)
return
result
.
data
return
result
return
undefined
}
/**
* 设置缓存数据
...
...
src/request/capiFn.ts
View file @
b6420d43
...
...
@@ -5,7 +5,7 @@ import { getRequestParams } from '../utils';
// 通用API封装方法
const
capiFn
=
(
apiList
,
request
)
=>
{
return
{
async
receiveObjectPrize
(
params
)
{
async
receiveObjectPrize
(
params
,
failMessage
,
successMessage
)
{
const
{
handle
,
method
,
ext
}
=
getRequestParams
(
apiList
[
'receiveObjectPrize'
]);
const
userAddress
:
IAddress
=
await
getUserAddress
().
catch
(
err
=>
{
commonToast
(
err
.
errorMessage
);
...
...
@@ -27,7 +27,12 @@ const capiFn = (apiList, request) => {
const
result
=
await
request
(
handle
,
method
,
params
,
ext
).
catch
(
res
=>
{
commonToast
(
res
&&
res
.
message
);
});
if
(
result
&&
!
result
.
success
)
{
commonToast
(
failMessage
||
'领取失败,前去“我的奖品”查看原因'
);
return
true
;
}
if
(
result
&&
result
.
success
)
{
successMessage
&&
commonToast
(
successMessage
)
return
true
;
}
})
...
...
@@ -46,21 +51,27 @@ const capiFn = (apiList, request) => {
return
false
;
},
async
receiveEnamePrize
(
params
)
{
async
receiveEnamePrize
(
params
,
failMessage
,
successMessage
)
{
const
{
handle
,
method
,
ext
}
=
getRequestParams
(
apiList
[
'receiveEnamePrize'
]);
const
result
=
await
request
(
handle
,
method
,
params
,
ext
).
catch
(
res
=>
{
commonToast
(
res
&&
res
.
message
);
});
if
(
result
&&
!
result
.
success
)
{
commonToast
(
failMessage
||
'领取失败,前去“我的奖品”查看原因'
);
return
true
;
}
if
(
result
&&
result
.
success
)
{
successMessage
&&
commonToast
(
successMessage
)
return
true
;
}
return
false
;
},
async
addStat
(
type
:
number
|
string
)
{
async
addStat
(
type
:
number
|
string
,
param
=
{}
)
{
const
{
handle
,
method
,
ext
}
=
getRequestParams
(
apiList
[
'addStat'
]);
const
result
=
await
request
(
handle
,
method
,
{
type
type
,
...
param
},
ext
).
catch
(
res
=>
{
commonToast
(
res
&&
res
.
message
);
});
...
...
yarn.lock
View file @
b6420d43
...
...
@@ -173,11 +173,6 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0:
dependencies:
color-convert "^2.0.1"
arg@^4.1.0:
version "4.1.3"
resolved "http://npm.dui88.com:80/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
integrity sha1-Jp/HrVuOQstjyJbVZmAXJhwUQIk=
argparse@^1.0.7:
version "1.0.10"
resolved "http://npm.dui88.com:80/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
...
...
@@ -203,11 +198,6 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0"
concat-map "0.0.1"
buffer-from@^1.0.0:
version "1.1.1"
resolved "http://npm.dui88.com:80/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
integrity sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=
callsites@^3.0.0:
version "3.1.0"
resolved "http://npm.dui88.com:80/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
...
...
@@ -259,11 +249,6 @@ concat-map@0.0.1:
resolved "http://npm.dui88.com:80/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
create-require@^1.1.0:
version "1.1.1"
resolved "http://npm.dui88.com:80/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha1-wdfo8eX2z8n/ZfnNNS03NIdWwzM=
cross-spawn@^7.0.2:
version "7.0.3"
resolved "http://npm.dui88.com:80/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
...
...
@@ -285,11 +270,6 @@ deep-is@^0.1.3:
resolved "http://npm.dui88.com:80/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=
diff@^4.0.1:
version "4.0.2"
resolved "http://npm.dui88.com:80/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha1-YPOuy4nV+uUgwRqhnvwruYKq3n0=
doctrine@^3.0.0:
version "3.0.0"
resolved "http://npm.dui88.com:80/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961"
...
...
@@ -631,11 +611,6 @@ lru-cache@^6.0.0:
dependencies:
yallist "^4.0.0"
make-error@^1.1.1:
version "1.3.6"
resolved "http://npm.dui88.com:80/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha1-LrLjfqm2fEiR9oShOUeZr0hM96I=
minimatch@^3.0.4:
version "3.0.4"
resolved "http://npm.dui88.com:80/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
...
...
@@ -766,19 +741,6 @@ slice-ansi@^4.0.0:
astral-regex "^2.0.0"
is-fullwidth-code-point "^3.0.0"
source-map-support@^0.5.17:
version "0.5.19"
resolved "http://npm.dui88.com:80/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"
integrity sha1-qYti+G3K9PZzmWSMCFKRq56P7WE=
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"
source-map@^0.6.0:
version "0.6.1"
resolved "http://npm.dui88.com:80/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha1-dHIq8y6WFOnCh6jQu95IteLxomM=
sprintf-js@~1.0.2:
version "1.0.3"
resolved "http://npm.dui88.com:80/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
...
...
@@ -834,18 +796,6 @@ text-table@^0.2.0:
resolved "http://npm.dui88.com:80/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=
ts-node@^9.0.0:
version "9.1.1"
resolved "http://npm.dui88.com:80/ts-node/-/ts-node-9.1.1.tgz#51a9a450a3e959401bda5f004a72d54b936d376d"
integrity sha1-UamkUKPpWUAb2l8ASnLVS5NtN20=
dependencies:
arg "^4.1.0"
create-require "^1.1.0"
diff "^4.0.1"
make-error "^1.1.1"
source-map-support "^0.5.17"
yn "3.1.1"
tslib@^1.8.1:
version "1.14.1"
resolved "http://npm.dui88.com:80/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
...
...
@@ -870,11 +820,6 @@ type-fest@^0.8.1:
resolved "http://npm.dui88.com:80/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
integrity sha1-CeJJ696FHTseSNJ8EFREZn8XuD0=
typescript@^3.9.7:
version "3.9.7"
resolved "http://npm.dui88.com:80/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
integrity sha1-mNYApevcOPQMsndSLxLcgA6eJfo=
uri-js@^4.2.2:
version "4.4.1"
resolved "http://npm.dui88.com:80/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
...
...
@@ -908,8 +853,3 @@ yallist@^4.0.0:
version "4.0.0"
resolved "http://npm.dui88.com:80/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
integrity sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=
yn@3.1.1:
version "3.1.1"
resolved "http://npm.dui88.com:80/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
integrity sha1-HodAGgnXZ8HV6rJqbkwYUYLS61A=
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment