app.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. "use strict";
  2. require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-2Y2U3MWF_js.js");
  3. require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js.js");
  4. require("./prebundle/vendors-node_modules_taro_weapp_prebundle_reduxjs_toolkit_js.js");
  5. require("./prebundle/vendors-node_modules_taro_weapp_prebundle_i18next_js.js");
  6. require("./prebundle/vendors-node_modules_taro_weapp_prebundle_react-redux_js.js");
  7. require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js.js");
  8. require("./prebundle/vendors-node_modules_taro_weapp_prebundle_react-i18next_js.js");
  9. require("./prebundle/vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-framework-react_dist_runtime_js.js");
  10. require("./prebundle/vendors-node_modules_taro_weapp_prebundle_tarojs_taro_js.js");
  11. require("./prebundle/vendors-node_modules_taro_weapp_prebundle_i18next-browser-languagedetector_js.js");
  12. require("./prebundle/node_modules_taro_weapp_prebundle_tarojs_runtime_js.js");
  13. require("./prebundle/vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-platform-weapp_dist_runtime_js.js");
  14. require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-LNJCN3VW_js.js");
  15. require("./prebundle/remoteEntry.js");
  16. require("./prebundle/node_modules_taro_weapp_prebundle_react_jsx-runtime_js.js");
  17. require("./prebundle/node_modules_taro_weapp_prebundle_react_js.js");
  18. require("./prebundle/node_modules_taro_weapp_prebundle_react-dom_js.js");
  19. require("./common");
  20. require("./vendors");
  21. require("./taro");
  22. require("./runtime");
  23. (wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["app"],{
  24. /***/ "./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/app.tsx":
  25. /*!******************************************************************************************!*\
  26. !*** ./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/app.tsx ***!
  27. \******************************************************************************************/
  28. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  29. /* harmony import */ var _context_locales_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./context/locales/index */ "./src/context/locales/index.ts");
  30. /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
  31. /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_1__);
  32. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./store/store */ "./src/store/store.tsx");
  33. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
  34. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
  35. // import 'taro-ui/dist/style/index.scss'
  36. var App = function App(_ref) {
  37. var children = _ref.children;
  38. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_redux__WEBPACK_IMPORTED_MODULE_1__.Provider, {
  39. store: _store_store__WEBPACK_IMPORTED_MODULE_2__["default"],
  40. children: children
  41. });
  42. };
  43. // class App extends Component<PropsWithChildren> {
  44. // componentDidMount () {}
  45. // componentDidShow () {}
  46. // componentDidHide () {}
  47. // // this.props.children 是将要会渲染的页面
  48. // render () {
  49. // return this.props.children
  50. // }
  51. // }
  52. /* harmony default export */ __webpack_exports__["default"] = (App);
  53. /***/ }),
  54. /***/ "./src/app.tsx":
  55. /*!*********************!*\
  56. !*** ./src/app.tsx ***!
  57. \*********************/
  58. /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
  59. /* harmony import */ var _tarojs_plugin_platform_weapp_dist_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/plugin-platform-weapp/dist/runtime */ "webpack/container/remote/@tarojs/plugin-platform-weapp/dist/runtime");
  60. /* harmony import */ var _tarojs_plugin_platform_weapp_dist_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_plugin_platform_weapp_dist_runtime__WEBPACK_IMPORTED_MODULE_0__);
  61. /* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tarojs/runtime */ "webpack/container/remote/@tarojs/runtime");
  62. /* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_1__);
  63. /* harmony import */ var _tarojs_plugin_framework_react_dist_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tarojs/plugin-framework-react/dist/runtime */ "webpack/container/remote/@tarojs/plugin-framework-react/dist/runtime");
  64. /* harmony import */ var _tarojs_plugin_framework_react_dist_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_tarojs_plugin_framework_react_dist_runtime__WEBPACK_IMPORTED_MODULE_2__);
  65. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
  66. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_3__);
  67. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ruleSet_1_rules_5_use_0_app_tsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./app.tsx */ "./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/app.tsx");
  68. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
  69. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
  70. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-dom */ "webpack/container/remote/react-dom");
  71. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_6__);
  72. var config = {"pages":["pages/index/index","pages/Second","pages/Login","pages/Auth","pages/ChooseAuth","pages/ChooseScenario","pages/SetSchedule"],"subPackages":[{"root":"moduleA","pages":["pages/third"]}],"tabBar":{"list":[{"pagePath":"pages/index/index","text":"首页"},{"pagePath":"pages/Second","text":"第二页"}]},"window":{"backgroundTextStyle":"light","navigationBarBackgroundColor":"#000000","navigationBarTitleText":"Weixin","navigationBarTextStyle":"white","backgroundColor":"#000000"},"darkmode":true};
  73. _tarojs_runtime__WEBPACK_IMPORTED_MODULE_1__.window.__taroAppConfig = config
  74. var inst = App((0,_tarojs_plugin_framework_react_dist_runtime__WEBPACK_IMPORTED_MODULE_2__.createReactApp)(_node_modules_babel_loader_lib_index_js_ruleSet_1_rules_5_use_0_app_tsx__WEBPACK_IMPORTED_MODULE_4__["default"], react__WEBPACK_IMPORTED_MODULE_5__, (react_dom__WEBPACK_IMPORTED_MODULE_6___default()), config))
  75. ;(0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_3__.initPxTransform)({
  76. designWidth: 750,
  77. deviceRatio: {"640":1.17,"750":1,"828":0.905},
  78. baseFontSize: 20,
  79. unitPrecision: undefined,
  80. targetUnit: undefined
  81. })
  82. /***/ }),
  83. /***/ "./src/context/locales/en.js":
  84. /*!***********************************!*\
  85. !*** ./src/context/locales/en.js ***!
  86. \***********************************/
  87. /***/ (function(__unused_webpack_module, __webpack_exports__) {
  88. /* harmony default export */ __webpack_exports__["default"] = ({
  89. languageList: {
  90. switch_language: 'Switch Language',
  91. zh: 'Chinese',
  92. en: 'English'
  93. },
  94. page: {
  95. choose_language: {
  96. title: '',
  97. sub_title: '',
  98. btn_confirm: ''
  99. },
  100. choose_auth: {
  101. app_name: '',
  102. btn_create_account: '',
  103. btn_login: '登录',
  104. btn_wechat: '微信登录'
  105. },
  106. auth: {
  107. agreement: 'I agree to the Terms of Service and Privacy Policy.'
  108. },
  109. choose_scenario: {
  110. title: 'Choose scenario',
  111. sub_title: 'A scenario clock will display on homepage',
  112. btn_next: 'Next',
  113. btn_more: 'Learn more',
  114. fast: 'Fast',
  115. sleep: 'Sleep',
  116. fast_sleep: 'Fast Sleep'
  117. },
  118. set_goal: {
  119. title: '',
  120. btn_done: ''
  121. }
  122. },
  123. feature: {
  124. auth: {
  125. create_account: {
  126. title: 'Create Account',
  127. sub_title: 'Enter username and email',
  128. input_username_placeholder: 'Username',
  129. input_email_placeholder: 'Email',
  130. footer_desc: 'Already have an account? ',
  131. footer_login: 'Log in',
  132. btn_next: 'Next'
  133. },
  134. login: {
  135. input_account_placeholder: 'Username or email',
  136. input_password_placeholder: 'Password',
  137. footer_desc: 'Don\'t have an account? ',
  138. footer_sign_up: 'Create account'
  139. },
  140. create_password: {
  141. title: 'Create password',
  142. sub_title: 'Enter password and confirm',
  143. input_password_placeholder: 'Password',
  144. input_password_confirm_placeholder: 'Confirm Password',
  145. btn_next: 'Next'
  146. }
  147. }
  148. }
  149. });
  150. /***/ }),
  151. /***/ "./src/context/locales/index.ts":
  152. /*!**************************************!*\
  153. !*** ./src/context/locales/index.ts ***!
  154. \**************************************/
  155. /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
  156. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
  157. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__);
  158. /* harmony import */ var i18next_browser_languagedetector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18next-browser-languagedetector */ "webpack/container/remote/i18next-browser-languagedetector");
  159. /* harmony import */ var i18next_browser_languagedetector__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(i18next_browser_languagedetector__WEBPACK_IMPORTED_MODULE_1__);
  160. /* harmony import */ var i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18next */ "webpack/container/remote/i18next");
  161. /* harmony import */ var i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(i18next__WEBPACK_IMPORTED_MODULE_2__);
  162. /* harmony import */ var _zh__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./zh */ "./src/context/locales/zh.js");
  163. /* harmony import */ var _en__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./en */ "./src/context/locales/en.js");
  164. /* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-i18next */ "webpack/container/remote/react-i18next");
  165. /* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_5__);
  166. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getStorage({
  167. key: 'language'
  168. }).then(function (res) {
  169. // initLocale(res.data)
  170. initLocale('zh');
  171. }).catch(function (err) {
  172. initLocale('zh');
  173. });
  174. function initLocale(strLocale) {
  175. i18next__WEBPACK_IMPORTED_MODULE_2___default().use((i18next_browser_languagedetector__WEBPACK_IMPORTED_MODULE_1___default())) //嗅探当前浏览器语言
  176. .use(react_i18next__WEBPACK_IMPORTED_MODULE_5__.initReactI18next) //init i18next
  177. .init({
  178. //引入资源文件
  179. resources: {
  180. en: {
  181. translation: _en__WEBPACK_IMPORTED_MODULE_4__["default"]
  182. },
  183. zh: {
  184. translation: _zh__WEBPACK_IMPORTED_MODULE_3__["default"]
  185. }
  186. },
  187. //选择默认语言,选择内容为上述配置中的key,即en/zh
  188. lng: strLocale,
  189. //Taro.getStorageSync('language') ? Taro.getStorageSync('language') : 'en',
  190. debug: false,
  191. interpolation: {
  192. escapeValue: false // not needed for react as it escapes by default
  193. }
  194. });
  195. }
  196. /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((i18next__WEBPACK_IMPORTED_MODULE_2___default()));
  197. /***/ }),
  198. /***/ "./src/context/locales/zh.js":
  199. /*!***********************************!*\
  200. !*** ./src/context/locales/zh.js ***!
  201. \***********************************/
  202. /***/ (function(__unused_webpack_module, __webpack_exports__) {
  203. /* harmony default export */ __webpack_exports__["default"] = ({
  204. languageList: {
  205. switch_language: '切换语言',
  206. zh: '中文',
  207. en: '英文'
  208. },
  209. page: {
  210. choose_language: {
  211. title: '',
  212. sub_title: '',
  213. btn_confirm: ''
  214. },
  215. choose_auth: {
  216. app_name: '',
  217. btn_create_account: '',
  218. btn_login: '登录',
  219. btn_wechat: '微信登录'
  220. },
  221. auth: {
  222. agreement: '已阅读并同意《用户协议》和《隐私政策》'
  223. },
  224. choose_scenario: {
  225. title: '选择场景',
  226. sub_title: '场景时钟将在首页展示',
  227. btn_next: '下一步',
  228. btn_more: '了解更多',
  229. fast: '断食',
  230. sleep: '睡眠',
  231. fast_sleep: '断食睡眠'
  232. }
  233. },
  234. feature: {
  235. auth: {
  236. create_account: {
  237. title: '注册账号',
  238. sub_title: '创建用户名',
  239. input_username_placeholder: '用户名',
  240. input_email_placeholder: '邮箱',
  241. footer_desc: '已有账号?',
  242. footer_login: '去登录',
  243. btn_next: '下一步'
  244. },
  245. login: {
  246. input_account_placeholder: '用户名或邮箱',
  247. input_password_placeholder: '密码',
  248. footer_desc: '还没有账号?',
  249. footer_sign_up: '去注册'
  250. },
  251. create_password: {
  252. title: '创建密码',
  253. sub_title: '输入并确认密码',
  254. input_password_placeholder: '密码',
  255. input_password_confirm_placeholder: '确认密码',
  256. btn_next: '下一步'
  257. }
  258. }
  259. }
  260. });
  261. /***/ }),
  262. /***/ "./src/store/demo.tsx":
  263. /*!****************************!*\
  264. !*** ./src/store/demo.tsx ***!
  265. \****************************/
  266. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  267. /* unused harmony exports increment, decrement, incrementByAmount, apple */
  268. /* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js */ "./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");
  269. /* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
  270. /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @reduxjs/toolkit */ "webpack/container/remote/@reduxjs/toolkit");
  271. /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__);
  272. var initialState = {
  273. value: 0
  274. };
  275. var counterSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createSlice)({
  276. name: 'counter',
  277. initialState: initialState,
  278. reducers: {
  279. increment: function increment(state) {
  280. state.value += 1;
  281. },
  282. decrement: function decrement(state) {
  283. state.value -= 1;
  284. },
  285. incrementByAmount: function incrementByAmount(state, action) {
  286. state.value += action.payload;
  287. }
  288. }
  289. });
  290. var _counterSlice$actions = counterSlice.actions,
  291. increment = _counterSlice$actions.increment,
  292. decrement = _counterSlice$actions.decrement,
  293. incrementByAmount = _counterSlice$actions.incrementByAmount;
  294. var apple = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createAsyncThunk)('user/wxLogin', /*#__PURE__*/function () {
  295. var _ref2 = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/(0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__["default"])().mark(function _callee(payload, _ref) {
  296. var dispatch;
  297. return (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__["default"])().wrap(function _callee$(_context) {
  298. while (1) switch (_context.prev = _context.next) {
  299. case 0:
  300. dispatch = _ref.dispatch;
  301. dispatch(increment());
  302. // console.log(payload.code)
  303. // request({
  304. // url: API_LOGIN, method: 'POST', data: { 'code':payload.code,type:'WX_MP',app_version:'1',client_version:'1',client_type:'WXP_MP' }
  305. // }).then(res => {
  306. // console.log(res);
  307. // dispatch(loginSuccess(res));
  308. // })
  309. case 2:
  310. case "end":
  311. return _context.stop();
  312. }
  313. }, _callee);
  314. }));
  315. return function (_x, _x2) {
  316. return _ref2.apply(this, arguments);
  317. };
  318. }());
  319. /* harmony default export */ __webpack_exports__["default"] = (counterSlice.reducer);
  320. /***/ }),
  321. /***/ "./src/store/store.tsx":
  322. /*!*****************************!*\
  323. !*** ./src/store/store.tsx ***!
  324. \*****************************/
  325. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  326. /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @reduxjs/toolkit */ "webpack/container/remote/@reduxjs/toolkit");
  327. /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__);
  328. /* harmony import */ var _user__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./user */ "./src/store/user.tsx");
  329. /* harmony import */ var _demo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./demo */ "./src/store/demo.tsx");
  330. var store = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.configureStore)({
  331. reducer: {
  332. // 添加你的 reducer
  333. user: _user__WEBPACK_IMPORTED_MODULE_1__["default"],
  334. counter: _demo__WEBPACK_IMPORTED_MODULE_2__["default"]
  335. }
  336. });
  337. /* harmony default export */ __webpack_exports__["default"] = (store);
  338. /***/ })
  339. },
  340. /******/ function(__webpack_require__) { // webpackRuntimeModules
  341. /******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
  342. /******/ __webpack_require__.O(0, ["vendors","common"], function() { return __webpack_exec__("./src/app.tsx"); });
  343. /******/ var __webpack_exports__ = __webpack_require__.O();
  344. /******/ }
  345. ]);;;
  346. //# sourceMappingURL=app.js.map