leon 2 년 전
부모
커밋
911c246cc1

+ 301 - 39
dist/pages/Clock.js

@@ -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;
+}
+
 /***/ })
 
 },

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/pages/Clock.js.map


+ 268 - 0
dist/pages/Clock.wxss

@@ -15,3 +15,271 @@
 .login {
   color: red;
 }
+/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
+  !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[2]!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[4]!./node_modules/taro-ui/dist/style/components/float-layout.scss ***!
+  \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
+@charset "UTF-8";
+/**
+ * Default variables
+ */
+/**
+ * Mixes a color with white. It's different from lighten()
+ *
+ * @param {color} $color
+ * @param {number (percentage)} $percent [The amout of white to be mixed in]
+ * @return {color}
+ *
+ * @example
+ *   .element {
+ *     background-color: tint(#6ecaa6 , 40%);
+ *   }
+ *
+ *   // CSS Output
+ *   .element {
+ *     background-color: #a8dfc9;
+ *   }
+ */
+/* The Color of O2Team Brand */
+/* Color */
+/* Color Palette */
+/* Text Color */
+/* Link */
+/* 背景色 */
+/* 边框颜色 */
+/* 图标颜色 */
+/* Border Radius */
+/* 透明度 */
+/* Font */
+/* Line Height */
+/* 水平间距 */
+/* 垂直间距 */
+/* 图标尺寸 */
+/* z-index */
+/* timing function */
+/**
+* CSS cubic-bezier timing functions
+* http://bourbon.io/docs/#timing-functions
+*/
+/**
+ * 组件变量
+ */
+/* Accordion */
+/* Activity Indicator */
+/* Avatar */
+/* Badge */
+/* Button */
+/* Float Button */
+/* Calendar */
+/* Card */
+/* Checkbox */
+/* Countdown */
+/* Curtain */
+/* Divider */
+/* Drawer */
+/* FloatLayout */
+/* Grid */
+/* ImagePicker */
+/* Indexes */
+/* InputNumber */
+/* Input */
+/* List */
+/* LoadMore */
+/* Loading */
+/* Message */
+/* Modal */
+/* NavBar */
+/* NoticeBar */
+/* Pagination */
+/* Progress */
+/* Radio */
+/* Range */
+/* Rate */
+/* SearchBar */
+/* SegmentedControl */
+/* Slider */
+/* Steps */
+/* SwipeAction */
+/* Switch */
+/* TabBar */
+/* Tabs */
+/* Tag */
+/* Textarea */
+/* Timeline */
+/**
+ * Mixins
+ */
+/* library */
+/**
+ * 元素居中定位
+ */
+/**
+ * @example scss
+ *
+ * .element {
+ *   @include clearfix;
+ * }
+ *
+ * // CSS Output
+ * .element::after {
+ *   clear: both;
+ *   content: '';
+ *   display: block;
+ * }
+ */
+/**
+ * 通用的遮罩
+ */
+/**
+ * Mixes a color with black. It's different from darken()
+ *
+ * @param {color} $color
+ * @param {number (percentage)} $percent [The amount of black to be mixed in]
+ * @return {color}
+ *
+ * @example
+ *   .element {
+ *     background-color: shade(#ffbb52, 60%);
+ *   }
+ *
+ *   // CSS Output
+ *   .element {
+ *     background-color: #664a20;
+ *   }
+ */
+/**
+ * Mixes a color with white. It's different from lighten()
+ *
+ * @param {color} $color
+ * @param {number (percentage)} $percent [The amout of white to be mixed in]
+ * @return {color}
+ *
+ * @example
+ *   .element {
+ *     background-color: tint(#6ecaa6 , 40%);
+ *   }
+ *
+ *   // CSS Output
+ *   .element {
+ *     background-color: #a8dfc9;
+ *   }
+ */
+/* Flex Item */
+/**
+ * 默认主题下 $color-border-light
+ */
+/**
+ * 点击态
+ */
+/**
+ * 禁止态
+ */
+/**
+ * 设置placeholder 颜色
+ */
+/**
+ * 默认主题下 $color-border-light
+ */
+.at-float-layout {
+  position: fixed;
+  width: 100%;
+  height: 100%;
+  top: 0;
+  left: 0;
+  visibility: hidden;
+  z-index: 810;
+  -webkit-transition: visibility 300ms cubic-bezier(0.36, 0.66, 0.04, 1);
+  transition: visibility 300ms cubic-bezier(0.36, 0.66, 0.04, 1);
+  /* elements */
+  /* modifiers */
+}
+.at-float-layout__overlay {
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  position: absolute;
+  background-color: rgba(0, 0, 0, 0.3);
+  opacity: 0;
+  -webkit-transition: opacity 150ms ease-in;
+  transition: opacity 150ms ease-in;
+}
+.at-float-layout__container {
+  position: absolute;
+  bottom: 0;
+  width: 100%;
+  min-height: 600rpx;
+  max-height: 950rpx;
+  background-color: #FFF;
+  -webkit-transform: translate3d(0, 100%, 0);
+          transform: translate3d(0, 100%, 0);
+  -webkit-transition: -webkit-transform 300ms cubic-bezier(0.36, 0.66, 0.04, 1);
+  transition: -webkit-transform 300ms cubic-bezier(0.36, 0.66, 0.04, 1);
+  transition: transform 300ms cubic-bezier(0.36, 0.66, 0.04, 1);
+  transition: transform 300ms cubic-bezier(0.36, 0.66, 0.04, 1), -webkit-transform 300ms cubic-bezier(0.36, 0.66, 0.04, 1);
+}
+.at-float-layout .layout-header {
+  position: relative;
+  padding: 18rpx;
+  line-height: 1.5;
+  background-color: #F7F7F7;
+}
+.at-float-layout .layout-header__title {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  color: #333;
+  font-size: 32rpx;
+  display: block;
+  padding-right: 80rpx;
+}
+.at-float-layout .layout-header__btn-close {
+  position: absolute;
+  padding: 10rpx;
+  top: 50%;
+  right: 18rpx;
+  width: 40rpx;
+  height: 100%;
+  line-height: 1;
+  -webkit-transform: translate(0, -50%);
+      -ms-transform: translate(0, -50%);
+          transform: translate(0, -50%);
+}
+.at-float-layout .layout-header__btn-close::before, .at-float-layout .layout-header__btn-close::after {
+  content: "";
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  display: inline-block;
+  width: 36rpx;
+  height: 2PX;
+  border-radius: 1PX;
+  background: #CCC;
+}
+.at-float-layout .layout-header__btn-close::before {
+  -webkit-transform: translate3d(-50%, -50%, 0) rotate(45deg);
+          transform: translate3d(-50%, -50%, 0) rotate(45deg);
+}
+.at-float-layout .layout-header__btn-close::after {
+  -webkit-transform: translate3d(-50%, -50%, 0) rotate(-45deg);
+          transform: translate3d(-50%, -50%, 0) rotate(-45deg);
+}
+.at-float-layout .layout-body {
+  font-size: 28rpx;
+  padding: 18rpx;
+  max-height: 828rpx;
+  min-height: 514rpx;
+}
+.at-float-layout .layout-body__content {
+  max-height: 798rpx;
+  min-height: 484rpx;
+}
+.at-float-layout--active {
+  visibility: visible;
+}
+.at-float-layout--active .at-float-layout__overlay {
+  opacity: 1;
+}
+.at-float-layout--active .at-float-layout__container {
+  -webkit-transform: translate3d(0, 0, 0);
+          transform: translate3d(0, 0, 0);
+}

