|
|
|
@ -16,6 +16,10 @@ const make_token = () => {
|
|
|
|
|
var authHeaderValue = 'Bearer apikey=' + apiKey + ',signature=' + hash + ',timestamp=' + timestamp;
|
|
|
|
|
return authHeaderValue;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取有效酒店编号
|
|
|
|
|
*/
|
|
|
|
|
const AvailableAccommodationIds = async (pageIndex) => {
|
|
|
|
|
const response = await get(`${HEYTRIP_API_PROD}/AvailableAccommodationIds?pageIndex=${pageIndex}`, {
|
|
|
|
|
headers: {
|
|
|
|
@ -26,6 +30,9 @@ const AvailableAccommodationIds = async (pageIndex) => {
|
|
|
|
|
return response.data.Data || [];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取酒店房型相关静态信息
|
|
|
|
|
*/
|
|
|
|
|
const AccommodationsDetails = async (body) => {
|
|
|
|
|
if (isEmpty(body.AccommodationIds)) {
|
|
|
|
|
return [];
|
|
|
|
@ -42,6 +49,9 @@ const AccommodationsDetails = async (body) => {
|
|
|
|
|
return Object.values(response.data.Data || {});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 报价查询
|
|
|
|
|
*/
|
|
|
|
|
const Availability = async (body) => {
|
|
|
|
|
// console.log('Call Heytrip');
|
|
|
|
|
const response = await post(
|
|
|
|
@ -57,6 +67,9 @@ const Availability = async (body) => {
|
|
|
|
|
return response.data.Data || [];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 酒店起价查询
|
|
|
|
|
*/
|
|
|
|
|
const QuotedHotelsPrice = async (body) => {
|
|
|
|
|
const idsChunk = body.hotelIds.length > 10 ? chunk(body.hotelIds, 10) : [body.hotelIds];
|
|
|
|
|
let quoteRes = [];
|
|
|
|
|