Commit 913e019f authored by shunx 马's avatar shunx 马

更新轮询接口

parent b3249a9d
......@@ -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": {
......
......@@ -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"];
}
......
......@@ -23,7 +23,7 @@
chalk "^2.0.0"
js-tokens "^4.0.0"
"@babel/runtime@^7.12.5":
"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.7.6":
version "7.15.3"
resolved "http://npm.dui88.com:80/@babel%2fruntime/-/runtime-7.15.3.tgz#2e1c2880ca118e5b2f9988322bd8a7656a32502b"
integrity sha1-LhwogMoRjlsvmYgyK9inZWoyUCs=
......@@ -76,7 +76,19 @@
"@spark/api-common" "^2.0.3"
"@spark/utils" "^2.0.4"
"@spark/utils@^2.0.19", "@spark/utils@^2.0.22", "@spark/utils@^2.0.3", "@spark/utils@^2.0.4":
"@spark/ui@^2.0.36":
version "2.0.36"
resolved "http://npm.dui88.com:80/@spark%2fui/-/ui-2.0.36.tgz#6806cc07d46c2126f755f451ff29bdcf0d3441ee"
integrity sha512-QI9R2h9LNeVqOCIs3NztTN7HAkkAHpLnM9TVNFVdWfg5vZw50vCkdEEJC59pxDdANg2Um21HzQEkeTQn5QB/xQ==
dependencies:
"@spark/utils" "^2.0.20"
classnames "^2.2.6"
hammerjs "^2.0.8"
history "*"
react-router-dom "*"
spark-wrapper-fyge "^1.0.30"
"@spark/utils@^2.0.19", "@spark/utils@^2.0.20", "@spark/utils@^2.0.22", "@spark/utils@^2.0.3", "@spark/utils@^2.0.4":
version "2.0.48"
resolved "http://npm.dui88.com:80/@spark%2futils/-/utils-2.0.48.tgz#84dba3adaf5dcf5d6f5b677b34a49c4acd7b97ad"
integrity sha512-MFirVh4Q+ZQCSTDkxTkRWDWQqbEHTbU9gbTh+DLqCwSfVDwZd2jxQ/2tN/836WnBfj47yzcBsbu2aPy6gxyr5g==
......@@ -867,6 +879,11 @@ class-utils@^0.3.5:
isobject "^3.0.0"
static-extend "^0.1.1"
classnames@^2.2.6:
version "2.3.1"
resolved "http://npm.dui88.com:80/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e"
integrity sha1-38+jiR4wbsHa0QXQ6I9EF7hTXo4=
cliui@^5.0.0:
version "5.0.0"
resolved "http://npm.dui88.com:80/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5"
......@@ -1317,7 +1334,7 @@ domain-browser@^1.1.1:
resolved "http://npm.dui88.com:80/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda"
integrity sha1-PTH1AZGmdJ3RN1p/Ui6CPULlTto=
duiba-utils@^1.0.11, duiba-utils@^1.0.6:
duiba-utils@^1.0.0, duiba-utils@^1.0.11, duiba-utils@^1.0.6:
version "1.0.11"
resolved "http://npm.dui88.com:80/duiba-utils/-/duiba-utils-1.0.11.tgz#deead33f0c86bbe0063131b70ff0592da7bcb9dd"
integrity sha512-mEKFgn+ZpaIwMFmZHiCZXJpPTPkoCZSEKKfubjJ+8edti0GbGnfrbZKvHveLu5HbvwpXCNA6xXPQDJcE12VqbA==
......@@ -1778,6 +1795,14 @@ function-bind@^1.1.1:
resolved "http://npm.dui88.com:80/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
integrity sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=
fyge@^3.0.4:
version "3.0.4"
resolved "http://npm.dui88.com:80/fyge/-/fyge-3.0.4.tgz#decbb6052175832c2342ec659ad916c0b0570eac"
integrity sha512-YEh4Aw/kG1czP4l9tKSdKW77z1q/EzC0kV+tind/TxoCX2odUvqVbVszcEv6Xgsko0ZZgGOPPI0G9qBpiq9Paw==
dependencies:
duiba-utils "^1.0.0"
tslib "^2.1.0"
get-caller-file@^2.0.1:
version "2.0.5"
resolved "http://npm.dui88.com:80/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
......@@ -1912,6 +1937,11 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6
resolved "http://npm.dui88.com:80/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a"
integrity sha1-5BK40z9eAGWTy9PO5t+fLOu+gCo=
hammerjs@^2.0.8:
version "2.0.8"
resolved "http://npm.dui88.com:80/hammerjs/-/hammerjs-2.0.8.tgz#04ef77862cff2bb79d30f7692095930222bf60f1"
integrity sha1-BO93hiz/K7edMPdpIJWTAiK/YPE=
handle-thing@^2.0.0:
version "2.0.1"
resolved "http://npm.dui88.com:80/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e"
......@@ -1989,6 +2019,25 @@ hash.js@^1.0.0, hash.js@^1.0.3:
inherits "^2.0.3"
minimalistic-assert "^1.0.1"
history@*:
version "5.0.1"
resolved "http://npm.dui88.com:80/history/-/history-5.0.1.tgz#de35025ed08bce0db62364b47ebbf9d97b5eb06a"
integrity sha1-3jUCXtCLzg22I2S0frv52XtesGo=
dependencies:
"@babel/runtime" "^7.7.6"
history@^4.9.0:
version "4.10.1"
resolved "http://npm.dui88.com:80/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3"
integrity sha1-MzcaZeOoOyZ0NOKz87G0xYqtTPM=
dependencies:
"@babel/runtime" "^7.1.2"
loose-envify "^1.2.0"
resolve-pathname "^3.0.0"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"
value-equal "^1.0.1"
hmac-drbg@^1.0.1:
version "1.0.1"
resolved "http://npm.dui88.com:80/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
......@@ -1998,6 +2047,13 @@ hmac-drbg@^1.0.1:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.1"
hoist-non-react-statics@^3.1.0:
version "3.3.2"
resolved "http://npm.dui88.com:80/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
integrity sha1-7OCsr3HWLClpwuxZ/v9CpLGoW0U=
dependencies:
react-is "^16.7.0"
homedir-polyfill@^1.0.1:
version "1.0.3"
resolved "http://npm.dui88.com:80/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8"
......@@ -2472,7 +2528,7 @@ isstream@~0.1.2:
resolved "http://npm.dui88.com:80/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
js-tokens@^4.0.0:
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
version "4.0.0"
resolved "http://npm.dui88.com:80/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha1-GSA/tZmR35jjoocFDUZHzerzJJk=
......@@ -2588,6 +2644,13 @@ loglevel@^1.6.8:
resolved "http://npm.dui88.com:80/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197"
integrity sha1-AF/eL15uRwaPk1/yhXPhJe9y8Zc=
loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
version "1.4.0"
resolved "http://npm.dui88.com:80/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha1-ce5R+nvkyuwaY4OffmgtgTLTDK8=
dependencies:
js-tokens "^3.0.0 || ^4.0.0"
lru-cache@^5.1.1:
version "5.1.1"
resolved "http://npm.dui88.com:80/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
......@@ -2704,6 +2767,14 @@ mime@^2.4.4, mime@^2.5.2:
resolved "http://npm.dui88.com:80/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe"
integrity sha1-bj3GzCuVEGQ4MOXxnVy3U9pe6r4=
mini-create-react-context@^0.4.0:
version "0.4.1"
resolved "http://npm.dui88.com:80/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz#072171561bfdc922da08a60c2197a497cc2d1d5e"
integrity sha1-ByFxVhv9ySLaCKYMIZekl8wtHV4=
dependencies:
"@babel/runtime" "^7.12.1"
tiny-warning "^1.0.3"
minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1:
version "1.0.1"
resolved "http://npm.dui88.com:80/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"
......@@ -3169,6 +3240,13 @@ path-to-regexp@0.1.7:
resolved "http://npm.dui88.com:80/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=
path-to-regexp@^1.7.0:
version "1.8.0"
resolved "http://npm.dui88.com:80/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a"
integrity sha1-iHs7qdhDk+h6CgufTLdWGYtTVIo=
dependencies:
isarray "0.0.1"
path@^0.12.7:
version "0.12.7"
resolved "http://npm.dui88.com:80/path/-/path-0.12.7.tgz#d4dc2a506c4ce2197eb481ebfcd5b36c0140b10f"
......@@ -3273,6 +3351,15 @@ promise-inflight@^1.0.1:
resolved "http://npm.dui88.com:80/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3"
integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM=
prop-types@^15.6.2:
version "15.7.2"
resolved "http://npm.dui88.com:80/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha1-UsQedbjIfnK52TYOAga5ncv/psU=
dependencies:
loose-envify "^1.4.0"
object-assign "^4.1.1"
react-is "^16.8.1"
proxy-addr@~2.0.5:
version "2.0.7"
resolved "http://npm.dui88.com:80/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"
......@@ -3424,6 +3511,40 @@ raw-body@^2.2.0:
iconv-lite "0.4.24"
unpipe "1.0.0"
react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1:
version "16.13.1"
resolved "http://npm.dui88.com:80/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha1-eJcppNw23imZ3BVt1sHZwYzqVqQ=
react-router-dom@*:
version "5.2.0"
resolved "http://npm.dui88.com:80/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662"
integrity sha1-nmWk0MReEyieZsexfH4XXQ6hVmI=
dependencies:
"@babel/runtime" "^7.1.2"
history "^4.9.0"
loose-envify "^1.3.1"
prop-types "^15.6.2"
react-router "5.2.0"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"
react-router@5.2.0:
version "5.2.0"
resolved "http://npm.dui88.com:80/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293"
integrity sha1-Qk51ZByodH+/duXsyml4GqN+opM=
dependencies:
"@babel/runtime" "^7.1.2"
history "^4.9.0"
hoist-non-react-statics "^3.1.0"
loose-envify "^1.3.1"
mini-create-react-context "^0.4.0"
path-to-regexp "^1.7.0"
prop-types "^15.6.2"
react-is "^16.6.0"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"
"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6:
version "2.3.7"
resolved "http://npm.dui88.com:80/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
......@@ -3548,6 +3669,11 @@ resolve-from@^3.0.0:
resolved "http://npm.dui88.com:80/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748"
integrity sha1-six699nWiBvItuZTM17rywoYh0g=
resolve-pathname@^3.0.0:
version "3.0.0"
resolved "http://npm.dui88.com:80/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd"
integrity sha1-mdAiJNPPJjaJvsuzk7xWAxMCXc0=
resolve-url@^0.2.1:
version "0.2.1"
resolved "http://npm.dui88.com:80/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
......@@ -3883,6 +4009,13 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
resolved "http://npm.dui88.com:80/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha1-dHIq8y6WFOnCh6jQu95IteLxomM=
spark-wrapper-fyge@^1.0.30:
version "1.1.3"
resolved "http://npm.dui88.com:80/spark-wrapper-fyge/-/spark-wrapper-fyge-1.1.3.tgz#3f57360e50b456fec982b030640bad48f3531cde"
integrity sha512-74F4cqWg/GD/RjU8nXxKBRGBYFu6ieM4f4EPd3xWSN16cQoEOD4m3eZ0SImUiavRfgIb2bo+DgSEvi1l97W+4A==
dependencies:
fyge "^3.0.4"
spdy-transport@^3.0.0:
version "3.0.0"
resolved "http://npm.dui88.com:80/spdy-transport/-/spdy-transport-3.0.0.tgz#00d4863a6400ad75df93361a1608605e5dcdcf31"
......@@ -4104,6 +4237,16 @@ timers-browserify@^2.0.4:
dependencies:
setimmediate "^1.0.4"
tiny-invariant@^1.0.2:
version "1.1.0"
resolved "http://npm.dui88.com:80/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875"
integrity sha1-Y0xfjv3CdxS384bDXmdgmR0jCHU=
tiny-warning@^1.0.0, tiny-warning@^1.0.3:
version "1.0.3"
resolved "http://npm.dui88.com:80/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
integrity sha1-lKMNtFPfTGQ9D9VmBg1gqHXYR1Q=
to-arraybuffer@^1.0.0:
version "1.0.1"
resolved "http://npm.dui88.com:80/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43"
......@@ -4167,7 +4310,7 @@ tslib@^2.0.1:
resolved "http://npm.dui88.com:80/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e"
integrity sha1-gDuM2rPhK6WBpMpByIObuw2ssJ4=
tslib@^2.3.0:
tslib@^2.1.0, tslib@^2.3.0:
version "2.3.1"
resolved "http://npm.dui88.com:80/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
integrity sha1-6KM1rdXOrlGqJh0ypJAVjvBC7wE=
......@@ -4395,6 +4538,11 @@ v8-compile-cache@^2.1.1:
resolved "http://npm.dui88.com:80/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee"
integrity sha1-LeGWGMZtwkfc+2+ZM4A12CRaLO4=
value-equal@^1.0.1:
version "1.0.1"
resolved "http://npm.dui88.com:80/value-equal/-/value-equal-1.0.1.tgz#1e0b794c734c5c0cade179c437d356d931a34d6c"
integrity sha1-Hgt5THNMXAyt4XnEN9NW2TGjTWw=
vary@~1.1.2:
version "1.1.2"
resolved "http://npm.dui88.com:80/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment