程序二维码分享组件, 支持传入size 显示二维码大小
This commit is contained in:
parent
983d55e97a
commit
d89a0a27ef
|
|
@ -3,7 +3,7 @@
|
|||
<image src="{{url}}" mode="aspectFit" class="image" />
|
||||
</block>
|
||||
<block wx:elif="{{qrcodeURL}}">
|
||||
<image class="image" src="{{qrcodeURL}}" mode="aspectFit" class="image" />
|
||||
<image src="{{qrcodeURL}}" mode="aspectFit" class="image" />
|
||||
</block>
|
||||
|
||||
<block wx:if="{{expiresAtStr}}">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "userEntityGrant", false, {
|
||||
disableDownload: boolean;
|
||||
size: number;
|
||||
}>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -69,5 +69,6 @@ export default OakComponent({
|
|||
},
|
||||
properties: {
|
||||
disableDownload: false,
|
||||
size: 280,
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<l-loading show="{{true}}" type="circle"></l-loading>
|
||||
</block>
|
||||
<block wx:elif="{{url}}">
|
||||
<qrCode url="{{url}}" expiresAt="{{expiresAt}}" disableDownload="{{disableDownload}}" />
|
||||
<qrCode url="{{url}}" expiresAt="{{expiresAt}}" disableDownload="{{disableDownload}}" size="{{size}}" />
|
||||
</block>
|
||||
<block wx:else>
|
||||
</block>
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@ export default function Render(props: WebComponentProps<EntityDict, 'userEntityG
|
|||
url: string;
|
||||
expiresAt: number;
|
||||
disableDownload: boolean;
|
||||
size: number;
|
||||
}, {}>): React.JSX.Element | null;
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ import React from 'react';
|
|||
import QrCode from '../../common/qrCode';
|
||||
import { DotLoading } from 'antd-mobile';
|
||||
export default function Render(props) {
|
||||
const { url, expiresAt, oakLoading, disableDownload } = props.data;
|
||||
const { url, expiresAt, oakLoading, disableDownload, size } = props.data;
|
||||
if (oakLoading) {
|
||||
return <DotLoading color="primary"/>;
|
||||
}
|
||||
if (url) {
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload}/>;
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload} size={size}/>;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@ export default function Render(props: WebComponentProps<EntityDict, 'userEntityG
|
|||
url: string;
|
||||
expiresAt: number;
|
||||
disableDownload: boolean;
|
||||
size: number;
|
||||
}, {}>): React.JSX.Element | null;
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ import React from 'react';
|
|||
import QrCode from '../../common/qrCode';
|
||||
import { Spin } from 'antd';
|
||||
export default function Render(props) {
|
||||
const { url, expiresAt, oakLoading, disableDownload } = props.data;
|
||||
const { url, expiresAt, oakLoading, disableDownload, size } = props.data;
|
||||
if (oakLoading) {
|
||||
return <Spin />;
|
||||
}
|
||||
if (url) {
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload}/>;
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload} size={size}/>;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "wechatQrCode", false, {
|
||||
disableDownload: boolean;
|
||||
size: number;
|
||||
}>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ export default OakComponent({
|
|||
};
|
||||
},
|
||||
properties: {
|
||||
disableDownload: false
|
||||
disableDownload: false,
|
||||
size: 280
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<l-loading show="{{true}}" type="circle"></l-loading>
|
||||
</block>
|
||||
<block wx:elif="{{url}}">
|
||||
<qrCode url="{{url}}" expiresAt="{{expiresAt}}" disableDownload="{{disableDownload}}" />
|
||||
<qrCode url="{{url}}" expiresAt="{{expiresAt}}" disableDownload="{{disableDownload}}" size="{{size}}" />
|
||||
</block>
|
||||
<block wx:else>
|
||||
</block>
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@ export default function Render(props: WebComponentProps<EntityDict, 'wechatQrCod
|
|||
url: string;
|
||||
expiresAt: number;
|
||||
disableDownload: boolean;
|
||||
size: number;
|
||||
}, {}>): React.JSX.Element | null;
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ import React from 'react';
|
|||
import QrCode from '../../common/qrCode';
|
||||
import { DotLoading } from 'antd-mobile';
|
||||
export default function Render(props) {
|
||||
const { url, expiresAt, oakLoading, disableDownload } = props.data;
|
||||
const { url, expiresAt, oakLoading, disableDownload, size } = props.data;
|
||||
if (oakLoading) {
|
||||
return <DotLoading color="primary"/>;
|
||||
}
|
||||
if (url) {
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload}/>;
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload} size={size}/>;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@ export default function Render(props: WebComponentProps<EntityDict, 'wechatQrCod
|
|||
url: string;
|
||||
expiresAt: number;
|
||||
disableDownload: boolean;
|
||||
size: number;
|
||||
}, {}>): React.JSX.Element | null;
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ import React from 'react';
|
|||
import QrCode from '../../common/qrCode';
|
||||
import { Spin } from 'antd';
|
||||
export default function Render(props) {
|
||||
const { url, expiresAt, oakLoading, disableDownload } = props.data;
|
||||
const { url, expiresAt, oakLoading, disableDownload, size } = props.data;
|
||||
if (oakLoading) {
|
||||
return <Spin />;
|
||||
}
|
||||
if (url) {
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload}/>;
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload} size={size}/>;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<image src="{{url}}" mode="aspectFit" class="image" />
|
||||
</block>
|
||||
<block wx:elif="{{qrcodeURL}}">
|
||||
<image class="image" src="{{qrcodeURL}}" mode="aspectFit" class="image" />
|
||||
<image src="{{qrcodeURL}}" mode="aspectFit" class="image" />
|
||||
</block>
|
||||
|
||||
<block wx:if="{{expiresAtStr}}">
|
||||
|
|
|
|||
|
|
@ -71,5 +71,6 @@ export default OakComponent({
|
|||
},
|
||||
properties: {
|
||||
disableDownload: false,
|
||||
size: 280,
|
||||
},
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
<l-loading show="{{true}}" type="circle"></l-loading>
|
||||
</block>
|
||||
<block wx:elif="{{url}}">
|
||||
<qrCode url="{{url}}" expiresAt="{{expiresAt}}" disableDownload="{{disableDownload}}" />
|
||||
<qrCode url="{{url}}" expiresAt="{{expiresAt}}" disableDownload="{{disableDownload}}" size="{{size}}" />
|
||||
</block>
|
||||
<block wx:else>
|
||||
</block>
|
||||
|
|
|
|||
|
|
@ -13,16 +13,17 @@ export default function Render(
|
|||
url: string;
|
||||
expiresAt: number;
|
||||
disableDownload: boolean;
|
||||
size: number;
|
||||
},
|
||||
{}
|
||||
>
|
||||
) {
|
||||
const { url, expiresAt, oakLoading, disableDownload } = props.data;
|
||||
const { url, expiresAt, oakLoading, disableDownload, size } = props.data;
|
||||
if (oakLoading) {
|
||||
return <Spin />;
|
||||
}
|
||||
if (url) {
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload} />;
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload} size={size} />;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
@ -13,16 +13,17 @@ export default function Render(
|
|||
url: string;
|
||||
expiresAt: number;
|
||||
disableDownload: boolean;
|
||||
size: number;
|
||||
},
|
||||
{}
|
||||
>
|
||||
) {
|
||||
const { url, expiresAt, oakLoading, disableDownload } = props.data;
|
||||
const { url, expiresAt, oakLoading, disableDownload, size } = props.data;
|
||||
if (oakLoading) {
|
||||
return <DotLoading color="primary" />;
|
||||
}
|
||||
if (url) {
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload} />;
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload} size={size} />;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ export default OakComponent({
|
|||
};
|
||||
},
|
||||
properties: {
|
||||
disableDownload: false
|
||||
disableDownload: false,
|
||||
size: 280
|
||||
}
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
<l-loading show="{{true}}" type="circle"></l-loading>
|
||||
</block>
|
||||
<block wx:elif="{{url}}">
|
||||
<qrCode url="{{url}}" expiresAt="{{expiresAt}}" disableDownload="{{disableDownload}}" />
|
||||
<qrCode url="{{url}}" expiresAt="{{expiresAt}}" disableDownload="{{disableDownload}}" size="{{size}}" />
|
||||
</block>
|
||||
<block wx:else>
|
||||
</block>
|
||||
|
|
|
|||
|
|
@ -12,17 +12,18 @@ export default function Render(
|
|||
{
|
||||
url: string;
|
||||
expiresAt: number;
|
||||
disableDownload: boolean
|
||||
disableDownload: boolean;
|
||||
size: number;
|
||||
},
|
||||
{}
|
||||
>
|
||||
) {
|
||||
const { url, expiresAt, oakLoading, disableDownload } = props.data;
|
||||
const { url, expiresAt, oakLoading, disableDownload, size } = props.data;
|
||||
if (oakLoading) {
|
||||
return <Spin />;
|
||||
}
|
||||
if (url) {
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload} />;
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload} size={size} />;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
@ -13,16 +13,17 @@ export default function Render(
|
|||
url: string;
|
||||
expiresAt: number;
|
||||
disableDownload: boolean;
|
||||
size: number;
|
||||
},
|
||||
{}
|
||||
>
|
||||
) {
|
||||
const { url, expiresAt, oakLoading, disableDownload } = props.data;
|
||||
const { url, expiresAt, oakLoading, disableDownload, size } = props.data;
|
||||
if (oakLoading) {
|
||||
return <DotLoading color="primary" />;
|
||||
}
|
||||
if (url) {
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload} />;
|
||||
return <QrCode url={url} expiresAt={expiresAt} disableDownload={disableDownload} size={size} />;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue