| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- "use strict";
- (wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["pages/ChooseAuth"],{
- /***/ "./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/ChooseAuth.tsx":
- /*!*******************************************************************************************************!*\
- !*** ./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/ChooseAuth.tsx ***!
- \*******************************************************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ Page; }
- /* harmony export */ });
- /* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js */ "./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");
- /* harmony import */ var _Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_7__ = __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_9__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
- /* harmony import */ var _components_Buttons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @components/Buttons */ "./src/components/Buttons.tsx");
- /* harmony import */ var _components_Texts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @components/Texts */ "./src/components/Texts.tsx");
- /* harmony import */ var _utils_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/types */ "./src/utils/types.ts");
- /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
- /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
- /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _store_user__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/store/user */ "./src/store/user.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 Page() {
- var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_4__.useDispatch)();
- var counter = (0,react_redux__WEBPACK_IMPORTED_MODULE_4__.useSelector)(function (state) {
- return state.counter.value;
- });
- var code = '';
- (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_3__.useReady)(function () {
- _tarojs_taro__WEBPACK_IMPORTED_MODULE_3___default().login().then(function (res) {
- code = res.code;
- // dispatch(wxLogin({code:res.code}) as any);
- });
- });
- function login() {
- return _login.apply(this, arguments);
- }
- function _login() {
- _login = (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_7__["default"])( /*#__PURE__*/(0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_8__["default"])().mark(function _callee() {
- var _yield$Taro$getUserPr, userInfo, encryptedData, iv;
- return (0,_Users_Work_hola2_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_8__["default"])().wrap(function _callee$(_context) {
- while (1) switch (_context.prev = _context.next) {
- case 0:
- _context.prev = 0;
- _context.next = 3;
- return _tarojs_taro__WEBPACK_IMPORTED_MODULE_3___default().getUserProfile({
- desc: '获取用户信息'
- });
- case 3:
- _yield$Taro$getUserPr = _context.sent;
- userInfo = _yield$Taro$getUserPr.userInfo;
- encryptedData = _yield$Taro$getUserPr.encryptedData;
- iv = _yield$Taro$getUserPr.iv;
- dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_5__.wxLogin)({
- code: code,
- encryptedData: encryptedData,
- iv: iv
- }));
- _tarojs_taro__WEBPACK_IMPORTED_MODULE_3___default().redirectTo({
- url: '/pages/ChooseScenario'
- });
- // 在这里处理用户信息
- _context.next = 14;
- break;
- case 11:
- _context.prev = 11;
- _context.t0 = _context["catch"](0);
- console.log('获取用户信息失败:', _context.t0);
- case 14:
- case "end":
- return _context.stop();
- }
- }, _callee, null, [[0, 11]]);
- }));
- return _login.apply(this, arguments);
- }
- function createAccount() {
- _tarojs_taro__WEBPACK_IMPORTED_MODULE_3___default().navigateTo({
- url: '/pages/Auth'
- });
- }
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_9__.View, {
- className: "container choose_container",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_components_Texts__WEBPACK_IMPORTED_MODULE_1__["default"], {
- text: "App name",
- type: _utils_types__WEBPACK_IMPORTED_MODULE_2__.TextType.big
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_components_Texts__WEBPACK_IMPORTED_MODULE_1__["default"], {
- text: counter
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_9__.View, {
- style: {
- height: 100
- }
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_components_Buttons__WEBPACK_IMPORTED_MODULE_0__["default"], {
- title: "WeChat",
- onClick: login,
- style: {
- width: 289,
- marginBottom: 30
- }
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_components_Buttons__WEBPACK_IMPORTED_MODULE_0__["default"], {
- title: "Create account",
- type: _utils_types__WEBPACK_IMPORTED_MODULE_2__.ButtonType.outline,
- onClick: createAccount,
- style: {
- width: 289,
- marginBottom: 30
- }
- })]
- });
- }
- /***/ }),
- /***/ "./src/pages/ChooseAuth.tsx":
- /*!**********************************!*\
- !*** ./src/pages/ChooseAuth.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_ChooseAuth_tsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./ChooseAuth.tsx */ "./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/ChooseAuth.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_ChooseAuth_tsx__WEBPACK_IMPORTED_MODULE_1__["default"], 'pages/ChooseAuth', {root:{cn:[]}}, config || {}))
- /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_ruleSet_1_rules_5_use_0_ChooseAuth_tsx__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /***/ })
- },
- /******/ 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/ChooseAuth.tsx"); });
- /******/ var __webpack_exports__ = __webpack_require__.O();
- /******/ }
- ]);
- //# sourceMappingURL=ChooseAuth.js.map
|