You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
const apiOrders = {
/**
* 订单创建
*/
add : ( params ) => {
return uni . $u . http . post ( "/orders" , {
tickets : params . tickets . map ( ( tkt ) => ( {
trainNo : tkt . trainNo , // 车次
from : tkt . from , // 上车
to : tkt . to , // 下车
date : uni . $u . dayjs ( tkt . date ) . format ( "YYYY/MM/DD" ) , // 乘车日期( python 后端要求这样转,按道理应该带上时区让后端处理)
seatClass : 0 , // (暂无)座位类型,一等座/二等座(不同车次叫法不一样)
passengerId : tkt . passengerId , // 乘车人( 这种写法是不支持添加乘车人的, 因为你不知道他人id)
} ) ) ,
} ) ;
} ,
/**
* 订单支付
*/
payment : ( params ) => {
return uni . $u . http . post ( ` /bank/pay ` , {
orderNo : params . orderNo ,
} ) ;
} ,
/**
* 订单支付查询
*/
queryPayment : ( params ) => {
return uni . $u . http . post ( ` /orders/ ${ params . orderNo } /query_payment ` ) ;
} ,
} ;
export default apiOrders ;