This commit is contained in:
wenjiarui 2023-05-14 20:07:34 +08:00
parent 4f73b42ca2
commit 0da3254838
8 changed files with 173 additions and 0 deletions

View File

@ -0,0 +1,5 @@
/// <reference types="wechat-miniprogram" />
/// <reference types="react" />
import { EntityDict } from '../../../general-app-domain';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "wechatLogin", false, WechatMiniprogram.Component.DataOption>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
export default _default;

View File

@ -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: {},
});

View File

@ -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"
}
}

View File

@ -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;
}

View File

@ -0,0 +1,4 @@
<!-- index.wxml -->
<view class="page-body">
绑定小程序尚未实现
</view>

16
lib/pages/wechatLogin/confirm/web.d.ts vendored Normal file
View File

@ -0,0 +1,16 @@
import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain';
export default function Render(props: WebComponentProps<EntityDict, 'wechatLogin', true, {
type: EntityDict['wechatLogin']['Schema']['type'];
expired: boolean;
expiresAt: boolean;
user?: {
name: string;
nickname: string;
};
successed: number;
userId: string;
loginUserId: string;
}, {
handleConfirm: () => void;
}>): JSX.Element;

View File

@ -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;

View File

@ -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;
}