Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wfc13
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
wildfirecode13
wfc13
Commits
913e019f
Commit
913e019f
authored
Aug 18, 2021
by
shunx 马
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新轮询接口
parent
b3249a9d
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
183 additions
and
11 deletions
+183
-11
package.json
project/package.json
+2
-0
cost.ts
project/src/panels/cost.ts
+28
-6
yarn.lock
project/yarn.lock
+153
-5
No files found.
project/package.json
View file @
913e019f
...
...
@@ -22,7 +22,9 @@
"webpack-merge"
:
"^4.1.2"
},
"dependencies"
:
{
"@spark/api-base"
:
"^2.0.30"
,
"@spark/share"
:
"^2.0.90"
,
"@spark/ui"
:
"^2.0.36"
,
"duiba-utils"
:
"^1.0.11"
},
"scripts"
:
{
...
...
project/src/panels/cost.ts
View file @
913e019f
...
...
@@ -12,6 +12,9 @@ import { NoPrizePanel } from "./noprize";
import
{
notEnoughMoneyPanel
}
from
"./notEnoughMoney"
;
import
{
PrizePanel
}
from
"./prize"
;
import
{
waitAPI
}
from
"./wait2"
;
import
{
polling
}
from
'@spark/api-base'
;
import
{
Toast
}
from
'@spark/ui'
;
let
section
;
export
class
CostPanel
extends
Panel
{
...
...
@@ -36,17 +39,34 @@ export class CostPanel extends Panel {
toPlaywayId
:
'dazzle'
,
toActionId
:
'drawPrize'
};
let
result
,
prizeData
;
let
result
,
prizeData
,
resultPolling
;
if
(
indexResult
.
data
.
type
==
1
)
{
params
.
credits
=
indexResult
.
data
.
needCredits
;
result
=
await
sendWebNet
(
WebNetName
.
getCreditCost
,
params
);
await
waitAPI
(
500
);
if
(
!
result
.
success
)
{
resultPolling
=
await
polling
(
(
rsp
)
=>
rsp
.
code
==
"0000000000"
,
'/projectx/{projectId}/credits/queryStatus.do'
,
{
ticketNum
:
result
.
data
},
10
,
500
,
'get'
).
catch
((
e
)
=>
{
console
.
log
(
"2222222"
,
e
)
Toast
(
'网络异常,请再试一次'
);
})
if
(
resultPolling
==
1
)
{
if
(
!
result
.
success
)
{
btn
.
mouseEnable
=
true
;
return
;
}
prizeData
=
await
sendWebNetWithToken
(
WebNetName
.
drawPrize
,
{
ticket
:
result
.
data
});
btn
.
mouseEnable
=
true
;
return
;
}
else
if
(
resultPolling
==
2
)
{
Toast
(
'扣分失败'
);
}
prizeData
=
await
sendWebNetWithToken
(
WebNetName
.
drawPrize
,
{
ticket
:
result
.
data
});
btn
.
mouseEnable
=
true
;
}
else
{
prizeData
=
await
sendWebNetWithToken
(
WebNetName
.
drawPrize
);
...
...
@@ -70,6 +90,8 @@ export class CostPanel extends Panel {
}
get
groupNames
()
{
return
[
"cost"
];
}
...
...
project/yarn.lock
View file @
913e019f
This diff is collapsed.
Click to expand it.
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