+ 6 - 6
dist/prebundle/remoteEntry.js

@@ -18,12 +18,12 @@ var moduleMap = {
 	"./react-redux": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-LNJCN3VW_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-2Y2U3MWF_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_react-redux_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-redux.js */ "./node_modules/.taro/weapp/prebundle/react-redux.js")); }; });
 	},
-	"./@reduxjs/toolkit": function() {
-		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_reduxjs_toolkit_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js */ "./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js")); }; });
-	},
 	"./react-i18next": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-LNJCN3VW_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_react-i18next_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-i18next.js */ "./node_modules/.taro/weapp/prebundle/react-i18next.js")); }; });
 	},
+	"./@reduxjs/toolkit": function() {
+		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_reduxjs_toolkit_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js */ "./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js")); }; });
+	},
 	"./i18next-browser-languagedetector": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_i18next-browser-languagedetector_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/i18next-browser-languagedetector.js */ "./node_modules/.taro/weapp/prebundle/i18next-browser-languagedetector.js")); }; });
 	},
@@ -86,12 +86,12 @@ var taroModuleMap = {
 	"./react-redux": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-redux.js */ "./node_modules/.taro/weapp/prebundle/react-redux.js")); };
 	},
-	"./@reduxjs/toolkit": function() {
-		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js */ "./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js")); };
-	},
 	"./react-i18next": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-i18next.js */ "./node_modules/.taro/weapp/prebundle/react-i18next.js")); };
 	},
