diff --git a/Discord/discordIndex.js b/Discord/discordIndex.js index ed5bde2..0b62dc6 100644 --- a/Discord/discordIndex.js +++ b/Discord/discordIndex.js @@ -183,7 +183,7 @@ module.exports = (Discord2, client) => { new Discord.EmbedBuilder() .setTitle('Selecione abaixo o item que deseja excluir!') .setDescription(`Clique em cancelar caso desista de excluir um item!`) - .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`}) + .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png` }) .setColor('personalize' in server && 'colorDest' in server.personalize ? server.personalize.colorDest : '#6E58C7') .setThumbnail(`https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp`) .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) @@ -213,7 +213,6 @@ module.exports = (Discord2, client) => { preCarrinhos[interaction.user.id] if (findCart) { preCarrinhos[interaction.user.id][findIndexCart].quantidade = parseInt(value) - console.log(preCarrinhos[interaction.user.id][findIndexCart]); } else { preCarrinhos[interaction.user.id].push({ product: product, @@ -227,10 +226,9 @@ module.exports = (Discord2, client) => { - // interacao do botao de compra de um produto - if (interaction.customId && interaction.customId.includes('comprar')) { + async function comprarFunction(productID) { let server = await db.findOne({ colecao: "servers", doc: interaction.guildId }) - let product = await server.products.find(product => product.productID == interaction.customId.replace('comprar_', '')) + let product = await server.products.find(product => product.productID == productID) let findChannel = interaction.guild.channels.cache.find(c => c.topic === interaction.user.id && c.name && c.name.includes('🛒・carrinho・')) if (!product || server.error == true || product.estoque.length <= 0) { await interaction.reply({ content: `⚠️| O produto selecionado está sem estoque!`, ephemeral: true }) @@ -259,7 +257,7 @@ module.exports = (Discord2, client) => { return } async function findUniCarrinhos() { - let prodid = await interaction.customId.replace('comprar_', '') + let prodid = productID let findItem if (preCarrinhos[interaction.user.id]) { findItem = await preCarrinhos[interaction.user.id].find(element => element.product == prodid) @@ -284,7 +282,7 @@ module.exports = (Discord2, client) => { await deleteExpiredCart(interaction.guildId, interaction, findChannel.id) return } - let prodid = await interaction.customId.replace('comprar_', '') + let prodid = await productID let findProductCart = await carrinhos[interaction.user.id].find((item) => item.product == prodid) let findProductCartIndex = await carrinhos[interaction.user.id].findIndex((item) => item.product == prodid) if (findProductCart) { @@ -383,13 +381,15 @@ module.exports = (Discord2, client) => { edit: false }) } - + } + // interacao do botao de compra de um produto + if (interaction.customId && interaction.customId.includes('comprar')) { + comprarFunction(interaction.customId.replace('comprar_', '')) } - - - - + if (interaction.customId == 'multSelectProduct') { + comprarFunction(interaction.values[0]) + } @@ -559,7 +559,7 @@ module.exports = (Discord2, client) => { .setDescription(`Pix Copiar e Colar: ${'**```' + cpc + '```**'}`) .setImage('attachment://qrcodepix.png') - .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`}) + .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png` }) .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) ], components: [new Discord.ActionRowBuilder() @@ -689,7 +689,7 @@ module.exports = (Discord2, client) => { } if (interaction.customId && interaction.customId.includes('productSendConfirm')) { - let quantidade = parseInt(interaction.customId.replace('productSendConfirm-','')) + let quantidade = parseInt(interaction.customId.replace('productSendConfirm-', '')) if (sendProduct[interaction.guild.id] && sendProduct[interaction.guild.id].user && sendProduct[interaction.guild.id].product) { let server = await db.findOne({ colecao: "servers", doc: interaction.guild.id }) const user = await client.users.fetch(await sendProduct[interaction.guild.id].user); @@ -706,13 +706,13 @@ module.exports = (Discord2, client) => { for (let index = 0; index < quantidade; index++) { const element2 = estoqueData[0].conteudo; - await element2.forEach(element=>{ + await element2.forEach(element => { fields.push({ name: element.title, value: "`" + element.content + "`" }) }) await estoqueData.splice(0, 1); product.estoque = estoqueData server.products[productIndex] = product - db.update('servers',interaction.guild.id,{ + db.update('servers', interaction.guild.id, { products: server.products }) } @@ -724,19 +724,19 @@ module.exports = (Discord2, client) => { new Discord.EmbedBuilder() .setTitle(`🛍️ | Você recebeu um produto!`) .setDescription(`Você recebeu um novo produto de ${SendUser.globalName}`) - .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`}) + .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png` }) .setColor('personalize' in server && 'colorDest' in server.personalize ? server.personalize.colorDest : '#6E58C7') .setTimestamp() .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp ` }) ], - files:[attachment] + files: [attachment] }).then((res) => { interaction.reply({ embeds: [ new Discord.EmbedBuilder() .setTitle(`✅ | Produto enviado!`) .setDescription(`Você enviou um produto para ${user.globalName} Abaixo esta uma copia do que foi enviado:`) - .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`}) + .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png` }) .setColor('personalize' in server && 'colorDest' in server.personalize ? server.personalize.colorDest : '#6E58C7') .setTimestamp() .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp ` }) @@ -746,7 +746,7 @@ module.exports = (Discord2, client) => { }).catch(err => { console.log("err", err); }) - + db.update('servers', interaction.guild.id, { products: server.products @@ -1554,7 +1554,7 @@ module.exports.sendProductPayment = async (params, id, type) => { productID: element.product, edit: true }) - }else{ + } else { require('../Discord/createProductMessage.js')(Discord, client, { channelID: product.channel, serverID: params.serverID, @@ -1572,7 +1572,7 @@ module.exports.sendProductPayment = async (params, id, type) => { productID: element.product, edit: true }) - }else{ + } else { require('../Discord/createProductMessage.js')(Discord, client, { channelID: product.channel, serverID: params.serverID, @@ -1591,7 +1591,7 @@ module.exports.sendProductPayment = async (params, id, type) => { productID: element.product, edit: true }) - }else{ + } else { require('../Discord/createProductMessage.js')(Discord, client, { channelID: product.channel, serverID: params.serverID, @@ -1634,7 +1634,7 @@ module.exports.sendProductPayment = async (params, id, type) => { new Discord.EmbedBuilder() .setTitle('📦 | Sua entrega chegou!') .setDescription(`Abaixo estão os dados da sua entrega:`) - .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`}) + .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png` }) .setColor('personalize' in serverData && 'colorDest' in serverData.personalize ? serverData.personalize.colorDest : '#6E58C7') .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) ], @@ -1645,57 +1645,58 @@ module.exports.sendProductPayment = async (params, id, type) => { const fetched = await findChannel.messages.fetch({ limit: 100 }).then(() => { }).catch(() => { }); findChannel.bulkDelete(fetched).then(() => { }).catch(() => { }) - if (fields.length >= 25) { - sendTxtMensage(findChannel) - sendTxtMensage(user) - sendTxtMensage(dono) - } else { - try { - // dono.send({ files: [attachment] }).catch(()=>{}); - await user.send({ - embeds: [ - new Discord.EmbedBuilder() - .setTitle('📦 | Sua entrega chegou!') - .setDescription(`Abaixo estão os dados da sua entrega:`) - .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`,}) - .setColor('personalize' in serverData && 'colorDest' in serverData.personalize ? serverData.personalize.colorDest : '#6E58C7') - .addFields(...fields) - .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) - ], - }).catch(() => { - sendTxtMensage(user) - }) - findChannel.send({ - embeds: [ - new Discord.EmbedBuilder() - .setTitle('📦 | Sua entrega chegou!') - .setDescription(`Enviamos a entrega no seu privado caso não tenha recebido o seu privado pode esta bloqueado então tenha certeza de baixar os arquivos antes que o carrinho seja fechado`) - .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`}) - .setColor('personalize' in serverData && 'colorDest' in serverData.personalize ? serverData.personalize.colorDest : '#6E58C7') - .addFields(...fields) - .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) - ], - components: [ - new Discord.ActionRowBuilder() - .addComponents( - new Discord.ButtonBuilder() - .setStyle(4) - .setLabel('Fechar carrinho') - .setCustomId('cancel') - ) - ], - }).catch(() => { - sendTxtMensage(findChannel) - }) - // findChannel.send({ files: [attachment] }).catch(()=>{}); - - } catch (error) { - sendTxtMensage(findChannel) - sendTxtMensage(user) - sendTxtMensage(dono) - } - } + + // if (fields.length >= 25) { + sendTxtMensage(findChannel) + sendTxtMensage(user) + // } else { + // try { + // // dono.send({ files: [attachment] }).catch(()=>{}); + // await user.send({ + // embeds: [ + // new Discord.EmbedBuilder() + // .setTitle('📦 | Sua entrega chegou!') + // .setDescription(`Abaixo estão os dados da sua entrega:`) + // .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`,}) + // .setColor('personalize' in serverData && 'colorDest' in serverData.personalize ? serverData.personalize.colorDest : '#6E58C7') + // .addFields(...fields) + // .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) + // ], + // }).catch(() => { + // sendTxtMensage(user) + // }) + // findChannel.send({ + // embeds: [ + // new Discord.EmbedBuilder() + // .setTitle('📦 | Sua entrega chegou!') + // .setDescription(`Enviamos a entrega no seu privado caso não tenha recebido o seu privado pode esta bloqueado então tenha certeza de baixar os arquivos antes que o carrinho seja fechado`) + // .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`}) + // .setColor('personalize' in serverData && 'colorDest' in serverData.personalize ? serverData.personalize.colorDest : '#6E58C7') + // .addFields(...fields) + // .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) + // ], + // components: [ + // new Discord.ActionRowBuilder() + // .addComponents( + // new Discord.ButtonBuilder() + // .setStyle(4) + // .setLabel('Fechar carrinho') + // .setCustomId('cancel') + // ) + // ], + // }).catch(() => { + // sendTxtMensage(findChannel) + // }) + // // findChannel.send({ files: [attachment] }).catch(()=>{}); + + + // } catch (error) { + // sendTxtMensage(findChannel) + // sendTxtMensage(user) + // sendTxtMensage(dono) + // } + // } if ('saleLogs' in serverData && serverData.saleLogs.publicLog) { try { @@ -1718,7 +1719,7 @@ module.exports.sendProductPayment = async (params, id, type) => { .addComponents( new Discord.ButtonBuilder() .setStyle(5) - .setLabel('📤・Ir para o produto') + .setLabel('📤・Produto') .setURL(`https://discord.com/channels/${params.serverID}/${findChannelProduct.id}`) )] } @@ -1744,30 +1745,7 @@ module.exports.sendProductPayment = async (params, id, type) => { if ('saleLogs' in serverData && serverData.saleLogs.privateLog) { let findChannelPrivate = DiscordServer.channels.cache.find(c => c.id === serverData.saleLogs.privateLog) try { - - findChannelPrivate.send({ - embeds: [ - new Discord.EmbedBuilder() - .setTitle(`Nova compra no servidor!`) - .setDescription(`Abaixo estão os dados que foram entregues:`) - .addFields( - { name: '\u200B', value: '\u200B' }, - { name: 'Nome do usuario comprador', value: user.username, inline: true }, - { name: 'ID do usuario', value: user.id, inline: true }, - { name: 'ID da compra', value: findChannel.id }, - { name: 'Data e hora da compra', value: dataHoraFormatada }, - { name: '\u200B', value: '\u200B' }, - ...fields - ) - .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`}) - .setColor('personalize' in serverData && 'colorDest' in serverData.personalize ? serverData.personalize.colorDest : '#6E58C7') - .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) - ], - }).catch(() => { - - sendTxtMensage(dono) - }) - } catch (error) { + findChannelPrivate.send({ embeds: [ new Discord.EmbedBuilder() @@ -1781,14 +1759,14 @@ module.exports.sendProductPayment = async (params, id, type) => { { name: 'Data e hora da compra', value: dataHoraFormatada }, { name: '\u200B', value: '\u200B' }, ) - .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`}) + .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png` }) .setColor('personalize' in serverData && 'colorDest' in serverData.personalize ? serverData.personalize.colorDest : '#6E58C7') .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) ], }) - sendTxtMensage(dono) - } - }else{ + findChannelPrivate.send({ files: [attachment] }).catch(() => { }); + } catch (error) { } + } else { try { await dono.send({ embeds: [ @@ -1804,13 +1782,12 @@ module.exports.sendProductPayment = async (params, id, type) => { { name: '\u200B', value: '\u200B' }, ...fields ) - .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`}) + .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png` }) .setColor('personalize' in serverData && 'colorDest' in serverData.personalize ? serverData.personalize.colorDest : '#6E58C7') .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) ], - }).catch(() => { - sendTxtMensage(dono) }) + dono.send({ files: [attachment] }).catch(() => { }); } catch (error) { await dono.send({ embeds: [ @@ -1825,7 +1802,7 @@ module.exports.sendProductPayment = async (params, id, type) => { { name: 'Data e hora da compra', value: dataHoraFormatada }, { name: '\u200B', value: '\u200B' }, ) - .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`}) + .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png` }) .setColor('personalize' in serverData && 'colorDest' in serverData.personalize ? serverData.personalize.colorDest : '#6E58C7') .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) ], @@ -1833,7 +1810,7 @@ module.exports.sendProductPayment = async (params, id, type) => { sendTxtMensage(dono) } } - + if ('personalize' in serverData && 'cargoPay' in serverData.personalize) { try { diff --git a/public/css/sales.css b/public/css/sales.css index d96cfb7..02f895c 100644 --- a/public/css/sales.css +++ b/public/css/sales.css @@ -145,208 +145,214 @@ - -#product-cadastro-containner { +.estoque-config-input-content-conteudo { width: 90%; display: flex; - justify-content: center; + flex-direction: column; +} + +.product-cadastro-containner{ + width: 90%; + flex-direction: column; align-items: center; - margin-top: 6%; - margin-bottom: 5em; + justify-content: center; + display: flex; + margin-bottom: 2em; +} +.product-cadastro-content { + padding: 1em; + width: 90%; + border-radius: var(--border-radius-min); + background-color: var(--secundary-color); - #product-cadastro-content { + .cadastro-content { + width: 100%; + height: calc(100% - 2.5em); + display: flex; padding: 1em; - width: 90%; - border-radius: var(--border-radius-min); - background-color: var(--secundary-color); + gap: 1em; + justify-content: space-around; + align-items: center; - #cadastro-content { - width: 100%; - height: calc(100% - 2.5em); - display: flex; + .cadastro-left-content, + .cadastro-rigth-content { + width: 45%; + height: 100%; padding: 1em; - gap: 1em; - justify-content: space-around; + margin-top: 1em; + } + + .cadastro-left-content { + display: flex; align-items: center; + justify-content: space-around; + flex-direction: column; + gap: 1em; - #cadastro-left-content, - #cadastro-rigth-content { - width: 45%; - height: 100%; - padding: 1em; - margin-top: 1em; + .channels-containner { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 1em; + + .cannels-title { + text-align: center; + font-size: 1.2em; + font-weight: 500; + color: var(--color-text-primary); + font-family: 'poppins'; + } } - #cadastro-left-content { + .backGround-containner { display: flex; - align-items: center; - justify-content: space-around; flex-direction: column; - gap: 1em; + gap: 1.5em; - #channels-containner { + .backGround-title { + text-align: center; + font-size: 1.2em; + font-weight: 500; + color: var(--color-text-primary); + font-family: 'poppins'; display: flex; - flex-direction: column; - justify-content: center; align-items: center; - gap: 1em; + justify-content: center; - #cannels-title { - text-align: center; - font-size: 1.2em; - font-weight: 500; - color: var(--color-text-primary); - font-family: 'poppins'; + #svg-premium { + width: 2em; } } - #backGround-containner { + .backGround-content { display: flex; flex-direction: column; + align-items: center; gap: 1.5em; + justify-content: space-around; - #backGround-title { + .backGround-image-preview { + display: flex; + flex-direction: column; + align-items: center; + width: 100%; text-align: center; - font-size: 1.2em; - font-weight: 500; + } + + .backGround-image-preview label { + font-size: 0.8em; + font-weight: 400; color: var(--color-text-primary); font-family: 'poppins'; - display: flex; - align-items: center; - justify-content: center; + } + + .backGround-image-preview img { + width: 80%; + max-width: 14em; + height: 10em; + object-fit: cover; + border-radius: var(--border-radius-min); - #svg-premium { - width: 2em; - } } - #backGround-content { + .backGround-image-input-content { display: flex; - flex-direction: column; + justify-content: center; align-items: center; - gap: 1.5em; - justify-content: space-around; + width: 100%; - #backGround-image-preview { + .image-lable { + border: 2px solid var(--secundary-color-purple); + border-radius: var(--border-radius-mid); + width: 80%; + height: 3em; display: flex; - flex-direction: column; + justify-content: center; align-items: center; - width: 100%; - text-align: center; - } - - #backGround-image-preview label { - font-size: 0.8em; - font-weight: 400; + font-size: 1.2em; + font-weight: 500; color: var(--color-text-primary); font-family: 'poppins'; + cursor: pointer; } + } + } + } - #backGround-image-preview img { - width: 80%; - max-width: 14em; - height: 10em; - object-fit: cover; - border-radius: var(--border-radius-min); - } + } - #backGround-image-input-content { - display: flex; - justify-content: center; - align-items: center; - width: 100%; - - #button-image-input { - border: 2px solid var(--secundary-color-purple); - border-radius: var(--border-radius-mid); - width: 80%; - height: 3em; - display: flex; - justify-content: center; - align-items: center; - font-size: 1.2em; - font-weight: 500; - color: var(--color-text-primary); - font-family: 'poppins'; - cursor: pointer; - } - } - } - } + .cadastro-rigth-content { + display: flex; + align-items: center; + justify-content: space-around; + flex-direction: column; + gap: 1em; - } - #cadastro-rigth-content { + .rigth-content { display: flex; - align-items: center; justify-content: space-around; + align-items: center; flex-direction: column; gap: 1em; + .inputs-containner { + width: 100%; + } - #rigth-content { + #product-desc { + resize: none; + height: 6em; + } + + .unic-containner { display: flex; - justify-content: space-around; - align-items: center; - flex-direction: column; + flex-wrap: wrap; gap: 1em; + width: 100%; + justify-content: space-between; + align-items: center; + height: 100%; - .inputs-containner { - width: 100%; - - } - - #product-desc { - resize: none; - height: 6em; - } - - #unic-containner { + .doble-containner { + width: 60%; display: flex; - flex-wrap: wrap; + flex-direction: column; gap: 1em; justify-content: space-between; - align-items: center; - height: 100%; - - #doble-containner { - width: 60%; - display: flex; - flex-direction: column; - gap: 1em; - justify-content: space-between; - } + } - #product-logo-content { - display: flex; - align-items: center; - flex-direction: column; - gap: 1em; - width: 30%; - justify-content: center; + .product-logo-content { + display: flex; + align-items: center; + flex-direction: column; + gap: 1em; + width: 30%; + justify-content: center; - #logo-preview { - cursor: pointer; - width: 8em; - height: 8em; - border-radius: var(--border-radius-mid); - } + #logo-preview { + cursor: pointer; + width: 8em; + height: 8em; + border-radius: var(--border-radius-mid); } - } } } + } } } -#rigth-content-title, -#logo-title { + +.rigth-content-title, +.logo-title { font-size: 1.2em; font-weight: 500; color: var(--color-text-primary); @@ -612,8 +618,8 @@ flex-direction: column; gap: 1em; - #rigth-content-title, - #logo-title { + .rigth-content-title, + .logo-title { font-size: 1.2em; font-weight: 500; color: var(--color-text-primary); @@ -1041,6 +1047,148 @@ } + +#create-mult-product-embend-containner { + width: 90%; + display: flex; + justify-content: center; + align-items: center; + margin-bottom: 5em; + #create-mult-product-embend-content { + padding: 1em; + width: 90%; + border-radius: var(--border-radius-min); + background-color: var(--secundary-color); + } +} + +#logo-preview-multi { + cursor: pointer; + width: 9em; + height: 9em; + border-radius: var(--border-radius-mid); +} + + +#select-product-containner{ + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + #select-product-content{ + width: 99%; + padding: 0.5em; + display: flex; + flex-direction: column; + gap: 1em; + max-height: 15em; + overflow: auto; + border: 1px solid var(--text-gray-color-primary); + #select-product-row{ + width: 100%; + display: flex; + flex-wrap: wrap; + gap: 0.5em; + justify-content: center; + align-items: center; + .select-product-col{ + width: 8.3em; + display: flex; + gap: 0.5em; + padding: 0.5em; + align-items: center; + justify-content: space-between; + border-radius: var(--border-radius-mid); + background-color: var(--primary-color-opacity); + .select-product-col-text{ + display: flex; + flex-direction: column; + } + .select-product-col-exclud-button{ + font-family: 'poppins'; + font-size: 1.2em; + + font-weight: 900; + cursor: pointer; + border: none; + background-color: transparent; + color: var(--red-color); + } + .select-product-col-title{ + font-family: 'poppins'; + font-size: 1em; + text-overflow: ellipsis; + overflow: hidden; + color: var(--color-text-primary); + } + .select-product-col-desc{ + font-family: 'poppins'; + font-size: 0.6em; + text-overflow: ellipsis; + overflow: hidden; + color: var(--text-gray-color-primary); + } + } + + } + } + +} + +.select-product-options-col-title{ + font-family: 'poppins'; + font-size: 1.2em; + text-overflow: ellipsis; + overflow: hidden; + color: var(--color-text-primary); +} +.select-product-options-col-desc{ + font-family: 'poppins'; + font-size: 0.8em; + + color: var(--text-gray-color-primary); +} + + + +#select-product-options-containner{ + position: absolute ; + justify-content: center; + align-items: center; + padding: 0.5em; + border-radius: var(--border-radius-min); + background-color: var(--primary-color); + #select-product-options-row{ + width: 100%; + display: flex; + flex-direction: column; + gap: 1em; + } + .select-product-options-col{ + width: 100% ; + display: flex; + align-items: center; + justify-content: center; + gap: 1em; + opacity: 1; + transition: 0.7s; + padding: 0.5em; + + &:hover{ + background-color: var(--menu-color); + opacity: 0.8; + transition: 0.7s; + cursor: pointer; + border-radius: var(--border-radius-min); + } + } +} +.select-product-options-col-image{ + width: 2em; + height: 2em; + border-radius: var(--border-radius-max); +} @media screen and (max-width:800px) { #pagamentos-produtos-containner{ flex-direction: column; @@ -1050,7 +1198,7 @@ #pagamentos-containner,#produtos-containner{ width: 90% !important; } - #cadastro-content{ + .cadastro-content{ flex-direction: column; } #estoque-config-add-button{ @@ -1059,7 +1207,7 @@ #estoque-config-col{ width: 100% !important; } - #cadastro-rigth-content,#cadastro-left-content{ + .cadastro-rigth-content,#cadastro-left-content{ width: 100% !important; } .estoque-config-col{ @@ -1089,7 +1237,7 @@ #pagamentos-produtos-containner{ gap: 1em; } - #product-cadastro-containner{ + .product-cadastro-containner{ width: 100% !important; } #cadastro-content{ diff --git a/public/js/sales.js b/public/js/sales.js index 7e1d175..f47f6b6 100644 --- a/public/js/sales.js +++ b/public/js/sales.js @@ -3,8 +3,8 @@ let serverID = location.pathname.replace('/server/sales/', "") -document.getElementById('add-pix-popup-tutorial').addEventListener('click',()=>{ - window.open('https://www.youtube.com/watch?v=jK4JmvWDvAc',"_blank") +document.getElementById('add-pix-popup-tutorial').addEventListener('click', () => { + window.open('https://www.youtube.com/watch?v=jK4JmvWDvAc', "_blank") }) if (document.getElementById('bank-input-list')) { @@ -494,13 +494,13 @@ document.addEventListener('click', async (event) => { body: JSON.stringify({ productID: productID, serverID: serverID, - txt:linhas, - title:document.getElementById('input-title-txt').value + txt: linhas, + title: document.getElementById('input-title-txt').value }), }).then(response => { return response.json() }) if (productData.success == true) { successNotify('Estoque adicionado!') - }else{ + } else { errorNotify('Erro ao adicionar estoque!') } }; @@ -805,6 +805,14 @@ document.getElementById('backGround-input-edit').addEventListener('change', func }); +document.getElementById('image-input-multi').addEventListener('change', function () { + previewImage(this, document.getElementById('image-preview-multi')); +}); +document.getElementById('logo-input-multi').addEventListener('change', function () { + previewImage(this, document.getElementById('logo-preview-multi')); +}); + + @@ -818,7 +826,7 @@ function clearCadastroProduct() { document.getElementById('logo-preview').src = 'https://res.cloudinary.com/dgcnfudya/image/upload/v1704981573/gxorbaldn7fw5ojcv1s0.jpg' document.getElementById('image-preview').src = 'https://res.cloudinary.com/dgcnfudya/image/upload/v1704981573/gxorbaldn7fw5ojcv1s0.jpg' - document.querySelector('#product-cadastro-containner #estoque-config-row').innerHTML = ` + document.querySelector('.product-cadastro-containner #estoque-config-row').innerHTML = `
${targetSelect.querySelector('.select-product-options-col-desc').textContent}
+