Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const Loading = () => { Toast.loading('加载中...', 0, ()=>{console.log('加载完成!!!')}) };
const Empty = () => { Toast.fail('加载失败!!!', 1) };
fetchBalance() {
if (!this.state.address) {
Toast.fail('请输入钱包地址',1)
}
Toast.loading('查询中...',0)
axios.get(`https://api.etherscan.io/api?module=account&action=balance&address=${this.state.address}&tag=latest&apikey=R3NUDUUSHIEWFW28XUKXJNWSDPVGCEGMKI`)
.then(res => {
this.setState({
balance: res.data.result,
})
if (res.data.result > 0) {
store.set('walletAddress', this.state.address)
this.fetchTransations()
} else {
Toast.hide()
}
})
}
fetchTransations() {
handleCryptoChange(crypto) {
Toast.loading('载入中...', 0)
axios.get(`https://min-api.cryptocompare.com/data/price?fsym=${crypto[0]}&tsyms=${this.state.legal[0]}`)
.then(res => {
Toast.hide()
this.setState({
crypto,
legalValue: (this.state.cryptoValue*res.data[this.state.legal[0]]).toFixed(2),
rate: res.data[this.state.legal[0]],
})
})
}
handleLegalChange(legal) {
function* postResumeOrderWorker(payload) {
try {
Toast.loading('提交中')
const currentUser = yield call(userService.getCurrentUserAsync)
const userinfo = yield call(userService.getUserInfoToJson, currentUser)
const count = yield call(
resumeOrderService.getResumeOrderCountOfToday,
currentUser
)
const resumeOrderLimit = userinfo.resumeOrderLimit
if (count < resumeOrderLimit) {
const response = yield call(
resumeOrderService.cerateResumeOrder,
payload,
userinfo,
currentUser
)
yield put(action.postResumeOrderSuccess(response))
Toast.success('提交成功', 1)
function* getHomeWarOrderListWorker(payload) {
try {
Toast.loading('加载中')
const response = yield call(warOrderService.getHomeWarOrderList, payload)
yield put(action.getHomeWarOrderListSuccess(response))
Toast.hide()
} catch (error) {
yield put(action.getHomeWarOrderListFailed(error))
Toast.hide()
}
}
componentDidMount() {
Toast.loading('加载中', 0);
this.props.getVideoData(`/GetHeroVideos?hero=${this.props.actions.summonerClick.keys || this.props.location.query.id}&p=${1}`, null, (data) => {
Toast.hide();
this.setState({
getHeroVideo: data
})
});
this.props.getVideoData(`/GetAuthors`, null, (data) => {
Toast.hide();
this.setState({
getAuthor: data
})
});
}
<div> {
const key = index === 0 ? 'all' : (index === 1 ? 'to' : 'from');
if (transactions.records.length > 8) {
const isTop = e.target.scrollTop === 0 ? false : true;
this.setState({ isTop });
if (e.target.scrollTop === ((58 * transactions.records.length + 36) - 484)) {
if (!isRequest) {
this.setState({ isRequest: true });
Toast.loading('', 0);
const records = await PopupAPI.getTransactionsByTokenId(id, typeof transactions.finger === 'string' ? transactions.finger : ++transactions.finger, key);
Toast.hide();
if (records.records.length === 0 || !records.finger) {
this.setState({ isRequest: true });
} else {
transactions.records = transactions.records.concat(records.records);
transactions.finger = records.finger;
this.setState({ transactions, isRequest: false });
}
}
}
}
}}
></div>
componentDidMount() {
if (this.props.requestData.video) {
this.setState({
initData: this.props.requestData.video.data
});
} else {
Toast.loading('加载中...', 0);
this.props.getVideoData(`/GetNewstVideos?p=${1}`, null, (data) => {
Toast.hide();
this.setState({
initData: data.data
});
}, 'video');
}
}
componentDidMount() {
let qquin = this.props.actions.searchClick.qquin || this.props.location.query.qquin;
let vaid = this.props.actions.searchClick.area_id || this.props.location.query.vaid;
Toast.loading('加载中', 0);
this.props.getData(`/CombatList?qquin=${qquin}&vaid=${vaid}`, null, res => {
if(res.code == 0){
this.setState({
getCombatList: res
})
}else{
Toast.fail('系统异常')
}
}, 'getCombatList');
this.props.getData(`/UserExtInfo?qquin=${qquin}&vaid=${vaid}`, null, res => {
if(res.code == 0){
this.setState({
getUserData: res
})