-
-
-
Link completo incluindo https://
+
+
+
+
+
+
+
Nome que aparecerá no botão
+
+
+
+
+
+
Link completo incluindo https://
+
+
+
+
+
+
Texto adicional que aparece abaixo do título
+
+
+
+
+
+
-
-
-
-
-
Texto adicional que aparece abaixo do título
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ Suportamos: Mercado Livre, Amazon, Magazine Luiza, Americanas, Shopee, e outros e-commerces conhecidos.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
A imagem será extraída automaticamente
+
+
+
+
+
+
+
+
+ Dica: Os dados serão extraídos automaticamente da página do produto.
+ Você pode editar manualmente se necessário.
+
@@ -501,6 +586,32 @@
transform: translateY(-1px);
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
+
+/* Product Link Preview Styles */
+.product-link-preview {
+ background: rgba(25, 135, 84, 0.05);
+ border-color: rgba(25, 135, 84, 0.2);
+}
+
+.product-link-preview .card {
+ box-shadow: none;
+ background: white;
+}
+
+.product-link-preview .card-body {
+ padding: 1rem;
+}
+
+.product-link-preview .card-title {
+ font-size: 1rem;
+ font-weight: 600;
+ margin-bottom: 0.5rem;
+}
+
+.product-link-preview img {
+ border: 1px solid rgba(0, 0, 0, 0.125);
+ border-radius: 4px;
+}
@section Scripts {
@@ -534,40 +645,44 @@
}
});
- // Save link from modal
- $(document).on('click', '#saveLinkBtn', function() {
- console.log('Save button clicked');
+ // Toggle between link types
+ $('input[name="linkType"]').on('change', function() {
+ const linkType = $(this).val();
+ if (linkType === 'Product') {
+ $('#normalLinkSection').hide();
+ $('#productLinkSection').show();
+ } else {
+ $('#normalLinkSection').show();
+ $('#productLinkSection').hide();
+ }
+ });
+
+ // Extract product data
+ $('#extractProductBtn').on('click', function() {
+ const url = $('#productUrl').val().trim();
- const title = $('#linkTitle').val().trim();
- const url = $('#linkUrl').val().trim();
- const description = $('#linkDescription').val().trim();
- const icon = $('#linkIcon').val();
-
- console.log('Values:', { title, url, description, icon });
-
- if (!title || !url) {
- alert('Por favor, preencha pelo menos o título e a URL do link.');
+ if (!url) {
+ alert('Por favor, insira a URL do produto.');
return;
}
- // Basic URL validation
if (!url.startsWith('http://') && !url.startsWith('https://')) {
alert('Por favor, insira uma URL válida que comece com http:// ou https://');
return;
}
- addLinkInput(title, url, description, icon);
+ extractProductData(url);
+ });
+
+ // Save link from modal
+ $(document).on('click', '#saveLinkBtn', function() {
+ const linkType = $('input[name="linkType"]:checked').val();
- // Clear modal form
- $('#addLinkForm')[0].reset();
-
- // Close modal using Bootstrap 5 syntax
- var modal = bootstrap.Modal.getInstance(document.getElementById('addLinkModal'));
- if (modal) {
- modal.hide();
+ if (linkType === 'Product') {
+ saveProductLink();
+ } else {
+ saveNormalLink();
}
-
- markStepComplete(3);
});
// Remove link functionality
@@ -663,7 +778,7 @@
}
}
- function addLinkInput(title = '', url = '', description = '', icon = '') {
+ function addLinkInput(title = '', url = '', description = '', icon = '', linkType = 'Normal') {
const iconHtml = icon ? `
` : '';
const linkHtml = `
@@ -696,6 +811,7 @@