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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { getApiBase } from '@utils/apiConfig';
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: getApiBase(),
|
||||
timeout: 10000,
|
||||
timeout: 30000, // 增加到 30 秒,因为首次需要从微信 API 获取 access_token 和 jsapi_ticket
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user