update pay ui
This commit is contained in:
@@ -47,6 +47,7 @@ const generatePlainUrlScheme = (path, query) => {
|
||||
* @param {Function} [props.onSuccess] - 跳转成功回调
|
||||
* @param {Function} [props.onError] - 跳转失败回调
|
||||
* @param {Object} [props.buttonProps] - 按钮属性
|
||||
* @param {Object} [props.buttonStyle] - 按钮内联样式
|
||||
*/
|
||||
const UrlSchemeLauncher = ({
|
||||
path = '',
|
||||
@@ -55,6 +56,7 @@ const UrlSchemeLauncher = ({
|
||||
onSuccess,
|
||||
onError,
|
||||
buttonProps = {},
|
||||
buttonStyle = {},
|
||||
}) => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [openlink, setOpenlink] = useState(null);
|
||||
@@ -132,7 +134,7 @@ const UrlSchemeLauncher = ({
|
||||
// 再次尝试跳转
|
||||
const handleRetry = useCallback(() => {
|
||||
if (openlink) {
|
||||
openUrlScheme(openlink);
|
||||
window.location.href = openlink;
|
||||
}
|
||||
}, [openlink]);
|
||||
|
||||
@@ -144,6 +146,7 @@ const UrlSchemeLauncher = ({
|
||||
loadingText="正在跳转..."
|
||||
colorScheme="green"
|
||||
leftIcon={<Icon as={FiExternalLink} />}
|
||||
style={buttonStyle}
|
||||
{...buttonProps}
|
||||
>
|
||||
{children || '打开小程序'}
|
||||
|
||||
Reference in New Issue
Block a user