Clock.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. "use strict";
  2. (wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["pages/Clock"],{
  3. /***/ "./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/Clock.tsx":
  4. /*!**************************************************************************************************!*\
  5. !*** ./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/Clock.tsx ***!
  6. \**************************************************************************************************/
  7. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  8. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  9. /* harmony export */ "default": function() { return /* binding */ IndexPage; }
  10. /* harmony export */ });
  11. /* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js */ "./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");
  12. /* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
  13. /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
  14. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
  15. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__);
  16. /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
  17. /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_1__);
  18. /* harmony import */ var _store_user__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/store/user */ "./src/store/user.tsx");
  19. /* harmony import */ var _services_permission__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/services/permission */ "./src/services/permission.tsx");
  20. /* harmony import */ var _features_trackTimeDuration_components_Clock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/features/trackTimeDuration/components/Clock */ "./src/features/trackTimeDuration/components/Clock.tsx");
  21. /* harmony import */ var _features_trackTimeDuration_components_Console__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/features/trackTimeDuration/components/Console */ "./src/features/trackTimeDuration/components/Console.tsx");
  22. /* harmony import */ var _features_trackTimeDuration_components_More__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/features/trackTimeDuration/components/More */ "./src/features/trackTimeDuration/components/More.tsx");
  23. /* harmony import */ var _services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/services/trackTimeDuration */ "./src/services/trackTimeDuration.tsx");
  24. /* harmony import */ var _store_scenario__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/store/scenario */ "./src/store/scenario.tsx");
  25. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
  26. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__);
  27. // import ComponentA from './component'
  28. // import TabBar from '../../components/Tabbar';
  29. function IndexPage() {
  30. var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useDispatch)();
  31. var array = [];
  32. var user = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(function (state) {
  33. return state.user;
  34. });
  35. var permission = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(function (state) {
  36. return state.permission;
  37. });
  38. var common = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(function (state) {
  39. return state.common;
  40. });
  41. array.push('ffff');
  42. array.push( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.Text, {
  43. children: "ffff"
  44. }));
  45. // array.push(<Rings radius={50}/>)
  46. (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.useReady)( /*#__PURE__*/(0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_11__["default"])( /*#__PURE__*/(0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_12__["default"])().mark(function _callee() {
  47. var userData;
  48. return (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_12__["default"])().wrap(function _callee$(_context) {
  49. while (1) switch (_context.prev = _context.next) {
  50. case 0:
  51. _context.next = 2;
  52. return getStorage('userData');
  53. case 2:
  54. userData = _context.sent;
  55. if (userData) {
  56. dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_2__.getInfoSuccess)(JSON.parse(userData)));
  57. // return JSON.parse(userData as string) as UserState;
  58. setTimeout(function () {
  59. checkWXPubFollow();
  60. getCheckData();
  61. }, 200);
  62. }
  63. case 4:
  64. case "end":
  65. return _context.stop();
  66. }
  67. }, _callee);
  68. })));
  69. (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.useDidShow)(function () {
  70. if (user.isLogin) getCheckData();
  71. });
  72. function getCheckData() {
  73. (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_7__.getChecks)().then(function (res) {
  74. if (res.scenario) {
  75. dispatch((0,_store_scenario__WEBPACK_IMPORTED_MODULE_8__.setScenario)(res.scenario));
  76. }
  77. });
  78. }
  79. function checkWXPubFollow() {
  80. (0,_services_permission__WEBPACK_IMPORTED_MODULE_3__.wxPubFollow)().then(function (res) {
  81. console.log(res);
  82. });
  83. }
  84. function followWxPub() {
  85. var resource = common.resources.filter(function (item) {
  86. return item.code == 'follow_wx_pub';
  87. });
  88. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showModal({
  89. title: '提示',
  90. content: '关注公众号后可接收提醒\n点击确定,前往关注',
  91. showCancel: true,
  92. success: function success(result) {
  93. if (result.confirm) {
  94. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({
  95. url: '/pages/H5?title=fast16cc 关注服务号&url=' + resource[0].url
  96. });
  97. }
  98. }
  99. });
  100. }
  101. function getStorage(_x) {
  102. return _getStorage.apply(this, arguments);
  103. }
  104. function _getStorage() {
  105. _getStorage = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_11__["default"])( /*#__PURE__*/(0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_12__["default"])().mark(function _callee2(key) {
  106. var res;
  107. return (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_12__["default"])().wrap(function _callee2$(_context2) {
  108. while (1) switch (_context2.prev = _context2.next) {
  109. case 0:
  110. _context2.prev = 0;
  111. _context2.next = 3;
  112. return _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getStorage({
  113. key: key
  114. });
  115. case 3:
  116. res = _context2.sent;
  117. return _context2.abrupt("return", res.data);
  118. case 7:
  119. _context2.prev = 7;
  120. _context2.t0 = _context2["catch"](0);
  121. return _context2.abrupt("return", '');
  122. case 10:
  123. case "end":
  124. return _context2.stop();
  125. }
  126. }, _callee2, null, [[0, 7]]);
  127. }));
  128. return _getStorage.apply(this, arguments);
  129. }
  130. function goDetail() {
  131. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({
  132. // url: '/pages/index/detail'
  133. //src/moduleA/pages/third.tsx
  134. url: '../../moduleA/pages/third'
  135. });
  136. }
  137. function login() {
  138. if (user.isLogin) {
  139. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({
  140. url: '/pages/ChooseScenario'
  141. });
  142. } else {
  143. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({
  144. url: '/pages/ChooseAuth'
  145. });
  146. }
  147. }
  148. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.View, {
  149. style: {
  150. backgroundColor: '#fff',
  151. flex: 1,
  152. flexDirection: 'column',
  153. display: 'flex'
  154. },
  155. children: [permission.wxPubFollow == false && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.Text, {
  156. onClick: function onClick() {
  157. return followWxPub();
  158. },
  159. children: "\u53BB\u5173\u6CE8\u516C\u4F17\u53F7"
  160. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.Button, {
  161. onClick: function onClick() {
  162. return goDetail();
  163. },
  164. children: "go detail"
  165. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_10__.Text, {
  166. className: "login",
  167. onClick: function onClick() {
  168. return login();
  169. },
  170. children: "sss"
  171. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_features_trackTimeDuration_components_Clock__WEBPACK_IMPORTED_MODULE_4__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_features_trackTimeDuration_components_Console__WEBPACK_IMPORTED_MODULE_5__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_features_trackTimeDuration_components_More__WEBPACK_IMPORTED_MODULE_6__["default"], {})]
  172. });
  173. }
  174. /***/ }),
  175. /***/ "./src/features/trackTimeDuration/components/Clock.tsx":
  176. /*!*************************************************************!*\
  177. !*** ./src/features/trackTimeDuration/components/Clock.tsx ***!
  178. \*************************************************************/
  179. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  180. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  181. /* harmony export */ "default": function() { return /* binding */ Component; }
  182. /* harmony export */ });
  183. /* harmony import */ var _components_Rings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/Rings */ "./src/components/Rings.weapp.tsx");
  184. /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
  185. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
  186. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
  187. function Component() {
  188. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.View, {
  189. children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components_Rings__WEBPACK_IMPORTED_MODULE_0__["default"], {
  190. radius: 50
  191. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.Text, {
  192. children: "Clock Component"
  193. })]
  194. });
  195. }
  196. /***/ }),
  197. /***/ "./src/features/trackTimeDuration/components/Console.tsx":
  198. /*!***************************************************************!*\
  199. !*** ./src/features/trackTimeDuration/components/Console.tsx ***!
  200. \***************************************************************/
  201. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  202. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  203. /* harmony export */ "default": function() { return /* binding */ Component; }
  204. /* harmony export */ });
  205. /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
  206. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
  207. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
  208. function Component() {
  209. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_1__.View, {
  210. children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_1__.Text, {
  211. children: "Console Component"
  212. })
  213. });
  214. }
  215. /***/ }),
  216. /***/ "./src/features/trackTimeDuration/components/More.tsx":
  217. /*!************************************************************!*\
  218. !*** ./src/features/trackTimeDuration/components/More.tsx ***!
  219. \************************************************************/
  220. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  221. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  222. /* harmony export */ "default": function() { return /* binding */ Component; }
  223. /* harmony export */ });
  224. /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
  225. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
  226. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__);
  227. /* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "webpack/container/remote/react-i18next");
  228. /* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
  229. /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
  230. /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_2__);
  231. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
  232. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
  233. function Component() {
  234. var _useTranslation = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)(),
  235. t = _useTranslation.t;
  236. var scenario = (0,react_redux__WEBPACK_IMPORTED_MODULE_2__.useSelector)(function (state) {
  237. return state.scenario;
  238. });
  239. function waitActionSheet() {
  240. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showActionSheet({
  241. itemList: [t('feature.track_time_duration.action_sheet.change_schedule'), t('feature.track_time_duration.action_sheet.switch_scenario')]
  242. }).then(function (res) {
  243. console.log(res.tapIndex);
  244. switch (res.tapIndex) {
  245. case 0:
  246. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({
  247. url: '/pages/SetSchedule'
  248. });
  249. break;
  250. case 1:
  251. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({
  252. url: '/pages/ChooseScenario'
  253. });
  254. break;
  255. }
  256. }).catch(function (err) {
  257. console.log(err.errMsg);
  258. });
  259. }
  260. function ongoingActionSheet() {
  261. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showActionSheet({
  262. itemList: [t('feature.track_time_duration.action_sheet.give_up'), t('feature.track_time_duration.action_sheet.switch_scenario')]
  263. }).then(function (res) {
  264. console.log(res.tapIndex);
  265. }).catch(function (err) {
  266. console.log(err.errMsg);
  267. });
  268. }
  269. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.View, {
  270. children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Text, {
  271. onClick: waitActionSheet,
  272. children: "More Component"
  273. })
  274. });
  275. }
  276. /***/ }),
  277. /***/ "./src/pages/Clock.tsx":
  278. /*!*****************************!*\
  279. !*** ./src/pages/Clock.tsx ***!
  280. \*****************************/
  281. /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
  282. /* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/runtime */ "webpack/container/remote/@tarojs/runtime");
  283. /* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__);
  284. /* 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");
  285. var config = {};
  286. 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 || {}))
  287. /* 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"]);
  288. /***/ })
  289. },
  290. /******/ function(__webpack_require__) { // webpackRuntimeModules
  291. /******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
  292. /******/ __webpack_require__.O(0, ["taro","vendors","common"], function() { return __webpack_exec__("./src/pages/Clock.tsx"); });
  293. /******/ var __webpack_exports__ = __webpack_require__.O();
  294. /******/ }
  295. ]);
  296. //# sourceMappingURL=Clock.js.map