+	"./@reduxjs/toolkit": function() {
+		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js */ "./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js")); };
+	},
 	"./i18next-browser-languagedetector": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/i18next-browser-languagedetector.js */ "./node_modules/.taro/weapp/prebundle/i18next-browser-languagedetector.js")); };
 	},

+ 18 - 14
src/features/trackTimeDuration/components/Console.tsx

@@ -12,20 +12,7 @@ export default function Component() {
     const [value, setValue] = useState('');
 
     useEffect(() => {
-        var state = trackTimeService.getSnapshot().value
-        if ((state as any).FAST_SLEEP) {
-            setKey('FAST_SLEEP');
-            setValue((state as any).FAST_SLEEP);
-        }
-        if ((state as any).FAST) {
-            setKey('FAST');
-            setValue((state as any).FAST);
-        }
-        if ((state as any).SLEEP) {
-            setKey('SLEEP');
-            setValue((state as any).SLEEP);
-        }
-
+        getStateDetail();
     }, [machine.context.currentStatus])
 
     useEffect(() => {
@@ -48,6 +35,23 @@ export default function Component() {
         });
     }, []);
 
+    function getStateDetail() {
+        var state = trackTimeService.getSnapshot().value
+        if ((state as any).FAST_SLEEP) {
+            setKey('FAST_SLEEP');
+            setValue((state as any).FAST_SLEEP);
+        }
+        if ((state as any).FAST) {
+            setKey('FAST');
+            setValue((state as any).FAST);
+        }
+        if ((state as any).SLEEP) {
+            setKey('SLEEP');
+            setValue((state as any).SLEEP);
+        }
+
+    }
+
     function isMap(obj: any): obj is Map<any, any> {
         return obj instanceof Map;
     }

+ 6 - 0
src/features/trackTimeDuration/components/Durations.tsx

@@ -0,0 +1,6 @@
+import { View } from "@tarojs/components";
+
+
+export default function Component() {
+    return <View></View>
+}

+ 101 - 0
src/features/trackTimeDuration/components/Schedule.tsx

