update pay ui
This commit is contained in:
@@ -133,26 +133,31 @@ const WxOpenLaunchWeapp = ({
|
||||
...buttonStyle,
|
||||
};
|
||||
|
||||
// 加载中状态
|
||||
// 加载中状态 - 显示可点击的按钮,避免用户等待太久
|
||||
if (loading) {
|
||||
return (
|
||||
<Box display="flex" alignItems="center" justifyContent="center" py={3}>
|
||||
<Spinner size="sm" mr={2} />
|
||||
<Text fontSize="sm" color="gray.500">正在初始化...</Text>
|
||||
</Box>
|
||||
<ChakraButton
|
||||
colorScheme="green"
|
||||
isLoading
|
||||
loadingText="初始化中..."
|
||||
width="100%"
|
||||
style={buttonStyle}
|
||||
>
|
||||
{typeof children === 'string' ? children : '打开小程序'}
|
||||
</ChakraButton>
|
||||
);
|
||||
}
|
||||
|
||||
// 错误状态
|
||||
// 错误状态 - 提供重试选项
|
||||
if (error) {
|
||||
return (
|
||||
<ChakraButton
|
||||
colorScheme="gray"
|
||||
isDisabled
|
||||
colorScheme="orange"
|
||||
onClick={initWxSdk}
|
||||
width="100%"
|
||||
py={3}
|
||||
style={buttonStyle}
|
||||
>
|
||||
{error}
|
||||
点击重试
|
||||
</ChakraButton>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user