-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdelivery.js
65 lines (48 loc) · 1.86 KB
/
delivery.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
var loginDetails = JSON.parse(localStorage.getItem("lsUserData"))
displayData(loginDetails)
var displayData2 = JSON.parse(localStorage.getItem("clicked_Image"))
// console.log('displayData:', displayData)
// console.log('data:', data)
displayData2a(displayData2)
// console.log('data:', data)
function displayData(ele) {
var fix = document.createElement("h3");
fix.innerHTML = "Logged in";
let div = document.createElement("div");
var title = document.createElement("h3");
title.innerHTML = ele[0].lsName;
var mobile = document.createElement("h3");
mobile.innerHTML = ` | ${ele[0].lsNumber}`;
div.append(title, mobile);
document.querySelector("#login").append(fix, div);
};
function displayData2a(item) {
var prod = document.createElement("p");
prod.innerHTML = item.food_name;
var mrp = document.createElement("p");
mrp.innerHTML = `₹ ${item.Price}`;
var div1 = document.createElement("div")
var div1a = document.createElement("p")
div1a.innerHTML = "Card Amount"
var div1b = document.createElement("p")
div1b.innerHTML = `₹ ${item.Price}`
var div2 = document.createElement("div")
var div2a = document.createElement("p")
div2a.innerHTML = "Discount"
var div2b = document.createElement("p")
div2b.innerHTML = "₹ 12"
var div3 = document.createElement("div")
var div3a = document.createElement("p")
div3a.innerHTML = "Delivery"
var div3b = document.createElement("p")
div3b.innerHTML = "Free"
div3b.id = "FreeItem"
var total = document.createElement("h3")
total.innerHTML = `₹ ${item.Price - 12}`
div1.append(div1a, div1b)
div2.append(div2a, div2b)
div3.append(div3a, div3b)
document.querySelector("#detail").append(prod, mrp);
document.querySelector("#final").append(div1, div2, div3)
document.querySelector("#total").append(total)
};