|
|
@@ -10,9 +10,9 @@
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "default": function() { return /* binding */ IndexPage; }
|
|
|
/* harmony export */ });
|
|
|
-/* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js */ "./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");
|
|
|
-/* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
|
|
|
-/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
|
+/* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js */ "./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");
|
|
|
+/* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
|
|
|
+/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
|
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
|
|
|
@@ -22,11 +22,12 @@
|
|
|
/* harmony import */ var _features_trackTimeDuration_components_Clock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/features/trackTimeDuration/components/Clock */ "./src/features/trackTimeDuration/components/Clock.tsx");
|
|
|
/* harmony import */ var _features_trackTimeDuration_components_Console__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/features/trackTimeDuration/components/Console */ "./src/features/trackTimeDuration/components/Console.tsx");
|
|
|
/* harmony import */ var _features_trackTimeDuration_components_More__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/features/trackTimeDuration/components/More */ "./src/features/trackTimeDuration/components/More.tsx");
|
|
|
-/* harmony import */ var _services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/services/trackTimeDuration */ "./src/services/trackTimeDuration.tsx");
|
|
|
-/* harmony import */ var _store_scenario__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/store/scenario */ "./src/store/scenario.tsx");
|
|
|
-/* harmony import */ var _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/store/trackTimeMachine */ "./src/store/trackTimeMachine.tsx");
|
|
|
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
|
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__);
|
|
|
+/* harmony import */ var _features_trackTimeDuration_components_Schedule__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/features/trackTimeDuration/components/Schedule */ "./src/features/trackTimeDuration/components/Schedule.tsx");
|
|
|
+/* harmony import */ var _services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/services/trackTimeDuration */ "./src/services/trackTimeDuration.tsx");
|
|
|
+/* harmony import */ var _store_scenario__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/store/scenario */ "./src/store/scenario.tsx");
|
|
|
+/* harmony import */ var _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/store/trackTimeMachine */ "./src/store/trackTimeMachine.tsx");
|
|
|
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
|
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -44,6 +45,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
// import TabBar from '../../components/Tabbar';
|
|
|
|
|
|
|
|
|
@@ -60,14 +62,14 @@ function IndexPage() {
|
|
|
return state.common;
|
|
|
});
|
|
|
array.push('ffff');
|
|
|
- array.push( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.Text, {
|
|
|
+ array.push( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.Text, {
|
|
|
children: "ffff"
|
|
|
}));
|
|
|
// array.push(<Rings radius={50}/>)
|
|
|
|
|
|
- (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.useReady)( /*#__PURE__*/(0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_12__["default"])( /*#__PURE__*/(0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_13__["default"])().mark(function _callee() {
|
|
|
+ (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.useReady)( /*#__PURE__*/(0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_13__["default"])( /*#__PURE__*/(0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_14__["default"])().mark(function _callee() {
|
|
|
var userData;
|
|
|
- return (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_13__["default"])().wrap(function _callee$(_context) {
|
|
|
+ return (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_14__["default"])().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
@@ -92,10 +94,11 @@ function IndexPage() {
|
|
|
if (user.isLogin) getCheckData();
|
|
|
});
|
|
|
function getCheckData() {
|
|
|
- (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_7__.getChecks)().then(function (res) {
|
|
|
+ (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_8__.getChecks)().then(function (res) {
|
|
|
if (res.scenario) {
|
|
|
- dispatch((0,_store_scenario__WEBPACK_IMPORTED_MODULE_8__.setScenario)(res.scenario));
|
|
|
+ dispatch((0,_store_scenario__WEBPACK_IMPORTED_MODULE_9__.setScenario)(res.scenario));
|
|
|
__webpack_require__.g.scenario = res.scenario;
|
|
|
+ // global.checkData = res;
|
|
|
// console.log((res as any).scenario.name + ' ' + (res as any).status);
|
|
|
// trackTimeService.send({type:(res as any).scenario.name});
|
|
|
// setSpecifiedStatus('FAST_SLEEP', 'ON_GOING');
|
|
|
@@ -109,19 +112,22 @@ function IndexPage() {
|
|
|
// setSpecifiedState();
|
|
|
// console.log('name:'+(res as any).scenario.name)
|
|
|
// machine.reset();
|
|
|
- _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_9__["default"].send({
|
|
|
+ _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_10__["default"].send({
|
|
|
type: 'RESET'
|
|
|
});
|
|
|
- _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_9__["default"].send({
|
|
|
+ _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_10__["default"].send({
|
|
|
type: res.scenario.name
|
|
|
});
|
|
|
- var currentState = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_9__["default"].getSnapshot();
|
|
|
+ var currentState = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_10__["default"].getSnapshot();
|
|
|
var json = {};
|
|
|
var key = res.scenario.name;
|
|
|
json[key] = res.status;
|
|
|
currentState.value = json;
|
|
|
// debugger
|
|
|
- _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_9__.machine.context.currentStatus = "".concat(key, ".").concat(res.status); //'mixed.ON_GOING2'
|
|
|
+ _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_10__.machine.context.currentStatus = "".concat(key, ".").concat(res.status); //'mixed.ON_GOING2'
|
|
|
+ _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_10__.machine.context.checkData = res;
|
|
|
+ var obj = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_10__.machine.context;
|
|
|
+ debugger;
|
|
|
// debugger
|
|
|
// trackTimeService.send('APPLE');
|
|
|
// machine.transition(`${key}.${(res as any).status}`,'' as any);
|
|
|
@@ -169,9 +175,9 @@ function IndexPage() {
|
|
|
return _getStorage.apply(this, arguments);
|
|
|
}
|
|
|
function _getStorage() {
|
|
|
- _getStorage = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_12__["default"])( /*#__PURE__*/(0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_13__["default"])().mark(function _callee2(key) {
|
|
|
+ _getStorage = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_13__["default"])( /*#__PURE__*/(0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_14__["default"])().mark(function _callee2(key) {
|
|
|
var res;
|
|
|
- return (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_13__["default"])().wrap(function _callee2$(_context2) {
|
|
|
+ return (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_14__["default"])().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_context2.prev = 0;
|
|
|
@@ -212,32 +218,32 @@ function IndexPage() {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.View, {
|
|
|
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.View, {
|
|
|
style: {
|
|
|
backgroundColor: '#fff',
|
|
|
flex: 1,
|
|
|
flexDirection: 'column',
|
|
|
display: 'flex'
|
|
|
},
|
|
|
- children: [permission.wxPubFollow == false ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.Text, {
|
|
|
+ children: [permission.wxPubFollow == false ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.Text, {
|
|
|
onClick: function onClick() {
|
|
|
return followWxPub();
|
|
|
},
|
|
|
children: "\u53BB\u5173\u6CE8\u516C\u4F17\u53F7"
|
|
|
- }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.Text, {
|
|
|
+ }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.Text, {
|
|
|
children: "\u5DF2\u5173\u6CE8"
|
|
|
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.Button, {
|
|
|
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.Button, {
|
|
|
onClick: function onClick() {
|
|
|
return goDetail();
|
|
|
},
|
|
|
children: "go detail"
|
|
|
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.Text, {
|
|
|
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.Text, {
|
|
|
className: "login",
|
|
|
onClick: function onClick() {
|
|
|
return login();
|
|
|
},
|
|
|
children: "sss"
|
|
|
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_features_trackTimeDuration_components_Clock__WEBPACK_IMPORTED_MODULE_4__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_features_trackTimeDuration_components_Console__WEBPACK_IMPORTED_MODULE_5__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_features_trackTimeDuration_components_More__WEBPACK_IMPORTED_MODULE_6__["default"], {})]
|
|
|
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_features_trackTimeDuration_components_Clock__WEBPACK_IMPORTED_MODULE_4__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_features_trackTimeDuration_components_Console__WEBPACK_IMPORTED_MODULE_5__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_features_trackTimeDuration_components_More__WEBPACK_IMPORTED_MODULE_6__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_features_trackTimeDuration_components_Schedule__WEBPACK_IMPORTED_MODULE_7__["default"], {})]
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -310,19 +316,7 @@ function Component() {
|
|
|
value = _useState4[0],
|
|
|
setValue = _useState4[1];
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
|
- var state = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].getSnapshot().value;
|
|
|
- if (state.FAST_SLEEP) {
|
|
|
- setKey('FAST_SLEEP');
|
|
|
- setValue(state.FAST_SLEEP);
|
|
|
- }
|
|
|
- if (state.FAST) {
|
|
|
- setKey('FAST');
|
|
|
- setValue(state.FAST);
|
|
|
- }
|
|
|
- if (state.SLEEP) {
|
|
|
- setKey('SLEEP');
|
|
|
- setValue(state.SLEEP);
|
|
|
- }
|
|
|
+ getStateDetail();
|
|
|
}, [_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__.machine.context.currentStatus]);
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
|
_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].onTransition(function (state) {
|
|
|
@@ -343,6 +337,21 @@ function Component() {
|
|
|
}
|
|
|
});
|
|
|
}, []);
|
|
|
+ function getStateDetail() {
|
|
|
+ var state = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].getSnapshot().value;
|
|
|
+ if (state.FAST_SLEEP) {
|
|
|
+ setKey('FAST_SLEEP');
|
|
|
+ setValue(state.FAST_SLEEP);
|
|
|
+ }
|
|
|
+ if (state.FAST) {
|
|
|
+ setKey('FAST');
|
|
|
+ setValue(state.FAST);
|
|
|
+ }
|
|
|
+ if (state.SLEEP) {
|
|
|
+ setKey('SLEEP');
|
|
|
+ setValue(state.SLEEP);
|
|
|
+ }
|
|
|
+ }
|
|
|
function isMap(obj) {
|
|
|
return obj instanceof Map;
|
|
|
}
|
|
|
@@ -616,6 +625,138 @@ function Component() {
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
+/***/ "./src/features/trackTimeDuration/components/Schedule.tsx":
|
|
|
+/*!****************************************************************!*\
|
|
|
+ !*** ./src/features/trackTimeDuration/components/Schedule.tsx ***!
|
|
|
+ \****************************************************************/
|
|
|
+/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
+
|
|
|
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
+/* harmony export */ "default": function() { return /* binding */ Component; }
|
|
|
+/* harmony export */ });
|
|
|
+/* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
|
|
|
+/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
|
+/* harmony import */ var _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/store/trackTimeMachine */ "./src/store/trackTimeMachine.tsx");
|
|
|
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
|
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
+/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
|
|
|
+/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
+/* harmony import */ var _utils_time_format__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/utils/time_format */ "./src/utils/time_format.ts");
|
|
|
+/* harmony import */ var taro_ui_dist_style_components_float_layout_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! taro-ui/dist/style/components/float-layout.scss */ "./node_modules/taro-ui/dist/style/components/float-layout.scss");
|
|
|
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
|
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+function Component() {
|
|
|
+ var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),
|
|
|
+ _useState2 = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_useState, 2),
|
|
|
+ checkData = _useState2[0],
|
|
|
+ setCheckData = _useState2[1];
|
|
|
+ var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''),
|
|
|
+ _useState4 = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_useState3, 2),
|
|
|
+ key = _useState4[0],
|
|
|
+ setKey = _useState4[1];
|
|
|
+ var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''),
|
|
|
+ _useState6 = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_useState5, 2),
|
|
|
+ value = _useState6[0],
|
|
|
+ setValue = _useState6[1];
|
|
|
+ (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
|
+ getStateDetail();
|
|
|
+ }, [_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__.machine.context.currentStatus]);
|
|
|
+ (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
|
+ if (_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__.machine.context.checkData) {
|
|
|
+ setCheckData(_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__.machine.context.checkData);
|
|
|
+ }
|
|
|
+ }, [_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__.machine.context.checkData]);
|
|
|
+ (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
|
+ _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__["default"].onTransition(function (state) {
|
|
|
+ getStateDetail();
|
|
|
+ });
|
|
|
+ }, []);
|
|
|
+ function getStateDetail() {
|
|
|
+ var state = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__["default"].getSnapshot().value;
|
|
|
+ if (state.FAST_SLEEP) {
|
|
|
+ setKey('FAST_SLEEP');
|
|
|
+ setValue(state.FAST_SLEEP);
|
|
|
+ }
|
|
|
+ if (state.FAST) {
|
|
|
+ setKey('FAST');
|
|
|
+ setValue(state.FAST);
|
|
|
+ }
|
|
|
+ if (state.SLEEP) {
|
|
|
+ setKey('SLEEP');
|
|
|
+ setValue(state.SLEEP);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function editSchedule() {
|
|
|
+ _tarojs_taro__WEBPACK_IMPORTED_MODULE_2___default().navigateTo({
|
|
|
+ url: '/pages/SetSchedule'
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //🚫❌⭕️✅
|
|
|
+ function statusString(isFast, isStart) {
|
|
|
+ if (value == 'WAIT_FOR_START') {
|
|
|
+ return '⭕️';
|
|
|
+ } else if (value == 'ONGOING1') {
|
|
|
+ if (isFast && isStart) {
|
|
|
+ return '✅';
|
|
|
+ }
|
|
|
+ } else if (value == 'ONGOING2') {
|
|
|
+ if (isStart) {
|
|
|
+ return '✅';
|
|
|
+ }
|
|
|
+ } else if (value == 'ONGOING3') {
|
|
|
+ if (isFast && !isStart) {
|
|
|
+ return '⭕️';
|
|
|
+ } else {
|
|
|
+ return '✅';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return '⭕️';
|
|
|
+ }
|
|
|
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.View, {
|
|
|
+ style: {
|
|
|
+ flexDirection: 'column',
|
|
|
+ display: 'flex',
|
|
|
+ alignItems: 'center'
|
|
|
+ },
|
|
|
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.Text, {
|
|
|
+ children: value == 'WAIT_FOR_START' ? 'Schedule' : 'Log in Progress'
|
|
|
+ }), checkData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.View, {
|
|
|
+ style: {
|
|
|
+ flexDirection: 'column',
|
|
|
+ display: 'flex'
|
|
|
+ },
|
|
|
+ children: [checkData.target.fast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.Text, {
|
|
|
+ children: [statusString(true, true), "\u5F00\u59CB\u65AD\u98DF\uFF1A", _utils_time_format__WEBPACK_IMPORTED_MODULE_7__.TimeFormatter.formatTimestamp(checkData.target.fast.start_time)]
|
|
|
+ }), checkData.target.sleep && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.Text, {
|
|
|
+ children: [statusString(false, true), "\u5F00\u59CB\u7761\u7720\uFF1A", _utils_time_format__WEBPACK_IMPORTED_MODULE_7__.TimeFormatter.formatTimestamp(checkData.target.sleep.start_time)]
|
|
|
+ }), checkData.target.sleep && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.Text, {
|
|
|
+ children: [statusString(false, false), "\u7ED3\u675F\u7761\u7720\uFF1A", _utils_time_format__WEBPACK_IMPORTED_MODULE_7__.TimeFormatter.formatTimestamp(checkData.target.sleep.end_time)]
|
|
|
+ }), checkData.target.fast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.Text, {
|
|
|
+ children: [statusString(true, false), "\u7ED3\u675F\u65AD\u98DF\uFF1A", _utils_time_format__WEBPACK_IMPORTED_MODULE_7__.TimeFormatter.formatTimestamp(checkData.target.fast.end_time)]
|
|
|
+ })]
|
|
|
+ }), value == 'WAIT_FOR_START' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.Text, {
|
|
|
+ onClick: editSchedule,
|
|
|
+ children: "\u8C03\u6574\u65E5\u7A0B"
|
|
|
+ }), value == 'WAIT_FOR_START' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.Text, {
|
|
|
+ children: "Duration goals by stage"
|
|
|
+ }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.Text, {
|
|
|
+ children: "Current stage"
|
|
|
+ })]
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/***/ }),
|
|
|
+
|
|
|
/***/ "./src/pages/Clock.tsx":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/pages/Clock.tsx ***!
|
|
|
@@ -657,7 +798,8 @@ var machine = (0,xstate__WEBPACK_IMPORTED_MODULE_0__.createMachine)({
|
|
|
id: "trackTime",
|
|
|
initial: "choose",
|
|
|
context: {
|
|
|
- currentStatus: ''
|
|
|
+ currentStatus: '',
|
|
|
+ checkData: null
|
|
|
},
|
|
|
on: {
|
|
|
RESET: {
|
|
|
@@ -802,6 +944,126 @@ var service = (0,xstate__WEBPACK_IMPORTED_MODULE_0__.interpret)(machine).start()
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (service);
|
|
|
|
|
|
+/***/ }),
|
|
|
+
|
|
|
+/***/ "./src/utils/time_format.ts":
|
|
|
+/*!**********************************!*\
|
|
|
+ !*** ./src/utils/time_format.ts ***!
|
|
|
+ \**********************************/
|
|
|
+/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
+
|
|
|
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
+/* harmony export */ TimeFormatter: function() { return /* binding */ TimeFormatter; }
|
|
|
+/* harmony export */ });
|
|
|
+/* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
|
|
|
+/* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_createClass_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/createClass.js */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
|
|
|
+
|
|
|
+
|
|
|
+var TimeFormatter = /*#__PURE__*/function () {
|
|
|
+ function TimeFormatter() {
|
|
|
+ (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, TimeFormatter);
|
|
|
+ }
|
|
|
+ (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_createClass_js__WEBPACK_IMPORTED_MODULE_1__["default"])(TimeFormatter, null, [{
|
|
|
+ key: "formatTimestamp",
|
|
|
+ value: function formatTimestamp(timestamp) {
|
|
|
+ var currentDate = new Date();
|
|
|
+ var inputDate = new Date(timestamp);
|
|
|
+
|
|
|
+ // 判断是否是今天
|
|
|
+ if (inputDate.getDate() === currentDate.getDate() && inputDate.getMonth() === currentDate.getMonth() && inputDate.getFullYear() === currentDate.getFullYear()) {
|
|
|
+ return "\u4ECA\u5929 ".concat(TimeFormatter.formatTime(inputDate));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断是否是昨天
|
|
|
+ var yesterday = new Date();
|
|
|
+ yesterday.setDate(currentDate.getDate() - 1);
|
|
|
+ if (inputDate.getDate() === yesterday.getDate() && inputDate.getMonth() === yesterday.getMonth() && inputDate.getFullYear() === yesterday.getFullYear()) {
|
|
|
+ return "\u6628\u5929 ".concat(TimeFormatter.formatTime(inputDate));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断是否是明天
|
|
|
+ var tomorrow = new Date();
|
|
|
+ tomorrow.setDate(currentDate.getDate() + 1);
|
|
|
+ if (inputDate.getDate() === tomorrow.getDate() && inputDate.getMonth() === tomorrow.getMonth() && inputDate.getFullYear() === tomorrow.getFullYear()) {
|
|
|
+ return "\u660E\u5929 ".concat(TimeFormatter.formatTime(inputDate));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 返回 YYYY-MM-DD HH:mm
|
|
|
+ return "".concat(inputDate.getFullYear(), "-").concat(TimeFormatter.formatNumber(inputDate.getMonth() + 1), "-").concat(TimeFormatter.formatNumber(inputDate.getDate()), " ").concat(TimeFormatter.formatTime(inputDate));
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: "formatTime",
|
|
|
+ value: function formatTime(date) {
|
|
|
+ return "".concat(TimeFormatter.formatNumber(date.getHours()), ":").concat(TimeFormatter.formatNumber(date.getMinutes()));
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: "formatNumber",
|
|
|
+ value: function formatNumber(num) {
|
|
|
+ return num.toString().padStart(2, '0');
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+ return TimeFormatter;
|
|
|
+}();
|
|
|
+
|
|
|
+/***/ }),
|
|
|
+
|
|
|
+/***/ "./node_modules/taro-ui/dist/style/components/float-layout.scss":
|
|
|
+/*!**********************************************************************!*\
|
|
|
+ !*** ./node_modules/taro-ui/dist/style/components/float-layout.scss ***!
|
|
|
+ \**********************************************************************/
|
|
|
+/***/ (function() {
|
|
|
+
|
|
|
+// extracted by mini-css-extract-plugin
|
|
|
+
|
|
|
+
|
|
|
+/***/ }),
|
|
|
+
|
|
|
+/***/ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js":
|
|
|
+/*!*******************************************************************!*\
|
|
|
+ !*** ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js ***!
|
|
|
+ \*******************************************************************/
|
|
|
+/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
+
|
|
|
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
+/* harmony export */ "default": function() { return /* binding */ _classCallCheck; }
|
|
|
+/* harmony export */ });
|
|
|
+function _classCallCheck(instance, Constructor) {
|
|
|
+ if (!(instance instanceof Constructor)) {
|
|
|
+ throw new TypeError("Cannot call a class as a function");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/***/ }),
|
|
|
+
|
|
|
+/***/ "./node_modules/@babel/runtime/helpers/esm/createClass.js":
|
|
|
+/*!****************************************************************!*\
|
|
|
+ !*** ./node_modules/@babel/runtime/helpers/esm/createClass.js ***!
|
|
|
+ \****************************************************************/
|
|
|
+/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
+
|
|
|
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
+/* harmony export */ "default": function() { return /* binding */ _createClass; }
|
|
|
+/* harmony export */ });
|
|
|
+/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
|
|
|
+
|
|
|
+function _defineProperties(target, props) {
|
|
|
+ for (var i = 0; i < props.length; i++) {
|
|
|
+ var descriptor = props[i];
|
|
|
+ descriptor.enumerable = descriptor.enumerable || false;
|
|
|
+ descriptor.configurable = true;
|
|
|
+ if ("value" in descriptor) descriptor.writable = true;
|
|
|
+ Object.defineProperty(target, (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(descriptor.key), descriptor);
|
|
|
+ }
|
|
|
+}
|
|
|
+function _createClass(Constructor, protoProps, staticProps) {
|
|
|
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
|
+ if (staticProps) _defineProperties(Constructor, staticProps);
|
|
|
+ Object.defineProperty(Constructor, "prototype", {
|
|
|
+ writable: false
|
|
|
+ });
|
|
|
+ return Constructor;
|
|
|
+}
|
|
|
+
|
|
|
/***/ })
|
|
|
|
|
|
},
|