Skip to content

Commit

Permalink
fake pay
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankFang committed May 7, 2020
1 parent d8781c4 commit 941b099
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/views/Pay.tsx
@@ -1,14 +1,15 @@
import React from 'react';
import Layout from '../components/Layout';
import {withRouter} from 'react-router-dom';
import {withRouter, RouteComponentProps} from 'react-router-dom';
import {MainButton} from '../components/button/MainButton';
import Icon from '../components/Icon';
import wepay from 'images/wepay.svg';
import alipay from 'images/alipay.svg';
import {Img} from '../components/Img';
import styled from 'styled-components';
import {Stretch} from '../components/Stretch';
import {showAlert} from '../components/Dialog';
import {defaultHttpClient} from '../lib/HttpClient';
import {history} from '../lib/history';

const Payments = styled.div`
margin-top: 32px;
Expand All @@ -26,9 +27,13 @@ const Wrapper = styled.div`
const pay = () => {
showAlert('抱歉,测试环境无法支付,请使用模拟支付');
};
export const _Pay: React.FC = () => {
const fakePay = () => {

export const _Pay: React.FC<RouteComponentProps<{ id: string }>> = (props) => {
const orderId = props.match.params.id;
const fakePay = async () => {
await defaultHttpClient.patch(`/order/${orderId}`, {status: 'paid'}, {autoHandlerError: true});
showAlert('支付成功', () => {
history.push('/orders');
});
};
return (
<Layout title="支付">
Expand Down

0 comments on commit 941b099

Please sign in to comment.