Janata E Com

Janata E Com

 <?xml version="1.0" encoding="UTF-8" ?>

<b:blog xmlns:b="http://www.google.com/2005/gml/b">

  <b:skin><![CDATA[

    body {

      font-family: Arial, sans-serif;

      background: #f1f1f1;

      text-align: center;

    }

    .card {

      background: white;

      border-radius: 16px;

      padding: 16px;

      max-width: 400px;

      margin: auto;

      box-shadow: 0 4px 10px rgba(0,0,0,0.1);

    }

    img {

      max-width: 100%;

      border-radius: 12px;

    }

    h2 {

      margin: 10px 0;

    }

    .price {

      font-size: 20px;

      color: green;

      margin-bottom: 16px;

    }

    .btn {

      display: inline-block;

      padding: 10px 16px;

      margin: 6px;

      border: none;

      border-radius: 6px;

      color: white;

      font-weight: bold;

      cursor: pointer;

      text-decoration: none;

    }

    .call1 { background-color: #007bff; }

    .call2 { background-color: #0056b3; }

    .wa1 { background-color: #25d366; }

    .wa2 { background-color: #128c7e; }

    .cart { background-color: orange; }

    .buy { background-color: #e91e63; }

  ]]></b:skin>


  <b:template-skin name="janata-skin" />


  <b:section id="main" class="main" maxwidgets="1" showaddelement="no">

    <b:widget id="Product1" type="HTML" title="Bluetooth Speaker">

      <b:widget-settings />

      <b:includable id="main">

        <div class="card">

          <img src="https://via.placeholder.com/350x200.png?text=Bluetooth+Speaker" alt="Bluetooth Speaker" />

          <h2>Bluetooth Speaker</h2>

          <div class="price">₹499</div>


          <a class="btn call1" href="tel:8411854305">Call 1</a>

          <a class="btn call2" href="tel:7719060190">Call 2</a>

          <a class="btn wa1" href="https://wa.me/8411854305?text=Hi%2C%20I%20am%20interested%20in%20this%20product" target="_blank">WhatsApp 1</a>

          <a class="btn wa2" href="https://wa.me/7719060190?text=Hi%2C%20I%20am%20interested%20in%20this%20product" target="_blank">WhatsApp 2</a>


          <br/>


          <button class="btn cart" onclick="alert('Added to cart')">Add to Cart</button>

          <button class="btn buy" onclick="alert('Proceed to buy')">Buy Now</button>

        </div>

      </b:includable>

    </b:widget>

  </b:section>

</b:blog>


main e com code

main e com code

// App.js - Main entry for React Native e-commerce app with UPI QR Payment import React from 'react'; import { NavigationContainer } from '@react-navigation/native'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; import HomeScreen from './screens/HomeScreen'; import ProductDetails from './screens/ProductDetails'; import PaymentScreen from './screens/PaymentScreen'; import SuccessScreen from './screens/SuccessScreen';

const Stack = createNativeStackNavigator();

export default function App() { return ( <Stack.Navigator initialRouteName="Home"> <Stack.Screen name="Home" component={HomeScreen} options={{ title: 'E-Store' }} /> <Stack.Screen name="ProductDetails" component={ProductDetails} options={{ title: 'Product Details' }} /> <Stack.Screen name="Payment" component={PaymentScreen} options={{ title: 'Pay via QR' }} /> <Stack.Screen name="Success" component={SuccessScreen} options={{ headerShown: false }} /> </Stack.Navigator> ); }

// --- screens/HomeScreen.js --- import React from 'react'; import { View, Text, FlatList, TouchableOpacity, StyleSheet } from 'react-native';

const products = [ { id: '1', name: 'Zebronics Power Bank', price: 799 }, { id: '2', name: 'Crompton LED Bulb Pack', price: 350 }, ];

export default function HomeScreen({ navigation }) { return ( <FlatList data={products} keyExtractor={(item) => item.id} renderItem={({ item }) => ( <TouchableOpacity style={styles.card} onPress={() => navigation.navigate('ProductDetails', { product: item })} > {item.name} ₹{item.price} )} /> ); }

const styles = StyleSheet.create({ container: { flex: 1, padding: 16 }, card: { padding: 16, backgroundColor: '#f0f0f0', marginBottom: 10, borderRadius: 8 }, name: { fontWeight: 'bold', fontSize: 16 }, });

// --- screens/ProductDetails.js --- import React from 'react'; import { View, Text, Button, StyleSheet } from 'react-native';

export default function ProductDetails({ route, navigation }) { const { product } = route.params; return ( {product.name} ₹{product.price} <Button title="Buy Now" onPress={() => navigation.navigate('Payment', { product })} /> ); }

const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center' }, title: { fontSize: 22, fontWeight: 'bold', marginBottom: 10 }, price: { fontSize: 18, marginBottom: 20 }, });

// --- screens/PaymentScreen.js --- import React, { useState } from 'react'; import { View, Text, TextInput, Button, Image, StyleSheet } from 'react-native';

export default function PaymentScreen({ route, navigation }) { const { product } = route.params; const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [screenshot, setScreenshot] = useState(null);

const handlePayment = () => { if (name && email) { navigation.navigate('Success', { name, product }); } else { alert('कृपया सर्व माहिती भरा'); } };

return ( Pay ₹{product.price} via UPI: <Image source={{ uri: 'https://api.qrserver.com/v1/create-qr-code/?data=upi://pay?pa=9623917685@pz&pn=Janata%20Sadguru' }} style={styles.qr} />

const styles = StyleSheet.create({ container: { padding: 20, alignItems: 'center' }, qr: { height: 200, width: 200, marginVertical: 20 }, input: { borderWidth: 1, width: '100%', marginBottom: 10, padding: 8, borderRadius: 4 }, });

// --- screens/SuccessScreen.js --- import React from 'react'; import { View, Text, Button, StyleSheet } from 'react-native';

export default function SuccessScreen({ route, navigation }) { const { name, product } = route.params; return ( धन्यवाद, {name}! तुमचं पेमेंट "{product.name}" साठी यशस्वी झालं आहे. <Button title="पुन्हा होमवर जा" onPress={() => navigation.navigate('Home')} /> ); }

const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', padding: 20 }, text: { fontSize: 18, textAlign: 'center', marginBottom: 10 }, });

e com app main

e com app main

// App.js - Main entry for React Native e-commerce app with UPI QR Payment import React from 'react'; import { NavigationContainer } from '@react-navigation/native'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; import HomeScreen from './screens/HomeScreen'; import ProductDetails from './screens/ProductDetails'; import PaymentScreen from './screens/PaymentScreen'; import SuccessScreen from './screens/SuccessScreen';

const Stack = createNativeStackNavigator();

export default function App() { return ( <Stack.Navigator initialRouteName="Home"> <Stack.Screen name="Home" component={HomeScreen} options={{ title: 'E-Store' }} /> <Stack.Screen name="ProductDetails" component={ProductDetails} options={{ title: 'Product Details' }} /> <Stack.Screen name="Payment" component={PaymentScreen} options={{ title: 'Pay via QR' }} /> <Stack.Screen name="Success" component={SuccessScreen} options={{ headerShown: false }} /> </Stack.Navigator> ); }

// --- screens/HomeScreen.js --- import React from 'react'; import { View, Text, FlatList, TouchableOpacity, StyleSheet } from 'react-native';

const products = [ { id: '1', name: 'Zebronics Power Bank', price: 799 }, { id: '2', name: 'Crompton LED Bulb Pack', price: 350 }, ];

export default function HomeScreen({ navigation }) { return ( <FlatList data={products} keyExtractor={(item) => item.id} renderItem={({ item }) => ( <TouchableOpacity style={styles.card} onPress={() => navigation.navigate('ProductDetails', { product: item })} > {item.name} ₹{item.price} )} /> ); }

const styles = StyleSheet.create({ container: { flex: 1, padding: 16 }, card: { padding: 16, backgroundColor: '#f0f0f0', marginBottom: 10, borderRadius: 8 }, name: { fontWeight: 'bold', fontSize: 16 }, });

// --- screens/ProductDetails.js --- import React from 'react'; import { View, Text, Button, StyleSheet } from 'react-native';

export default function ProductDetails({ route, navigation }) { const { product } = route.params; return ( {product.name} ₹{product.price} <Button title="Buy Now" onPress={() => navigation.navigate('Payment', { product })} /> ); }

const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center' }, title: { fontSize: 22, fontWeight: 'bold', marginBottom: 10 }, price: { fontSize: 18, marginBottom: 20 }, });

// --- screens/PaymentScreen.js --- import React, { useState } from 'react'; import { View, Text, TextInput, Button, Image, StyleSheet } from 'react-native';

export default function PaymentScreen({ route, navigation }) { const { product } = route.params; const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [screenshot, setScreenshot] = useState(null);

const handlePayment = () => { if (name && email) { navigation.navigate('Success', { name, product }); } else { alert('कृपया सर्व माहिती भरा'); } };

return ( Pay ₹{product.price} via UPI: <Image source={{ uri: 'https://api.qrserver.com/v1/create-qr-code/?data=upi://pay?pa=9623917685@pz&pn=Janata%20Sadguru' }} style={styles.qr} />

const styles = StyleSheet.create({ container: { padding: 20, alignItems: 'center' }, qr: { height: 200, width: 200, marginVertical: 20 }, input: { borderWidth: 1, width: '100%', marginBottom: 10, padding: 8, borderRadius: 4 }, });

// --- screens/SuccessScreen.js --- import React from 'react'; import { View, Text, Button, StyleSheet } from 'react-native';

export default function SuccessScreen({ route, navigation }) { const { name, product } = route.params; return ( धन्यवाद, {name}! तुमचं पेमेंट "{product.name}" साठी यशस्वी झालं आहे. <Button title="पुन्हा होमवर जा" onPress={() => navigation.navigate('Home')} /> ); }

const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', padding: 20 }, text: { fontSize: 18, textAlign: 'center', marginBottom: 10 }, });

admin panal password login

admin panal password login

import React, { useState } from "react"; import { Card, CardContent } from "@/components/ui/card"; import { Button } from "@/components/ui/button";

const mockPayments = [ { id: 1, name: "Rahul Patil", email: "rahul@example.com", product: "Power Bank", amount: 799, screenshot: "https://via.placeholder.com/100", status: "Pending", }, { id: 2, name: "Sneha More", email: "sneha@example.com", product: "LED Bulb Pack", amount: 350, screenshot: "https://via.placeholder.com/100", status: "Approved", }, ];

export default function AdminPanelPreview() { const [payments, setPayments] = useState(mockPayments);

const handleStatusChange = (id, newStatus) => { setPayments((prev) => prev.map((p) => (p.id === id ? { ...p, status: newStatus } : p)) ); };

return (

Admin Dashboard

{payments.map((pay) => (

नाव: {pay.name}

ई-मेल: {pay.email}

प्रॉडक्ट: {pay.product}

रक्कम: ₹{pay.amount}

स्थिती: {pay.status}

screenshot
<Button onClick={() => handleStatusChange(pay.id, "Approved")} className="bg-green-600" > Approve <Button onClick={() => handleStatusChange(pay.id, "Pending")} className="bg-yellow-500" > Pending
))}
); }

admin panal preview

admin panal preview

import React, { useState } from "react"; import { Card, CardContent } from "@/components/ui/card"; import { Button } from "@/components/ui/button";

const mockPayments = [ { id: 1, name: "Rahul Patil", email: "rahul@example.com", product: "Power Bank", amount: 799, screenshot: "https://via.placeholder.com/100", status: "Pending", }, { id: 2, name: "Sneha More", email: "sneha@example.com", product: "LED Bulb Pack", amount: 350, screenshot: "https://via.placeholder.com/100", status: "Approved", }, ];

export default function AdminPanelPreview() { const [payments, setPayments] = useState(mockPayments);

const handleStatusChange = (id, newStatus) => { setPayments((prev) => prev.map((p) => (p.id === id ? { ...p, status: newStatus } : p)) ); };

return (

Admin Dashboard

{payments.map((pay) => (

नाव: {pay.name}

ई-मेल: {pay.email}

प्रॉडक्ट: {pay.product}

रक्कम: ₹{pay.amount}

स्थिती: {pay.status}

screenshot
<Button onClick={() => handleStatusChange(pay.id, "Approved")} className="bg-green-600" > Approve <Button onClick={() => handleStatusChange(pay.id, "Pending")} className="bg-yellow-500" > Pending
))}
); }

payment UI preview

payment UI preview

import React, { useState } from "react"; import { Card, CardContent } from "@/components/ui/card"; import { Button } from "@/components/ui/button";

export default function PaymentPreview() { const [submitted, setSubmitted] = useState(false);

return (

QR कोड स्कॅन करून पेमेंट करा

{!submitted ? ( <form onSubmit={(e) => { e.preventDefault(); setSubmitted(true); }} className="space-y-3" > UPI QR Code ) : (
पेमेंट यशस्वी! तुमचा स्क्रीनशॉट सबमिट झाला आहे.
)}
); }

full e com code

full e com code

// --- Updated Payment Submission (with order info + email alert simulation) --- import React, { useState } from 'react'; import axios from 'axios';

function PaymentUPI() { const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [product, setProduct] = useState(''); const [amount, setAmount] = useState(''); const [file, setFile] = useState(null); const [msg, setMsg] = useState('');

const handleSubmit = async (e) => { e.preventDefault(); const formData = new FormData(); formData.append('name', name); formData.append('email', email); formData.append('product', product); formData.append('amount', amount); formData.append('screenshot', file);

try {
  await axios.post('http://localhost:5000/api/payments', formData);
  setMsg('पेमेंट यशस्वी!');
} catch (err) {
  setMsg('त्रुटी आली. कृपया पुन्हा प्रयत्न करा.');
}

};

return (

QR कोड स्कॅन करून पेमेंट करा

UPI QR Code
<input type="text" placeholder="तुमचं नाव" className="border p-2 w-full" value={name} onChange={e => setName(e.target.value)} required /> <input type="email" placeholder="ई-मेल" className="border p-2 w-full" value={email} onChange={e => setEmail(e.target.value)} required /> <input type="text" placeholder="प्रॉडक्ट / ऑर्डर डिटेल्स" className="border p-2 w-full" value={product} onChange={e => setProduct(e.target.value)} required /> <input type="number" placeholder="रक्कम (₹)" className="border p-2 w-full" value={amount} onChange={e => setAmount(e.target.value)} required /> <input type="file" accept="image/*" onChange={e => setFile(e.target.files[0])} className="w-full" required />
{msg &&

{msg}

}
); }

export default PaymentUPI;

// --- Updated Backend server/index.js --- const Payment = mongoose.model('Payment', new mongoose.Schema({ name: String, email: String, product: String, amount: Number, screenshot: String, status: { type: String, default: 'Pending' }, createdAt: { type: Date, default: Date.now } }));

app.post('/api/payments', upload.single('screenshot'), async (req, res) => { const { name, email, product, amount } = req.body; const screenshot = req.file?.filename; const payment = await Payment.create({ name, email, product, amount, screenshot });

// (Simulated email alert) console.log(EMAIL SENT to ${email}: पेमेंट प्राप्त झाला! ₹${amount} - ${product});

res.json(payment); });

 
Copyright © 2015. SP MART
Blogger Templates