DmitrMakeev commited on
Commit
896e4e0
·
verified ·
1 Parent(s): 3f35659

Update pages.html

Browse files
Files changed (1) hide show
  1. pages.html +124 -42
pages.html CHANGED
@@ -463,51 +463,104 @@ z-index: 1000; /* Убедитесь, что кнопка находится п
463
  </script>
464
 
465
  <script>
466
- // Создаем блок формы
467
- editor.Blocks.add('custom-form', {
468
- label: 'Custom Form',
469
- content: `
470
- <div class="form-container container">
471
- <form id="contactForm">
472
- <div class="form-group title-field">
473
- <h4>КЛУБ-ПРАКТИК. 255 техник для психолога - 2024</h4>
474
- </div>
475
- <div class="form-group name-field">
476
- <label for="name">Имя</label>
477
- <input type="text" id="name" required>
478
- </div>
479
- <div class="form-group email-field">
480
- <label for="email">Почта</label>
481
- <input type="email" id="email" required>
482
- </div>
483
- <div class="form-group phone-field">
484
- <label for="phone">Телефон</label>
485
- <input type="tel" id="phone" required>
486
- </div>
487
- <div class="form-group options-field">
488
- <label for="options">Выберите тариф</label>
489
- <select id="options" required>
490
- <option value="" disabled selected>Тариф</option>
491
- <option>БИЗНЕС - 69 970р.</option>
492
- <option>PREMIUM - 89 970р.</option>
493
- <option>VIP - 149 990р.</option>
494
- </select>
495
- </div>
496
- <div class="form-check newsletter-field">
497
- <input type="checkbox" id="newsletter" required>
498
- <label for="newsletter">Согласие на email рассылку</label>
499
- </div>
500
- <div class="form-group privacy-policy-link">
501
- <a href="#" id="privacyPolicyLink">Политика конфиденциальности</a>
502
- </div>
503
- <div class="form-group submit-button">
504
- <button type="submit" class="btn-primary">ПЕРЕЙТИ К ОПЛАТЕ</button>
 
 
 
 
 
 
 
 
 
 
 
505
  </div>
506
- </form>
507
- </div>
508
- `,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
509
  });
510
 
 
 
 
511
  // Добавляем возможность настройки каждого элемента формы
512
  editor.DomComponents.addType('form-input', {
513
  model: {
@@ -719,11 +772,40 @@ editor.DomComponents.addType('privacy-policy-link', {
719
 
720
 
721
 
 
 
 
 
 
722
 
723
 
724
 
725
 
726
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
727
 
728
 
729
 
 
463
  </script>
464
 
465
  <script>
466
+
467
+
468
+
469
+
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+ // Создаем новый тип компонента для формы
478
+ editor.Components.addType('custom-form', {
479
+ model: {
480
+ defaults: {
481
+ // HTML-код формы
482
+ content: `
483
+ <div class="container">
484
+ <form id="contactForm">
485
+ <h4>КЛУБ-ПРАКТИК. 255 техник для психолога - 2024</h4>
486
+ <div class="form-group">
487
+ <label for="name">Имя</label>
488
+ <input type="text" id="name" required>
489
+ </div>
490
+ <div class="form-group">
491
+ <label for="email">Почта</label>
492
+ <input type="email" id="email" required>
493
+ </div>
494
+ <div class="form-group">
495
+ <label for="phone">Телефон</label>
496
+ <input type="tel" id="phone" required>
497
+ </div>
498
+ <div class="form-group">
499
+ <label for="options">Выберите тариф</label>
500
+ <select id="options" required>
501
+ <option value="" disabled selected>Тариф</option>
502
+ <option>БИЗНЕС - 69 970р.</option>
503
+ <option>PREMIUM - 89 970р.</option>
504
+ <option>VIP - 149 990р.</option>
505
+ </select>
506
+ </div>
507
+ <div class="form-check">
508
+ <input type="checkbox" id="newsletter" required>
509
+ <label for="newsletter">Согласие на email рассылку</label>
510
+ </div>
511
+ <div class="form-group">
512
+ <a href="#" id="privacyPolicyLink">Политика конфиденциальности</a>
513
+ </div>
514
+ <button type="submit" class="btn-primary">ПЕРЕЙТИ К ОПЛАТЕ</button>
515
+ </form>
516
  </div>
517
+ `,
518
+ // Скрипт для обработки отправки формы
519
+ script: function(props) {
520
+ const form = this.querySelector('#contactForm');
521
+ const avpInput = form.querySelector('input[name="avp_v"]');
522
+ const grupInput = form.querySelector('input[name="grup_v"]');
523
+ const red_urlInput = form.querySelector('input[name="red_url_v"]');
524
+ if (avpInput) {
525
+ avpInput.value = props.avp;
526
+ }
527
+ if (grupInput) {
528
+ grupInput.value = props.grup;
529
+ }
530
+ if (red_urlInput) {
531
+ grupInput.value = props.red_url;
532
+ }
533
+ },
534
+ // Свойства, которые будут передаваться в скрипт
535
+ 'script-props': ['avp', 'grup', 'red_url'],
536
+ // Настройки для изменения URL отправки
537
+ traits: [
538
+ {
539
+ type: 'text',
540
+ name: 'avp',
541
+ label: 'AVP',
542
+ changeProp: true
543
+ },
544
+ {
545
+ type: 'text',
546
+ name: 'grup',
547
+ label: 'GRUP',
548
+ changeProp: true
549
+ },
550
+ {
551
+ type: 'text',
552
+ name: 'red_url',
553
+ label: 'RED_URL',
554
+ changeProp: true
555
+ }
556
+ ]
557
+ }
558
+ }
559
  });
560
 
561
+
562
+
563
+
564
  // Добавляем возможность настройки каждого элемента формы
565
  editor.DomComponents.addType('form-input', {
566
  model: {
 
772
 
773
 
774
 
775
+
776
+
777
+
778
+
779
+
780
 
781
 
782
 
783
 
784
 
785
+
786
+ // Создаем блок для компонента формы
787
+ editor.Blocks.add('custom-form-block', {
788
+ label: 'Custom Form',
789
+ content: { type: 'custom-form' },
790
+ });
791
+
792
+
793
+
794
+
795
+
796
+
797
+
798
+
799
+
800
+
801
+
802
+
803
+
804
+
805
+
806
+
807
+
808
+
809
 
810
 
811