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
9c028b13
Commit
9c028b13
authored
Sep 06, 2021
by
mqf_0707
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新默认接口
parent
dc8ff82e
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
524 additions
and
220 deletions
+524
-220
tb.d.ts
lib/core/tb.d.ts
+1
-1
tb.js
lib/core/tb.js
+2
-0
tb.js.map
lib/core/tb.js.map
+1
-1
index.d.ts
lib/index.d.ts
+8
-12
index.js
lib/index.js
+2
-2
index.js.map
lib/index.js.map
+1
-1
capi.d.ts
lib/request/capi.d.ts
+5
-5
capi.js
lib/request/capi.js
+7
-7
capi.js.map
lib/request/capi.js.map
+1
-1
capiFn.d.ts
lib/request/capiFn.d.ts
+18
-7
capiFn.js
lib/request/capiFn.js
+171
-96
capiFn.js.map
lib/request/capiFn.js.map
+1
-1
index.d.ts
lib/utils/index.d.ts
+14
-0
index.js
lib/utils/index.js
+84
-1
index.js.map
lib/utils/index.js.map
+1
-1
package.json
package.json
+1
-1
tb.ts
src/core/tb.ts
+1
-0
index.ts
src/index.ts
+1
-1
capi.ts
src/request/capi.ts
+13
-13
capiFn.ts
src/request/capiFn.ts
+112
-68
index.d.ts
src/typing/index.d.ts
+11
-1
index.ts
src/utils/index.ts
+68
-0
No files found.
lib/core/tb.d.ts
View file @
9c028b13
...
...
@@ -27,7 +27,7 @@ export declare const getSystemInfo: () => Promise<unknown>;
* @param {number} sellerId 店铺归属的卖家Id
* @returns {boolean} 关注状态
*/
export
declare
const
favorShop
:
(
sellerId
:
number
)
=>
Promise
<
false
|
{
export
declare
const
favorShop
:
(
sellerId
:
number
)
=>
Promise
<
boolean
|
{
error
?:
number
;
}
>
;
/**
...
...
lib/core/tb.js
View file @
9c028b13
...
...
@@ -119,6 +119,8 @@ var favorShop = function (sellerId) { return __awaiter(void 0, void 0, void 0, f
result
=
_a
.
sent
();
if
((
result
===
null
||
result
===
void
0
?
void
0
:
result
.
error
)
===
11
)
return
[
2
/*return*/
,
false
];
if
((
result
===
null
||
result
===
void
0
?
void
0
:
result
.
error
)
===
12
)
return
[
2
/*return*/
,
true
];
return
[
2
/*return*/
,
result
];
}
});
...
...
lib/core/tb.js.map
View file @
9c028b13
{"version":3,"file":"tb.js","sourceRoot":"","sources":["../../src/core/tb.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAKmB;AACnB;;;;;GAKG;AACI,IAAM,WAAW,GAAG,UAAC,OAAe,EAAE,QAAiB,EAAE,SAAqB;IACjF,4BAAkB,CAAC,WAAW,EAAC;QAC3B,OAAO,EAAE,OAAO,IAAI,WAAW;QAC/B,QAAQ,EAAE,QAAQ,IAAI,IAAI;QAC1B,OAAO,EAAE,SAAS;KACrB,CAAC,CAAA;AACN,CAAC,CAAC;AANW,QAAA,WAAW,eAMtB;AACF;;;GAGG;AACI,IAAM,WAAW,GAAG,UAAC,OAAe;IACvC,4BAAkB,CAAC,OAAO,EAAC;QACvB,OAAO,SAAA;KACV,CAAC,CAAA;AACN,CAAC,CAAC;AAJW,QAAA,WAAW,eAItB;AACF;;;;;GAKG;AACI,IAAM,aAAa,GAAG,UAAO,KAAY,EAAE,OAAe,EAAE,SAAqB;IAApD,sBAAA,EAAA,YAAY;;;YAC5C,4BAAkB,CAAC,SAAS,EAAC;gBACzB,KAAK,OAAA;gBACL,OAAO,SAAA;gBACP,iBAAiB,EAAE,IAAI;gBACvB,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;;oBAChC,qBAAM,0BAAgB,CAAC,SAAS,EAAC,EAAE,MAAM,QAAA,EAAE,CAAC,EAAA;;gBAArD,MAAM,GAAG,SAA4C;gBACzD,sBAAO,MAAM,EAAA;;;KAChB,CAAA;AAHY,QAAA,YAAY,gBAGxB;AACD;;GAEG;AACI,IAAM,YAAY,GAAG;;;;oBACX,qBAAM,0BAAgB,CAAC,SAAS,EAAC,EAAE,CAAC,EAAA;;gBAA7C,MAAM,GAAG,SAAoC;gBACjD,sBAAO,MAAM,EAAA;;;KAChB,CAAA;AAHY,QAAA,YAAY,gBAGxB;AACD;;;;;GAKG;AACI,IAAM,kBAAkB,GAAG,UAAO,MAAc,EAAE,KAAc,EAAE,QAAiB;;;;oBACzE,qBAAM,0BAAgB,CAAC,oBAAoB,EAAC;oBACrD,IAAI,EAAE;wBACF,MAAM,QAAA;wBACN,KAAK,EAAE,KAAK,IAAI,CAAC,CAAC;wBAClB,QAAQ,EAAE,QAAQ,IAAI,CAAC;wBACvB,aAAa,EAAE,EAAE;qBACpB;iBACJ,CAAC,EAAA;;gBAPE,MAAM,GAAG,SAOX;gBACF,sBAAO,MAAM,EAAA;;;KAChB,CAAA;AAVY,QAAA,kBAAkB,sBAU9B"}
\ No newline at end of file
lib/index.d.ts
View file @
9c028b13
import
*
as
utils
from
'./utils'
;
import
*
as
constants
from
'./constants'
;
import
*
as
capiFn
from
'./request/capiFn'
;
declare
const
_default
:
{
capi
:
{
getMy
Prize
List
:
{
getMy
Awards
List
:
{
method
:
string
;
handle
:
string
;
isShowLoading
:
boolean
;
...
...
@@ -15,29 +16,24 @@ declare const _default: {
method
:
string
;
handle
:
string
;
};
getItemListByItemIds
:
{
completeTask
:
{
method
:
string
;
handle
:
string
;
};
getCollectGoodsList
:
{
receiveTask
:
{
method
:
string
;
handle
:
string
;
};
doCompleteTask
:
{
getTaskList
:
{
method
:
string
;
handle
:
string
;
};
get
VipInfo
:
{
get
CollectGoods
:
{
method
:
string
;
handle
:
string
;
};
};
capiFn
:
(
apiList
:
any
,
request
:
any
)
=>
{
receiveObjectPrize
(
params
:
any
):
Promise
<
false
|
void
>
;
getVipInfo
(
params
:
any
):
Promise
<
any
>
;
receiveEnamePrize
(
params
:
any
):
Promise
<
boolean
>
;
addStat
(
activityId
:
string
,
type
:
string
|
number
):
Promise
<
boolean
>
;
};
capiFn
:
typeof
capiFn
;
tb
:
{
getUserAddress
:
(
opts
?:
{})
=>
Promise
<
unknown
>
;
chooseImage
:
(
opts
?:
{})
=>
Promise
<
unknown
>
;
...
...
@@ -56,7 +52,7 @@ declare const _default: {
simpleAlert
:
(
content
:
string
)
=>
void
;
commonConfirm
:
(
title
:
string
,
content
:
string
,
successCb
?:
()
=>
any
)
=>
Promise
<
void
>
;
getSystemInfo
:
()
=>
Promise
<
unknown
>
;
favorShop
:
(
sellerId
:
number
)
=>
Promise
<
false
|
{
favorShop
:
(
sellerId
:
number
)
=>
Promise
<
boolean
|
{
error
?:
number
;
}
>
;
checkShopFavoredStatus
:
(
sellerId
:
number
)
=>
Promise
<
boolean
|
{
...
...
lib/index.js
View file @
9c028b13
...
...
@@ -16,11 +16,11 @@ var tbFn = require("./core/tbFn");
var
utils
=
require
(
"./utils"
);
var
constants
=
require
(
"./constants"
);
var
capi_1
=
require
(
"./request/capi"
);
var
capiFn
_1
=
require
(
"./request/capiFn"
);
var
capiFn
=
require
(
"./request/capiFn"
);
var
request_1
=
require
(
"./request"
);
exports
.
default
=
{
capi
:
capi_1
.
default
,
capiFn
:
capiFn
_1
.
default
,
capiFn
:
capiFn
,
tb
:
__assign
(
__assign
({},
tb
),
tbFn
),
utils
:
utils
,
request
:
request_1
.
default
,
...
...
lib/index.js.map
View file @
9c028b13
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,8BAAgC;AAChC,kCAAoC;AACpC,+BAAiC;AACjC,uCAAyC;AACzC,uCAAkC;AAClC,2CAAsC;AACtC,qCAAgC;AAEhC,kBAAe;IACb,IAAI,gBAAA;IACJ,MAAM,kBAAA;IACN,EAAE,wBACE,EAAE,GAAK,IAAI,CACd;IACD,KAAK,OAAA;IACL,OAAO,mBAAA;IACP,SAAS,WAAA;CACV,CAAA"}
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,8BAAgC;AAChC,kCAAoC;AACpC,+BAAiC;AACjC,uCAAyC;AACzC,uCAAkC;AAClC,yCAA2C;AAC3C,qCAAgC;AAEhC,kBAAe;IACb,IAAI,gBAAA;IACJ,MAAM,QAAA;IACN,EAAE,wBACE,EAAE,GAAK,IAAI,CACd;IACD,KAAK,OAAA;IACL,OAAO,mBAAA;IACP,SAAS,WAAA;CACV,CAAA"}
\ No newline at end of file
lib/request/capi.d.ts
View file @
9c028b13
declare
const
capi
:
{
getMy
Prize
List
:
{
getMy
Awards
List
:
{
method
:
string
;
handle
:
string
;
isShowLoading
:
boolean
;
...
...
@@ -12,19 +12,19 @@ declare const capi: {
method
:
string
;
handle
:
string
;
};
getItemListByItemIds
:
{
completeTask
:
{
method
:
string
;
handle
:
string
;
};
getCollectGoodsList
:
{
receiveTask
:
{
method
:
string
;
handle
:
string
;
};
doCompleteTask
:
{
getTaskList
:
{
method
:
string
;
handle
:
string
;
};
get
VipInfo
:
{
get
CollectGoods
:
{
method
:
string
;
handle
:
string
;
};
...
...
lib/request/capi.js
View file @
9c028b13
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
var
capi
=
{
getMy
Prize
List
:
{
getMy
Awards
List
:
{
method
:
'GET'
,
handle
:
'getMy
Prize
List'
,
isShowLoading
:
fals
e
handle
:
'getMy
Awards
List'
,
isShowLoading
:
tru
e
},
receiveObjectPrize
:
{
method
:
'GET'
,
handle
:
'receiveObjectPrize'
},
receiveEnamePrize
:
{
method
:
'GET'
,
handle
:
'receiveEnamePrize'
},
getItemListByItemIds
:
{
method
:
'GET'
,
handle
:
'getItemListByItemIds
'
},
getCollectGoodsList
:
{
method
:
'GET'
,
handle
:
'getCollectGoodsList
'
},
doCompleteTask
:
{
method
:
'GET'
,
handle
:
'doCompleteTask
'
},
get
VipInfo
:
{
method
:
'GET'
,
handle
:
'getVipInfo'
}
completeTask
:
{
method
:
'GET'
,
handle
:
'completeTask
'
},
receiveTask
:
{
method
:
'GET'
,
handle
:
'receiveTask
'
},
getTaskList
:
{
method
:
'GET'
,
handle
:
'getTaskList
'
},
get
CollectGoods
:
{
method
:
'GET'
,
handle
:
'getCollectGoods'
},
};
exports
.
default
=
capi
;
//# sourceMappingURL=capi.js.map
\ No newline at end of file
lib/request/capi.js.map
View file @
9c028b13
{"version":3,"file":"capi.js","sourceRoot":"","sources":["../../src/request/capi.ts"],"names":[],"mappings":";;AAAA,IAAM,IAAI,GAAG;IACT,cAAc,EAAE;QACd,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,gBAAgB;QACxB,aAAa,EAAE,KAAK;KACrB;IACD,kBAAkB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,oBAAoB,EAAE;IACnE,iBAAiB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE;IACjE,oBAAoB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,sBAAsB,EAAE;IACvE,mBAAmB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE;IACrE,cAAc,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE;IAC3D,UAAU,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE;CACpD,CAAC;AAEF,kBAAe,IAAI,CAAC"}
\ No newline at end of file
{"version":3,"file":"capi.js","sourceRoot":"","sources":["../../src/request/capi.ts"],"names":[],"mappings":";;AAAA,IAAM,IAAI,GAAG;IACX,eAAe,EAAE;QACf,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,iBAAiB;QACzB,aAAa,EAAE,IAAI;KACpB;IACD,kBAAkB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,oBAAoB,EAAE;IACnE,iBAAiB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE;IACjE,YAAY,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE;IACvD,WAAW,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE;IACrD,WAAW,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE;IACrD,eAAe,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE;CAC9D,CAAC;AAEF,kBAAe,IAAI,CAAC"}
\ No newline at end of file
lib/request/capiFn.d.ts
View file @
9c028b13
declare
const
capiFn
:
(
apiList
:
any
,
request
:
any
)
=>
{
receiveObjectPrize
(
params
:
any
):
Promise
<
false
|
void
>
;
getVipInfo
(
params
:
any
):
Promise
<
any
>
;
receiveEnamePrize
(
params
:
any
):
Promise
<
boolean
>
;
addStat
(
activityId
:
string
,
type
:
number
|
string
):
Promise
<
boolean
>
;
};
export
default
capiFn
;
/**
* 领取实物奖品
* @param api
* @param data
*/
export
declare
const
receiveObjectPrize
:
(
api
:
any
,
data
:
IReceivePrize
)
=>
Promise
<
unknown
>
;
/**
* 领取权益
* @param api
* @param data
*/
export
declare
const
receiveEnamePrize
:
(
api
:
any
,
data
:
IReceivePrize
)
=>
Promise
<
unknown
>
;
/**
* 会员优惠券领取
* @param api
* @param data
*/
export
declare
const
receiveMemberEname
:
(
api
:
any
,
data
:
IReceivePrize
)
=>
Promise
<
unknown
>
;
lib/request/capiFn.js
View file @
9c028b13
...
...
@@ -46,124 +46,199 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
if
(
op
[
0
]
&
5
)
throw
op
[
1
];
return
{
value
:
op
[
0
]
?
op
[
1
]
:
void
0
,
done
:
true
};
}
};
var
__rest
=
(
this
&&
this
.
__rest
)
||
function
(
s
,
e
)
{
var
t
=
{};
for
(
var
p
in
s
)
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
s
,
p
)
&&
e
.
indexOf
(
p
)
<
0
)
t
[
p
]
=
s
[
p
];
if
(
s
!=
null
&&
typeof
Object
.
getOwnPropertySymbols
===
"function"
)
for
(
var
i
=
0
,
p
=
Object
.
getOwnPropertySymbols
(
s
);
i
<
p
.
length
;
i
++
)
{
if
(
e
.
indexOf
(
p
[
i
])
<
0
&&
Object
.
prototype
.
propertyIsEnumerable
.
call
(
s
,
p
[
i
]))
t
[
p
[
i
]]
=
s
[
p
[
i
]];
}
return
t
;
};
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
exports
.
receiveMemberEname
=
exports
.
receiveEnamePrize
=
exports
.
receiveObjectPrize
=
void
0
;
var
tb_1
=
require
(
"../core/tb"
);
var
tbFn_1
=
require
(
"../core/tbFn"
);
var
utils_1
=
require
(
"../utils"
);
// 通用API封装方法
var
capiFn
=
function
(
apiList
,
request
)
{
return
{
receiveObjectPrize
:
function
(
params
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
_a
,
handle
,
method
,
ext
,
userAddress
,
_b
,
name
,
telNumber
,
provinceName
,
cityName
,
cityCode
,
countyName
,
detailInfo
,
streetName
,
confirmResult
,
_c
;
return
__generator
(
this
,
function
(
_d
)
{
switch
(
_d
.
label
)
{
case
0
:
_a
=
utils_1
.
getRequestParams
(
apiList
[
'receiveObjectPrize'
]),
handle
=
_a
.
handle
,
method
=
_a
.
method
,
ext
=
_a
.
ext
;
return
[
4
/*yield*/
,
tbFn_1
.
getUserAddress
().
catch
(
function
(
err
)
{
// 领取实物
var
getUerAddressParam
=
function
()
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
var
userAddress
,
_a
,
name
,
telNumber
,
provinceName
,
cityName
,
cityCode
,
countyName
,
detailInfo
,
streetName
,
params
;
return
__generator
(
this
,
function
(
_b
)
{
switch
(
_b
.
label
)
{
case
0
:
return
[
4
/*yield*/
,
tbFn_1
.
getUserAddress
().
catch
(
function
(
err
)
{
tb_1
.
commonToast
(
err
.
errorMessage
);
})];
case
1
:
userAddress
=
_d
.
sent
();
_b
=
userAddress
||
{},
name
=
_b
.
name
,
telNumber
=
_b
.
telNumber
,
provinceName
=
_b
.
provinceName
,
cityName
=
_b
.
cityName
,
cityCode
=
_b
.
cityCode
,
countyName
=
_b
.
countyName
,
detailInfo
=
_b
.
detailInfo
,
streetName
=
_b
.
streetName
;
params
=
__assign
({
name
:
name
,
phone
:
telNumber
,
addressDetail
:
detailInfo
,
cityCode
:
cityCode
,
city
:
cityName
,
province
:
provinceName
,
area
:
countyName
,
streetName
:
streetName
},
params
);
if
(
!
userAddress
)
return
[
3
/*break*/
,
3
];
return
[
4
/*yield*/
,
tb_1
.
commonConfirm
(
'提示'
,
'确认使用该收货地址:'
+
name
+
telNumber
+
userAddress
.
duibaAddress
.
address
,
function
()
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
result
;
return
__generator
(
this
,
function
(
_a
)
{
switch
(
_a
.
label
)
{
case
0
:
return
[
4
/*yield*/
,
request
(
handle
,
method
,
params
,
ext
).
catch
(
function
(
res
)
{
tb_1
.
commonToast
(
res
&&
res
.
message
);
})];
case
1
:
result
=
_a
.
sent
();
if
(
result
&&
result
.
success
)
{
return
[
2
/*return*/
,
true
];
}
userAddress
=
_b
.
sent
();
if
(
!
userAddress
)
return
[
2
/*return*/
,
false
];
_a
=
userAddress
||
{},
name
=
_a
.
name
,
telNumber
=
_a
.
telNumber
,
provinceName
=
_a
.
provinceName
,
cityName
=
_a
.
cityName
,
cityCode
=
_a
.
cityCode
,
countyName
=
_a
.
countyName
,
detailInfo
=
_a
.
detailInfo
,
streetName
=
_a
.
streetName
;
params
=
{
name
:
name
,
phone
:
telNumber
,
addressDetail
:
detailInfo
,
cityCode
:
cityCode
,
city
:
cityName
,
province
:
provinceName
,
area
:
countyName
,
streetName
:
streetName
,
};
return
[
2
/*return*/
,
{
params
:
params
,
duibaAddress
:
userAddress
.
duibaAddress
.
address
}];
}
});
});
})];
case
2
:
_c
=
(
_d
.
sent
());
return
[
3
/*break*/
,
4
];
case
3
:
_c
=
false
;
_d
.
label
=
4
;
case
4
:
confirmResult
=
_c
;
return
[
2
/*return*/
,
confirmResult
];
});
};
var
confirmAddress
=
function
(
address
)
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
return
__generator
(
this
,
function
(
_a
)
{
return
[
2
/*return*/
,
new
Promise
(
function
(
resolve
,
reject
)
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
return
__generator
(
this
,
function
(
_a
)
{
// @ts-ignore
my
.
confirm
({
title
:
'提示'
,
content
:
'确认使用该收货地址:'
+
address
,
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
resolve
(
true
);
}
else
{
resolve
(
false
);
}
},
});
return
[
2
/*return*/
];
});
},
getVipInfo
:
function
(
params
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
_a
,
handle
,
method
,
ext
,
result
,
isVip
;
});
})];
});
});
};
/**
* 领取实物奖品
* @param api
* @param data
*/
var
receiveObjectPrize
=
function
(
api
,
data
)
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
var
params
,
successMsg
,
errorMsg
;
return
__generator
(
this
,
function
(
_a
)
{
params
=
data
.
params
,
successMsg
=
data
.
successMsg
,
errorMsg
=
data
.
errorMsg
;
return
[
2
/*return*/
,
new
Promise
(
function
(
resolve
,
reject
)
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
var
userInfo
,
_params
,
duibaAddress
,
name
,
phone
,
address
,
canPass
,
_a
,
success
,
data
,
message
;
return
__generator
(
this
,
function
(
_b
)
{
switch
(
_b
.
label
)
{
case
0
:
_a
=
utils_1
.
getRequestParams
(
apiList
[
'getVipInfo'
]),
handle
=
_a
.
handle
,
method
=
_a
.
method
,
ext
=
_a
.
ext
;
return
[
4
/*yield*/
,
request
(
handle
,
method
,
params
,
ext
).
catch
(
function
(
res
)
{
tb_1
.
commonToast
(
res
&&
res
.
message
);
})];
case
0
:
return
[
4
/*yield*/
,
getUerAddressParam
()];
case
1
:
result
=
_b
.
sent
();
if
(
result
&&
result
.
success
)
{
isVip
=
result
.
data
.
isVip
;
return
[
2
/*return*/
,
isVip
];
userInfo
=
_b
.
sent
();
if
(
!
userInfo
)
{
resolve
(
false
)
;
return
[
2
/*return*/
];
}
return
[
2
/*return*/
,
false
];
_params
=
userInfo
.
params
,
duibaAddress
=
userInfo
.
duibaAddress
;
name
=
_params
.
name
,
phone
=
_params
.
phone
;
address
=
name
+
phone
+
duibaAddress
;
return
[
4
/*yield*/
,
confirmAddress
(
address
)];
case
2
:
canPass
=
_b
.
sent
();
if
(
!
canPass
)
{
resolve
(
false
);
return
[
2
/*return*/
];
}
return
[
4
/*yield*/
,
api
(
__assign
(
__assign
({},
params
),
_params
))];
case
3
:
_a
=
_b
.
sent
(),
success
=
_a
.
success
,
data
=
_a
.
data
,
message
=
_a
.
message
;
if
(
success
)
{
tb_1
.
commonToast
(
successMsg
);
resolve
(
true
);
}
else
{
tb_1
.
commonToast
(
errorMsg
||
message
);
resolve
(
false
);
}
return
[
2
/*return*/
];
}
});
});
})];
});
},
receiveEnamePrize
:
function
(
params
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
_a
,
handle
,
method
,
ext
,
result
;
});
};
exports
.
receiveObjectPrize
=
receiveObjectPrize
;
/**
* 领取权益
* @param api
* @param data
*/
var
receiveEnamePrize
=
function
(
api
,
data
)
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
var
params
,
successMsg
,
errorMsg
;
return
__generator
(
this
,
function
(
_a
)
{
params
=
data
.
params
,
successMsg
=
data
.
successMsg
,
errorMsg
=
data
.
errorMsg
;
return
[
2
/*return*/
,
new
Promise
(
function
(
resolve
,
reject
)
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
var
_a
,
success
,
data
,
message
;
return
__generator
(
this
,
function
(
_b
)
{
switch
(
_b
.
label
)
{
case
0
:
_a
=
utils_1
.
getRequestParams
(
apiList
[
'receiveEnamePrize'
]),
handle
=
_a
.
handle
,
method
=
_a
.
method
,
ext
=
_a
.
ext
;
return
[
4
/*yield*/
,
request
(
handle
,
method
,
params
,
ext
).
catch
(
function
(
res
)
{
tb_1
.
commonToast
(
res
&&
res
.
message
);
case
0
:
return
[
4
/*yield*/
,
api
(
params
).
catch
(
function
(
res
)
{
tb_1
.
commonToast
(
successMsg
||
res
.
message
);
resolve
(
false
);
})];
case
1
:
result
=
_b
.
sent
();
if
(
result
&&
result
.
success
)
{
return
[
2
/*return*/
,
true
];
_a
=
_b
.
sent
(),
success
=
_a
.
success
,
data
=
_a
.
data
,
message
=
_a
.
message
;
if
(
success
)
{
tb_1
.
commonToast
(
successMsg
);
resolve
(
true
);
}
return
[
2
/*return*/
,
false
];
else
{
tb_1
.
commonToast
(
errorMsg
||
message
);
resolve
(
false
);
}
return
[
2
/*return*/
];
}
});
});
})];
});
},
addStat
:
function
(
activityId
,
type
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
_a
,
handle
,
method
,
ext
,
result
;
});
};
exports
.
receiveEnamePrize
=
receiveEnamePrize
;
/**
* 会员优惠券领取
* @param api
* @param data
*/
var
receiveMemberEname
=
function
(
api
,
data
)
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
var
params
,
successMsg
,
errorMsg
,
sellerId
,
ename
,
ext
;
return
__generator
(
this
,
function
(
_a
)
{
params
=
data
.
params
,
successMsg
=
data
.
successMsg
,
errorMsg
=
data
.
errorMsg
;
sellerId
=
params
.
sellerId
,
ename
=
params
.
ename
,
ext
=
__rest
(
params
,
[
"sellerId"
,
"ename"
]);
if
(
!
ename
)
return
[
2
/*return*/
,
false
];
return
[
2
/*return*/
,
new
Promise
(
function
(
resolve
,
reject
)
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
var
result
,
_a
,
success
,
data_1
,
message
;
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
,
{
activityId
:
activityId
,
type
:
type
},
ext
).
catch
(
function
(
res
)
{
tb_1
.
commonToast
(
res
&&
res
.
message
);
})];
case
0
:
return
[
4
/*yield*/
,
utils_1
.
applyActivity
({
sellerId
:
sellerId
,
activityId
:
ename
})];
case
1
:
result
=
_b
.
sent
();
if
(
result
&&
result
.
success
)
{
return
[
2
/*return*/
,
true
];
if
(
!
result
)
resolve
(
false
);
if
(
!
result
.
businessSuccess
)
return
[
3
/*break*/
,
3
];
return
[
4
/*yield*/
,
api
(
__assign
({},
ext
))];
case
2
:
_a
=
_b
.
sent
(),
success
=
_a
.
success
,
data_1
=
_a
.
data
,
message
=
_a
.
message
;
if
(
success
)
{
tb_1
.
commonToast
(
successMsg
||
'奖品发放成功,请前往我的奖品处进行使用'
);
resolve
(
true
);
}
return
[
2
/*return*/
,
false
];
else
{
tb_1
.
commonToast
(
errorMsg
||
message
);
resolve
(
false
);
}
return
[
3
/*break*/
,
4
];
case
3
:
tb_1
.
commonToast
(
result
.
errorMsg
);
resolve
(
false
);
_b
.
label
=
4
;
case
4
:
return
[
2
/*return*/
];
}
});
});
})];
});
},
};
};
exports
.
default
=
capiFn
;
});
};
exports
.
receiveMemberEname
=
receiveMemberEname
;
//# sourceMappingURL=capiFn.js.map
\ No newline at end of file
lib/request/capiFn.js.map
View file @
9c028b13
{"version":3,"file":"capiFn.js","sourceRoot":"","sources":["../../src/request/capiFn.ts"],"names":[],"mapp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ChC,OAAO,CAAC,KAAK,CAAC,CAAA;6BACjB;;;4BAED,gBAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;4BAC5B,OAAO,CAAC,KAAK,CAAC,CAAA;;;;;iBAErB,CAAC,EAAA;;KACH,CAAA;AArBY,QAAA,kBAAkB,sBAqB9B"}
\ No newline at end of file
lib/utils/index.d.ts
View file @
9c028b13
...
...
@@ -70,4 +70,18 @@ export declare const validateActivityStatus: (checkParam: {
endTime
:
number
;
noCheck
:
boolean
;
})
=>
Promise
<
unknown
>
;
/**
* 查询商家权益活动
* @param sellerId
*/
export
declare
const
getActivity
:
(
sellerId
:
number
)
=>
any
[]
|
Promise
<
unknown
>
;
/**
* 领取会员优惠券
* @param params
*/
export
declare
const
applyActivity
:
(
params
:
{
sellerId
:
number
;
activityId
:
string
;
})
=>
false
|
Promise
<
unknown
>
;
export
declare
const
getGrade
:
(
sellerId
:
number
)
=>
any
[]
|
Promise
<
unknown
>
;
export
{};
lib/utils/index.js
View file @
9c028b13
...
...
@@ -58,7 +58,7 @@ var __rest = (this && this.__rest) || function (s, e) {
return
t
;
};
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
exports
.
validateActivityStatus
=
exports
.
formatTimeStamp
=
exports
.
checkIsMember
=
exports
.
getImgShareUrl
=
exports
.
throttleHandle
=
exports
.
generateAPI
=
exports
.
getRequestParams
=
exports
.
versionCompare
=
exports
.
dateFormatter
=
void
0
;
exports
.
getGrade
=
exports
.
applyActivity
=
exports
.
getActivity
=
exports
.
validateActivityStatus
=
exports
.
formatTimeStamp
=
exports
.
checkIsMember
=
exports
.
getImgShareUrl
=
exports
.
throttleHandle
=
exports
.
generateAPI
=
exports
.
getRequestParams
=
exports
.
versionCompare
=
exports
.
dateFormatter
=
void
0
;
var
tb_1
=
require
(
"../core/tb"
);
/**
* 时间格式化
...
...
@@ -275,4 +275,87 @@ var validateActivityStatus = function (checkParam) { return __awaiter(void 0, vo
});
});
};
exports
.
validateActivityStatus
=
validateActivityStatus
;
/**
* 查询商家权益活动
* @param sellerId
*/
var
getActivity
=
function
(
sellerId
)
{
// @ts-ignore
var
memberBenefitPlugin
=
requirePlugin
(
"memberBenefit"
);
if
(
!
memberBenefitPlugin
)
return
[];
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
return
__generator
(
this
,
function
(
_a
)
{
memberBenefitPlugin
.
getActivity
({
data
:
{
sellerId
:
sellerId
,
},
success
:
function
(
result
)
{
resolve
(
result
);
},
fail
:
function
(
error
)
{
console
.
log
(
'获取失败'
+
JSON
.
stringify
(
error
));
resolve
(
error
);
}
});
return
[
2
/*return*/
];
});
});
});
};
exports
.
getActivity
=
getActivity
;
/**
* 领取会员优惠券
* @param params
*/
var
applyActivity
=
function
(
params
)
{
var
sellerId
=
params
.
sellerId
,
activityId
=
params
.
activityId
;
// @ts-ignore
var
memberBenefitPlugin
=
requirePlugin
(
"memberBenefit"
);
if
(
!
memberBenefitPlugin
)
return
false
;
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
return
__generator
(
this
,
function
(
_a
)
{
memberBenefitPlugin
.
applyActivity
({
data
:
{
sellerId
:
sellerId
,
activityId
:
activityId
,
},
success
:
function
(
result
)
{
resolve
(
result
);
},
fail
:
function
(
error
)
{
console
.
warn
(
'领取商家权益失败'
+
JSON
.
stringify
(
error
.
data
));
resolve
(
error
.
data
);
}
});
return
[
2
/*return*/
];
});
});
});
};
exports
.
applyActivity
=
applyActivity
;
// 查询商家会员等级
var
getGrade
=
function
(
sellerId
)
{
// @ts-ignore
var
memberBenefitPlugin
=
requirePlugin
(
"memberBenefit"
);
if
(
!
memberBenefitPlugin
)
return
[];
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
return
__generator
(
this
,
function
(
_a
)
{
memberBenefitPlugin
.
getGrade
({
data
:
{
sellerId
:
sellerId
},
success
:
function
(
result
)
{
resolve
(
result
);
},
fail
:
function
(
error
)
{
console
.
log
(
'查询商家会员等级失败'
+
JSON
.
stringify
(
error
));
resolve
(
error
);
}
});
return
[
2
/*return*/
];
});
});
});
};
exports
.
getGrade
=
getGrade
;
//# sourceMappingURL=index.js.map
\ No newline at end of file
lib/utils/index.js.map
View file @
9c028b13
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAwD;AACxD;;;;;GAKG;AACI,IAAM,aAAa,GAAG,UAAC,OAAe,EAAE,MAAqB;IAArB,uBAAA,EAAA,qBAAqB;IAChE,IAAI,CAAC,OAAO;QAAE,OAAO,GAAG,CAAC;IAEzB,IAAM,IAAI,GAAG,IAAI,IAAI,CACnB,OAAO,OAAO,KAAK,QAAQ,IAAI,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CACtF,CAAC;IACF,IAAI,CAAC,GAAG;QACN,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;QACzB,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE;QACpB,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE;QACrB,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE;QACvB,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE;QACvB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAC3C,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE;KAC1B,CAAC;IACF,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QACvB,MAAM,GAAG,MAAM,CAAC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,UAAC,KAAK;oBACR,OAAO,CAAC,IAAI,CAAC,UAAU,GAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;oBACnD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;gBACvB,CAAC;aACF,CAAC,CAAC;;;SACR,CAAC,CAAA;AACJ,CAAC,CAAA;AApBY,QAAA,aAAa,iBAoBzB;AACD,WAAW;AACJ,IAAM,QAAQ,GAAG,UAAC,QAAgB;IACvC,aAAa;IACb,IAAM,mBAAmB,GAAG,aAAa,CAAC,eAAe,CAAC,CAAA;IAC1D,IAAG,CAAC,mBAAmB;QAAE,OAAO,EAAE,CAAA;IAClC,OAAO,IAAI,OAAO,CAAC,UAAO,OAAO,EAAC,MAAM;;YACpC,mBAAmB,CAAC,QAAQ,CAAC;gBACzB,IAAI,EAAE;oBACJ,QAAQ,UAAA;iBACT;gBACD,OAAO,EAAE,UAAC,MAAM;oBACZ,OAAO,CAAC,MAAM,CAAC,CAAA;gBACnB,CAAC;gBACD,IAAI,EAAE,UAAC,KAAK;oBACR,OAAO,CAAC,GAAG,CAAC,YAAY,GAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;oBAC/C,OAAO,CAAC,KAAK,CAAC,CAAA;gBAClB,CAAC;aACF,CAAC,CAAC;;;SACR,CAAC,CAAA;AACJ,CAAC,CAAA;AAlBY,QAAA,QAAQ,YAkBpB"}
\ No newline at end of file
package.json
View file @
9c028b13
{
"name"
:
"tbcc-sdk-ts"
,
"version"
:
"1.0.
6
"
,
"version"
:
"1.0.
7
"
,
"description"
:
""
,
"main"
:
"lib/index.js"
,
"scripts"
:
{
...
...
src/core/tb.ts
View file @
9c028b13
...
...
@@ -63,6 +63,7 @@ export const favorShop = async (sellerId: number) => {
}
let
result
:
{
error
?:
number
}
=
await
promisifyApiToTb
(
'favorShop'
,{
id
:
+
sellerId
})
if
(
result
?.
error
===
11
)
return
false
if
(
result
?.
error
===
12
)
return
true
return
result
};
/**
...
...
src/index.ts
View file @
9c028b13
...
...
@@ -3,7 +3,7 @@ import * as tbFn from './core/tbFn';
import
*
as
utils
from
'./utils'
;
import
*
as
constants
from
'./constants'
;
import
capi
from
'./request/capi'
;
import
capiFn
from
'./request/capiFn'
;
import
*
as
capiFn
from
'./request/capiFn'
;
import
request
from
'./request'
;
export
default
{
...
...
src/request/capi.ts
View file @
9c028b13
const
capi
=
{
getMyPrize
List
:
{
getMyAwards
List
:
{
method
:
'GET'
,
handle
:
'getMyPrize
List'
,
isShowLoading
:
fals
e
handle
:
'getMyAwards
List'
,
isShowLoading
:
tru
e
},
receiveObjectPrize
:
{
method
:
'GET'
,
handle
:
'receiveObjectPrize'
},
receiveEnamePrize
:
{
method
:
'GET'
,
handle
:
'receiveEnamePrize'
},
getItemListByItemIds
:
{
method
:
'GET'
,
handle
:
'getItemListByItemIds
'
},
getCollectGoodsList
:
{
method
:
'GET'
,
handle
:
'getCollectGoodsList
'
},
doCompleteTask
:
{
method
:
'GET'
,
handle
:
'doCompleteTask
'
},
getVipInfo
:
{
method
:
'GET'
,
handle
:
'getVipInfo'
}
};
completeTask
:
{
method
:
'GET'
,
handle
:
'completeTask
'
},
receiveTask
:
{
method
:
'GET'
,
handle
:
'receiveTask
'
},
getTaskList
:
{
method
:
'GET'
,
handle
:
'getTaskList
'
},
getCollectGoods
:
{
method
:
'GET'
,
handle
:
'getCollectGoods'
},
};
export
default
capi
;
\ No newline at end of file
export
default
capi
;
\ No newline at end of file
src/request/capiFn.ts
View file @
9c028b13
import
{
commonToast
,
commonConfirm
}
from
'../core/tb'
;
import
{
commonToast
}
from
'../core/tb'
;
import
{
getUserAddress
}
from
'../core/tbFn'
;
import
{
getRequestParams
}
from
'../utils'
;
import
{
applyActivity
}
from
'../utils'
;
// 通用API封装方法
const
capiFn
=
(
apiList
,
request
)
=>
{
return
{
async
receiveObjectPrize
(
params
)
{
const
{
handle
,
method
,
ext
}
=
getRequestParams
(
apiList
[
'receiveObjectPrize'
]);
const
userAddress
:
IAddress
=
await
getUserAddress
().
catch
(
err
=>
{
// 领取实物
const
getUerAddressParam
=
async
()
=>
{
const
userAddress
:
any
=
await
getUserAddress
().
catch
(
err
=>
{
commonToast
(
err
.
errorMessage
);
});
//
if(!userAddress) return false
if
(
!
userAddress
)
return
false
const
{
name
,
telNumber
,
provinceName
,
cityName
,
cityCode
,
countyName
,
detailInfo
,
streetName
}
=
userAddress
||
{};
params
=
{
const
params
=
{
name
,
phone
:
telNumber
,
addressDetail
:
detailInfo
,
...
...
@@ -21,57 +18,104 @@ const capiFn = (apiList, request) => {
province
:
provinceName
,
area
:
countyName
,
streetName
,
...
params
}
const
confirmResult
=
userAddress
?
(
await
commonConfirm
(
'提示'
,
'确认使用该收货地址:'
+
name
+
telNumber
+
userAddress
.
duibaAddress
.
address
,
async
function
()
{
const
result
=
await
request
(
handle
,
method
,
params
,
ext
).
catch
(
res
=>
{
commonToast
(
res
&&
res
.
message
);
});
if
(
result
&&
result
.
success
)
{
return
true
;
return
{
params
,
duibaAddress
:
userAddress
.
duibaAddress
.
address
}
return
false
}))
:
false
return
confirmResult
},
async
getVipInfo
(
params
)
{
const
{
handle
,
method
,
ext
}
=
getRequestParams
(
apiList
[
'getVipInfo'
]);
const
result
=
await
request
(
handle
,
method
,
params
,
ext
).
catch
(
res
=>
{
commonToast
(
res
&&
res
.
message
);
});
if
(
result
&&
result
.
success
)
{
const
{
isVip
}
=
result
.
data
return
isVip
;
}
const
confirmAddress
=
async
(
address
)
=>
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
// @ts-ignore
my
.
confirm
({
title
:
'提示'
,
content
:
'确认使用该收货地址:'
+
address
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
resolve
(
true
)
}
else
{
resolve
(
false
)
}
return
false
;
},
async
receiveEnamePrize
(
params
)
{
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
)
{
return
true
;
})
}
/**
* 领取实物奖品
* @param api
* @param data
*/
export
const
receiveObjectPrize
=
async
(
api
:
any
,
data
:
IReceivePrize
)
=>
{
const
{
params
,
successMsg
,
errorMsg
}
=
data
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
const
userInfo
=
await
getUerAddressParam
()
if
(
!
userInfo
)
{
resolve
(
false
)
return
;
}
return
false
;
},
async
addStat
(
activityId
:
string
,
type
:
number
|
string
)
{
const
{
handle
,
method
,
ext
}
=
getRequestParams
(
apiList
[
'addStat'
]);
const
result
=
await
request
(
handle
,
method
,
{
activityId
,
type
},
ext
).
catch
(
res
=>
{
commonToast
(
res
&&
res
.
message
);
const
{
params
:
_params
,
duibaAddress
}
=
userInfo
const
{
name
,
phone
}
=
_params
const
address
=
name
+
phone
+
duibaAddress
const
canPass
=
await
confirmAddress
(
address
)
if
(
!
canPass
)
{
resolve
(
false
)
return
;
}
const
{
success
,
data
,
message
}
=
await
api
({
...
params
,
...
_params
})
if
(
success
)
{
commonToast
(
successMsg
)
resolve
(
true
)
}
else
{
commonToast
(
errorMsg
||
message
)
resolve
(
false
)
}
})
}
/**
* 领取权益
* @param api
* @param data
*/
export
const
receiveEnamePrize
=
async
(
api
:
any
,
data
:
IReceivePrize
)
=>
{
const
{
params
,
successMsg
,
errorMsg
}
=
data
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
const
{
success
,
data
,
message
}
=
await
api
(
params
).
catch
(
res
=>
{
commonToast
(
successMsg
||
res
.
message
)
resolve
(
false
)
});
if
(
result
&&
result
.
success
)
{
return
true
;
if
(
success
)
{
commonToast
(
successMsg
)
resolve
(
true
)
}
else
{
commonToast
(
errorMsg
||
message
)
resolve
(
false
)
}
return
false
;
},
})
}
/**
* 会员优惠券领取
* @param api
* @param data
*/
export
const
receiveMemberEname
=
async
(
api
:
any
,
data
:
IReceivePrize
)
=>
{
const
{
params
,
successMsg
,
errorMsg
}
=
data
const
{
sellerId
,
ename
,
...
ext
}
=
params
if
(
!
ename
)
return
false
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
const
result
:
any
=
await
applyActivity
({
sellerId
,
activityId
:
ename
})
if
(
!
result
)
resolve
(
false
)
if
(
result
.
businessSuccess
)
{
const
{
success
,
data
,
message
}
=
await
api
({
...
ext
})
if
(
success
)
{
commonToast
(
successMsg
||
'奖品发放成功,请前往我的奖品处进行使用'
)
resolve
(
true
)
}
else
{
commonToast
(
errorMsg
||
message
)
resolve
(
false
)
}
};
export
default
capiFn
;
}
else
{
commonToast
(
result
.
errorMsg
)
resolve
(
false
)
}
})
}
\ No newline at end of file
src/typing/index.d.ts
View file @
9c028b13
...
...
@@ -78,3 +78,13 @@ interface ISkuInfo {
}
declare
var
my
:
any
interface
IReceivePrize
{
params
:
{
sellerId
:
number
ename
:
string
[
key
:
string
]:
string
|
number
}
successMsg
:
string
errorMsg
:
string
}
\ No newline at end of file
src/utils/index.ts
View file @
9c028b13
...
...
@@ -194,3 +194,71 @@ export const validateActivityStatus = async (checkParam: { startTime: number, en
}
})
}
/**
* 查询商家权益活动
* @param sellerId
*/
export
const
getActivity
=
(
sellerId
:
number
)
=>
{
// @ts-ignore
const
memberBenefitPlugin
=
requirePlugin
(
"memberBenefit"
)
if
(
!
memberBenefitPlugin
)
return
[]
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
memberBenefitPlugin
.
getActivity
({
data
:
{
sellerId
,
},
success
:
(
result
)
=>
{
resolve
(
result
)
},
fail
:
(
error
)
=>
{
console
.
log
(
'获取失败'
+
JSON
.
stringify
(
error
))
resolve
(
error
)
}
});
})
}
/**
* 领取会员优惠券
* @param params
*/
export
const
applyActivity
=
(
params
:
{
sellerId
:
number
,
activityId
:
string
})
=>
{
const
{
sellerId
,
activityId
}
=
params
// @ts-ignore
const
memberBenefitPlugin
=
requirePlugin
(
"memberBenefit"
)
if
(
!
memberBenefitPlugin
)
return
false
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
memberBenefitPlugin
.
applyActivity
({
data
:
{
sellerId
,
activityId
,
},
success
:
(
result
)
=>
{
resolve
(
result
)
},
fail
:
(
error
)
=>
{
console
.
warn
(
'领取商家权益失败'
+
JSON
.
stringify
(
error
.
data
))
resolve
(
error
.
data
)
}
});
})
}
// 查询商家会员等级
export
const
getGrade
=
(
sellerId
:
number
)
=>
{
// @ts-ignore
const
memberBenefitPlugin
=
requirePlugin
(
"memberBenefit"
)
if
(
!
memberBenefitPlugin
)
return
[]
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
memberBenefitPlugin
.
getGrade
({
data
:
{
sellerId
},
success
:
(
result
)
=>
{
resolve
(
result
)
},
fail
:
(
error
)
=>
{
console
.
log
(
'查询商家会员等级失败'
+
JSON
.
stringify
(
error
))
resolve
(
error
)
}
});
})
}
\ No newline at end of file
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