-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
103 lines (94 loc) · 4.97 KB
/
index.html
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ইসলামি বই ডট কম</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
<div id="app">
<div class="container">
<br>
<nav id="top-navigation" class="well well-sm flex flex-row align-center">
<a href="#" @click.prevent="isShowingCart = false"><strong>ইসলামি বই ডট কম</strong></a>
<div class="text-right pull-right cart-info">
<span class="stats">{{ cart.items.length }} <template v-if="cart.items.length == 1">item</template>
<template v-else>items</template> in cart, মোট মূল্য {{ cartTotal | currency }}</span>
<button class="btn btn-primary" @click="isShowingCart = true">শপিংব্যাগ দেখুন</button>
</div>
</nav>
<div v-if="!isShowingCart" id="products" class="row list-group">
<div v-for="product in products" class="item col-xs-4">
<div class="thumbnail">
<img class="group list-group-image" src="images/product.png">
<div class="caption">
<h4 class="group inner list-group-item-heading"> {{ product.name }} </h4>
<p class="group inner list-group-item-text"> {{ product.description }} </p>
<br>
<div class="row flex flex-row align-center">
<div class="col-xs-4">
<p class="lead">{{ product.price | currency }}</p>
</div>
<div class="col-xs-8 flex flex-row align-center justify-right">
<div class="number-in-stock"
:class="{ few: product.inStock < 10, none: product.inStock == 0}">
{{ product.inStock }} in stock
</div>
<button class="btn btn-success" @click="addProductToCart(product)"
:disabled="product.inStock == 0">ব্যাগে যুক্ত করুন</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div v-else>
<h1>Cart</h1>
<table v-if="cart.items.length > 0" class="table table-striped">
<thead>
<tr>
<th>নাম</th>
<th>পরিমাণ</th>
<th>মূল্য</th>
</tr>
</thead>
<tbody>
<tr v-for="item in cart.items">
<td> {{ item.product.name }}</td>
<td> <button class="btn" @click="increaseQuantity(item)" :disabled="item.product.inStock == 0" :class="{ 'btn-success': item.product.inStock > 0, 'btn-danger': item.product.inStock == 0}">+</button> {{ item.quantity }} <button class="btn btn-danger" @click="decreaseQuantity(item)">-</button></td>
<td> {{ item.quantity * item.product.price | currency }}</td>
</tr>
<tr>
<td class="text-right" colspan="2">
<strong>Subtotal</strong>
</td>
<td>{{ cartTotal | currency }}</td>
</tr>
<tr>
<td class="text-right" colspan="2">
<strong>ট্যাক্স</strong>
</td>
<td> {{ taxAmount | currency}} </td>
</tr>
<tr>
<td class="text-right" colspan="2">
<strong>মোট</strong>
</td>
<td> {{ cartTotal + taxAmount | currency }}</td>
</tr>
<tr>
<td class="text-right" colspan="2">
<td><button class="btn btn-success" @click="checkout(item)">চেকআউট করুন</button></td>
</td>
</tr>
</tbody>
</table>
<p v-else>আপনার কার্টে কোনো বই নেই!</p>
</div>
</div>
</div>
<script src="js/vue.js"></script>
<script src="js/app.js"></script>
</body>
</html>