@aliedu/app-self-check
Version:
应用自检模块
80 lines (68 loc) • 2.55 kB
JavaScript
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
import _regeneratorRuntime from "@babel/runtime/regenerator";
import React, { useEffect } from 'react';
import styles from './index.module.scss';
import store from '../../store';
import BtnOpera from '../btnOpera';
function StepTwo() {
var _store$useModel = store.useModel('StepTwoModel'),
StepTwoModelState = _store$useModel[0],
StepTwoModelDispatchers = _store$useModel[1];
var _store$useModel2 = store.useModel('IndexModel'),
indexState = _store$useModel2[0],
StepIndexModelDispatchers = _store$useModel2[1];
console.log(indexState);
useEffect(function () {
fetchData();
}, []);
function fetchData() {
return _fetchData.apply(this, arguments);
}
function _fetchData() {
_fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return StepTwoModelDispatchers.initDefaultState();
case 2:
_context.t0 = !indexState.backtrack;
if (!_context.t0) {
_context.next = 6;
break;
}
_context.next = 6;
return StepIndexModelDispatchers.searchStep();
case 6:
_context.next = 8;
return StepTwoModelDispatchers.startDetect();
case 8:
case "end":
return _context.stop();
}
}
}, _callee);
}));
return _fetchData.apply(this, arguments);
}
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
className: styles.content
}, /*#__PURE__*/React.createElement("div", {
className: styles.baseImg,
style: {
animationPlayState: StepTwoModelState.checkFinish ? 'paused' : 'running'
}
}, /*#__PURE__*/React.createElement("div", {
className: styles.dotsImg
})), /*#__PURE__*/React.createElement("ul", null, StepTwoModelState.conditionList.map(function (item, index) {
return /*#__PURE__*/React.createElement("li", {
key: index
}, /*#__PURE__*/React.createElement("span", {
className: item.pass ? styles.hadPass : styles.fail
}), item.name);
}))), /*#__PURE__*/React.createElement(BtnOpera, {
nextFun: StepTwoModelDispatchers.preCheckSubmit
}));
}
export default StepTwo;