From 0da3254838ac9d7cccbc23a5f045cfc5e05c783b Mon Sep 17 00:00:00 2001 From: wenjiarui Date: Sun, 14 May 2023 20:07:34 +0800 Subject: [PATCH] fix --- lib/pages/wechatLogin/confirm/index.d.ts | 5 +++ lib/pages/wechatLogin/confirm/index.js | 32 ++++++++++++++ lib/pages/wechatLogin/confirm/index.json | 7 +++ lib/pages/wechatLogin/confirm/index.less | 44 +++++++++++++++++++ lib/pages/wechatLogin/confirm/index.xml | 4 ++ lib/pages/wechatLogin/confirm/web.d.ts | 16 +++++++ lib/pages/wechatLogin/confirm/web.js | 24 ++++++++++ lib/pages/wechatLogin/confirm/web.module.less | 41 +++++++++++++++++ 8 files changed, 173 insertions(+) create mode 100644 lib/pages/wechatLogin/confirm/index.d.ts create mode 100644 lib/pages/wechatLogin/confirm/index.js create mode 100644 lib/pages/wechatLogin/confirm/index.json create mode 100644 lib/pages/wechatLogin/confirm/index.less create mode 100644 lib/pages/wechatLogin/confirm/index.xml create mode 100644 lib/pages/wechatLogin/confirm/web.d.ts create mode 100644 lib/pages/wechatLogin/confirm/web.js create mode 100644 lib/pages/wechatLogin/confirm/web.module.less diff --git a/lib/pages/wechatLogin/confirm/index.d.ts b/lib/pages/wechatLogin/confirm/index.d.ts new file mode 100644 index 000000000..67780bd8a --- /dev/null +++ b/lib/pages/wechatLogin/confirm/index.d.ts @@ -0,0 +1,5 @@ +/// +/// +import { EntityDict } from '../../../general-app-domain'; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; +export default _default; diff --git a/lib/pages/wechatLogin/confirm/index.js b/lib/pages/wechatLogin/confirm/index.js new file mode 100644 index 000000000..aaeb4b953 --- /dev/null +++ b/lib/pages/wechatLogin/confirm/index.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = OakComponent({ + entity: 'wechatLogin', + projection: { + id: 1, + expired: 1, + expiresAt: 1, + userId: 1, + type: 1, + qrCodeType: 1, + successed: 1, + }, + isList: false, + formData: function (_a) { + var wechatLogin = _a.data, features = _a.features; + var loginUserId = features.token.getUserId(true); + var user = wechatLogin === null || wechatLogin === void 0 ? void 0 : wechatLogin.user; + var userId = wechatLogin === null || wechatLogin === void 0 ? void 0 : wechatLogin.userId; + var type = wechatLogin === null || wechatLogin === void 0 ? void 0 : wechatLogin.type; + return { + type: type, + userId: userId, + expired: wechatLogin === null || wechatLogin === void 0 ? void 0 : wechatLogin.expired, + expiresAt: wechatLogin === null || wechatLogin === void 0 ? void 0 : wechatLogin.expiresAt, + successed: wechatLogin === null || wechatLogin === void 0 ? void 0 : wechatLogin.successed, + loginUserId: loginUserId, + }; + }, + listeners: {}, + methods: {}, +}); diff --git a/lib/pages/wechatLogin/confirm/index.json b/lib/pages/wechatLogin/confirm/index.json new file mode 100644 index 000000000..7214d1ec6 --- /dev/null +++ b/lib/pages/wechatLogin/confirm/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "绑定/登录", + "usingComponents": { + "l-icon": "@oak-frontend-base/miniprogram_npm/lin-ui/icon/index", + "l-button": "@oak-frontend-base/miniprogram_npm/lin-ui/button/index" + } +} diff --git a/lib/pages/wechatLogin/confirm/index.less b/lib/pages/wechatLogin/confirm/index.less new file mode 100644 index 000000000..5bb28b408 --- /dev/null +++ b/lib/pages/wechatLogin/confirm/index.less @@ -0,0 +1,44 @@ +/** index.wxss **/ +@import "../../../config/styles/mp/index.less"; +@import "../../../config/styles/mp/mixins.less"; + +.page-body { + height: 100vh; + display: flex; + flex: 1; + flex-direction: column; + background-color: @oak-bg-color-container; + box-sizing: border-box; + .safe-area-inset-bottom(); +} + +.content { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 60rpx; +} + +.circle-view { + margin-top: 30rpx; + padding: 10rpx; + width: 200rpx; + height: 200rpx; + border-radius: 50%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + background-color: #fff; +} + +.title { + font-size: 32rpx; + color: @oak-text-color-primary; +} + +.desc { + margin-top: 16rpx; + font-size: 28rpx; + color: @oak-text-color-secondary; +} \ No newline at end of file diff --git a/lib/pages/wechatLogin/confirm/index.xml b/lib/pages/wechatLogin/confirm/index.xml new file mode 100644 index 000000000..9eea2a130 --- /dev/null +++ b/lib/pages/wechatLogin/confirm/index.xml @@ -0,0 +1,4 @@ + + + 绑定小程序尚未实现 + \ No newline at end of file diff --git a/lib/pages/wechatLogin/confirm/web.d.ts b/lib/pages/wechatLogin/confirm/web.d.ts new file mode 100644 index 000000000..0e8b02625 --- /dev/null +++ b/lib/pages/wechatLogin/confirm/web.d.ts @@ -0,0 +1,16 @@ +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../general-app-domain'; +export default function Render(props: WebComponentProps void; +}>): JSX.Element; diff --git a/lib/pages/wechatLogin/confirm/web.js b/lib/pages/wechatLogin/confirm/web.js new file mode 100644 index 000000000..b25a62ed2 --- /dev/null +++ b/lib/pages/wechatLogin/confirm/web.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var jsx_runtime_1 = require("react/jsx-runtime"); +var antd_1 = require("antd"); +var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); +var utils_1 = require("oak-frontend-base/lib/utils/utils"); +function Render(props) { + var _a = props.data, oakLoading = _a.oakLoading, oakExecuting = _a.oakExecuting, type = _a.type, expired = _a.expired, expiresAt = _a.expiresAt, user = _a.user, successed = _a.successed, userId = _a.userId, loginUserId = _a.loginUserId; + var _b = props.methods, t = _b.t, handleConfirm = _b.handleConfirm; + var V; + if (successed) { + V = '成功的'; + } + else if (expired) { + V = '过期了'; + } + return ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: [(0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.content }, { children: V })), (0, jsx_runtime_1.jsxs)(antd_1.Space, tslib_1.__assign({ direction: "vertical" }, { children: [!oakLoading && !expired && !successed && ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ size: "large", block: true, type: "primary", onClick: function () { + handleConfirm(); + }, disabled: oakExecuting }, { children: "\u9886\u53D6" }))), utils_1.isWeiXin && ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ size: "large", block: true, onClick: function () { + WeixinJSBridge.call('closeWindow'); + } }, { children: "\u5173\u95ED" })))] }))] }))); +} +exports.default = Render; diff --git a/lib/pages/wechatLogin/confirm/web.module.less b/lib/pages/wechatLogin/confirm/web.module.less new file mode 100644 index 000000000..afb304536 --- /dev/null +++ b/lib/pages/wechatLogin/confirm/web.module.less @@ -0,0 +1,41 @@ + + +.container { + height: 100vh; + display: flex; + flex-direction: column; + padding: 30px 32px; + +} + +.content { + display: flex; + flex-direction: column; + align-items: center; + + + .icon { + + font-size: 72px; + + color: var(--oak-color-primary); + + } + + .title { + font-weight: 500; + font-size: 16px; + line-height: 28px; + margin-top: 8px; + color: var(--oak-text-color-primary); + } + + .description { + margin-top: 8px; + font-size: 14px; + line-height: 22px; + color: var(--oak-text-color-secondary); + } + + margin-bottom: 30px; +} \ No newline at end of file