Commit 1264e486 by garyZlot

use real API

parent d30ba9d2
......@@ -29,102 +29,102 @@ class Poster extends Component {
cookie: this.state.cookie
};
//axios.post((this.state.showHistory ? "/flow/v1_0/activity/activity_history" : "/flow/v1_0/activity/courier_activity"), paramData).then(res => {
axios.post((this.state.showHistory ? "/flow/v1_0/activity/activity_history" : "/flow/v1_0/activity/courier_activity"), paramData).then(res => {
//mock data
const mockRes = {
"resperr": "",
"respcd": "0000",
"respmsg": "",
"data": {
"kind": "CourierActivity",
"data": [
{
"status": 1,
"courier_record": {
"finish_count": 17,
"reward_amount": 0
},
"task_id": 2,
"remain_minutes": 58,
"start_time": "2021-03-14 19:00:40",
"end_time": "2021-03-25 19:00:40",
"type_json": [
{
"count": 12,
"price": 600
},
{
"count": 20,
"price": 1800
},
{
"count": 30,
"price": 3000
},
{
"count": 36,
"price": 6000
},
{
"count": 45,
"price": 8400
},
{
"count": 50,
"price": 11000
}
],
"reward_type": 1,
"remain_hours": 7
},
{
"status": 0,
"courier_record": {
"finish_count": 40,
"reward_amount": 0
},
"task_id": 1,
"remain_minutes": "",
"start_time": "2021-03-20 19:00:40",
"end_time": "2021-03-30 19:00:40",
"type_json": [
{
"count": 12,
"price": 600
},
{
"count": 20,
"price": 1800
},
{
"count": 30,
"price": 3000
},
{
"count": 36,
"price": 6000
},
{
"count": 45,
"price": 8400
},
{
"count": 50,
"price": 11000
}
],
"reward_type": 1,
"remain_hours": ""
}
]
}
};
const res = {
status: 200,
data: mockRes
};
// const mockRes = {
// "resperr": "",
// "respcd": "0000",
// "respmsg": "",
// "data": {
// "kind": "CourierActivity",
// "data": [
// {
// "status": 1,
// "courier_record": {
// "finish_count": 17,
// "reward_amount": 0
// },
// "task_id": 2,
// "remain_minutes": 58,
// "start_time": "2021-03-14 19:00:40",
// "end_time": "2021-03-25 19:00:40",
// "type_json": [
// {
// "count": 12,
// "price": 600
// },
// {
// "count": 20,
// "price": 1800
// },
// {
// "count": 30,
// "price": 3000
// },
// {
// "count": 36,
// "price": 6000
// },
// {
// "count": 45,
// "price": 8400
// },
// {
// "count": 50,
// "price": 11000
// }
// ],
// "reward_type": 1,
// "remain_hours": 7
// },
// {
// "status": 0,
// "courier_record": {
// "finish_count": 40,
// "reward_amount": 0
// },
// "task_id": 1,
// "remain_minutes": "",
// "start_time": "2021-03-20 19:00:40",
// "end_time": "2021-03-30 19:00:40",
// "type_json": [
// {
// "count": 12,
// "price": 600
// },
// {
// "count": 20,
// "price": 1800
// },
// {
// "count": 30,
// "price": 3000
// },
// {
// "count": 36,
// "price": 6000
// },
// {
// "count": 45,
// "price": 8400
// },
// {
// "count": 50,
// "price": 11000
// }
// ],
// "reward_type": 1,
// "remain_hours": ""
// }
// ]
// }
// };
// const res = {
// status: 200,
// data: mockRes
// };
//end mock data
......@@ -156,9 +156,9 @@ class Poster extends Component {
historyRecordArr: historyArr
});
// }).catch(error => {
// console.error(error)
// });
}).catch(error => {
console.error(error)
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment