Каталог файловtilda-cart-1.1.js
5901 setPaymentInputAvailability(paymentInput, false);5902 });5903 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)5904 // @ts-expect-error ST-2949_15905 if (paymentGroup) paymentGroup.style.display = 'none';5906 setPaymentSystem('none', { forceNone: true });5907 }5908 5909 // 0 ПС в проекте5910 if (!paymentInputs.length && !hasProjectPaymentSystem) {5911 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)5912
История файла и сравнение версий
// @ts-expect-error ST-2949_1
5913 if (paymentGroup) paymentGroup.style.display = ''; 5914 setPaymentSystem('none'); 5918 // 1 ПС — только data-payment-system, блока выбора нет 5919 if (!paymentInputs.length) { 5920 if (!tcart__isPaymentUnavailable(projectPaymentSystem, paySystemsToDisable)) { 5921 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 5922 // @ts-expect-error ST-2949_1 5923 if (paymentGroup) paymentGroup.style.display = ''; 5924 setPaymentSystem(projectPaymentSystem); 5928 if (selectedDelivery) { 5929 applyNonePaymentSystem(); 5931 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 5932 // @ts-expect-error ST-2949_1 5933 delete window.tcart.force_none; 5938 // >=2 ПС — radio-блок 5939 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 5940 // @ts-expect-error ST-2949_2 5941 const availablePayments = []; 5942 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046) 5943 // @ts-expect-error ST-2949_5 5944 const preferredPaymentSystem = tcart__getRememberedPaySys(selectedDelivery); 5945 let selectedAvailablePayment = null; 5946 let preferredAvailablePayment = null; 5948 paymentInputs.forEach(function (paymentInput) { 5949 const paymentVariant = paymentInput.getAttribute('data-payment-variant-system') || ''; 5950 const isAvailable = !tcart__isPaymentUnavailable(paymentVariant, paySystemsToDisable); 5952 setPaymentInputAvailability(paymentInput, isAvailable); 5953 if (!isAvailable) return; 5955 availablePayments.push(paymentInput); 5956 if (paymentInput.checked) selectedAvailablePayment = paymentInput; 5957 if (preferredPaymentSystem && paymentVariant === preferredPaymentSystem) { 5958 preferredAvailablePayment = paymentInput; 5962 if (!availablePayments.length) { 5963 if (!selectedDelivery) { 5964 setPaymentSystem(''); 5967 applyNonePaymentSystem(); 5971 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 5972 // @ts-expect-error ST-2949_1 5973 if (paymentGroup) paymentGroup.style.display = ''; 5975 // Сначала память доставки (preferred), иначе текущий checked, иначе первая доступная. 5976 // Preferred важнее checked: UI ПС общий, а после доставки без ПС / ререндера checked может быть чужим. 5977 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 5978 // @ts-expect-error ST-2949_2 5979 const paymentToSelect = preferredAvailablePayment || selectedAvailablePayment || availablePayments[0]; 5980 const paymentSystemToSelect = paymentToSelect.getAttribute('data-payment-variant-system') || ''; 5982 if (paymentToSelect === selectedAvailablePayment && paymentToSelect.checked) { 5983 setPaymentSystem(paymentSystemToSelect); 5987 paymentInputs.forEach(function (paymentInput) { 5988 if (paymentInput !== paymentToSelect && !paymentInput.disabled) { 5989 uncheckPaymentInput(paymentInput); 5992 paymentToSelect.checked = true; 5993 paymentToSelect.setAttribute('checked', 'checked'); 5994 setPaymentSystem(paymentSystemToSelect); 5995 t_triggerEvent(paymentToSelect, 'change'); 5998function tcart__addEvent__selectpayment() { 5999 if (document.querySelectorAll('.t706 .t-input-group_pm').length == 0) { 6000 tcart__syncPaymentMethodsForDelivery();