app.js 18 KB

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