"use strict"; (wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["pages/Clock"],{ /***/ "./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/Clock.tsx": /*!**************************************************************************************************!*\ !*** ./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/Clock.tsx ***! \**************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { /* 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 _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"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _store_user__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/store/user */ "./src/store/user.tsx"); /* harmony import */ var _services_permission__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/services/permission */ "./src/services/permission.tsx"); /* 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__); // import ComponentA from './component' // import TabBar from '../../components/Tabbar'; function IndexPage() { var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(); var array = []; var user = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(function (state) { return state.user; }); var permission = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(function (state) { return state.permission; }); var common = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(function (state) { 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, { children: "ffff" })); // array.push() (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() { var userData; return (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_13__["default"])().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: _context.next = 2; return getStorage('userData'); case 2: userData = _context.sent; if (userData) { dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_2__.getInfoSuccess)(JSON.parse(userData))); // return JSON.parse(userData as string) as UserState; setTimeout(function () { checkWXPubFollow(); getCheckData(); }, 200); } case 4: case "end": return _context.stop(); } }, _callee); }))); (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.useDidShow)(function () { if (user.isLogin) getCheckData(); }); function getCheckData() { (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_7__.getChecks)().then(function (res) { if (res.scenario) { dispatch((0,_store_scenario__WEBPACK_IMPORTED_MODULE_8__.setScenario)(res.scenario)); __webpack_require__.g.scenario = res.scenario; // console.log((res as any).scenario.name + ' ' + (res as any).status); // trackTimeService.send({type:(res as any).scenario.name}); // setSpecifiedStatus('FAST_SLEEP', 'ON_GOING'); // 初始化状态机 // const initialState = machine.initialState; // 设置指定状态为 C->3 // const nextState = machine.transition(initialState, 'SET_SPECIFIED_STATE'); // const specifiedState = setSpecifiedState(nextState, 'FAST_SLEEP'); // setSpecifiedState(); // console.log('name:'+(res as any).scenario.name) // machine.reset(); _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_9__["default"].send({ type: 'RESET' }); _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_9__["default"].send({ type: res.scenario.name }); var currentState = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_9__["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' // debugger // trackTimeService.send('APPLE'); // machine.transition(`${key}.${(res as any).status}`,'' as any); // trackTimeService.send({type:'START_FAST'}); // trackTimeService.send({type:'START_SLEEP'}); // trackTimeService.send({type:'END_SLEEP'}); // trackTimeService.send({type:'END_SLEEP'}); // trackTimeService.send({type:'START_FAST'}); // trackTimeService.send({type:'END_FAST'}); // trackTimeService.send({type:'START_SLEEP'}); // console.log(currentState.value); // debugger // trackTimeService.send('setCurrentStatus', {status:(res as any).status}); // setCurrentStatus((res as any).status); // trackTimeService.send({type:'START_FAST'}); } }); } function checkWXPubFollow() { (0,_services_permission__WEBPACK_IMPORTED_MODULE_3__.wxPubFollow)().then(function (res) { console.log(res); }); } function followWxPub() { var resource = common.resources.filter(function (item) { return item.code == 'follow_wx_pub'; }); _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showModal({ title: '提示', content: '关注公众号后可接收提醒\n点击确定,前往关注', showCancel: true, success: function success(result) { if (result.confirm) { _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({ url: '/pages/H5?title=fast16cc 关注服务号&url=' + resource[0].url }); } } }); } function getStorage(_x) { 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) { var res; return (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_13__["default"])().wrap(function _callee2$(_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: _context2.prev = 0; _context2.next = 3; return _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getStorage({ key: key }); case 3: res = _context2.sent; return _context2.abrupt("return", res.data); case 7: _context2.prev = 7; _context2.t0 = _context2["catch"](0); return _context2.abrupt("return", ''); case 10: case "end": return _context2.stop(); } }, _callee2, null, [[0, 7]]); })); return _getStorage.apply(this, arguments); } function goDetail() { _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({ // url: '/pages/index/detail' //src/moduleA/pages/third.tsx url: '../../moduleA/pages/third' }); } function login() { if (user.isLogin) { _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({ url: '/pages/ChooseScenario' }); } else { _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({ url: '/pages/ChooseAuth' }); } } return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.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, { onClick: function onClick() { return followWxPub(); }, children: "\u53BB\u5173\u6CE8\u516C\u4F17\u53F7111" }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.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, { 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"], {})] }); } /***/ }), /***/ "./src/features/trackTimeDuration/components/Clock.tsx": /*!*************************************************************!*\ !*** ./src/features/trackTimeDuration/components/Clock.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 _components_Rings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/Rings */ "./src/components/Rings.weapp.tsx"); /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime"); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__); function Component() { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.View, { children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components_Rings__WEBPACK_IMPORTED_MODULE_0__["default"], { radius: 50 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.Text, { children: "Clock Component" })] }); } /***/ }), /***/ "./src/features/trackTimeDuration/components/Console.tsx": /*!***************************************************************!*\ !*** ./src/features/trackTimeDuration/components/Console.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_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"); /* harmony import */ var _services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/services/trackTimeDuration */ "./src/services/trackTimeDuration.tsx"); /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"); /* harmony import */ var _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/store/trackTimeMachine */ "./src/store/trackTimeMachine.tsx"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "webpack/container/remote/react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime"); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__); function Component() { // const [current,send] = useService(machine) // const currentState = trackTimeService.getSnapshot(); // console.log(currentState.value); // debugger var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(''), _useState2 = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(_useState, 2), key = _useState2[0], setKey = _useState2[1]; var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(''), _useState4 = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(_useState3, 2), 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); } }, [_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) { // console.log(state.value); var value = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].getSnapshot().value; // console.log('aaa:'+JSON.parse(JSON.stringify(value))); if (state.value.FAST_SLEEP) { setKey('FAST_SLEEP'); setValue(state.value.FAST_SLEEP); } if (state.value.FAST) { setKey('FAST'); setValue(state.value.FAST); } if (state.value.SLEEP) { setKey('SLEEP'); setValue(state.value.SLEEP); } }); }, []); function isMap(obj) { return obj instanceof Map; } function startFast() { _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({ type: 'START_FAST' }); var start_time = new Date().getTime(); var duration = 8 * 3600 * 1000; var extra = { set_time: start_time - 20 * 1000, confirm_time: start_time + 50 * 1000 }; (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_0__.recordCheck)({ action: 'FAST_START', real_check_time: start_time, target_duration: duration, extra: extra }).then(function (res) { console.log(res); }); // dispatch(startFast()); } function startSleep() { _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({ type: 'START_SLEEP' }); var start_time = new Date().getTime(); var duration = 8 * 3600 * 1000; var extra = { set_time: start_time - 20 * 1000, confirm_time: start_time + 50 * 1000 }; (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_0__.recordCheck)({ action: 'SLEEP_START', real_check_time: start_time, target_duration: duration, extra: extra }).then(function (res) { console.log(res); }); // dispatch(startSleep()); } function endSleep() { _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({ type: 'END_SLEEP' }); var start_time = new Date().getTime(); // const duration = 8 * 3600 * 1000; var extra = { set_time: start_time - 20 * 1000, confirm_time: start_time + 50 * 1000 }; (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_0__.recordCheck)({ action: 'SLEEP_END', real_check_time: start_time, extra: extra }).then(function (res) { console.log(res); }); } function endFast() { _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({ type: 'END_FAST' }); var start_time = new Date().getTime(); // const duration = 8 * 3600 * 1000; var extra = { set_time: start_time - 20 * 1000, confirm_time: start_time + 50 * 1000 }; (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_0__.recordCheck)({ action: 'FAST_END', real_check_time: start_time, extra: extra }).then(function (res) { console.log(res); _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({ type: 'RESET' }); _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({ type: __webpack_require__.g.scenario.name }); }); } function mixedBtns() { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, { children: [(value == 'WAIT_FOR_START' || value == 'DONE') && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, { onClick: startFast, children: "Start Fast" }), (value == 'ONGOING' /* ||value == 'ONGOING1' || value == 'ONGOING2'*/ || value == 'ONGOING3') && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, { onClick: endFast, children: "End Fast" }), value == 'ONGOING1' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, { onClick: startSleep, children: "Start Sleep" }), value == 'ONGOING2' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, { onClick: endSleep, children: "End Sleep" })] }); } function fastBtns() { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, { children: value == 'ONGOING' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, { onClick: endFast, children: "End Fast" }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, { onClick: startFast, children: "Start Fast" }) }); } function sleepBtns() { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, { children: value == 'ONGOING' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, { onClick: endSleep, children: "End Sleep" }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, { onClick: startSleep, children: "Start Sleep" }) }); } return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, { children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, { children: "Console Component" }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, { children: [key === 'FAST_SLEEP' && mixedBtns(), key === 'FAST' && fastBtns(), key === 'SLEEP' && sleepBtns()] })] }); } /***/ }), /***/ "./src/features/trackTimeDuration/components/More.tsx": /*!************************************************************!*\ !*** ./src/features/trackTimeDuration/components/More.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 _tarojs_components__WEBPACK_IMPORTED_MODULE_7__ = __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__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 react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "webpack/container/remote/react-i18next"); /* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/store/trackTimeMachine */ "./src/store/trackTimeMachine.tsx"); /* harmony import */ var _services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/services/trackTimeDuration */ "./src/services/trackTimeDuration.tsx"); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime"); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); function Component() { var _useTranslation = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)(), t = _useTranslation.t; var scenario = (0,react_redux__WEBPACK_IMPORTED_MODULE_3__.useSelector)(function (state) { return state.scenario; }); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () { var value = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].getSnapshot().value; }, [_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__.machine.context.currentStatus]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () { _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].onTransition(function (state) { var value = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].getSnapshot().value; }); }, []); function waitActionSheet() { _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showActionSheet({ itemList: [t('feature.track_time_duration.action_sheet.change_schedule'), t('feature.track_time_duration.action_sheet.switch_scenario')] }).then(function (res) { console.log(res.tapIndex); switch (res.tapIndex) { case 0: _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({ url: '/pages/SetSchedule' }); break; case 1: _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({ url: '/pages/ChooseScenario' }); break; } }).catch(function (err) { console.log(err.errMsg); }); } function endFastActionSheet() { _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showActionSheet({ itemList: [t('feature.track_time_duration.action_sheet.end_fast')] }).then(function (res) { console.log(res.tapIndex); switch (res.tapIndex) { case 0: { var start_time = new Date().getTime(); // const duration = 8 * 3600 * 1000; var extra = { set_time: start_time - 20 * 1000, confirm_time: start_time + 50 * 1000 }; (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_5__.recordCheck)({ action: 'FAST_END', real_check_time: start_time, extra: extra }).then(function (res) { _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].send({ type: 'END_FAST' }); console.log(res); _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].send({ type: 'RESET' }); _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].send({ type: __webpack_require__.g.scenario.name }); }); } break; } }).catch(function (err) { console.log(err.errMsg); }); } function ongoingActionSheet() { _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showActionSheet({ itemList: [t('feature.track_time_duration.action_sheet.give_up'), t('feature.track_time_duration.action_sheet.switch_scenario')] }).then(function (res) { console.log(res.tapIndex); }).catch(function (err) { console.log(err.errMsg); }); } function checkActionSheetData() { var state = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].getSnapshot().value; debugger; if (state.FAST_SLEEP === 'WAIT_FOR_START' || state.FAST === 'WAIT_FOR_START' || state.SLEEP === 'WAIT_FOR_START') { waitActionSheet(); } else if (state.FAST_SLEEP === 'ONGOING1' || state.FAST_SLEEP === 'ONGOING2') { endFastActionSheet(); } else if (state.FAST_SLEEP === 'ONGOING3') { _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showToast({ title: '暂无更多操作', icon: 'none', duration: 2000 }); } } return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, { onClick: checkActionSheetData, children: "More Component" }) }); } /***/ }), /***/ "./src/pages/Clock.tsx": /*!*****************************!*\ !*** ./src/pages/Clock.tsx ***! \*****************************/ /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) { /* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/runtime */ "webpack/container/remote/@tarojs/runtime"); /* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _node_modules_babel_loader_lib_index_js_ruleSet_1_rules_5_use_0_Clock_tsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./Clock.tsx */ "./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/Clock.tsx"); var config = {}; var inst = Page((0,_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__.createPageConfig)(_node_modules_babel_loader_lib_index_js_ruleSet_1_rules_5_use_0_Clock_tsx__WEBPACK_IMPORTED_MODULE_1__["default"], 'pages/Clock', {root:{cn:[]}}, config || {})) /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_ruleSet_1_rules_5_use_0_Clock_tsx__WEBPACK_IMPORTED_MODULE_1__["default"]); /***/ }), /***/ "./src/store/trackTimeMachine.tsx": /*!****************************************!*\ !*** ./src/store/trackTimeMachine.tsx ***! \****************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ machine: function() { return /* binding */ machine; } /* harmony export */ }); /* unused harmony exports setSpecifiedState, setSpecifiedStatus */ /* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"); /* harmony import */ var xstate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! xstate */ "webpack/container/remote/xstate"); /* harmony import */ var xstate__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(xstate__WEBPACK_IMPORTED_MODULE_0__); var machine = (0,xstate__WEBPACK_IMPORTED_MODULE_0__.createMachine)({ id: "trackTime", initial: "choose", context: { currentStatus: '' }, on: { RESET: { target: '.choose', actions: (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)(function (_) { return { currentStatus: '' }; }) } }, states: { choose: { on: { SLEEP: { target: "SLEEP" }, FAST_SLEEP: { target: "FAST_SLEEP" }, FAST: { target: "FAST" } } }, SLEEP: { initial: "WAIT_FOR_START", states: { WAIT_FOR_START: { on: { START_SLEEP: { target: "ONGOING" } } }, ONGOING: { on: { END_SLEEP: { target: "DONE" } } }, DONE: {} } }, FAST_SLEEP: { initial: "WAIT_FOR_START", states: { WAIT_FOR_START: { on: { START_FAST: { target: "ONGOING1" } } }, ONGOING1: { on: { START_SLEEP: { target: "ONGOING2" }, END_FAST: { target: "DONE" } } }, ONGOING2: { on: { END_FAST: { target: "DONE" }, END_SLEEP: { target: "ONGOING3" } } }, DONE: {}, ONGOING3: { on: { END_FAST: { target: "DONE" } } } } }, FAST: { initial: "WAIT_FOR_START", states: { WAIT_FOR_START: { on: { START_FAST: { target: "ONGOING" } } }, ONGOING: { on: { END_FAST: { target: "DONE" } } }, DONE: {} } } }, schema: { events: {} }, predictableActionArguments: true, preserveActionOrder: true }, { actions: { apple: (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)({}), setCurrentStatus: (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)(function (context, event) { return { currentStatus: event.type }; }) }, services: {}, guards: {}, delays: {} }); var setSpecifiedState = function setSpecifiedState(currentState, specifiedState) { return (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)({ myMachine: (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["default"])({}, currentState.myMachine), {}, { value: specifiedState }) }); }; var setSpecifiedStatus = function setSpecifiedStatus(currentState, specifiedState) { return (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)({ machine: { currentState: currentState, specifiedState: specifiedState } }); }; var service = (0,xstate__WEBPACK_IMPORTED_MODULE_0__.interpret)(machine).start(); // const service = machine.withContext(initialContext).start(); /* harmony default export */ __webpack_exports__["default"] = (service); /***/ }) }, /******/ function(__webpack_require__) { // webpackRuntimeModules /******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); } /******/ __webpack_require__.O(0, ["taro","vendors","common"], function() { return __webpack_exec__("./src/pages/Clock.tsx"); }); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ } ]); //# sourceMappingURL=Clock.js.map