| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076 |
- "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_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");
- /* 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 _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__);
- // 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_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_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_14__["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_8__.getChecks)().then(function (res) {
- if (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');
- // 初始化状态机
- // 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_10__["default"].send({
- type: 'RESET'
- });
- _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_10__["default"].send({
- type: res.scenario.name
- });
- 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_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);
- // 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_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_14__["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_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_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_11__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.Text, {
- children: "\u5DF2\u5173\u6CE8"
- }), /*#__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_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_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"], {})]
- });
- }
- /***/ }),
- /***/ "./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 () {
- 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) {
- // 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 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;
- }
- 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/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 ***!
- \*****************************/
- /***/ (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: '',
- checkData: null
- },
- 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);
- /***/ }),
- /***/ "./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;
- }
- /***/ })
- },
- /******/ 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
|