mobile端身份认证 及mobile绑定样式
This commit is contained in:
parent
1c13ecc25a
commit
6ea5255a43
|
|
@ -2,7 +2,6 @@ import WechatSDK from 'oak-external-sdk/lib/WechatSDK';
|
||||||
import { assert } from 'oak-domain/lib/utils/assert';
|
import { assert } from 'oak-domain/lib/utils/assert';
|
||||||
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
||||||
import { OakExternalException } from 'oak-domain/lib/types/Exception';
|
import { OakExternalException } from 'oak-domain/lib/types/Exception';
|
||||||
|
|
||||||
async function getWechatPublicConfig(applicationId, context) {
|
async function getWechatPublicConfig(applicationId, context) {
|
||||||
const [application] = await context.select('application', {
|
const [application] = await context.select('application', {
|
||||||
data: {
|
data: {
|
||||||
|
|
@ -49,15 +48,14 @@ export async function getMenu(params, context) {
|
||||||
try {
|
try {
|
||||||
const result = await wechatInstance.getMenu();
|
const result = await wechatInstance.getMenu();
|
||||||
return result;
|
return result;
|
||||||
} catch (e) {
|
}
|
||||||
if (
|
catch (e) {
|
||||||
e instanceof OakExternalException &&
|
if (e instanceof OakExternalException &&
|
||||||
e?.message?.includes('menu no exist')
|
e?.message?.includes('menu no exist')) {
|
||||||
) {
|
|
||||||
return {
|
return {
|
||||||
menu: {
|
menu: {
|
||||||
button: [],
|
button: []
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
declare const checkers: (import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "token", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "mobile", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "message", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "parasite", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>>)[];
|
declare const checkers: (import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "token", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "mobile", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "message", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "parasite", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>>)[];
|
||||||
export default checkers;
|
export default checkers;
|
||||||
|
|
|
||||||
|
|
@ -13,19 +13,19 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
|
||||||
type?: ButtonProps['type'] | AmButtonProps['type'];
|
type?: ButtonProps['type'] | AmButtonProps['type'];
|
||||||
executeText?: string | undefined;
|
executeText?: string | undefined;
|
||||||
buttonProps?: (ButtonProps & {
|
buttonProps?: (ButtonProps & {
|
||||||
color?: "success" | "default" | "warning" | "primary" | "danger" | undefined;
|
color?: "default" | "success" | "warning" | "primary" | "danger" | undefined;
|
||||||
fill?: "none" | "solid" | "outline" | undefined;
|
fill?: "none" | "solid" | "outline" | undefined;
|
||||||
size?: "small" | "middle" | "large" | "mini" | undefined;
|
size?: "small" | "large" | "middle" | "mini" | undefined;
|
||||||
block?: boolean | undefined;
|
block?: boolean | undefined;
|
||||||
loading?: boolean | "auto" | undefined;
|
loading?: boolean | "auto" | undefined;
|
||||||
loadingText?: string | undefined;
|
loadingText?: string | undefined;
|
||||||
loadingIcon?: import("react").ReactNode;
|
loadingIcon?: import("react").ReactNode;
|
||||||
disabled?: boolean | undefined;
|
disabled?: boolean | undefined;
|
||||||
onClick?: ((event: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => unknown) | undefined;
|
onClick?: ((event: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => unknown) | undefined;
|
||||||
type?: "button" | "reset" | "submit" | undefined;
|
type?: "button" | "submit" | "reset" | undefined;
|
||||||
shape?: "default" | "rounded" | "rectangular" | undefined;
|
shape?: "default" | "rounded" | "rectangular" | undefined;
|
||||||
children?: import("react").ReactNode;
|
children?: import("react").ReactNode;
|
||||||
} & Pick<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>, "id" | "onMouseDown" | "onMouseUp" | "onTouchStart" | "onTouchEnd"> & {
|
} & Pick<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>, "id" | "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & {
|
||||||
className?: string | undefined;
|
className?: string | undefined;
|
||||||
style?: (import("react").CSSProperties & Partial<Record<"--text-color" | "--background-color" | "--border-radius" | "--border-width" | "--border-style" | "--border-color", string>>) | undefined;
|
style?: (import("react").CSSProperties & Partial<Record<"--text-color" | "--background-color" | "--border-radius" | "--border-width" | "--border-style" | "--border-color", string>>) | undefined;
|
||||||
tabIndex?: number | undefined;
|
tabIndex?: number | undefined;
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,15 @@
|
||||||
|
|
||||||
|
|
||||||
.loginbox-main {
|
.loginbox-main {
|
||||||
height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background: var(--oak-bg-color-container);
|
|
||||||
padding-top: 20%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.loginbox-wrap {
|
.loginbox-wrap {
|
||||||
width: 90%;
|
|
||||||
display: block;
|
display: block;
|
||||||
background: var(--oak-bg-color-container);
|
|
||||||
border-radius: 4px;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
box-shadow: 0 2px 4px rgb(0 0 0 / 8%), 0 0 4px rgb(0 0 0 / 8%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.loginbox-hd {
|
.loginbox-hd {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "mobile", true, {
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "mobile", true, {
|
||||||
onFinish: (() => void) | undefined;
|
onFinish: (() => void) | undefined;
|
||||||
bindNum: number;
|
bindNum: number;
|
||||||
|
addMobile: (() => void) | undefined;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ export default OakComponent({
|
||||||
properties: {
|
properties: {
|
||||||
onFinish: undefined,
|
onFinish: undefined,
|
||||||
bindNum: 10,
|
bindNum: 10,
|
||||||
|
addMobile: undefined,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async onRefreshMobile(e) {
|
async onRefreshMobile(e) {
|
||||||
|
|
@ -86,9 +87,11 @@ export default OakComponent({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
goAddMobile() {
|
goAddMobile() {
|
||||||
this.navigateTo({
|
const { addMobile } = this.props;
|
||||||
url: '/mobile/login',
|
if (addMobile) {
|
||||||
});
|
addMobile();
|
||||||
|
return;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async onRemoveConfirm() {
|
async onRemoveConfirm() {
|
||||||
const { mobileId } = this.state;
|
const { mobileId } = this.state;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,17 @@
|
||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
import { List, Button, Dialog } from 'antd-mobile';
|
import { List, Button, Popup, Dialog } from 'antd-mobile';
|
||||||
import { MobileOutlined, DeleteOutlined } from '@ant-design/icons';
|
import { MobileOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||||
import Style from './mobile.module.less';
|
import Style from './mobile.module.less';
|
||||||
|
import MobileLogin from '../login';
|
||||||
export default function render(props) {
|
export default function render(props) {
|
||||||
const { mobiles, allowRemove, tokenMobileId } = props.data;
|
const { mobiles, allowRemove, tokenMobileId } = props.data;
|
||||||
const { goAddMobile, removeItem, recoverItem, execute } = props.methods;
|
const { goAddMobile, removeItem, recoverItem, execute } = props.methods;
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
return (<div className={Style.container}>
|
return (<div className={Style.container}>
|
||||||
{mobiles && mobiles.length > 0 ? (<>
|
{mobiles && mobiles.length > 0 ? (<>
|
||||||
<List className={Style.list}>
|
<List className={Style.list}>
|
||||||
{mobiles?.map((ele, index) => (<List.Item key={index} prefix={<MobileOutlined />} extra={allowRemove && tokenMobileId !== ele.id && (<div onClick={async () => {
|
{mobiles?.map((ele, index) => (<List.Item key={index} prefix={<MobileOutlined />} extra={allowRemove &&
|
||||||
|
tokenMobileId !== ele.id && (<div onClick={async () => {
|
||||||
const result = await Dialog.confirm({
|
const result = await Dialog.confirm({
|
||||||
content: '确认删除吗?删除后无法用此号码登录',
|
content: '确认删除吗?删除后无法用此号码登录',
|
||||||
});
|
});
|
||||||
|
|
@ -33,8 +36,20 @@ export default function render(props) {
|
||||||
<span>尚未绑定手机号</span>
|
<span>尚未绑定手机号</span>
|
||||||
</div>)}
|
</div>)}
|
||||||
|
|
||||||
<Button block size="large" color="primary" onClick={() => goAddMobile()}>
|
<Button block size="large" color="primary" onClick={() => setOpen(true)}>
|
||||||
绑定
|
绑定
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
<Popup visible={open} showCloseButton={true} onClose={() => {
|
||||||
|
setOpen(false);
|
||||||
|
}} bodyStyle={{
|
||||||
|
borderTopLeftRadius: '8px',
|
||||||
|
borderTopRightRadius: '8px',
|
||||||
|
height: '40vh',
|
||||||
|
}}>
|
||||||
|
<MobileLogin callback={() => {
|
||||||
|
setOpen(false);
|
||||||
|
}} oakPath="$mobile/me-mobile/login" oakAutoUnmount={true}/>
|
||||||
|
</Popup>
|
||||||
</div>);
|
</div>);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,54 +1,16 @@
|
||||||
.addView {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
left: 50%;
|
|
||||||
z-index: 99;
|
|
||||||
}
|
|
||||||
|
|
||||||
.imgView {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
height: 200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.img {
|
.pageBody {
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: contain;
|
display: flex;
|
||||||
}
|
flex: 1;
|
||||||
|
flex-direction: column;
|
||||||
.imgContent {
|
box-sizing: border-box;
|
||||||
padding: 16px;
|
align-items: stretch;
|
||||||
margin: 16px;
|
|
||||||
border-radius: 8px;
|
|
||||||
background-color: var(--oak-bg-color-page);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
height: 100%;
|
flex: 1;
|
||||||
box-sizing: border-box;
|
display: flex;
|
||||||
display: flex;
|
flex-direction: column;
|
||||||
flex-direction: column;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.circleBtn {
|
|
||||||
width: 25px;
|
|
||||||
height: 25px;
|
|
||||||
border-radius: 50%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background-color: var(--oak-color-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonView {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex: 1;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding: 16px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +1,17 @@
|
||||||
|
import React from 'react';
|
||||||
import { WebComponentProps } from 'oak-frontend-base';
|
import { WebComponentProps } from 'oak-frontend-base';
|
||||||
import { EntityDict } from '../../../oak-app-domain';
|
import { EntityDict } from '../../../oak-app-domain';
|
||||||
import type { UploadFile } from 'antd/es/upload/interface';
|
|
||||||
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {
|
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||||
userId: string;
|
userId: string;
|
||||||
name: string;
|
name: string;
|
||||||
idNumber: string;
|
idNumber: string;
|
||||||
idState: EntityDict['user']['Schema']['idState'];
|
idState: EntityDict['user']['Schema']['idState'];
|
||||||
|
idCardType: EntityDict['user']['Schema']['idCardType'];
|
||||||
|
idCardTypeArr: {
|
||||||
|
value: string;
|
||||||
|
label: string;
|
||||||
|
}[];
|
||||||
|
showBtn: boolean;
|
||||||
}, {
|
}, {
|
||||||
commit: (file1: UploadFile, file2: UploadFile) => void;
|
onConfirm: () => void;
|
||||||
prevImg: (file: UploadFile, id: string) => void;
|
}>): React.JSX.Element;
|
||||||
onChange: (attr: keyof EntityDict['user']['Schema'], value: string) => void;
|
|
||||||
}>): null;
|
|
||||||
|
|
|
||||||
|
|
@ -1,104 +1,52 @@
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
import Styles from './mobile.module.less';
|
||||||
|
import { Picker, Form, Input, Button } from 'antd-mobile';
|
||||||
export default function Render(props) {
|
export default function Render(props) {
|
||||||
const { methods, data } = props;
|
const { methods, data } = props;
|
||||||
const { t, onChange, prevImg, commit } = methods;
|
const { t, update, onConfirm } = methods;
|
||||||
// const { oakFullpath, oakId, oakLegalActions, userId, idState, name, idNumber } = data;
|
const { oakFullpath, oakId, oakLegalActions, idState, name, idNumber, idCardType, idCardTypeArr, showBtn, } = data;
|
||||||
// const [fileList, setFileList] = useState<UploadFile[]>([]);
|
const [open, setOpen] = useState(false);
|
||||||
// const [fileList2, setFileList2] = useState<UploadFile[]>([]);
|
return (<div className={Styles.pageBody}>
|
||||||
// const uploadProps: UploadProps = {
|
<div className={Styles.container}>
|
||||||
// maxCount: 1,
|
<Form layout="horizontal">
|
||||||
// showUploadList: false,
|
<Form.Item label={t('user:attr.name')} required>
|
||||||
// beforeUpload: (file) => {
|
<Input disabled={idState !== 'unverified'} value={name} onChange={(val) => {
|
||||||
// return false;
|
update({
|
||||||
// },
|
name: val,
|
||||||
// onChange: ({ file, fileList, event }) => {
|
});
|
||||||
// prevImg(file, 'imgView1');
|
}} placeholder={t('please input name')}/>
|
||||||
// setFileList([...fileList]);
|
</Form.Item>
|
||||||
// },
|
<Form.Item label={t('user:attr.idCardType')} required>
|
||||||
// fileList,
|
<div onClick={idState === 'unverified' ? () => {
|
||||||
// };
|
setOpen(true);
|
||||||
// const uploadProps2: UploadProps = {
|
} : undefined}>
|
||||||
// maxCount: 1,
|
<Input value={idCardType
|
||||||
// showUploadList: false,
|
? t('user:v.idCardType.' + idCardType)
|
||||||
// beforeUpload: (file) => {
|
: ''} readOnly placeholder={t('please choose idCardType')}/>
|
||||||
// return false;
|
</div>
|
||||||
// },
|
|
||||||
// onChange: ({ file, fileList, event }) => {
|
<Picker columns={[idCardTypeArr]} visible={open} onClose={() => {
|
||||||
// prevImg(file, 'imgView2');
|
setOpen(false);
|
||||||
// setFileList2([...fileList]);
|
}} value={idCardType ? [idCardType] : undefined} onConfirm={(v) => {
|
||||||
// },
|
update({
|
||||||
// fileList: fileList2,
|
idCardType: v[0],
|
||||||
// };
|
});
|
||||||
// if (idState === 'verified') {
|
}}/>
|
||||||
// return (
|
</Form.Item>
|
||||||
// <Result
|
<Form.Item label={t('user:attr.idNumber')} required>
|
||||||
// status='success'
|
<Input value={idNumber} disabled={!idCardType || idState !== 'unverified'} onChange={(val) => {
|
||||||
// title={t("Real name verification passed")}
|
update({
|
||||||
// />
|
idNumber: val,
|
||||||
// )
|
});
|
||||||
// }
|
}} placeholder={t('please input idNumber')}/>
|
||||||
return null;
|
</Form.Item>
|
||||||
// return (
|
</Form>
|
||||||
// <div className={styles.container}>
|
</div>
|
||||||
// <div className={styles.imgContent}>
|
|
||||||
// <Upload {...uploadProps}>
|
{showBtn ? (<Button block color="primary" size="large" onClick={() => {
|
||||||
// <div id="imgView1" className={styles.imgView} style={{ marginBottom: 16 }}>
|
onConfirm();
|
||||||
// <IDCard1 width={"100%"} height={"100%"} style={{ background: '#fff' }} />
|
}}>
|
||||||
// {/* <img id="img1" className={styles.img} /> */}
|
提交认证
|
||||||
// {fileList.length === 0 && (
|
</Button>) : null}
|
||||||
// <Space direction="vertical" className={styles.addView} align="center">
|
</div>);
|
||||||
// <div className={styles.circleBtn}>
|
|
||||||
// <AddOutline color="#fff" />
|
|
||||||
// </div>
|
|
||||||
// <div className={styles.text}>
|
|
||||||
// {t("Identity witness profile")}
|
|
||||||
// </div>
|
|
||||||
// </Space>
|
|
||||||
// )}
|
|
||||||
// </div>
|
|
||||||
// </Upload>
|
|
||||||
// <Upload {...uploadProps2}>
|
|
||||||
// <div id="imgView2" className={styles.imgView}>
|
|
||||||
// <IDCard2 width={"100%"} height={"100%"} style={{ background: '#fff' }} />
|
|
||||||
// {/* <img id="img2" className={styles.img} /> */}
|
|
||||||
// {fileList2.length === 0 && (
|
|
||||||
// <Space direction="vertical" className={styles.addView} align="center">
|
|
||||||
// <div className={styles.circleBtn}>
|
|
||||||
// <AddOutline color="#fff" />
|
|
||||||
// </div>
|
|
||||||
// <div className={styles.text}>
|
|
||||||
// {t("Identity national emblem profile")}
|
|
||||||
// </div>
|
|
||||||
// </Space>
|
|
||||||
// )}
|
|
||||||
// </div>
|
|
||||||
// </Upload>
|
|
||||||
// </div>
|
|
||||||
// <Form layout='horizontal'>
|
|
||||||
// <Form.Item label={t("user:attr.name")}>
|
|
||||||
// <Input
|
|
||||||
// value={name}
|
|
||||||
// style={{ '--text-align': 'right' }}
|
|
||||||
// placeholder={t("please input name")}
|
|
||||||
// clearable
|
|
||||||
// onChange={(value) => onChange('name', value)}
|
|
||||||
// />
|
|
||||||
// </Form.Item>
|
|
||||||
// <Form.Item label={t("user:attr.idNumber")}>
|
|
||||||
// <Input
|
|
||||||
// value={idNumber}
|
|
||||||
// style={{ '--text-align': 'right' }}
|
|
||||||
// placeholder={t("please input idNumber")}
|
|
||||||
// clearable
|
|
||||||
// onChange={(value) => onChange('idNumber', value)}
|
|
||||||
// />
|
|
||||||
// </Form.Item>
|
|
||||||
// </Form>
|
|
||||||
// <div className={styles.buttonView}>
|
|
||||||
// <Button block shape='rounded' color='primary' onClick={() => commit(fileList[0], fileList2[0])}>
|
|
||||||
// {t("common::commit")}
|
|
||||||
// </Button>
|
|
||||||
// <SafeArea position='bottom' />
|
|
||||||
// </div>
|
|
||||||
// </div>
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
||||||
entity: keyof EntityDict;
|
entity: keyof EntityDict;
|
||||||
entityFilter: any;
|
entityFilter: any;
|
||||||
relationIds: string[];
|
relationIds: string[];
|
||||||
rule: "single" | "all" | "free";
|
rule: "all" | "single" | "free";
|
||||||
ruleOnRow: "single" | "all" | "free";
|
ruleOnRow: "all" | "single" | "free";
|
||||||
onPickRelations: (ids: string[]) => void;
|
onPickRelations: (ids: string[]) => void;
|
||||||
onPickRows: (ids: string[]) => void;
|
onPickRows: (ids: string[]) => void;
|
||||||
pickedRowIds: string[] | undefined;
|
pickedRowIds: string[] | undefined;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
||||||
claimUrl: string;
|
claimUrl: string;
|
||||||
qrCodeType: QrCodeType;
|
qrCodeType: QrCodeType;
|
||||||
multiple: boolean;
|
multiple: boolean;
|
||||||
rule: "single" | "all" | "free";
|
rule: "all" | "single" | "free";
|
||||||
ruleOnRow: "single" | "all" | "free";
|
ruleOnRow: "all" | "single" | "free";
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { EntityDict } from '../../../oak-app-domain';
|
import { EntityDict } from '../../../oak-app-domain';
|
||||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, false, {
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, false, {
|
||||||
type: "bind" | "login";
|
type: "login" | "bind";
|
||||||
url: string;
|
url: string;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../oak-app-domain").EntityDict, keyof import("../../oak-app-domain").EntityDict, true, {
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../oak-app-domain").EntityDict, keyof import("../../oak-app-domain").EntityDict, false, {
|
||||||
applicationId: string;
|
applicationId: string;
|
||||||
isPlatform: boolean;
|
isPlatform: boolean;
|
||||||
tabKey: string;
|
tabKey: string;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
export default OakComponent({
|
export default OakComponent({
|
||||||
isList: true,
|
isList: false,
|
||||||
properties: {
|
properties: {
|
||||||
applicationId: '',
|
applicationId: '',
|
||||||
isPlatform: false,
|
isPlatform: false,
|
||||||
|
|
@ -8,7 +8,6 @@ export default OakComponent({
|
||||||
lifetimes: {
|
lifetimes: {
|
||||||
async ready() {
|
async ready() {
|
||||||
const { applicationId } = this.props;
|
const { applicationId } = this.props;
|
||||||
// const result = await this.features.wechatMenu.getCurrentMenu({ applicationId: applicationId! });
|
|
||||||
const { data: wechatMenu } = await this.features.cache.refresh('wechatMenu', {
|
const { data: wechatMenu } = await this.features.cache.refresh('wechatMenu', {
|
||||||
data: {
|
data: {
|
||||||
id: 1,
|
id: 1,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ export default OakComponent({
|
||||||
return {
|
return {
|
||||||
id: rows?.[0]?.id,
|
id: rows?.[0]?.id,
|
||||||
config: rows?.[0]?.menuConfig,
|
config: rows?.[0]?.menuConfig,
|
||||||
totalConfig: rows?.[0]?.menuConfig,
|
|
||||||
iState: rows?.[0]?.iState,
|
iState: rows?.[0]?.iState,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,10 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { WechatPublicInstance } from 'oak-external-sdk/es/WechatSDK';
|
|
||||||
import { WebComponentProps } from 'oak-frontend-base';
|
import { WebComponentProps } from 'oak-frontend-base';
|
||||||
import { EntityDict } from "../../../oak-app-domain";
|
import { EntityDict } from "../../../oak-app-domain";
|
||||||
export default function Render(props: WebComponentProps<EntityDict, 'wechatMenu', true, {
|
export default function Render(props: WebComponentProps<EntityDict, 'wechatMenu', true, {
|
||||||
id: string;
|
id: string;
|
||||||
config: any;
|
config: any;
|
||||||
totalConfig: any;
|
|
||||||
file: File;
|
file: File;
|
||||||
wechatInstance: WechatPublicInstance;
|
|
||||||
errorIndex: number[];
|
errorIndex: number[];
|
||||||
oakId: string;
|
oakId: string;
|
||||||
menuType: string;
|
menuType: string;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import ActionPhone from '../actionPhone';
|
||||||
import MenuInfo from '../menuInfo';
|
import MenuInfo from '../menuInfo';
|
||||||
export default function Render(props) {
|
export default function Render(props) {
|
||||||
const { data, methods } = props;
|
const { data, methods } = props;
|
||||||
const { id, oakFullpath, config, wechatInstance, totalConfig, menuType, applicationId, actions, iState, tabKey } = data;
|
const { id, oakFullpath, config, menuType, applicationId, actions, iState, tabKey } = data;
|
||||||
const { updateItem, execute, create, } = methods;
|
const { updateItem, execute, create, } = methods;
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [isPreview, setIsPreview] = useState(false);
|
const [isPreview, setIsPreview] = useState(false);
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { WebComponentProps } from 'oak-frontend-base';
|
import { WebComponentProps } from 'oak-frontend-base';
|
||||||
import { EntityDict } from '../../oak-app-domain';
|
import { EntityDict } from '../../oak-app-domain';
|
||||||
export default function Render(props: WebComponentProps<EntityDict, 'wechatMenu', true, {
|
export default function Render(props: WebComponentProps<EntityDict, 'wechatMenu', false, {
|
||||||
is_menu_open: boolean;
|
is_menu_open: boolean;
|
||||||
applicationId: string;
|
applicationId: string;
|
||||||
menuId: string;
|
menuId: string;
|
||||||
isPlatform: boolean;
|
isPlatform: boolean;
|
||||||
tabKey: string;
|
tabKey: string;
|
||||||
}, {}>): React.JSX.Element | null;
|
}, {}>): React.JSX.Element;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import Style from './web.module.less';
|
||||||
import { Tabs } from 'antd';
|
import { Tabs } from 'antd';
|
||||||
import TagList from './tagList';
|
import TagList from './tagList';
|
||||||
export default function Render(props) {
|
export default function Render(props) {
|
||||||
const { menuId, oakFullpath, is_menu_open, applicationId, isPlatform, tabKey } = props.data;
|
const { menuId, oakFullpath, is_menu_open, applicationId, isPlatform, tabKey, } = props.data;
|
||||||
const {} = props.methods;
|
const {} = props.methods;
|
||||||
const [menuType, setMenuType] = useState('common');
|
const [menuType, setMenuType] = useState('common');
|
||||||
const [tag, setTag] = useState({});
|
const [tag, setTag] = useState({});
|
||||||
|
|
@ -16,38 +16,29 @@ export default function Render(props) {
|
||||||
{
|
{
|
||||||
key: '1',
|
key: '1',
|
||||||
label: '通用菜单',
|
label: '通用菜单',
|
||||||
children: <WechatMenu menuId={menuId ? menuId : undefined} oakPath={'$wechatMenu'} applicationId={applicationId} oakAutoUnmount={true} menuType={menuType} tabKey={tabKey}/>,
|
children: (<WechatMenu menuId={menuId ? menuId : undefined} oakPath={'$wechatMenu'} applicationId={applicationId} oakAutoUnmount={true} menuType={menuType} tabKey={tabKey}/>),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '2',
|
key: '2',
|
||||||
label: '个性化菜单',
|
label: '个性化菜单',
|
||||||
children: <div className={Style.conditionalMenu}>
|
children: (<div className={Style.conditionalMenu}>
|
||||||
<div className={Style.tagList}>
|
<div className={Style.tagList}>
|
||||||
<TagList oakAutoUnmount={true} oakPath='$wechatPublicTag' applicationId={applicationId} getTag={getTag}/>
|
<TagList oakAutoUnmount={true} oakPath="$wechatPublicTag" applicationId={applicationId} getTag={getTag}/>
|
||||||
</div>
|
</div>
|
||||||
{tag.id ? (<ConditionalMenu oakPath={`$conditionalMenu-${tag.id}`} applicationId={applicationId} oakAutoUnmount={true} tagId={tag.id} wechatId={tag.wechatId} menuType={menuType} tabKey={tabKey}/>) : (<div className={Style.tagHelp}>请选择一个标签</div>)}
|
{tag.id ? (<ConditionalMenu oakPath={`$conditionalMenu-${tag.id}`} applicationId={applicationId} oakAutoUnmount={true} tagId={tag.id} wechatId={tag.wechatId} menuType={menuType} tabKey={tabKey}/>) : (<div className={Style.tagHelp}>请选择一个标签</div>)}
|
||||||
</div>,
|
</div>),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
if (oakFullpath) {
|
return (<div>
|
||||||
return (<div>
|
{is_menu_open ? (<div className={Style.tabs}>
|
||||||
{is_menu_open && (<div className={Style.tabs}>
|
{isPlatform ? (<WechatMenu menuId={menuId ? menuId : undefined} oakPath={'$wechatMenu'} applicationId={applicationId} oakAutoUnmount={true} menuType={menuType} tabKey={tabKey}/>) : (<Tabs defaultActiveKey="1" items={items} onChange={(key) => {
|
||||||
{isPlatform ? <WechatMenu menuId={menuId ? menuId : undefined} oakPath={'$wechatMenu'} applicationId={applicationId} oakAutoUnmount={true} menuType={menuType} tabKey={tabKey}/> : <Tabs defaultActiveKey='1' items={items} onChange={(key) => {
|
if (key === '1') {
|
||||||
if (key === '1') {
|
setMenuType('common');
|
||||||
setMenuType('common');
|
}
|
||||||
}
|
else {
|
||||||
else {
|
setMenuType('conditional');
|
||||||
setMenuType('conditional');
|
}
|
||||||
}
|
}}/>)}
|
||||||
}}/>}
|
</div>) : null}
|
||||||
</div>)
|
</div>);
|
||||||
// : (
|
|
||||||
// <div className={Style.container}>
|
|
||||||
// <div className={Style.warn}>尚未开启菜单,请先前往微信公众平台开启。</div>
|
|
||||||
// </div>
|
|
||||||
// )
|
|
||||||
}
|
|
||||||
</div>);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
declare const _default: (import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BRC<import("../oak-app-domain").EntityDict>>)[];
|
declare const _default: (import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BRC<import("../oak-app-domain").EntityDict>>)[];
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@ const tslib_1 = require("tslib");
|
||||||
const WechatSDK_1 = tslib_1.__importDefault(require("oak-external-sdk/lib/WechatSDK"));
|
const WechatSDK_1 = tslib_1.__importDefault(require("oak-external-sdk/lib/WechatSDK"));
|
||||||
const assert_1 = require("oak-domain/lib/utils/assert");
|
const assert_1 = require("oak-domain/lib/utils/assert");
|
||||||
const uuid_1 = require("oak-domain/lib/utils/uuid");
|
const uuid_1 = require("oak-domain/lib/utils/uuid");
|
||||||
const Exception_1 = require('oak-domain/lib/types/Exception');
|
const Exception_1 = require("oak-domain/lib/types/Exception");
|
||||||
|
|
||||||
async function getWechatPublicConfig(applicationId, context) {
|
async function getWechatPublicConfig(applicationId, context) {
|
||||||
const [application] = await context.select('application', {
|
const [application] = await context.select('application', {
|
||||||
data: {
|
data: {
|
||||||
|
|
@ -56,16 +55,14 @@ async function getMenu(params, context) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
if (
|
if (e instanceof Exception_1.OakExternalException &&
|
||||||
e instanceof Exception_1.OakExternalException &&
|
e?.message?.includes('menu no exist')) {
|
||||||
e?.message?.includes('menu no exist')
|
return {
|
||||||
) {
|
menu: {
|
||||||
return {
|
button: []
|
||||||
menu: {
|
}
|
||||||
button: [],
|
};
|
||||||
},
|
}
|
||||||
};
|
|
||||||
}
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
declare const checkers: (import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "token", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "mobile", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "message", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "parasite", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>>)[];
|
declare const checkers: (import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "token", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "mobile", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "message", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "parasite", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>>)[];
|
||||||
export default checkers;
|
export default checkers;
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
declare const _default: (import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BRC<import("../oak-app-domain").EntityDict>>)[];
|
declare const _default: (import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BRC<import("../oak-app-domain").EntityDict>>)[];
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,15 @@
|
||||||
|
|
||||||
|
|
||||||
.loginbox-main {
|
.loginbox-main {
|
||||||
height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background: var(--oak-bg-color-container);
|
|
||||||
padding-top: 20%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.loginbox-wrap {
|
.loginbox-wrap {
|
||||||
width: 90%;
|
|
||||||
display: block;
|
display: block;
|
||||||
background: var(--oak-bg-color-container);
|
|
||||||
border-radius: 4px;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
box-shadow: 0 2px 4px rgb(0 0 0 / 8%), 0 0 4px rgb(0 0 0 / 8%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.loginbox-hd {
|
.loginbox-hd {
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ export default OakComponent({
|
||||||
properties: {
|
properties: {
|
||||||
onFinish: undefined as (() => void) | undefined,
|
onFinish: undefined as (() => void) | undefined,
|
||||||
bindNum: 10,
|
bindNum: 10,
|
||||||
|
addMobile: undefined as (() => void) | undefined,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async onRefreshMobile(e: WechatMiniprogram.Touch) {
|
async onRefreshMobile(e: WechatMiniprogram.Touch) {
|
||||||
|
|
@ -84,9 +85,11 @@ export default OakComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
goAddMobile() {
|
goAddMobile() {
|
||||||
this.navigateTo({
|
const { addMobile } = this.props;
|
||||||
url: '/mobile/login',
|
if (addMobile) {
|
||||||
});
|
addMobile();
|
||||||
|
return;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async onRemoveConfirm() {
|
async onRemoveConfirm() {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { List, Button, Modal, Dialog } from 'antd-mobile';
|
import { List, Button, Popup, Dialog } from 'antd-mobile';
|
||||||
import { MobileOutlined, DeleteOutlined } from '@ant-design/icons';
|
import { MobileOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||||
import { WebComponentProps } from 'oak-frontend-base';
|
import { WebComponentProps } from 'oak-frontend-base';
|
||||||
import { EntityDict } from '../../../oak-app-domain';
|
import { EntityDict } from '../../../oak-app-domain';
|
||||||
import Style from './mobile.module.less';
|
import Style from './mobile.module.less';
|
||||||
|
|
||||||
|
import MobileLogin from '../login';
|
||||||
|
|
||||||
export default function render(
|
export default function render(
|
||||||
props: WebComponentProps<
|
props: WebComponentProps<
|
||||||
EntityDict,
|
EntityDict,
|
||||||
|
|
@ -22,6 +24,8 @@ export default function render(
|
||||||
) {
|
) {
|
||||||
const { mobiles, allowRemove, tokenMobileId } = props.data;
|
const { mobiles, allowRemove, tokenMobileId } = props.data;
|
||||||
const { goAddMobile, removeItem, recoverItem, execute } = props.methods;
|
const { goAddMobile, removeItem, recoverItem, execute } = props.methods;
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={Style.container}>
|
<div className={Style.container}>
|
||||||
{mobiles && mobiles.length > 0 ? (
|
{mobiles && mobiles.length > 0 ? (
|
||||||
|
|
@ -32,7 +36,8 @@ export default function render(
|
||||||
key={index}
|
key={index}
|
||||||
prefix={<MobileOutlined />}
|
prefix={<MobileOutlined />}
|
||||||
extra={
|
extra={
|
||||||
allowRemove && tokenMobileId !== ele.id && (
|
allowRemove &&
|
||||||
|
tokenMobileId !== ele.id && (
|
||||||
<div
|
<div
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
const result =
|
const result =
|
||||||
|
|
@ -44,8 +49,7 @@ export default function render(
|
||||||
removeItem(ele.id);
|
removeItem(ele.id);
|
||||||
try {
|
try {
|
||||||
await execute();
|
await execute();
|
||||||
}
|
} catch (err) {
|
||||||
catch (err) {
|
|
||||||
recoverItem(ele.id);
|
recoverItem(ele.id);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
@ -73,10 +77,31 @@ export default function render(
|
||||||
block
|
block
|
||||||
size="large"
|
size="large"
|
||||||
color="primary"
|
color="primary"
|
||||||
onClick={() => goAddMobile()}
|
onClick={() => setOpen(true)}
|
||||||
>
|
>
|
||||||
绑定
|
绑定
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
<Popup
|
||||||
|
visible={open}
|
||||||
|
showCloseButton={true}
|
||||||
|
onClose={() => {
|
||||||
|
setOpen(false);
|
||||||
|
}}
|
||||||
|
bodyStyle={{
|
||||||
|
borderTopLeftRadius: '8px',
|
||||||
|
borderTopRightRadius: '8px',
|
||||||
|
height: '40vh',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MobileLogin
|
||||||
|
callback={() => {
|
||||||
|
setOpen(false);
|
||||||
|
}}
|
||||||
|
oakPath="$mobile/me-mobile/login"
|
||||||
|
oakAutoUnmount={true}
|
||||||
|
/>
|
||||||
|
</Popup>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,54 +1,16 @@
|
||||||
.addView {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
left: 50%;
|
|
||||||
z-index: 99;
|
|
||||||
}
|
|
||||||
|
|
||||||
.imgView {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
height: 200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.img {
|
.pageBody {
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: contain;
|
display: flex;
|
||||||
}
|
flex: 1;
|
||||||
|
flex-direction: column;
|
||||||
.imgContent {
|
box-sizing: border-box;
|
||||||
padding: 16px;
|
align-items: stretch;
|
||||||
margin: 16px;
|
|
||||||
border-radius: 8px;
|
|
||||||
background-color: var(--oak-bg-color-page);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
height: 100%;
|
flex: 1;
|
||||||
box-sizing: border-box;
|
display: flex;
|
||||||
display: flex;
|
flex-direction: column;
|
||||||
flex-direction: column;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.circleBtn {
|
|
||||||
width: 25px;
|
|
||||||
height: 25px;
|
|
||||||
border-radius: 50%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background-color: var(--oak-color-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonView {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex: 1;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding: 16px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
import React, { useRef, useState } from 'react';
|
import React, { useRef, useState } from 'react';
|
||||||
import { WebComponentProps } from 'oak-frontend-base';
|
import { WebComponentProps } from 'oak-frontend-base';
|
||||||
import { EntityDict } from '../../../oak-app-domain';
|
import { EntityDict } from '../../../oak-app-domain';
|
||||||
import styles from './mobile.module.less';
|
import Styles from './mobile.module.less';
|
||||||
import { Image, Card, Space, Form, Input, SafeArea, Button, Result } from 'antd-mobile';
|
import { Picker, Form, Input, Button } from 'antd-mobile';
|
||||||
import { AddOutline } from 'antd-mobile-icons';
|
|
||||||
import type { UploadFile, UploadProps } from 'antd/es/upload/interface';
|
|
||||||
|
|
||||||
export default function Render(
|
export default function Render(
|
||||||
props: WebComponentProps<
|
props: WebComponentProps<
|
||||||
|
|
@ -16,117 +14,105 @@ export default function Render(
|
||||||
name: string;
|
name: string;
|
||||||
idNumber: string;
|
idNumber: string;
|
||||||
idState: EntityDict['user']['Schema']['idState'];
|
idState: EntityDict['user']['Schema']['idState'];
|
||||||
|
idCardType: EntityDict['user']['Schema']['idCardType'];
|
||||||
|
idCardTypeArr: { value: string; label: string }[];
|
||||||
|
showBtn: boolean;
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
commit: (file1: UploadFile, file2: UploadFile) => void;
|
onConfirm: () => void;
|
||||||
prevImg: (file: UploadFile, id: string) => void;
|
|
||||||
onChange: (attr: keyof EntityDict['user']['Schema'], value: string) => void;
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
) {
|
) {
|
||||||
const { methods, data } = props;
|
const { methods, data } = props;
|
||||||
const { t, onChange, prevImg, commit } = methods;
|
const { t, update, onConfirm } = methods;
|
||||||
// const { oakFullpath, oakId, oakLegalActions, userId, idState, name, idNumber } = data;
|
const {
|
||||||
// const [fileList, setFileList] = useState<UploadFile[]>([]);
|
oakFullpath,
|
||||||
// const [fileList2, setFileList2] = useState<UploadFile[]>([]);
|
oakId,
|
||||||
// const uploadProps: UploadProps = {
|
oakLegalActions,
|
||||||
// maxCount: 1,
|
idState,
|
||||||
// showUploadList: false,
|
name,
|
||||||
// beforeUpload: (file) => {
|
idNumber,
|
||||||
// return false;
|
idCardType,
|
||||||
// },
|
idCardTypeArr,
|
||||||
// onChange: ({ file, fileList, event }) => {
|
showBtn,
|
||||||
// prevImg(file, 'imgView1');
|
} = data;
|
||||||
// setFileList([...fileList]);
|
const [open, setOpen] = useState(false);
|
||||||
// },
|
|
||||||
// fileList,
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const uploadProps2: UploadProps = {
|
return (
|
||||||
// maxCount: 1,
|
<div className={Styles.pageBody}>
|
||||||
// showUploadList: false,
|
<div className={Styles.container}>
|
||||||
// beforeUpload: (file) => {
|
<Form layout="horizontal">
|
||||||
// return false;
|
<Form.Item label={t('user:attr.name')} required>
|
||||||
// },
|
<Input
|
||||||
// onChange: ({ file, fileList, event }) => {
|
disabled={idState !== 'unverified'}
|
||||||
// prevImg(file, 'imgView2');
|
value={name}
|
||||||
// setFileList2([...fileList]);
|
onChange={(val) => {
|
||||||
// },
|
update({
|
||||||
// fileList: fileList2,
|
name: val,
|
||||||
// };
|
});
|
||||||
// if (idState === 'verified') {
|
}}
|
||||||
// return (
|
placeholder={t('please input name')}
|
||||||
// <Result
|
/>
|
||||||
// status='success'
|
</Form.Item>
|
||||||
// title={t("Real name verification passed")}
|
<Form.Item label={t('user:attr.idCardType')} required>
|
||||||
// />
|
<div
|
||||||
// )
|
onClick={idState === 'unverified' ? () => {
|
||||||
// }
|
setOpen(true);
|
||||||
|
} : undefined}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
value={
|
||||||
|
idCardType
|
||||||
|
? t('user:v.idCardType.' + idCardType)
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
readOnly
|
||||||
|
placeholder={t('please choose idCardType')}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
return null;
|
<Picker
|
||||||
|
columns={[idCardTypeArr]}
|
||||||
|
visible={open}
|
||||||
|
onClose={() => {
|
||||||
|
setOpen(false);
|
||||||
|
}}
|
||||||
|
value={idCardType ? [idCardType] : undefined}
|
||||||
|
onConfirm={(v) => {
|
||||||
|
update({
|
||||||
|
idCardType:
|
||||||
|
v[0] as EntityDict['user']['Schema']['idCardType'],
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label={t('user:attr.idNumber')} required>
|
||||||
|
<Input
|
||||||
|
value={idNumber}
|
||||||
|
disabled={!idCardType || idState !== 'unverified'}
|
||||||
|
onChange={(val) => {
|
||||||
|
update({
|
||||||
|
idNumber: val,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
placeholder={t('please input idNumber')}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
|
||||||
// return (
|
{showBtn ? (
|
||||||
// <div className={styles.container}>
|
<Button
|
||||||
// <div className={styles.imgContent}>
|
block
|
||||||
// <Upload {...uploadProps}>
|
color="primary"
|
||||||
// <div id="imgView1" className={styles.imgView} style={{ marginBottom: 16 }}>
|
size="large"
|
||||||
// <IDCard1 width={"100%"} height={"100%"} style={{ background: '#fff' }} />
|
onClick={() => {
|
||||||
// {/* <img id="img1" className={styles.img} /> */}
|
onConfirm();
|
||||||
// {fileList.length === 0 && (
|
}}
|
||||||
// <Space direction="vertical" className={styles.addView} align="center">
|
>
|
||||||
// <div className={styles.circleBtn}>
|
提交认证
|
||||||
// <AddOutline color="#fff" />
|
</Button>
|
||||||
// </div>
|
) : null}
|
||||||
// <div className={styles.text}>
|
</div>
|
||||||
// {t("Identity witness profile")}
|
);
|
||||||
// </div>
|
|
||||||
// </Space>
|
|
||||||
// )}
|
|
||||||
// </div>
|
|
||||||
// </Upload>
|
|
||||||
// <Upload {...uploadProps2}>
|
|
||||||
// <div id="imgView2" className={styles.imgView}>
|
|
||||||
// <IDCard2 width={"100%"} height={"100%"} style={{ background: '#fff' }} />
|
|
||||||
// {/* <img id="img2" className={styles.img} /> */}
|
|
||||||
// {fileList2.length === 0 && (
|
|
||||||
// <Space direction="vertical" className={styles.addView} align="center">
|
|
||||||
// <div className={styles.circleBtn}>
|
|
||||||
// <AddOutline color="#fff" />
|
|
||||||
// </div>
|
|
||||||
// <div className={styles.text}>
|
|
||||||
// {t("Identity national emblem profile")}
|
|
||||||
// </div>
|
|
||||||
// </Space>
|
|
||||||
// )}
|
|
||||||
// </div>
|
|
||||||
// </Upload>
|
|
||||||
// </div>
|
|
||||||
// <Form layout='horizontal'>
|
|
||||||
// <Form.Item label={t("user:attr.name")}>
|
|
||||||
// <Input
|
|
||||||
// value={name}
|
|
||||||
// style={{ '--text-align': 'right' }}
|
|
||||||
// placeholder={t("please input name")}
|
|
||||||
// clearable
|
|
||||||
// onChange={(value) => onChange('name', value)}
|
|
||||||
// />
|
|
||||||
// </Form.Item>
|
|
||||||
// <Form.Item label={t("user:attr.idNumber")}>
|
|
||||||
// <Input
|
|
||||||
// value={idNumber}
|
|
||||||
// style={{ '--text-align': 'right' }}
|
|
||||||
// placeholder={t("please input idNumber")}
|
|
||||||
// clearable
|
|
||||||
// onChange={(value) => onChange('idNumber', value)}
|
|
||||||
// />
|
|
||||||
// </Form.Item>
|
|
||||||
// </Form>
|
|
||||||
// <div className={styles.buttonView}>
|
|
||||||
// <Button block shape='rounded' color='primary' onClick={() => commit(fileList[0], fileList2[0])}>
|
|
||||||
// {t("common::commit")}
|
|
||||||
// </Button>
|
|
||||||
// <SafeArea position='bottom' />
|
|
||||||
// </div>
|
|
||||||
// </div>
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
export default OakComponent({
|
export default OakComponent({
|
||||||
isList: true,
|
isList: false,
|
||||||
properties: {
|
properties: {
|
||||||
applicationId: '',
|
applicationId: '',
|
||||||
isPlatform: false,
|
isPlatform: false,
|
||||||
|
|
@ -9,7 +9,6 @@ export default OakComponent({
|
||||||
lifetimes: {
|
lifetimes: {
|
||||||
async ready() {
|
async ready() {
|
||||||
const { applicationId } = this.props;
|
const { applicationId } = this.props;
|
||||||
// const result = await this.features.wechatMenu.getCurrentMenu({ applicationId: applicationId! });
|
|
||||||
const { data: wechatMenu } = await this.features.cache.refresh(
|
const { data: wechatMenu } = await this.features.cache.refresh(
|
||||||
'wechatMenu',
|
'wechatMenu',
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import WechatSDK, { WechatMpInstance, WechatPublicInstance } from 'oak-external-sdk/es/WechatSDK';
|
|
||||||
import { WechatMpConfig, WechatPublicConfig } from '../../../oak-app-domain/Application/Schema';
|
|
||||||
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
|
||||||
export default OakComponent({
|
export default OakComponent({
|
||||||
isList: true,
|
isList: true,
|
||||||
entity: 'wechatMenu',
|
entity: 'wechatMenu',
|
||||||
|
|
@ -22,7 +20,6 @@ export default OakComponent({
|
||||||
return {
|
return {
|
||||||
id: rows?.[0]?.id,
|
id: rows?.[0]?.id,
|
||||||
config: rows?.[0]?.menuConfig,
|
config: rows?.[0]?.menuConfig,
|
||||||
totalConfig: rows?.[0]?.menuConfig,
|
|
||||||
iState: rows?.[0]?.iState,
|
iState: rows?.[0]?.iState,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import React, { useEffect, useState, useRef } from 'react';
|
import React, { useEffect, useState, useRef } from 'react';
|
||||||
import { WechatPublicInstance } from 'oak-external-sdk/es/WechatSDK';
|
|
||||||
import { WebComponentProps } from 'oak-frontend-base';
|
import { WebComponentProps } from 'oak-frontend-base';
|
||||||
import { EntityDict } from "../../../oak-app-domain";
|
import { EntityDict } from "../../../oak-app-domain";
|
||||||
import Style from './web.module.less';
|
import Style from './web.module.less';
|
||||||
import { Space, Button, Form, Input, Radio, Modal } from 'antd';
|
import { Modal } from 'antd';
|
||||||
import Preview from '../preview';
|
import Preview from '../preview';
|
||||||
import ActionPhone from '../actionPhone';
|
import ActionPhone from '../actionPhone';
|
||||||
import MenuInfo from '../menuInfo';
|
import MenuInfo from '../menuInfo';
|
||||||
|
|
||||||
export default function Render(
|
export default function Render(
|
||||||
props: WebComponentProps<
|
props: WebComponentProps<
|
||||||
EntityDict,
|
EntityDict,
|
||||||
|
|
@ -15,9 +15,7 @@ export default function Render(
|
||||||
{
|
{
|
||||||
id: string;
|
id: string;
|
||||||
config: any;
|
config: any;
|
||||||
totalConfig: any;
|
|
||||||
file: File;
|
file: File;
|
||||||
wechatInstance: WechatPublicInstance;
|
|
||||||
errorIndex: number[];
|
errorIndex: number[];
|
||||||
oakId: string;
|
oakId: string;
|
||||||
menuType: string;
|
menuType: string;
|
||||||
|
|
@ -32,7 +30,7 @@ export default function Render(
|
||||||
>
|
>
|
||||||
) {
|
) {
|
||||||
const { data, methods } = props;
|
const { data, methods } = props;
|
||||||
const { id, oakFullpath, config, wechatInstance, totalConfig, menuType, applicationId, actions, iState, tabKey } = data;
|
const { id, oakFullpath, config, menuType, applicationId, actions, iState, tabKey } = data;
|
||||||
const {
|
const {
|
||||||
updateItem,
|
updateItem,
|
||||||
execute,
|
execute,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export default function Render(
|
||||||
props: WebComponentProps<
|
props: WebComponentProps<
|
||||||
EntityDict,
|
EntityDict,
|
||||||
'wechatMenu',
|
'wechatMenu',
|
||||||
true,
|
false,
|
||||||
{
|
{
|
||||||
is_menu_open: boolean;
|
is_menu_open: boolean;
|
||||||
applicationId: string;
|
applicationId: string;
|
||||||
|
|
@ -20,100 +20,101 @@ export default function Render(
|
||||||
isPlatform: boolean;
|
isPlatform: boolean;
|
||||||
tabKey: string;
|
tabKey: string;
|
||||||
},
|
},
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
>
|
>
|
||||||
) {
|
) {
|
||||||
const { menuId, oakFullpath, is_menu_open, applicationId, isPlatform, tabKey } = props.data;
|
const {
|
||||||
const { } = props.methods;
|
menuId,
|
||||||
|
oakFullpath,
|
||||||
|
is_menu_open,
|
||||||
|
applicationId,
|
||||||
|
isPlatform,
|
||||||
|
tabKey,
|
||||||
|
} = props.data;
|
||||||
|
const {} = props.methods;
|
||||||
const [menuType, setMenuType] = useState('common');
|
const [menuType, setMenuType] = useState('common');
|
||||||
const [tag, setTag] = useState({} as { id: string, name: string, wechatId: string });
|
const [tag, setTag] = useState(
|
||||||
|
{} as { id: string; name: string; wechatId: string }
|
||||||
|
);
|
||||||
|
|
||||||
const getTag = (tag: { id: string, name: string, wechatId: string }) => {
|
const getTag = (tag: { id: string; name: string; wechatId: string }) => {
|
||||||
setTag(tag);
|
setTag(tag);
|
||||||
}
|
};
|
||||||
|
|
||||||
const items: TabsProps['items'] = [
|
const items: TabsProps['items'] = [
|
||||||
{
|
{
|
||||||
key: '1',
|
key: '1',
|
||||||
label: '通用菜单',
|
label: '通用菜单',
|
||||||
children: <WechatMenu
|
children: (
|
||||||
menuId={menuId ? menuId : undefined}
|
<WechatMenu
|
||||||
oakPath={'$wechatMenu'}
|
menuId={menuId ? menuId : undefined}
|
||||||
applicationId={applicationId}
|
oakPath={'$wechatMenu'}
|
||||||
oakAutoUnmount={true}
|
applicationId={applicationId}
|
||||||
menuType={menuType}
|
oakAutoUnmount={true}
|
||||||
tabKey={tabKey}
|
menuType={menuType}
|
||||||
/>,
|
tabKey={tabKey}
|
||||||
|
/>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '2',
|
key: '2',
|
||||||
label: '个性化菜单',
|
label: '个性化菜单',
|
||||||
children:
|
children: (
|
||||||
<div className={Style.conditionalMenu}>
|
<div className={Style.conditionalMenu}>
|
||||||
<div className={Style.tagList}>
|
<div className={Style.tagList}>
|
||||||
<TagList
|
<TagList
|
||||||
oakAutoUnmount={true}
|
oakAutoUnmount={true}
|
||||||
oakPath='$wechatPublicTag'
|
oakPath="$wechatPublicTag"
|
||||||
applicationId={applicationId}
|
applicationId={applicationId}
|
||||||
getTag={getTag}
|
getTag={getTag}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{
|
{tag.id ? (
|
||||||
tag.id ? (
|
<ConditionalMenu
|
||||||
<ConditionalMenu
|
oakPath={`$conditionalMenu-${tag.id}`}
|
||||||
oakPath={`$conditionalMenu-${tag.id}`}
|
applicationId={applicationId}
|
||||||
applicationId={applicationId}
|
oakAutoUnmount={true}
|
||||||
oakAutoUnmount={true}
|
tagId={tag.id}
|
||||||
tagId={tag.id}
|
wechatId={tag.wechatId}
|
||||||
wechatId={tag.wechatId}
|
menuType={menuType}
|
||||||
menuType={menuType}
|
tabKey={tabKey}
|
||||||
tabKey={tabKey}
|
/>
|
||||||
/>
|
) : (
|
||||||
) : (
|
<div className={Style.tagHelp}>请选择一个标签</div>
|
||||||
<div className={Style.tagHelp}>请选择一个标签</div>
|
)}
|
||||||
)
|
</div>
|
||||||
}
|
),
|
||||||
</div>,
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
if (oakFullpath) {
|
return (
|
||||||
return (
|
<div>
|
||||||
<div>
|
{is_menu_open ? (
|
||||||
{
|
<div className={Style.tabs}>
|
||||||
is_menu_open && (
|
{isPlatform ? (
|
||||||
<div className={Style.tabs}>
|
<WechatMenu
|
||||||
{
|
menuId={menuId ? menuId : undefined}
|
||||||
isPlatform ? <WechatMenu
|
oakPath={'$wechatMenu'}
|
||||||
menuId={menuId ? menuId : undefined}
|
applicationId={applicationId}
|
||||||
oakPath={'$wechatMenu'}
|
oakAutoUnmount={true}
|
||||||
applicationId={applicationId}
|
menuType={menuType}
|
||||||
oakAutoUnmount={true}
|
tabKey={tabKey}
|
||||||
menuType={menuType}
|
/>
|
||||||
tabKey={tabKey}
|
) : (
|
||||||
/> : <Tabs
|
<Tabs
|
||||||
defaultActiveKey='1'
|
defaultActiveKey="1"
|
||||||
items={items}
|
items={items}
|
||||||
onChange={(key: string) => {
|
onChange={(key: string) => {
|
||||||
if (key === '1') {
|
if (key === '1') {
|
||||||
setMenuType('common');
|
setMenuType('common');
|
||||||
} else {
|
} else {
|
||||||
setMenuType('conditional');
|
setMenuType('conditional');
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
) : null}
|
||||||
// : (
|
</div>
|
||||||
// <div className={Style.container}>
|
);
|
||||||
// <div className={Style.warn}>尚未开启菜单,请先前往微信公众平台开启。</div>
|
|
||||||
// </div>
|
|
||||||
// )
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue