fix(onec): increase client timeout to 60s for 1C large catalog responses

This commit is contained in:
Dana Medical Developer 2026-10-14 14:06:48 +00:00
parent b892fd6c4a
commit 3bb44c4e80
4 changed files with 33 additions and 23 deletions

View File

@ -39,7 +39,7 @@ func New(base, key, authHeader string) *Client {
Base: strings.TrimRight(strings.TrimSpace(base), "/"), Base: strings.TrimRight(strings.TrimSpace(base), "/"),
Key: strings.TrimSpace(key), Key: strings.TrimSpace(key),
AuthHeader: authHeader, AuthHeader: authHeader,
HTTP: &http.Client{Timeout: 20 * time.Second}, HTTP: &http.Client{Timeout: 60 * time.Second},
} }
} }

View File

@ -101,7 +101,7 @@ const CHECKUP_MEDIA = {
'zdorovaya-devoch-a': { photo: ckGirl, icon: icoFemale, hero: checkupHeroGirl }, 'zdorovaya-devoch-a': { photo: ckGirl, icon: icoFemale, hero: checkupHeroGirl },
'proverit-svoe-zhenskoe-zdorove-': { photo: ckWoman, icon: icoCheckup, cutout: cutWomanHealth }, 'proverit-svoe-zhenskoe-zdorove-': { photo: ckWoman, icon: icoCheckup, cutout: cutWomanHealth },
'planirovannie-beremennosti': { photo: ckPregnancy, icon: icoPregnant, cutout: cutPlanning }, 'planirovannie-beremennosti': { photo: ckPregnancy, icon: icoPregnant, cutout: cutPlanning },
'profilaktika-raka-sheyki-matki': { photo: ckCervix, icon: icoRibbon, cutout: cutCervix }, 'profilaktika-raka-sheyki-matki': { photo: ckCervix, icon: icoRibbon, cutout: cutCervix, cutoutCenter: true },
// серо-синий фон шапки (#7886a9) — давление и родители // серо-синий фон шапки (#7886a9) — давление и родители
'davlenie-v-poryadke': { photo: ckPressure, icon: icoTonometer, cutout: cutPressure, heroBg: '#7886a9' }, 'davlenie-v-poryadke': { photo: ckPressure, icon: icoTonometer, cutout: cutPressure, heroBg: '#7886a9' },
'zdorovye-roditeli': { photo: ckParents, icon: icoFamily, cutout: cutParents, heroBg: '#7886a9' }, 'zdorovye-roditeli': { photo: ckParents, icon: icoFamily, cutout: cutParents, heroBg: '#7886a9' },
@ -133,6 +133,8 @@ export function checkupMedia(checkup) {
cutout: m.cutout || '', cutout: m.cutout || '',
// свой цвет фона шапки, если в макете он не коралловый // свой цвет фона шапки, если в макете он не коралловый
heroBg: m.heroBg || '', heroBg: m.heroBg || '',
// главное в кадре по центру — при нехватке места фигура обрезается с двух сторон, а не только слева
cutoutCenter: Boolean(m.cutoutCenter),
}; };
} }

View File

@ -125,8 +125,8 @@
} }
.checkup-hero__image--card { .checkup-hero__image--card {
width: 360px; width: 480px;
height: 270px; height: 360px;
align-self: center; align-self: center;
border-radius: 24px; border-radius: 24px;
} }
@ -289,8 +289,8 @@
height: 400px; height: 400px;
} }
.checkup-hero__image--card { .checkup-hero__image--card {
width: 280px; width: 340px;
height: 210px; height: 255px;
} }
.checkup-content__head { .checkup-content__head {
flex-direction: column; flex-direction: column;
@ -443,31 +443,41 @@
} }
/* ---------- вырезанная фигура в шапке ---------- /* ---------- вырезанная фигура в шапке ----------
Фото без фона справа на всю высоту шапки, низом к краю, как в макете. Широкий снимок Фигура срезана сверху и снизу, поэтому всегда на всю высоту шапки (срез совпадает с краями)
уменьшается целиком (без обрезки), чтобы не заходить на текст; справа может выходить за сетку. */ и не выходит за правую линию сетки. Если снимок шире места справа от текста, лишнее уходит
влево под плавное растворение — без прямого среза. */
.checkup-hero__row--cutout .checkup-hero__copy { .checkup-hero__row--cutout .checkup-hero__copy {
max-width: 560px; max-width: 520px;
} }
.checkup-hero__image--cutout { .checkup-hero__image--cutout {
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
left: 592px; left: 548px;
right: min(0px, calc((100% - 100vw) / 2 + 80px)); right: 0;
width: auto; width: auto;
height: auto; height: auto;
overflow: visible; overflow: hidden;
pointer-events: none; pointer-events: none;
-webkit-mask-image: linear-gradient(to right, transparent 0, #000 72px);
mask-image: linear-gradient(to right, transparent 0, #000 72px);
} }
.checkup-hero__image--cutout img { .checkup-hero__image--cutout img {
position: absolute; position: absolute;
inset: 0; right: 0;
width: 100%; bottom: 0;
width: auto;
height: 100%; height: 100%;
object-fit: contain; max-width: none;
object-position: right bottom; }
/* главное в кадре по центру (лента у «Профилактики рака шейки матки») — центрируем, а не к линии */
.checkup-hero__image--center img {
right: auto;
left: 50%;
transform: translateX(-50%);
} }
@media (max-width: 1023px) { @media (max-width: 1023px) {
@ -475,8 +485,8 @@
max-width: 55%; max-width: 55%;
} }
.checkup-hero__image--cutout { .checkup-hero__image--cutout {
left: 58%; left: 56%;
right: calc(-1 * var(--gutter)); right: 0;
width: auto; width: auto;
height: auto; height: auto;
} }
@ -490,14 +500,12 @@
.checkup-hero__image--cutout { .checkup-hero__image--cutout {
top: 0; top: 0;
bottom: 0; bottom: 0;
left: 18%; left: 12%;
right: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter));
width: auto; width: auto;
height: auto; height: auto;
} }
.checkup-hero__image--cutout img { .checkup-hero__image--cutout img {
object-fit: cover;
object-position: 70% bottom;
opacity: 0.5; opacity: 0.5;
} }
} }

View File

@ -27,7 +27,7 @@ export default function CheckupPage() {
if (!checkup.data || checkup.data.slug !== slug) return <p className="state checkup-loading">Загружаем…</p>; if (!checkup.data || checkup.data.slug !== slug) return <p className="state checkup-loading">Загружаем…</p>;
const c = checkup.data; const c = checkup.data;
const { hero, photo, cutout, heroBg } = checkupMedia(c); const { hero, photo, cutout, heroBg, cutoutCenter } = checkupMedia(c);
const items = c.items?.length ? c.items.map(cleanText) : checklistItems(c.blocks); const items = c.items?.length ? c.items.map(cleanText) : checklistItems(c.blocks);
const intro = introText(c.blocks); const intro = introText(c.blocks);
const lead = cleanText(c.lead); const lead = cleanText(c.lead);
@ -64,7 +64,7 @@ export default function CheckupPage() {
</div> </div>
</div> </div>
{cutout ? ( {cutout ? (
<div className="checkup-hero__image checkup-hero__image--cutout"> <div className={`checkup-hero__image checkup-hero__image--cutout${cutoutCenter ? ' checkup-hero__image--center' : ''}`}>
<img src={cutout} alt="" /> <img src={cutout} alt="" />
</div> </div>
) : hero ? ( ) : hero ? (