调整了user/info组件,在组件内创建mobile和password
This commit is contained in:
parent
7b7b8cb39e
commit
983ac16101
|
|
@ -128,7 +128,6 @@ export default OakComponent({
|
|||
gotoDoc(articleMenuId) {
|
||||
const { onMenuViewById } = this.props;
|
||||
onMenuViewById && onMenuViewById(articleMenuId);
|
||||
// window.open(`/article/doc?articleMenuId=${articleMenuId}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Style } from '../../../../types/Style';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../../oak-app-domain").EntityDict, keyof import("../../../../oak-app-domain").EntityDict, false, {
|
||||
style: Style;
|
||||
entity: "platform" | "application" | "system";
|
||||
entity: "platform" | "system" | "application";
|
||||
entityId: string;
|
||||
name: string;
|
||||
}>) => React.ReactElement;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
|
|||
type?: ButtonProps['type'] | AmButtonProps['type'];
|
||||
executeText?: string | undefined;
|
||||
buttonProps?: (ButtonProps & {
|
||||
color?: "default" | "success" | "primary" | "warning" | "danger" | undefined;
|
||||
color?: "default" | "primary" | "success" | "warning" | "danger" | undefined;
|
||||
fill?: "none" | "solid" | "outline" | undefined;
|
||||
size?: "small" | "large" | "middle" | "mini" | undefined;
|
||||
block?: boolean | undefined;
|
||||
|
|
@ -24,7 +24,7 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
|
|||
loadingIcon?: import("react").ReactNode;
|
||||
disabled?: boolean | undefined;
|
||||
onClick?: ((event: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => unknown) | undefined;
|
||||
type?: "button" | "reset" | "submit" | undefined;
|
||||
type?: "reset" | "submit" | "button" | undefined;
|
||||
shape?: "default" | "rounded" | "rectangular" | undefined;
|
||||
children?: import("react").ReactNode;
|
||||
} & Pick<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>, "id" | "onMouseUp" | "onMouseDown" | "onTouchStart" | "onTouchEnd"> & {
|
||||
|
|
|
|||
|
|
@ -38,36 +38,12 @@ export default function Render(props) {
|
|||
}}>
|
||||
编辑
|
||||
</Button>)}
|
||||
|
||||
{/* {!nodeData.isLeaf && (
|
||||
<Button
|
||||
onClick={() =>
|
||||
{
|
||||
setSubwayId((nodeData as any).key)
|
||||
setStation(true)
|
||||
}
|
||||
}
|
||||
>
|
||||
添加站点
|
||||
</Button>
|
||||
// <Button
|
||||
// type="primary"
|
||||
// onClick={() =>
|
||||
// goServiceUpsert(
|
||||
// nodeData!
|
||||
// .key as string
|
||||
// )
|
||||
// }
|
||||
// >
|
||||
// 添加站点
|
||||
// </Button>
|
||||
)} */}
|
||||
</Space>
|
||||
</Col>
|
||||
</Row>);
|
||||
}}/>
|
||||
{openSubway && (<UpsertSubway onClose={() => setSubway(false)} openSubway={openSubway} oakId={subwayId} oakPath={`${oakFullpath}.${subwayId}`} oakAutoUnmount={true}/>)}
|
||||
|
||||
{openStation && (<UpsertStation onClose={() => setStation(false)} openStation={openStation} oakId={stationId} subwayId={subwayId} oakPath={`$subwayLine/upsertStation,${stationId}`} oakAutoUnmount={true}/>)}
|
||||
{openStation && (<UpsertStation onClose={() => setStation(false)} openStation={openStation} oakId={stationId} subwayId={subwayId} oakPath={`$subwayLine/list-UpsertStation-${stationId}`} oakAutoUnmount={true}/>)}
|
||||
</>);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@ export default function Render(props) {
|
|||
clean();
|
||||
setOpen(false);
|
||||
}} width={500} footer={<Space>
|
||||
<Button
|
||||
// type='primary'
|
||||
onClick={async () => {
|
||||
<Button onClick={async () => {
|
||||
clean();
|
||||
setOpen(false);
|
||||
}} disabled={oakExecuting}>
|
||||
|
|
@ -47,7 +45,7 @@ export default function Render(props) {
|
|||
{oldestVersion || t('common::unset')}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t('system:attr.super')}>
|
||||
{isSuper ? '是' : '否'}
|
||||
{isSuper ? t('common::true') : t('common::false')}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item>
|
||||
<Row justify="end">
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export default function Render(props) {
|
|||
const { t, } = props.methods;
|
||||
if (id && oakFullpath) {
|
||||
return (<div className={Styles.container}>
|
||||
<Tabs tabPosition="left" items={[
|
||||
<Tabs tabPosition="left" style={{ minHeight: '50vh' }} items={[
|
||||
{
|
||||
label: (<div className={Styles.tabLabel}>
|
||||
{t('detail')}
|
||||
|
|
|
|||
|
|
@ -3,5 +3,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
|||
changeMobileUrl: string;
|
||||
changePasswordUrl: string;
|
||||
authenticateUrl: string;
|
||||
onConfirm: () => void;
|
||||
}>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
||||
import { OakOperationUnpermittedException } from 'oak-domain/lib/types';
|
||||
import dayjs from 'dayjs';
|
||||
import { isMobile } from 'oak-domain/lib/utils/validator';
|
||||
export default OakComponent({
|
||||
entity: 'user',
|
||||
projection: {
|
||||
|
|
@ -67,6 +68,7 @@ export default OakComponent({
|
|||
nickname: 1,
|
||||
},
|
||||
},
|
||||
hasPassword: 1,
|
||||
},
|
||||
isList: false,
|
||||
formData({ data: user, features, origin }) {
|
||||
|
|
@ -90,6 +92,7 @@ export default OakComponent({
|
|||
return {
|
||||
id: user?.id,
|
||||
name: user?.name,
|
||||
hasPassword: user?.password || user?.hasPassword,
|
||||
nameDirty: origin && user?.name !== origin?.name,
|
||||
nickname: user?.nickname,
|
||||
nnDirty: origin && user?.nickname !== origin?.nickname,
|
||||
|
|
@ -115,6 +118,7 @@ export default OakComponent({
|
|||
canSyncPublic,
|
||||
editable,
|
||||
executable,
|
||||
isCreation: this.isCreation(),
|
||||
};
|
||||
},
|
||||
data: {
|
||||
|
|
@ -141,12 +145,15 @@ export default OakComponent({
|
|||
],
|
||||
refreshing: false,
|
||||
editAttr: '',
|
||||
mobileInput: '',
|
||||
mobileInputLegal: false,
|
||||
},
|
||||
actions: ['update'],
|
||||
properties: {
|
||||
changeMobileUrl: '',
|
||||
changePasswordUrl: '',
|
||||
authenticateUrl: '',
|
||||
onConfirm: () => undefined,
|
||||
},
|
||||
methods: {
|
||||
checkEditable(attr) {
|
||||
|
|
@ -183,21 +190,33 @@ export default OakComponent({
|
|||
throw err;
|
||||
}
|
||||
},
|
||||
goChangeMobile() {
|
||||
editMobile() {
|
||||
this.checkEditable('nickname');
|
||||
if (this.state.isCreation) {
|
||||
this.setState({
|
||||
editAttr: 'mobile',
|
||||
});
|
||||
return;
|
||||
}
|
||||
const { changeMobileUrl, oakId } = this.props;
|
||||
if (changeMobileUrl) {
|
||||
this.navigateTo({
|
||||
url: changeMobileUrl,
|
||||
oakId,
|
||||
userId: oakId,
|
||||
});
|
||||
}
|
||||
else if (process.env.NODE_ENV === 'development') {
|
||||
console.warn('changeMobileUrl unset');
|
||||
}
|
||||
},
|
||||
goChangePassword() {
|
||||
editPassword() {
|
||||
this.checkEditable('password');
|
||||
if (this.state.isCreation) {
|
||||
this.setState({
|
||||
editAttr: 'password',
|
||||
});
|
||||
return;
|
||||
}
|
||||
const { changePasswordUrl, oakId } = this.props;
|
||||
if (changePasswordUrl) {
|
||||
this.navigateTo({
|
||||
|
|
@ -265,6 +284,13 @@ export default OakComponent({
|
|||
birth,
|
||||
});
|
||||
},
|
||||
changePasswordMp(e) {
|
||||
const { value } = e.detail;
|
||||
this.update({
|
||||
password: value,
|
||||
hasPassword: !!value,
|
||||
});
|
||||
},
|
||||
changeNicknameMp(e) {
|
||||
const { value } = e.detail;
|
||||
this.update({
|
||||
|
|
@ -277,6 +303,30 @@ export default OakComponent({
|
|||
name: value,
|
||||
});
|
||||
},
|
||||
inputMobileMp(e) {
|
||||
const { value } = e.detail;
|
||||
const mobileInputLegal = !!isMobile(value);
|
||||
this.setState({
|
||||
mobileInput: value,
|
||||
mobileInputLegal,
|
||||
});
|
||||
},
|
||||
async confirmMobileInputMp() {
|
||||
const { mobileInput } = this.state;
|
||||
this.update({
|
||||
mobile$user: [
|
||||
{
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'create',
|
||||
data: {
|
||||
id: await generateNewIdAsync(),
|
||||
mobile: mobileInput,
|
||||
ableState: 'enabled',
|
||||
}
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
async unbindingWechat(captcha) {
|
||||
const { mobile, wechatUser } = this.state;
|
||||
try {
|
||||
|
|
@ -331,6 +381,8 @@ export default OakComponent({
|
|||
async onConfirm() {
|
||||
await this.execute();
|
||||
this.reRender();
|
||||
const { onConfirm } = this.props;
|
||||
onConfirm && onConfirm();
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -77,11 +77,26 @@
|
|||
</block>
|
||||
</view>
|
||||
</l-list>
|
||||
<l-list title="手机号" bind:lintap="goChangeMobile">
|
||||
<l-list title="手机号" bind:lintap="editMobile">
|
||||
<view slot="right-section" class="value">{{mobile || '未绑定'}}</view>
|
||||
</l-list>
|
||||
<l-list title="密码" bind:lintap="goChangePassword">
|
||||
<view slot="right-section" class="value">******</view>
|
||||
<l-list title="密码" bind:lintap="editPassword">
|
||||
<block wx:if="{{editAttr==='password'}}">
|
||||
<input
|
||||
slot="right-section"
|
||||
value="{{password}}"
|
||||
focus
|
||||
password
|
||||
placeholder="请输入密码"
|
||||
bindchange="changePasswordMp"
|
||||
bindconfirm="cancelEdit"
|
||||
bindblur="cancelEdit"
|
||||
disabled="{{!editable}}"
|
||||
/>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<view slot="right-section" class="value">{{hasPassword ? '******' : '未设置'}}</view>
|
||||
</block>
|
||||
</l-list>
|
||||
<l-list tag-position="right" is-link="{{false}}" title="用户状态">
|
||||
<view slot="right-section" class="value">
|
||||
|
|
@ -108,25 +123,46 @@
|
|||
</block>
|
||||
</view>
|
||||
<l-popup
|
||||
show="{{editAttr === 'gender'}}"
|
||||
show="{{editAttr === 'gender' || editAttr === 'mobile'}}"
|
||||
content-align="bottom"
|
||||
bind:lintap="cancelEdit"
|
||||
>
|
||||
<view class='popup-content'>
|
||||
<view class='popup-form'>
|
||||
<l-form-item label="性别" label-width="100rpx">
|
||||
<l-radio-group
|
||||
current="{{gender}}"
|
||||
placement="row"
|
||||
length="2"
|
||||
bind:linchange="changeGenderMp"
|
||||
l-class="radio-group"
|
||||
<block wx:if="{{editAttr === 'gender'}}">
|
||||
<l-form-item label="性别" label-width="100rpx">
|
||||
<l-radio-group
|
||||
current="{{gender}}"
|
||||
placement="row"
|
||||
length="2"
|
||||
bind:linchange="changeGenderMp"
|
||||
l-class="radio-group"
|
||||
>
|
||||
<l-radio l-class="l-radio" wx:for="{{genderOptions}}" wx:key="id" key="{{item.value}}" placement="left">
|
||||
{{item.label}}
|
||||
</l-radio>
|
||||
</l-radio-group>
|
||||
</l-form-item>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<l-input
|
||||
hide-label="{{true}}"
|
||||
focus="{{true}}"
|
||||
value="{{mobileInput || mobile}}"
|
||||
placeholder="{{t('placeholder.mobile')}}"
|
||||
bind:lininput="inputMobileMp"
|
||||
type="number"
|
||||
>
|
||||
<l-radio l-class="l-radio" wx:for="{{genderOptions}}" wx:key="id" key="{{item.value}}" placement="left">
|
||||
{{item.label}}
|
||||
</l-radio>
|
||||
</l-radio-group>
|
||||
</l-form-item>
|
||||
<l-button
|
||||
slot="right"
|
||||
size="mini"
|
||||
bind:lintap="confirmMobileInputMp"
|
||||
disabled="{{!mobileInputLegal}}"
|
||||
>
|
||||
{{t('common::confirm')}}
|
||||
</l-button>
|
||||
</l-input>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</l-popup>
|
||||
|
|
@ -13,7 +13,8 @@
|
|||
"unbindingWechat": "确定解绑微信账号",
|
||||
"placeholder": {
|
||||
"nickname": "请输入昵称,长度不超过20",
|
||||
"Captcha": "输入4位短信验证码"
|
||||
"Captcha": "输入4位短信验证码",
|
||||
"mobile": "输入11位手机号"
|
||||
},
|
||||
"unset": "未设置",
|
||||
"unknown": "未知",
|
||||
|
|
|
|||
|
|
@ -27,11 +27,12 @@ type DataProps = {
|
|||
userStateColor: string;
|
||||
idStateStr: string;
|
||||
idStateColor: string;
|
||||
isCreation: boolean;
|
||||
editable: boolean;
|
||||
};
|
||||
type MethodsProps = {
|
||||
goChangeMobile: () => void;
|
||||
goChangePassword: () => void;
|
||||
editMobile: () => void;
|
||||
editPassword: () => void;
|
||||
goAuthenticate: () => void;
|
||||
setAvatar: () => void;
|
||||
refreshWechatPublicUserInfo: () => void;
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import OakAvatar from '../../../components/extraFile/avatar';
|
|||
import Style from './mobile.module.less';
|
||||
export default function render(props) {
|
||||
const { data, methods } = props;
|
||||
const { t, clean, goChangeMobile, goAuthenticate, refreshWechatPublicUserInfo, goChangePassword, editNickname, editName, editGender, cancelEdit, update, editBirth, execute, } = methods;
|
||||
const { oakFullpath, executable, nickname, name, birth, gender, mobile, id, canSyncPublic, refreshing, editAttr, genderOptions, oakDirty, nnDirty, birthDirty, nameDirty, genderDirty, userStateColor, userStateStr, idStateColor, idStateStr, editable, } = data;
|
||||
const { t, clean, editMobile, goAuthenticate, refreshWechatPublicUserInfo, editPassword, editNickname, editName, editGender, cancelEdit, update, editBirth, execute, } = methods;
|
||||
const { oakFullpath, executable, nickname, name, birth, gender, mobile, isCreation, id, canSyncPublic, refreshing, editAttr, genderOptions, oakDirty, nnDirty, birthDirty, nameDirty, genderDirty, userStateColor, userStateStr, idStateColor, idStateStr, editable, } = data;
|
||||
return (<div className={Style.container}>
|
||||
<div className={Style['avatar_container']}>
|
||||
<OakAvatar oakAutoUnmount={true} oakPath={oakFullpath + '.extraFile$entity'} entity="user" entityId={id} autoUpload={true}/>
|
||||
|
|
@ -48,16 +48,16 @@ export default function render(props) {
|
|||
</div>} onClick={editAttr === 'birth' ? undefined : () => editBirth()}>
|
||||
{t('user:attr.birth')}
|
||||
</List.Item>
|
||||
<List.Item extra={mobile ? mobile : t('unset')} onClick={() => {
|
||||
goChangeMobile();
|
||||
}}>
|
||||
{!isCreation && <List.Item extra={mobile ? mobile : t('unset')} onClick={() => {
|
||||
editMobile();
|
||||
}}>
|
||||
{t('mobile')}
|
||||
</List.Item>
|
||||
<List.Item extra={'********'} onClick={() => {
|
||||
goChangePassword();
|
||||
}}>
|
||||
</List.Item>}
|
||||
{!isCreation && <List.Item extra={'********'} onClick={() => {
|
||||
editPassword();
|
||||
}}>
|
||||
{t('password')}
|
||||
</List.Item>
|
||||
</List.Item>}
|
||||
<List.Item extra={<Tag fill="outline" color={userStateColor}>
|
||||
{userStateStr}
|
||||
</Tag>}>
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@ export default function Render(props: WebComponentProps<EntityDict, 'user', fals
|
|||
userStateColor: string;
|
||||
idStateStr: string;
|
||||
idStateColor: string;
|
||||
isCreation: boolean;
|
||||
editable: boolean;
|
||||
}, {
|
||||
goUserManage: () => void;
|
||||
goChangeMobile: () => void;
|
||||
editMobile: () => void;
|
||||
sendCaptcha: () => void;
|
||||
goChangePassword: () => void;
|
||||
editPassword: () => void;
|
||||
goAuthenticate: () => void;
|
||||
updateMyInfo: () => void;
|
||||
unbindingWechat: (captcha?: string) => void;
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ import WechatUserList from '../../../components/wechatUser/bindingList';
|
|||
import Style from './web.module.less';
|
||||
export default function Render(props) {
|
||||
const { data, methods } = props;
|
||||
const { t, updateMyInfo, goChangeMobile, goAuthenticate, sendCaptcha, unbindingWechat, goChangePassword, goUserManage, } = methods;
|
||||
const { nickname, name, birth, gender, mobile, oakExecuting, genderOptions, oakFullpath, oakDirty, wechatUser, editable, userStateColor, userStateStr, idStateColor, idStateStr, isRoot, } = data;
|
||||
const { t, updateMyInfo, editMobile, goAuthenticate, sendCaptcha, unbindingWechat, editPassword, } = methods;
|
||||
const { nickname, name, birth, gender, mobile, oakExecuting, genderOptions, oakFullpath, oakDirty, wechatUser, editable, userStateColor, userStateStr, idStateColor, idStateStr, isRoot, isCreation, } = data;
|
||||
const [open, setOpen] = useState(false);
|
||||
const [open2, setOpen2] = useState(false);
|
||||
return (<div className={Style.container}>
|
||||
|
|
@ -79,7 +79,7 @@ export default function Render(props) {
|
|||
</Card>
|
||||
<div style={{ marginTop: 10 }}></div>
|
||||
|
||||
<Card title={t('secuInfo')}>
|
||||
{!isCreation && <Card title={t('secuInfo')}>
|
||||
<Form labelCol={{ xs: { span: 4 }, md: { span: 6 } }} wrapperCol={{ xs: { span: 16 }, md: { span: 12 } }}>
|
||||
<Form.Item label={t('user:attr.userState')}>
|
||||
<Space>
|
||||
|
|
@ -98,12 +98,12 @@ export default function Render(props) {
|
|||
<Space>
|
||||
<Typography>{mobile || t('unset')}</Typography>
|
||||
{editable && <Button size="small" onClick={() => {
|
||||
if (mobile) {
|
||||
goChangeMobile();
|
||||
return;
|
||||
}
|
||||
setOpen(true);
|
||||
}}>
|
||||
if (mobile) {
|
||||
editMobile();
|
||||
return;
|
||||
}
|
||||
setOpen(true);
|
||||
}}>
|
||||
{mobile ? t('manage') : t('bind')}
|
||||
</Button>}
|
||||
</Space>
|
||||
|
|
@ -112,9 +112,9 @@ export default function Render(props) {
|
|||
<Space>
|
||||
<Typography>{'********'}</Typography>
|
||||
{editable && <Button disabled={!editable} size="small" onClick={() => {
|
||||
goChangePassword();
|
||||
return;
|
||||
}}>
|
||||
editPassword();
|
||||
return;
|
||||
}}>
|
||||
{t('manage')}
|
||||
</Button>}
|
||||
</Space>
|
||||
|
|
@ -126,17 +126,17 @@ export default function Render(props) {
|
|||
{wechatUser.nickname}
|
||||
</Typography>
|
||||
<WechatUserList oakPath={oakFullpath
|
||||
? `${oakFullpath}.wechatUser$user`
|
||||
: undefined}/>
|
||||
? `${oakFullpath}.wechatUser$user`
|
||||
: undefined}/>
|
||||
</Space>) : (<Button size="small" disabled={!editable} onClick={() => {
|
||||
setOpen2(true);
|
||||
}}>
|
||||
setOpen2(true);
|
||||
}}>
|
||||
{t('bind')}
|
||||
</Button>)}
|
||||
</>
|
||||
</Form.Item>)}
|
||||
</Form>
|
||||
</Card>
|
||||
</Card>}
|
||||
|
||||
<Modal title={t('bindMobile')} open={open} destroyOnClose={true} footer={null} onCancel={() => {
|
||||
setOpen(false);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { EntityDict } from '../../../oak-app-domain';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, false, {
|
||||
type: "bind" | "login";
|
||||
type: "login" | "bind";
|
||||
url: string;
|
||||
size: undefined;
|
||||
}>) => React.ReactElement;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@ export default OakComponent({
|
|||
content.key = config.button[currentIndex].sub_button[index].key || content.key;
|
||||
config.button[currentIndex].sub_button[index] = content;
|
||||
changeConfig(config);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
content.name = config.button[index].name;
|
||||
content.key = config.button[index].key || content.key;
|
||||
content.sub_button = [...config.button[index].sub_button];
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import React from 'react';
|
||||
import { Input } from 'antd';
|
||||
import Style from './web.module.less';
|
||||
import "@wangeditor/editor/dist/css/style.css"; // 引入 css
|
||||
import { Editor, Toolbar } from "@wangeditor/editor-for-react";
|
||||
import { Input } from 'antd';
|
||||
const toolbarConfig = {
|
||||
excludeKeys: [
|
||||
"blockquote",
|
||||
|
|
@ -25,25 +24,35 @@ export default function Render(props) {
|
|||
const { value, editor, getDecidedMenuContent } = props.data;
|
||||
const { setEditor, setHtml } = props.methods;
|
||||
return (<div className={Style.container}>
|
||||
{/* <Toolbar editor={editor} defaultConfig={toolbarConfig} mode="default" style={{
|
||||
borderBottom: '1px solid #ccc',
|
||||
}}/>
|
||||
<Editor defaultConfig={{
|
||||
placeholder: '请输入内容...',
|
||||
}} value={value} onCreated={setEditor} onChange={(editorDom) => {
|
||||
const html = editorDom.getHtml();
|
||||
if (html && html !== '<p><br></p>') {
|
||||
getDecidedMenuContent(html);
|
||||
}
|
||||
}} mode="default" style={{
|
||||
minHeight: 200,
|
||||
maxHeight: 400,
|
||||
overflowY: 'auto',
|
||||
}}/> */}
|
||||
<Input.TextArea rows={4}
|
||||
{/* <Toolbar
|
||||
editor={editor}
|
||||
defaultConfig={toolbarConfig}
|
||||
mode="default"
|
||||
style={{
|
||||
borderBottom: '1px solid #ccc',
|
||||
}}
|
||||
/>
|
||||
<Editor
|
||||
defaultConfig={{
|
||||
placeholder: '请输入内容...',
|
||||
}}
|
||||
value={value}
|
||||
onChange={(e) => {
|
||||
getDecidedMenuContent(e.target.value.trim());
|
||||
}} />
|
||||
</div>);
|
||||
onCreated={setEditor}
|
||||
onChange={(editorDom: any) => {
|
||||
const html = editorDom.getHtml();
|
||||
if(html && html !== '<p><br></p>') {
|
||||
getDecidedMenuContent(html);
|
||||
}
|
||||
}}
|
||||
mode="default"
|
||||
style={{
|
||||
minHeight: 200,
|
||||
maxHeight: 400,
|
||||
overflowY: 'auto',
|
||||
}}
|
||||
/> */}
|
||||
<Input.TextArea rows={4} value={value} onChange={(e) => {
|
||||
getDecidedMenuContent(e.target.value?.trim());
|
||||
}}/>
|
||||
</div>);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,38 +156,6 @@ const i18ns = [
|
|||
"moreThanOne": "多于一条手机号"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "d558d71567b4e379250a5f2cd43e4a27",
|
||||
namespace: "oak-general-business-c-paper-detail",
|
||||
language: "zh-CN",
|
||||
module: "oak-general-business",
|
||||
position: "src/components/paper/detail",
|
||||
data: {
|
||||
"detail": "详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "992af92da3504b0ec27f55a4ac4e2432",
|
||||
namespace: "oak-general-business-c-paper-list",
|
||||
language: "zh-CN",
|
||||
module: "oak-general-business",
|
||||
position: "src/components/paper/list",
|
||||
data: {
|
||||
"action": {
|
||||
"add": "添加"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "6cedaa26d9738d509c3c99ad06064282",
|
||||
namespace: "oak-general-business-c-paper-preview",
|
||||
language: "zh-CN",
|
||||
module: "oak-general-business",
|
||||
position: "src/components/paper/preview",
|
||||
data: {
|
||||
"detail": "预览"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "9bdbb9993789ecd48e7b0e10b7117620",
|
||||
namespace: "oak-general-business-c-passport",
|
||||
|
|
@ -325,7 +293,8 @@ const i18ns = [
|
|||
"unbindingWechat": "确定解绑微信账号",
|
||||
"placeholder": {
|
||||
"nickname": "请输入昵称,长度不超过20",
|
||||
"Captcha": "输入4位短信验证码"
|
||||
"Captcha": "输入4位短信验证码",
|
||||
"mobile": "输入11位手机号"
|
||||
},
|
||||
"unset": "未设置",
|
||||
"unknown": "未知",
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
declare const _default: (import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "passport", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "system", 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>> | 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, "extraFile", 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, "address", 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, "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, "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>>)[];
|
||||
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>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "system", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "passport", import("..").BRC<import("../oak-app-domain").EntityDict>>)[];
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export declare function createToDo<ED extends EntityDict & BaseEntityDict, T ext
|
|||
redirectTo: EntityDict['toDo']['OpSchema']['redirectTo'];
|
||||
entity: any;
|
||||
entityId: string;
|
||||
}, userIds?: string[]): Promise<1 | 0>;
|
||||
}, userIds?: string[]): Promise<0 | 1>;
|
||||
/**
|
||||
* 完成todo例程,当在entity对象上进行action操作时(操作条件是filter),将对应的todo完成
|
||||
* 必须在entity的action的后trigger中调用
|
||||
|
|
|
|||
|
|
@ -158,38 +158,6 @@ const i18ns = [
|
|||
"moreThanOne": "多于一条手机号"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "d558d71567b4e379250a5f2cd43e4a27",
|
||||
namespace: "oak-general-business-c-paper-detail",
|
||||
language: "zh-CN",
|
||||
module: "oak-general-business",
|
||||
position: "src/components/paper/detail",
|
||||
data: {
|
||||
"detail": "详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "992af92da3504b0ec27f55a4ac4e2432",
|
||||
namespace: "oak-general-business-c-paper-list",
|
||||
language: "zh-CN",
|
||||
module: "oak-general-business",
|
||||
position: "src/components/paper/list",
|
||||
data: {
|
||||
"action": {
|
||||
"add": "添加"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "6cedaa26d9738d509c3c99ad06064282",
|
||||
namespace: "oak-general-business-c-paper-preview",
|
||||
language: "zh-CN",
|
||||
module: "oak-general-business",
|
||||
position: "src/components/paper/preview",
|
||||
data: {
|
||||
"detail": "预览"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "9bdbb9993789ecd48e7b0e10b7117620",
|
||||
namespace: "oak-general-business-c-passport",
|
||||
|
|
@ -327,7 +295,8 @@ const i18ns = [
|
|||
"unbindingWechat": "确定解绑微信账号",
|
||||
"placeholder": {
|
||||
"nickname": "请输入昵称,长度不超过20",
|
||||
"Captcha": "输入4位短信验证码"
|
||||
"Captcha": "输入4位短信验证码",
|
||||
"mobile": "输入11位手机号"
|
||||
},
|
||||
"unset": "未设置",
|
||||
"unknown": "未知",
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
declare const _default: (import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "passport", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "system", 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>> | 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, "extraFile", 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, "address", 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, "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, "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>>)[];
|
||||
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>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "system", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "passport", import("..").BRC<import("../oak-app-domain").EntityDict>>)[];
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export declare function createToDo<ED extends EntityDict & BaseEntityDict, T ext
|
|||
redirectTo: EntityDict['toDo']['OpSchema']['redirectTo'];
|
||||
entity: any;
|
||||
entityId: string;
|
||||
}, userIds?: string[]): Promise<1 | 0>;
|
||||
}, userIds?: string[]): Promise<0 | 1>;
|
||||
/**
|
||||
* 完成todo例程,当在entity对象上进行action操作时(操作条件是filter),将对应的todo完成
|
||||
* 必须在entity的action的后trigger中调用
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
|||
import { OakOperationUnpermittedException } from 'oak-domain/lib/types';
|
||||
import dayjs from 'dayjs';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { isMobile } from 'oak-domain/lib/utils/validator';
|
||||
|
||||
export default OakComponent({
|
||||
entity: 'user',
|
||||
|
|
@ -69,6 +70,7 @@ export default OakComponent({
|
|||
nickname: 1,
|
||||
},
|
||||
},
|
||||
hasPassword: 1,
|
||||
},
|
||||
isList: false,
|
||||
formData({ data: user, features, origin }) {
|
||||
|
|
@ -98,6 +100,7 @@ export default OakComponent({
|
|||
return {
|
||||
id: user?.id,
|
||||
name: user?.name,
|
||||
hasPassword: user?.password || user?.hasPassword,
|
||||
nameDirty: origin && user?.name !== origin?.name,
|
||||
nickname: user?.nickname,
|
||||
nnDirty: origin && user?.nickname !== origin?.nickname,
|
||||
|
|
@ -124,6 +127,7 @@ export default OakComponent({
|
|||
canSyncPublic,
|
||||
editable,
|
||||
executable,
|
||||
isCreation: this.isCreation(),
|
||||
};
|
||||
},
|
||||
data: {
|
||||
|
|
@ -149,14 +153,17 @@ export default OakComponent({
|
|||
},
|
||||
],
|
||||
refreshing: false,
|
||||
|
||||
editAttr: '',
|
||||
mobileInput: '',
|
||||
mobileInputLegal: false,
|
||||
|
||||
},
|
||||
actions: ['update'],
|
||||
properties: {
|
||||
changeMobileUrl: '',
|
||||
changePasswordUrl: '',
|
||||
authenticateUrl: '',
|
||||
onConfirm: () => undefined as void,
|
||||
},
|
||||
methods: {
|
||||
checkEditable(attr: string) {
|
||||
|
|
@ -192,21 +199,33 @@ export default OakComponent({
|
|||
throw err;
|
||||
}
|
||||
},
|
||||
goChangeMobile() {
|
||||
editMobile() {
|
||||
this.checkEditable('nickname');
|
||||
if (this.state.isCreation) {
|
||||
this.setState({
|
||||
editAttr: 'mobile',
|
||||
});
|
||||
return;
|
||||
}
|
||||
const { changeMobileUrl, oakId } = this.props;
|
||||
if (changeMobileUrl) {
|
||||
this.navigateTo({
|
||||
url: changeMobileUrl,
|
||||
oakId,
|
||||
userId: oakId,
|
||||
});
|
||||
}
|
||||
else if (process.env.NODE_ENV === 'development') {
|
||||
console.warn('changeMobileUrl unset');
|
||||
}
|
||||
},
|
||||
goChangePassword() {
|
||||
editPassword() {
|
||||
this.checkEditable('password');
|
||||
if (this.state.isCreation) {
|
||||
this.setState({
|
||||
editAttr: 'password',
|
||||
});
|
||||
return;
|
||||
}
|
||||
const { changePasswordUrl, oakId } = this.props;
|
||||
if (changePasswordUrl) {
|
||||
this.navigateTo({
|
||||
|
|
@ -279,6 +298,15 @@ export default OakComponent({
|
|||
birth,
|
||||
});
|
||||
},
|
||||
|
||||
changePasswordMp(e: WechatMiniprogram.Input) {
|
||||
const { value } = e.detail;
|
||||
this.update({
|
||||
password: value,
|
||||
hasPassword: !!value,
|
||||
});
|
||||
},
|
||||
|
||||
changeNicknameMp(e: WechatMiniprogram.Input) {
|
||||
const { value } = e.detail;
|
||||
this.update({
|
||||
|
|
@ -291,6 +319,30 @@ export default OakComponent({
|
|||
name: value,
|
||||
});
|
||||
},
|
||||
inputMobileMp(e: WechatMiniprogram.Input) {
|
||||
const { value } = e.detail;
|
||||
const mobileInputLegal = !!isMobile(value);
|
||||
this.setState({
|
||||
mobileInput: value,
|
||||
mobileInputLegal,
|
||||
});
|
||||
},
|
||||
async confirmMobileInputMp() {
|
||||
const { mobileInput } = this.state;
|
||||
this.update({
|
||||
mobile$user: [
|
||||
{
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'create',
|
||||
data: {
|
||||
id: await generateNewIdAsync(),
|
||||
mobile: mobileInput,
|
||||
ableState: 'enabled',
|
||||
}
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
async unbindingWechat(captcha?: string) {
|
||||
const { mobile, wechatUser } = this.state;
|
||||
try {
|
||||
|
|
@ -348,6 +400,8 @@ export default OakComponent({
|
|||
async onConfirm() {
|
||||
await this.execute();
|
||||
this.reRender();
|
||||
const { onConfirm } = this.props;
|
||||
onConfirm && onConfirm();
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -77,11 +77,26 @@
|
|||
</block>
|
||||
</view>
|
||||
</l-list>
|
||||
<l-list title="手机号" bind:lintap="goChangeMobile">
|
||||
<l-list title="手机号" bind:lintap="editMobile">
|
||||
<view slot="right-section" class="value">{{mobile || '未绑定'}}</view>
|
||||
</l-list>
|
||||
<l-list title="密码" bind:lintap="goChangePassword">
|
||||
<view slot="right-section" class="value">******</view>
|
||||
<l-list title="密码" bind:lintap="editPassword">
|
||||
<block wx:if="{{editAttr==='password'}}">
|
||||
<input
|
||||
slot="right-section"
|
||||
value="{{password}}"
|
||||
focus
|
||||
password
|
||||
placeholder="请输入密码"
|
||||
bindchange="changePasswordMp"
|
||||
bindconfirm="cancelEdit"
|
||||
bindblur="cancelEdit"
|
||||
disabled="{{!editable}}"
|
||||
/>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<view slot="right-section" class="value">{{hasPassword ? '******' : '未设置'}}</view>
|
||||
</block>
|
||||
</l-list>
|
||||
<l-list tag-position="right" is-link="{{false}}" title="用户状态">
|
||||
<view slot="right-section" class="value">
|
||||
|
|
@ -108,25 +123,46 @@
|
|||
</block>
|
||||
</view>
|
||||
<l-popup
|
||||
show="{{editAttr === 'gender'}}"
|
||||
show="{{editAttr === 'gender' || editAttr === 'mobile'}}"
|
||||
content-align="bottom"
|
||||
bind:lintap="cancelEdit"
|
||||
>
|
||||
<view class='popup-content'>
|
||||
<view class='popup-form'>
|
||||
<l-form-item label="性别" label-width="100rpx">
|
||||
<l-radio-group
|
||||
current="{{gender}}"
|
||||
placement="row"
|
||||
length="2"
|
||||
bind:linchange="changeGenderMp"
|
||||
l-class="radio-group"
|
||||
<block wx:if="{{editAttr === 'gender'}}">
|
||||
<l-form-item label="性别" label-width="100rpx">
|
||||
<l-radio-group
|
||||
current="{{gender}}"
|
||||
placement="row"
|
||||
length="2"
|
||||
bind:linchange="changeGenderMp"
|
||||
l-class="radio-group"
|
||||
>
|
||||
<l-radio l-class="l-radio" wx:for="{{genderOptions}}" wx:key="id" key="{{item.value}}" placement="left">
|
||||
{{item.label}}
|
||||
</l-radio>
|
||||
</l-radio-group>
|
||||
</l-form-item>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<l-input
|
||||
hide-label="{{true}}"
|
||||
focus="{{true}}"
|
||||
value="{{mobileInput || mobile}}"
|
||||
placeholder="{{t('placeholder.mobile')}}"
|
||||
bind:lininput="inputMobileMp"
|
||||
type="number"
|
||||
>
|
||||
<l-radio l-class="l-radio" wx:for="{{genderOptions}}" wx:key="id" key="{{item.value}}" placement="left">
|
||||
{{item.label}}
|
||||
</l-radio>
|
||||
</l-radio-group>
|
||||
</l-form-item>
|
||||
<l-button
|
||||
slot="right"
|
||||
size="mini"
|
||||
bind:lintap="confirmMobileInputMp"
|
||||
disabled="{{!mobileInputLegal}}"
|
||||
>
|
||||
{{t('common::confirm')}}
|
||||
</l-button>
|
||||
</l-input>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</l-popup>
|
||||
|
|
@ -13,7 +13,8 @@
|
|||
"unbindingWechat": "确定解绑微信账号",
|
||||
"placeholder": {
|
||||
"nickname": "请输入昵称,长度不超过20",
|
||||
"Captcha": "输入4位短信验证码"
|
||||
"Captcha": "输入4位短信验证码",
|
||||
"mobile": "输入11位手机号"
|
||||
},
|
||||
"unset": "未设置",
|
||||
"unknown": "未知",
|
||||
|
|
|
|||
|
|
@ -47,14 +47,13 @@ export default function Render(
|
|||
userStateColor: string;
|
||||
idStateStr: string;
|
||||
idStateColor: string;
|
||||
|
||||
isCreation: boolean;
|
||||
editable: boolean;
|
||||
},
|
||||
{
|
||||
goUserManage: () => void;
|
||||
goChangeMobile: () => void;
|
||||
editMobile: () => void;
|
||||
sendCaptcha: () => void;
|
||||
goChangePassword: () => void;
|
||||
editPassword: () => void;
|
||||
goAuthenticate: () => void;
|
||||
updateMyInfo: () => void;
|
||||
unbindingWechat: (captcha?: string) => void;
|
||||
|
|
@ -65,12 +64,11 @@ export default function Render(
|
|||
const {
|
||||
t,
|
||||
updateMyInfo,
|
||||
goChangeMobile,
|
||||
editMobile,
|
||||
goAuthenticate,
|
||||
sendCaptcha,
|
||||
unbindingWechat,
|
||||
goChangePassword,
|
||||
goUserManage,
|
||||
editPassword,
|
||||
} = methods;
|
||||
const {
|
||||
nickname,
|
||||
|
|
@ -89,6 +87,7 @@ export default function Render(
|
|||
idStateColor,
|
||||
idStateStr,
|
||||
isRoot,
|
||||
isCreation,
|
||||
} = data;
|
||||
const [open, setOpen] = useState(false);
|
||||
const [open2, setOpen2] = useState(false);
|
||||
|
|
@ -217,7 +216,7 @@ export default function Render(
|
|||
</Card>
|
||||
<div style={{ marginTop: 10 }}></div>
|
||||
|
||||
<Card title={t('secuInfo')}>
|
||||
{!isCreation && <Card title={t('secuInfo')}>
|
||||
<Form
|
||||
labelCol={{ xs: { span: 4 }, md: { span: 6 } }}
|
||||
wrapperCol={{ xs: { span: 16 }, md: { span: 12 } }}
|
||||
|
|
@ -245,7 +244,7 @@ export default function Render(
|
|||
size="small"
|
||||
onClick={() => {
|
||||
if (mobile) {
|
||||
goChangeMobile();
|
||||
editMobile();
|
||||
return;
|
||||
}
|
||||
setOpen(true);
|
||||
|
|
@ -262,7 +261,7 @@ export default function Render(
|
|||
disabled={!editable}
|
||||
size="small"
|
||||
onClick={() => {
|
||||
goChangePassword();
|
||||
editPassword();
|
||||
return;
|
||||
}}
|
||||
>
|
||||
|
|
@ -301,7 +300,7 @@ export default function Render(
|
|||
</Form.Item>
|
||||
)}
|
||||
</Form>
|
||||
</Card>
|
||||
</Card>}
|
||||
|
||||
<Modal
|
||||
title={t('bindMobile')}
|
||||
|
|
|
|||
|
|
@ -40,13 +40,14 @@ type DataProps = {
|
|||
userStateColor: string;
|
||||
idStateStr: string;
|
||||
idStateColor: string;
|
||||
isCreation: boolean;
|
||||
|
||||
editable: boolean;
|
||||
};
|
||||
|
||||
type MethodsProps = {
|
||||
goChangeMobile: () => void;
|
||||
goChangePassword: () => void;
|
||||
editMobile: () => void;
|
||||
editPassword: () => void;
|
||||
goAuthenticate: () => void;
|
||||
setAvatar: () => void;
|
||||
refreshWechatPublicUserInfo: () => void;
|
||||
|
|
@ -64,10 +65,10 @@ export default function render(
|
|||
const {
|
||||
t,
|
||||
clean,
|
||||
goChangeMobile,
|
||||
editMobile,
|
||||
goAuthenticate,
|
||||
refreshWechatPublicUserInfo,
|
||||
goChangePassword,
|
||||
editPassword,
|
||||
editNickname,
|
||||
editName,
|
||||
editGender,
|
||||
|
|
@ -84,6 +85,7 @@ export default function render(
|
|||
birth,
|
||||
gender,
|
||||
mobile,
|
||||
isCreation,
|
||||
id,
|
||||
canSyncPublic,
|
||||
refreshing,
|
||||
|
|
@ -202,22 +204,22 @@ export default function render(
|
|||
>
|
||||
{t('user:attr.birth')}
|
||||
</List.Item>
|
||||
<List.Item
|
||||
{!isCreation && <List.Item
|
||||
extra={mobile ? mobile : t('unset')}
|
||||
onClick={() => {
|
||||
goChangeMobile();
|
||||
editMobile();
|
||||
}}
|
||||
>
|
||||
{t('mobile')}
|
||||
</List.Item>
|
||||
<List.Item
|
||||
</List.Item>}
|
||||
{!isCreation && <List.Item
|
||||
extra={'********'}
|
||||
onClick={() => {
|
||||
goChangePassword();
|
||||
editPassword();
|
||||
}}
|
||||
>
|
||||
{t('password')}
|
||||
</List.Item>
|
||||
</List.Item>}
|
||||
<List.Item
|
||||
extra={
|
||||
<Tag fill="outline" color={userStateColor}>
|
||||
|
|
|
|||
|
|
@ -158,38 +158,6 @@ const i18ns: I18n[] = [
|
|||
"moreThanOne": "多于一条手机号"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "d558d71567b4e379250a5f2cd43e4a27",
|
||||
namespace: "oak-general-business-c-paper-detail",
|
||||
language: "zh-CN",
|
||||
module: "oak-general-business",
|
||||
position: "src/components/paper/detail",
|
||||
data: {
|
||||
"detail": "详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "992af92da3504b0ec27f55a4ac4e2432",
|
||||
namespace: "oak-general-business-c-paper-list",
|
||||
language: "zh-CN",
|
||||
module: "oak-general-business",
|
||||
position: "src/components/paper/list",
|
||||
data: {
|
||||
"action": {
|
||||
"add": "添加"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "6cedaa26d9738d509c3c99ad06064282",
|
||||
namespace: "oak-general-business-c-paper-preview",
|
||||
language: "zh-CN",
|
||||
module: "oak-general-business",
|
||||
position: "src/components/paper/preview",
|
||||
data: {
|
||||
"detail": "预览"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "9bdbb9993789ecd48e7b0e10b7117620",
|
||||
namespace: "oak-general-business-c-passport",
|
||||
|
|
@ -327,7 +295,8 @@ const i18ns: I18n[] = [
|
|||
"unbindingWechat": "确定解绑微信账号",
|
||||
"placeholder": {
|
||||
"nickname": "请输入昵称,长度不超过20",
|
||||
"Captcha": "输入4位短信验证码"
|
||||
"Captcha": "输入4位短信验证码",
|
||||
"mobile": "输入11位手机号"
|
||||
},
|
||||
"unset": "未设置",
|
||||
"unknown": "未知",
|
||||
|
|
|
|||
Loading…
Reference in New Issue