@@ -0,0 +1,101 @@
+import { View, Text } from "@tarojs/components";
+import trackTimeService, { machine } from "@/store/trackTimeMachine"
+import { useEffect, useState } from "react";
+import Taro from "@tarojs/taro";
+import { TimeFormatter } from "@/utils/time_format";
+import {AtFloatLayout} from 'taro-ui';
+import "taro-ui/dist/style/components/float-layout.scss";
+
+
+export default function Component() {
+    const [checkData, setCheckData] = useState(null)
+
+    const [key, setKey] = useState('');
+    const [value, setValue] = useState('');
+
+
+    useEffect(() => {
+        getStateDetail();
+    }, [machine.context.currentStatus])
+
+    useEffect(() => {
+        if (machine.context.checkData) {
+            setCheckData(machine.context.checkData as any);
+        }
+
+    }, [machine.context.checkData]);
+    useEffect(() => {
+        trackTimeService.onTransition(state => {
+            getStateDetail();
+        });
+    }, []);
+
+    function getStateDetail() {
+        var state = trackTimeService.getSnapshot().value
+        if ((state as any).FAST_SLEEP) {
+            setKey('FAST_SLEEP');
+            setValue((state as any).FAST_SLEEP);
+        }
+        if ((state as any).FAST) {
+            setKey('FAST');
+            setValue((state as any).FAST);
+        }
+        if ((state as any).SLEEP) {
+            setKey('SLEEP');
+            setValue((state as any).SLEEP);
+        }
+
+    }
+
+    function editSchedule() {
+        Taro.navigateTo({
+            url: '/pages/SetSchedule'
+        })
+    }
+
+    //🚫❌⭕️✅
+    function statusString(isFast: boolean, isStart: boolean) {
+        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 <View style={{ flexDirection: 'column', display: 'flex', alignItems: 'center' }}>
+        <Text>{value == 'WAIT_FOR_START' ? 'Schedule' : 'Log in Progress'}</Text>
+        {
+            checkData && <View style={{ flexDirection: 'column', display: 'flex' }}>
+                {(checkData as any).target.fast && <Text>{statusString(true,true)}开始断食:{TimeFormatter.formatTimestamp((checkData as any).target.fast.start_time)}</Text>}
+                {(checkData as any).target.sleep && <Text>{statusString(false,true)}开始睡眠:{TimeFormatter.formatTimestamp((checkData as any).target.sleep.start_time)}</Text>}
+                {(checkData as any).target.sleep && <Text>{statusString(false,false)}结束睡眠:{TimeFormatter.formatTimestamp((checkData as any).target.sleep.end_time)}</Text>}
+                {(checkData as any).target.fast && <Text>{statusString(true,false)}结束断食:{TimeFormatter.formatTimestamp((checkData as any).target.fast.end_time)}</Text>}
+            </View>
+        }
+        {
+            value == 'WAIT_FOR_START' && <Text onClick={editSchedule}>调整日程</Text>
+        }
+        {
+            value == 'WAIT_FOR_START' ? <Text>Duration goals by stage</Text> : <Text>Current stage</Text>
+        }
+
+    </View>
+}

+ 4 - 0
src/pages/clock.tsx

@@ -13,6 +13,7 @@ import { use } from 'i18next';
 import Clocks from '@/features/trackTimeDuration/components/Clock';
 import Console from '@/features/trackTimeDuration/components/Console';
 import More from '@/features/trackTimeDuration/components/More';
+import Schedule from '@/features/trackTimeDuration/components/Schedule';
 import { getChecks } from '@/services/trackTimeDuration';
 import { setScenario } from '@/store/scenario';
 
@@ -55,6 +56,7 @@ export default function IndexPage() {
       if ((res as any).scenario) {
         dispatch(setScenario((res as any).scenario));
         global.scenario = (res as any).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');
@@ -79,6 +81,7 @@ export default function IndexPage() {
         currentState.value = json;
         // debugger
         machine.context.currentStatus =  `${key}.${(res as any).status}`;//'mixed.ON_GOING2'
+        machine.context.checkData = res as any;
         // debugger
         // trackTimeService.send('APPLE');
         // machine.transition(`${key}.${(res as any).status}`,'' as any);
@@ -171,6 +174,7 @@ export default function IndexPage() {
       <Clocks />
       <Console />
       <More />
+      <Schedule />
 
     </View>
   )

+ 2 - 1
src/store/trackTimeMachine.tsx

@@ -5,7 +5,8 @@ export const machine = createMachine(
     id: "trackTime",
     initial: "choose",
     context:{
-        currentStatus:''
+        currentStatus:'',
+        checkData:null
     },
     on: {
         RESET:{

+ 0 - 0
src/utils/time_format.js


+ 52 - 0
src/utils/time_format.ts

@@ -0,0 +1,52 @@
+export class TimeFormatter {
+    static formatTimestamp(timestamp: number): string {
+      const currentDate = new Date();
+      const inputDate = new Date(timestamp);
+  
+      // 判断是否是今天
+      if (
+        inputDate.getDate() === currentDate.getDate() &&
+        inputDate.getMonth() === currentDate.getMonth() &&
+        inputDate.getFullYear() === currentDate.getFullYear()
+      ) {
+        return `今天 ${TimeFormatter.formatTime(inputDate)}`;
+      }
+  
+      // 判断是否是昨天
+      const yesterday = new Date();
+      yesterday.setDate(currentDate.getDate() - 1);
+  
+      if (
+        inputDate.getDate() === yesterday.getDate() &&
+        inputDate.getMonth() === yesterday.getMonth() &&
+        inputDate.getFullYear() === yesterday.getFullYear()
+      ) {
+        return `昨天 ${TimeFormatter.formatTime(inputDate)}`;
+      }
+  
+      // 判断是否是明天
+      const tomorrow = new Date();
+      tomorrow.setDate(currentDate.getDate() + 1);
+  
+      if (
+        inputDate.getDate() === tomorrow.getDate() &&
+        inputDate.getMonth() === tomorrow.getMonth() &&
+        inputDate.getFullYear() === tomorrow.getFullYear()
+      ) {
+        return `明天 ${TimeFormatter.formatTime(inputDate)}`;
+      }
+  
+      // 返回 YYYY-MM-DD HH:mm
+      return `${inputDate.getFullYear()}-${TimeFormatter.formatNumber(inputDate.getMonth() + 1)}-${TimeFormatter.formatNumber(
+        inputDate.getDate()
+      )} ${TimeFormatter.formatTime(inputDate)}`;
+    }
+  
+    static formatTime(date: Date): string {
+      return `${TimeFormatter.formatNumber(date.getHours())}:${TimeFormatter.formatNumber(date.getMinutes())}`;
+    }
+  
+    static formatNumber(num: number): string {
+      return num.toString().padStart(2, '0');
+    }
+  }

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.