init
This commit is contained in:
227
pages/_slug.vue
Normal file
227
pages/_slug.vue
Normal file
@@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<v-container mt-4 style="padding-bottom:120px;">
|
||||
<p v-if="$fetchState.pending">Loading....</p>
|
||||
<p v-else-if="$fetchState.error">Error while fetching...</p>
|
||||
<v-row v-else>
|
||||
<v-card class="mx-auto pa-3">
|
||||
<v-card width="500" class="justify-center">
|
||||
<v-img
|
||||
:src="`https://api7.siliconpin.com/assets/${pageContent.data[0].img}`"
|
||||
aspect-ratio="1.2"
|
||||
></v-img>
|
||||
</v-card>
|
||||
|
||||
<v-card-title
|
||||
class="font-weight-bold justify-center"
|
||||
style="font-size:2em; line-height: 1.6;"
|
||||
>{{ pageContent.data[0].name }}</v-card-title>
|
||||
<!-- :class="{'subheading': $vuetify.breakpoint.xs}" -->
|
||||
<hr />
|
||||
<div class="text-center font-weight-bold">
|
||||
<span v-if="pageContent.data[0].description"></span>
|
||||
{{ pageContent.data[0].description }}
|
||||
<br />
|
||||
<div class="pa-1" v-if="pageContent.data[0].price">
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="addToCart(pageContent.data[0].price)"
|
||||
>{{ pageContent.data[0].quantity }}</v-btn>
|
||||
<span>মূল্য - {{ pageContent.data[0].price }} টাকা ।</span>
|
||||
</div>
|
||||
<div class="pa-1" v-if="pageContent.data[0].p2">
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="addToCart(pageContent.data[0].p2)"
|
||||
>{{ pageContent.data[0].q2 }}</v-btn>
|
||||
<span>মূল্য - {{ pageContent.data[0].p2 }} টাকা ।</span>
|
||||
</div>
|
||||
<div class="pa-1" v-if="pageContent.data[0].p3">
|
||||
<v-btn color="primary"
|
||||
@click="addToCart(pageContent.data[0].p3)"
|
||||
>{{ pageContent.data[0].q3 }}</v-btn>
|
||||
<span>মূল্য - {{ pageContent.data[0].p3 }} টাকা ।</span>
|
||||
</div>
|
||||
<div class="pa-1" v-if="pageContent.data[0].p4">
|
||||
<v-btn color="primary"
|
||||
@click="addToCart(pageContent.data[0].p4)"
|
||||
>{{ pageContent.data[0].q4 }}</v-btn>
|
||||
<span>মূল্য - {{ pageContent.data[0].p4 }} টাকা ।</span>
|
||||
|
||||
</div>
|
||||
<!-- <div> {{ cartTotal }} </div> -->
|
||||
<!-- <div> {{cartBag}} </div> -->
|
||||
<div v-if="addedToCartChip">
|
||||
<v-chip
|
||||
class="ma-2"
|
||||
close
|
||||
color="red"
|
||||
text-color="white"
|
||||
@click:close="addedToCartChip = false"
|
||||
>
|
||||
ব্যাগ এ রাখা হয়েছে
|
||||
</v-chip>
|
||||
<nuxt-link to="/"> <v-btn> আরও </v-btn> </nuxt-link>
|
||||
<a href="/bag"> <v-btn> ব্যাগ </v-btn> </a>
|
||||
</div>
|
||||
|
||||
<!-- <div v-show="loaded">
|
||||
{{ $shoppingCart }}
|
||||
{{ $localStorageLoaded }}
|
||||
{{ $sessionStorageLoaded }}
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
<br />
|
||||
<div id="block_container">
|
||||
<div>
|
||||
<!-- <span> <a href="'https://wa.me/8597894293?url='+$route.params.slug" > Purchase Cash On Delivery </a> </span> -->
|
||||
</div>
|
||||
</div>
|
||||
</v-card>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pageContent: {},
|
||||
name: "",
|
||||
slug: "",
|
||||
img: "",
|
||||
cartBag:[],
|
||||
addedToCartChip:false,
|
||||
cartTotal:0,
|
||||
// apiLink:process.env.apiLink
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// loaded() {
|
||||
// return this.$store.state.shoppingCart.status ,this.$store.state.localStorage.status , this.$store.state.sessionStorage.status
|
||||
// }
|
||||
},
|
||||
mounted: function() {
|
||||
/// Retrieves cart from local storage when user first loads
|
||||
|
||||
// this.shoppingCart = JSON.parse(
|
||||
// localStorage.getItem('shoppingCart') || "[]")
|
||||
|
||||
if (localStorage && localStorage.cart) {
|
||||
const cartBag = JSON.parse(localStorage.cart);
|
||||
this.cartBag = cartBag;
|
||||
cartBag.forEach((i) => {
|
||||
// total += i.amount * 1;
|
||||
this.cartTotal++
|
||||
});
|
||||
// this.cartTotal = total;
|
||||
// this.countTotals(cart);
|
||||
// alert("ss")
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
addToCart(price) {
|
||||
const cartRaw = localStorage.cart || '[]';
|
||||
const cart = JSON.parse(cartRaw)
|
||||
let product={}
|
||||
product["slug"]=this.slug
|
||||
product["name"]=this.name
|
||||
product["price"]=price
|
||||
product["img"]=this.img
|
||||
// const product=[slug, name, price]
|
||||
// if(process.client){
|
||||
cart.push({
|
||||
// ...this.selectedCard,
|
||||
product:product
|
||||
});
|
||||
localStorage.cart = JSON.stringify(cart);
|
||||
this.addedToCartChip=true
|
||||
// this.$router.push('/bag');
|
||||
// }
|
||||
// let exists = false
|
||||
|
||||
// for (const cartItem of this.shoppingCart) {
|
||||
// if (cartItem.slug === product.slug) {
|
||||
// cartItem.amount = cartItem.amount + 1
|
||||
// exists = true
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// if (!exists) {
|
||||
|
||||
// this.shoppingCart.push({
|
||||
// ...product,
|
||||
// amount: 1,
|
||||
// })
|
||||
// console.log(product)
|
||||
// }
|
||||
},
|
||||
},
|
||||
// async asyncData({ $axios, route }) {
|
||||
// const product = await $axios.$get(`/swarnamaths/?slug=`+route.params.slug)
|
||||
// // $route.fullPath
|
||||
// // console.log(route.params.slug);
|
||||
// // console.log(product)
|
||||
// const url=route.params.slug
|
||||
// return { product}
|
||||
// },
|
||||
async fetch() {
|
||||
this.pageContent = await fetch(
|
||||
'https://api7.siliconpin.com/items/swarnamath?filter[slug]=' + this.$route.params.slug
|
||||
).then(res => res.json())
|
||||
this.name = this.pageContent.data[0].name
|
||||
this.slug = this.pageContent.data[0].slug
|
||||
if (this.pageContent.data[0].img) this.img = this.pageContent.data[0].img
|
||||
},
|
||||
fetchOnServer: false,
|
||||
head() {
|
||||
return {
|
||||
title: this.name,
|
||||
meta: [
|
||||
// hid is used as unique identifier. Do not use `vmid` for it as it will not work
|
||||
{
|
||||
hid: 'description',
|
||||
name: 'description',
|
||||
content: this.name
|
||||
},
|
||||
{
|
||||
hid: 'og:description',
|
||||
name: 'og:description',
|
||||
content: this.name
|
||||
},
|
||||
{
|
||||
hid: 'og:title',
|
||||
name: 'og:title',
|
||||
content: this.name
|
||||
},
|
||||
{
|
||||
hid: 'og:url',
|
||||
name: 'og:url',
|
||||
content: 'https://swarnamath.com/' + this.slug
|
||||
},
|
||||
{
|
||||
hid: 'og:image',
|
||||
name: 'og:image',
|
||||
content: 'https://api7.siliconpin.com' + this.img
|
||||
},
|
||||
{
|
||||
hid: 'og:image:secure_url',
|
||||
name: 'og:image:secure_url',
|
||||
content: 'https://api7.siliconpin.com' + this.img
|
||||
},
|
||||
{
|
||||
hid: 'og:type',
|
||||
name: 'og:type',
|
||||
content: 'News'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scopped>
|
||||
#block_container {
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
||||
18
pages/about.vue
Normal file
18
pages/about.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<v-text>
|
||||
|
||||
|
||||
<!-- mounted() {
|
||||
document.onreadystatechange = () => {
|
||||
if (document.readyState == "complete") {
|
||||
console.log('Page completed with image and files!')
|
||||
|
||||
// HOW LOAD COMPONENTS HERE?
|
||||
this.readyStateComplete = true
|
||||
|
||||
}
|
||||
}
|
||||
}, -->
|
||||
|
||||
</v-text>
|
||||
</template>
|
||||
182
pages/bag.vue
Normal file
182
pages/bag.vue
Normal file
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<v-container mt-4 style="padding-bottom:120px;">
|
||||
<!-- <v-card class="bg mb-5" v-show="calculateCart"> -->
|
||||
<v-card class="bg mb-5" >
|
||||
<v-card v-for="item in cartBag" :key="item.slug">
|
||||
<div>
|
||||
<div>
|
||||
<v-avatar class="ma-3" size="125" tile>
|
||||
<v-img v-if="item.product.img" :src="`https://api7.siliconpin.com/assets/${item.product.img}`"></v-img>
|
||||
</v-avatar>
|
||||
|
||||
<v-card-title class="text-h5" v-text="item.product.name"></v-card-title>
|
||||
|
||||
<v-card-subtitle v-text="item.product.name"></v-card-subtitle>
|
||||
|
||||
<!-- <v-card-actions>
|
||||
<v-btn
|
||||
v-if="item.artist === 'Ellie Goulding'"
|
||||
class="ml-2 mt-3"
|
||||
fab
|
||||
icon
|
||||
height="40px"
|
||||
right
|
||||
width="40px"
|
||||
>
|
||||
<v-icon>mdi-play</v-icon>
|
||||
</v-btn>
|
||||
|
||||
<v-btn
|
||||
v-else
|
||||
class="ml-2 mt-5"
|
||||
outlined
|
||||
rounded
|
||||
big
|
||||
>
|
||||
বাদ
|
||||
</v-btn>
|
||||
</v-card-actions>-->
|
||||
</div>
|
||||
</div>
|
||||
</v-card>
|
||||
<div v-if="bagTotalPrice>0" >
|
||||
<h2 > মোট {{bagTotalPrice}} /- টাকা</h2>
|
||||
<v-btn @click="cartEmpty()">
|
||||
বাদ
|
||||
</v-btn>
|
||||
<v-btn>
|
||||
<nuxt-link to="/purchase">এগিয়ে যাই</nuxt-link>
|
||||
</v-btn>
|
||||
|
||||
</div>
|
||||
|
||||
<h2 v-else > ব্যাগ ফাঁকা </h2>
|
||||
</v-card>
|
||||
<v-btn>
|
||||
<nuxt-link to="/">আরও কিনবো</nuxt-link>
|
||||
</v-btn>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pageContent: {},
|
||||
name: "",
|
||||
slug: "",
|
||||
img: "",
|
||||
cartBag: [],
|
||||
bagTotalPrice: 0,
|
||||
formData: {
|
||||
slug: "",
|
||||
name: "",
|
||||
price: "",
|
||||
// permission: []
|
||||
}
|
||||
|
||||
// apiLink:process.env.apiLink
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// loaded() {
|
||||
// return this.$store.state.shoppingCart.status ,this.$store.state.localStorage.status , this.$store.state.sessionStorage.status
|
||||
// }
|
||||
// calculateCart(){
|
||||
// if (localStorage && localStorage.cart) {
|
||||
// const cart = JSON.parse(localStorage.cart);
|
||||
// this.cart = cart;
|
||||
// // this.countTotals(cart);
|
||||
// }
|
||||
// }
|
||||
},
|
||||
mounted() {
|
||||
/// Retrieves cart from local storage when user first loads
|
||||
|
||||
// this.shoppingCart = JSON.parse(
|
||||
// localStorage.getItem('shoppingCart') || "[]")
|
||||
if (localStorage && localStorage.cart) {
|
||||
const cartBag = JSON.parse(localStorage.cart);
|
||||
this.cartBag = cartBag;
|
||||
this.cartBag.forEach(element => {
|
||||
this.bagTotalPrice +=element.product.price
|
||||
// console.log(element.product.price)
|
||||
});
|
||||
// this.countTotals(cart);
|
||||
// alert("ss")
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
cartEmpty() {
|
||||
|
||||
localStorage.cart = '[]';
|
||||
// this.$forceUpdate();
|
||||
this.$router.go(0);
|
||||
|
||||
|
||||
},
|
||||
calculateCart(){
|
||||
if (localStorage && localStorage.cart) {
|
||||
const cart = JSON.parse(localStorage.cart);
|
||||
this.cart = cart;
|
||||
// this.countTotals(cart);
|
||||
}
|
||||
}
|
||||
},
|
||||
// async fetch() {
|
||||
// this.pageContent = await fetch(
|
||||
// 'https://api7.siliconpin.com/items/swarnamath?filter[slug]=' + this.$route.params.slug
|
||||
// ).then(res => res.json())
|
||||
// this.name = this.pageContent.data[0].name
|
||||
// this.slug = this.pageContent.data[0].slug
|
||||
// if (this.pageContent.data[0].img) this.img = this.pageContent.data[0].img
|
||||
// },
|
||||
// head() {
|
||||
// return {
|
||||
// title: this.name,
|
||||
// meta: [
|
||||
// // hid is used as unique identifier. Do not use `vmid` for it as it will not work
|
||||
// {
|
||||
// hid: 'description',
|
||||
// name: 'description',
|
||||
// content: this.name
|
||||
// },
|
||||
// {
|
||||
// hid: 'og:description',
|
||||
// name: 'og:description',
|
||||
// content: this.name
|
||||
// },
|
||||
// {
|
||||
// hid: 'og:title',
|
||||
// name: 'og:title',
|
||||
// content: this.name
|
||||
// },
|
||||
// {
|
||||
// hid: 'og:url',
|
||||
// name: 'og:url',
|
||||
// content: 'https://swarnamath.com/' + this.slug
|
||||
// },
|
||||
// {
|
||||
// hid: 'og:image',
|
||||
// name: 'og:image',
|
||||
// content: 'https://api7.siliconpin.com' + this.img
|
||||
// },
|
||||
// {
|
||||
// hid: 'og:image:secure_url',
|
||||
// name: 'og:image:secure_url',
|
||||
// content: 'https://api7.siliconpin.com' + this.img
|
||||
// },
|
||||
// {
|
||||
// hid: 'og:type',
|
||||
// name: 'og:type',
|
||||
// content: 'News'
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// }
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
a{ text-decoration:none}
|
||||
</style>
|
||||
238
pages/category/_slug.vue
Normal file
238
pages/category/_slug.vue
Normal file
@@ -0,0 +1,238 @@
|
||||
<template>
|
||||
<v-container mt-4 style="padding-bottom:120px;">
|
||||
<p v-if="$fetchState.pending">Loading....</p>
|
||||
<p v-else-if="$fetchState.error">Error while fetching...</p>
|
||||
<v-row v-else>
|
||||
<v-col v-for="Service in pageContent.data" :key="pageContent.data.id" sm="6" lg="4" xl="3">
|
||||
<nuxt-link :to="`/${Service.slug}`">
|
||||
<v-card class>
|
||||
<v-img :src="`https://api7.siliconpin.com/assets/${Service.img}`" aspect-ratio="1.2"></v-img>
|
||||
|
||||
<v-card-text>
|
||||
<h3>{{ Service.name }}</h3>
|
||||
</v-card-text>
|
||||
<v-rating
|
||||
half-increments
|
||||
dense
|
||||
size="20"
|
||||
v-model="Service.rating"
|
||||
background-color="orange lighten-3"
|
||||
color="orange"
|
||||
></v-rating>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;">
|
||||
{{ Service.description }}
|
||||
<br />
|
||||
<span style="font-weight:bold">মূল্য {{ Service.price }} টাকা ।</span>
|
||||
<!-- <span v-if="Service.p2" style="font-weight:bold">মূল্য {{ Service.p2 }} টাকা ।</span> -->
|
||||
</p>
|
||||
</v-card>
|
||||
</nuxt-link>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- <v-row v-else>
|
||||
<v-card class="mx-auto pa-3">
|
||||
<v-card width="500" class="justify-center">
|
||||
<v-img
|
||||
:src="`https://api7.siliconpin.com/assets/${pageContent.data[0].img}`"
|
||||
aspect-ratio="1.2"
|
||||
></v-img>
|
||||
</v-card>
|
||||
|
||||
<v-card-title
|
||||
class="font-weight-bold justify-center"
|
||||
style="font-size:2em; line-height: 1.6;"
|
||||
>{{ pageContent.data[0].name }}</v-card-title>
|
||||
<hr />
|
||||
<div class="text-center font-weight-bold">
|
||||
<span v-if="pageContent.data[0].description"></span>
|
||||
{{ pageContent.data[0].description }}
|
||||
<br />
|
||||
<div class="pa-1" v-if="pageContent.data[0].price">
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="addToCart(pageContent.data[0].price)"
|
||||
>{{ pageContent.data[0].quantity }}</v-btn>
|
||||
<span>মূল্য - {{ pageContent.data[0].price }} টাকা ।</span>
|
||||
</div>
|
||||
<div class="pa-1" v-if="pageContent.data[0].p2">
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="addToCart(pageContent.data[0].p2)"
|
||||
>{{ pageContent.data[0].q2 }}</v-btn>
|
||||
<span>মূল্য - {{ pageContent.data[0].p2 }} টাকা ।</span>
|
||||
</div>
|
||||
<div class="pa-1" v-if="pageContent.data[0].p3">
|
||||
<v-btn color="primary"
|
||||
@click="addToCart(pageContent.data[0].p3)"
|
||||
>{{ pageContent.data[0].q3 }}</v-btn>
|
||||
<span>মূল্য - {{ pageContent.data[0].p3 }} টাকা ।</span>
|
||||
</div>
|
||||
<div class="pa-1" v-if="pageContent.data[0].p4">
|
||||
<v-btn color="primary"
|
||||
@click="addToCart(pageContent.data[0].p4)"
|
||||
>{{ pageContent.data[0].q4 }}</v-btn>
|
||||
<span>মূল্য - {{ pageContent.data[0].p4 }} টাকা ।</span>
|
||||
|
||||
</div>
|
||||
<div v-if="addedToCartChip">
|
||||
<v-chip
|
||||
class="ma-2"
|
||||
close
|
||||
color="red"
|
||||
text-color="white"
|
||||
@click:close="addedToCartChip = false"
|
||||
>
|
||||
ব্যাগ এ রাখা হয়েছে
|
||||
</v-chip>
|
||||
<nuxt-link to="/"> <v-btn> আরও </v-btn> </nuxt-link>
|
||||
<a href="/bag"> <v-btn> ব্যাগ </v-btn> </a>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div id="block_container">
|
||||
<div>
|
||||
</div>
|
||||
</div>
|
||||
</v-card>
|
||||
</v-row> -->
|
||||
</v-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pageContent: {},
|
||||
name: "",
|
||||
slug: "",
|
||||
img: "",
|
||||
cartBag:[],
|
||||
addedToCartChip:false,
|
||||
cartTotal:0,
|
||||
// apiLink:process.env.apiLink
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// loaded() {
|
||||
// return this.$store.state.shoppingCart.status ,this.$store.state.localStorage.status , this.$store.state.sessionStorage.status
|
||||
// }
|
||||
},
|
||||
mounted: function() {
|
||||
/// Retrieves cart from local storage when user first loads
|
||||
|
||||
// this.shoppingCart = JSON.parse(
|
||||
// localStorage.getItem('shoppingCart') || "[]")
|
||||
|
||||
if (localStorage && localStorage.cart) {
|
||||
const cartBag = JSON.parse(localStorage.cart);
|
||||
this.cartBag = cartBag;
|
||||
cartBag.forEach((i) => {
|
||||
// total += i.amount * 1;
|
||||
this.cartTotal++
|
||||
});
|
||||
// this.cartTotal = total;
|
||||
// this.countTotals(cart);
|
||||
// alert("ss")
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
addToCart(price) {
|
||||
const cartRaw = localStorage.cart || '[]';
|
||||
const cart = JSON.parse(cartRaw)
|
||||
let product={}
|
||||
product["slug"]=this.slug
|
||||
product["name"]=this.name
|
||||
product["price"]=price
|
||||
product["img"]=this.img
|
||||
// const product=[slug, name, price]
|
||||
// if(process.client){
|
||||
cart.push({
|
||||
// ...this.selectedCard,
|
||||
product:product
|
||||
});
|
||||
localStorage.cart = JSON.stringify(cart);
|
||||
this.addedToCartChip=true
|
||||
// this.$router.push('/bag');
|
||||
// }
|
||||
// let exists = false
|
||||
|
||||
// for (const cartItem of this.shoppingCart) {
|
||||
// if (cartItem.slug === product.slug) {
|
||||
// cartItem.amount = cartItem.amount + 1
|
||||
// exists = true
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// if (!exists) {
|
||||
|
||||
// this.shoppingCart.push({
|
||||
// ...product,
|
||||
// amount: 1,
|
||||
// })
|
||||
// console.log(product)
|
||||
// }
|
||||
},
|
||||
},
|
||||
|
||||
async fetch() {
|
||||
this.pageContent = await fetch(
|
||||
'https://api7.siliconpin.com/items/swarnamath?filter[cat]=["' + this.$route.params.slug +'"]'
|
||||
).then(res => res.json())
|
||||
// console.log(this.pageContent.data[0])
|
||||
// this.name = this.pageContent.data[0].name
|
||||
// this.slug = this.pageContent.data[0].slug
|
||||
// if (this.pageContent.data[0].img) this.img = this.pageContent.data[0].img
|
||||
},
|
||||
fetchOnServer: false,
|
||||
head() {
|
||||
return {
|
||||
title: this.name,
|
||||
meta: [
|
||||
// hid is used as unique identifier. Do not use `vmid` for it as it will not work
|
||||
{
|
||||
hid: 'description',
|
||||
name: 'description',
|
||||
content: this.name
|
||||
},
|
||||
{
|
||||
hid: 'og:description',
|
||||
name: 'og:description',
|
||||
content: this.name
|
||||
},
|
||||
{
|
||||
hid: 'og:title',
|
||||
name: 'og:title',
|
||||
content: this.name
|
||||
},
|
||||
{
|
||||
hid: 'og:url',
|
||||
name: 'og:url',
|
||||
content: 'https://swarnamath.com/' + this.slug
|
||||
},
|
||||
{
|
||||
hid: 'og:image',
|
||||
name: 'og:image',
|
||||
content: 'https://api7.siliconpin.com' + this.img
|
||||
},
|
||||
{
|
||||
hid: 'og:image:secure_url',
|
||||
name: 'og:image:secure_url',
|
||||
content: 'https://api7.siliconpin.com' + this.img
|
||||
},
|
||||
{
|
||||
hid: 'og:type',
|
||||
name: 'og:type',
|
||||
content: 'News'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scopped>
|
||||
#block_container {
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
||||
94
pages/contact.vue
Normal file
94
pages/contact.vue
Normal file
@@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-img src="/images/veg.jpg">
|
||||
|
||||
<template>
|
||||
<v-container>
|
||||
<v-row class="py-5">
|
||||
<v-title class="font-weight-bold white--text" >CONTACT US<br><v-icon class="black--text">mdi-whatsapp</v-icon>- 8597894293</v-title>
|
||||
<v-col md="12">
|
||||
|
||||
<template>
|
||||
<v-card outlined id="position" width="500" class="pa-5 mx-auto mt-5" color="grey lighten-3">
|
||||
<v-form ref="form" v-model="valid" lazy-validation>
|
||||
<v-text-field v-model="name" :counter="10" :rules="nameRules" label="Name"
|
||||
required>
|
||||
</v-text-field>
|
||||
<v-text-field label="P-Number" required>
|
||||
</v-text-field>
|
||||
|
||||
<v-text-field v-model="email" :rules="emailRules" label="E-mail" required>
|
||||
</v-text-field>
|
||||
|
||||
|
||||
<v-textarea color="cyan" label="Input Massege"></v-textarea>
|
||||
|
||||
<v-checkbox v-model="checkbox"
|
||||
:rules="[v => !!v || 'You must agree to continue!']" label="Do you agree?"
|
||||
required></v-checkbox>
|
||||
<!--
|
||||
<v-btn :disabled="!valid" color="success" class="mr-4" @click="validate">
|
||||
Submit
|
||||
</v-btn> -->
|
||||
|
||||
|
||||
</v-form>
|
||||
</v-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
</v-container>
|
||||
|
||||
</template>
|
||||
</v-img>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data: () => ({
|
||||
valid: true,
|
||||
name: '',
|
||||
nameRules: [
|
||||
v => !!v || 'Name is required',
|
||||
v => (v && v.length <= 10) || 'Name must be less than 10 characters',
|
||||
],
|
||||
email: '',
|
||||
emailRules: [
|
||||
v => !!v || 'E-mail is required',
|
||||
v => /.+@.+\..+/.test(v) || 'E-mail must be valid',
|
||||
],
|
||||
select: null,
|
||||
items: [
|
||||
'Item 1',
|
||||
'Item 2',
|
||||
'Item 3',
|
||||
'Item 4',
|
||||
],
|
||||
checkbox: false,
|
||||
}),
|
||||
|
||||
methods: {
|
||||
validate() {
|
||||
this.$refs.form.validate()
|
||||
},
|
||||
reset() {
|
||||
this.$refs.form.reset()
|
||||
},
|
||||
resetValidation() {
|
||||
this.$refs.form.resetValidation()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
384
pages/index.vue
Normal file
384
pages/index.vue
Normal file
@@ -0,0 +1,384 @@
|
||||
<template>
|
||||
<v-container>
|
||||
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-card>
|
||||
<center>
|
||||
<h2>সবজি</h2>
|
||||
</center>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col v-for="Service in catVegetables" :key="catVegetables.id" sm="6" lg="4" xl="3">
|
||||
<nuxt-link :to="`/${Service.slug}`">
|
||||
<v-card class="mx-auto mb-1">
|
||||
<v-img :src="`https://api7.siliconpin.com/assets/${Service.img}`" aspect-ratio="1.2"></v-img>
|
||||
|
||||
<v-card-text>
|
||||
<h3>{{ Service.name }}</h3>
|
||||
</v-card-text>
|
||||
<v-rating
|
||||
half-increments
|
||||
dense
|
||||
size="20"
|
||||
v-model="Service.rating"
|
||||
background-color="orange lighten-3"
|
||||
color="orange"
|
||||
></v-rating>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;">
|
||||
{{ Service.description }}
|
||||
<br />
|
||||
<span style="font-weight:bold">মূল্য {{ Service.price }} টাকা ।</span>
|
||||
<!-- <span v-if="Service.p2" style="font-weight:bold">মূল্য {{ Service.p2 }} টাকা ।</span> -->
|
||||
</p>
|
||||
</v-card>
|
||||
</nuxt-link>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-card>
|
||||
<center>
|
||||
<h2>ফল</h2>
|
||||
</center>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row>
|
||||
<v-col v-for="Service in catFruits" :key="catFruits.id" sm="6" lg="4" xl="3">
|
||||
<nuxt-link :to="`/${Service.slug}`">
|
||||
<v-card class>
|
||||
<v-img :src="`https://api7.siliconpin.com/assets/${Service.img}`" aspect-ratio="1.2"></v-img>
|
||||
|
||||
<v-card-text>
|
||||
<h3>{{ Service.name }}</h3>
|
||||
</v-card-text>
|
||||
<v-rating
|
||||
half-increments
|
||||
dense
|
||||
size="20"
|
||||
v-model="Service.rating"
|
||||
background-color="orange lighten-3"
|
||||
color="orange"
|
||||
></v-rating>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;">
|
||||
{{ Service.description }}
|
||||
<br />
|
||||
<span style="font-weight:bold">মূল্য {{ Service.price }} টাকা ।</span>
|
||||
<!-- <span v-if="Service.p2" style="font-weight:bold">মূল্য {{ Service.p2 }} টাকা ।</span> -->
|
||||
</p>
|
||||
</v-card>
|
||||
</nuxt-link>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-card>
|
||||
<center>
|
||||
<h2>মুদি </h2>
|
||||
</center>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col v-for="Service in catGrocery" :key="catGrocery.id" sm="6" lg="4" xl="3">
|
||||
<nuxt-link :to="`/${Service.slug}`">
|
||||
<v-card class="mx-auto mb-1">
|
||||
<v-img :src="`https://api7.siliconpin.com/assets/${Service.img}`" aspect-ratio="1.2"></v-img>
|
||||
|
||||
<v-card-text>
|
||||
<h3>{{ Service.name }}</h3>
|
||||
</v-card-text>
|
||||
<v-rating
|
||||
half-increments
|
||||
dense
|
||||
size="20"
|
||||
v-model="Service.rating"
|
||||
background-color="orange lighten-3"
|
||||
color="orange"
|
||||
></v-rating>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;">
|
||||
{{ Service.description }}
|
||||
<br />
|
||||
<span style="font-weight:bold">মূল্য {{ Service.price }} টাকা ।</span>
|
||||
<!-- <span v-if="Service.p2" style="font-weight:bold">মূল্য {{ Service.p2 }} টাকা ।</span> -->
|
||||
</p>
|
||||
</v-card>
|
||||
</nuxt-link>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-card>
|
||||
<center>
|
||||
<h2> সার্ভিস </h2>
|
||||
</center>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col v-for="Service in catServices" :key="catServices.id" sm="6" lg="4" xl="3">
|
||||
<nuxt-link :to="`/${Service.slug}`">
|
||||
<v-card class="mx-auto mb-1">
|
||||
<v-img :src="`https://api7.siliconpin.com/assets/${Service.img}`" aspect-ratio="1.2"></v-img>
|
||||
|
||||
<v-card-text>
|
||||
<h3>{{ Service.name }}</h3>
|
||||
</v-card-text>
|
||||
<v-rating
|
||||
half-increments
|
||||
dense
|
||||
size="20"
|
||||
v-model="Service.rating"
|
||||
background-color="orange lighten-3"
|
||||
color="orange"
|
||||
></v-rating>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;">
|
||||
{{ Service.description }}
|
||||
<br />
|
||||
<span style="font-weight:bold">মূল্য {{ Service.price }} টাকা ।</span>
|
||||
<!-- <span v-if="Service.p2" style="font-weight:bold">মূল্য {{ Service.p2 }} টাকা ।</span> -->
|
||||
</p>
|
||||
</v-card>
|
||||
</nuxt-link>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-card>
|
||||
<center>
|
||||
<h2> গয়না </h2>
|
||||
</center>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col v-for="Service in catJewlry" :key="catJewlry.id" sm="6" lg="4" xl="3">
|
||||
<nuxt-link :to="`/${Service.slug}`">
|
||||
<v-card class="mx-auto mb-1">
|
||||
<v-img :src="`https://api7.siliconpin.com/assets/${Service.img}`" aspect-ratio="1.2"></v-img>
|
||||
|
||||
<v-card-text>
|
||||
<h3>{{ Service.name }}</h3>
|
||||
</v-card-text>
|
||||
<v-rating
|
||||
half-increments
|
||||
dense
|
||||
size="20"
|
||||
v-model="Service.rating"
|
||||
background-color="orange lighten-3"
|
||||
color="orange"
|
||||
></v-rating>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;">
|
||||
{{ Service.description }}
|
||||
<br />
|
||||
<span style="font-weight:bold">মূল্য {{ Service.price }} টাকা ।</span>
|
||||
<!-- <span v-if="Service.p2" style="font-weight:bold">মূল্য {{ Service.p2 }} টাকা ।</span> -->
|
||||
</p>
|
||||
</v-card>
|
||||
</nuxt-link>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-card>
|
||||
<center>
|
||||
<h2> প্রসাধনী </h2>
|
||||
</center>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col v-for="Service in catCosmetics" :key="catCosmetics.id" sm="6" lg="4" xl="3">
|
||||
<nuxt-link :to="`/${Service.slug}`">
|
||||
<v-card class="mx-auto mb-1">
|
||||
<v-img :src="`https://api7.siliconpin.com/assets/${Service.img}`" aspect-ratio="1.2"></v-img>
|
||||
|
||||
<v-card-text>
|
||||
<h3>{{ Service.name }}</h3>
|
||||
</v-card-text>
|
||||
<v-rating
|
||||
half-increments
|
||||
dense
|
||||
size="20"
|
||||
v-model="Service.rating"
|
||||
background-color="orange lighten-3"
|
||||
color="orange"
|
||||
></v-rating>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;">
|
||||
{{ Service.description }}
|
||||
<br />
|
||||
<span style="font-weight:bold">মূল্য {{ Service.price }} টাকা ।</span>
|
||||
<!-- <span v-if="Service.p2" style="font-weight:bold">মূল্য {{ Service.p2 }} টাকা ।</span> -->
|
||||
</p>
|
||||
</v-card>
|
||||
</nuxt-link>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-card>
|
||||
<center>
|
||||
<h2> জামা কাপড় </h2>
|
||||
</center>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col v-for="Service in catCloths" :key="catCloths.id" sm="6" lg="4" xl="3">
|
||||
<nuxt-link :to="`/${Service.slug}`">
|
||||
<v-card class="mx-auto mb-1">
|
||||
<v-img :src="`https://api7.siliconpin.com/assets/${Service.img}`" aspect-ratio="1.2"></v-img>
|
||||
|
||||
<v-card-text>
|
||||
<h3>{{ Service.name }}</h3>
|
||||
</v-card-text>
|
||||
<v-rating
|
||||
half-increments
|
||||
dense
|
||||
size="20"
|
||||
v-model="Service.rating"
|
||||
background-color="orange lighten-3"
|
||||
color="orange"
|
||||
></v-rating>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;">
|
||||
{{ Service.description }}
|
||||
<br />
|
||||
<span style="font-weight:bold">মূল্য {{ Service.price }} টাকা ।</span>
|
||||
<!-- <span v-if="Service.p2" style="font-weight:bold">মূল্য {{ Service.p2 }} টাকা ।</span> -->
|
||||
</p>
|
||||
</v-card>
|
||||
</nuxt-link>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<!-- <div>
|
||||
<p v-if="$fetchState.pending">Fetching mountains...</p>
|
||||
<p v-else-if="$fetchState.error">An error occurred :(</p>
|
||||
<div v-else>
|
||||
<h1>Nuxt Mountains {{mountains}} </h1>
|
||||
<ul>
|
||||
<li v-for="mountain of mountains">{{ mountain.title }}</li>
|
||||
</ul>
|
||||
<button @click="$fetch">Refresh</button>
|
||||
</div>
|
||||
</div>-->
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
smProducts: [],
|
||||
catFruits: [],
|
||||
catVegetables: [],
|
||||
catGrocery: [],
|
||||
catServices: [],
|
||||
catJewlry: [],
|
||||
catCosmetics: [],
|
||||
catCloths: [],
|
||||
// product: [],
|
||||
// shoppingCart: []
|
||||
}
|
||||
},
|
||||
// methods: {
|
||||
// addToCart(product) {
|
||||
// // const product = [slug, name, price]
|
||||
// this.shoppingCart.push({
|
||||
// ...product,
|
||||
// amount: 1,
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// watch: {
|
||||
// shoppingCart: {
|
||||
// handler(newValue) {
|
||||
// /// Updates the item in local storage
|
||||
|
||||
// localStorage.setItem('shoppingCart', JSON.stringify(newValue));
|
||||
|
||||
// }, deep: true
|
||||
// }
|
||||
// },
|
||||
// mounted() {
|
||||
// /// Retrieves cart from local storage when user first loads
|
||||
|
||||
// this.shoppingCart = JSON.parse(
|
||||
// localStorage.getItem('shoppingCart') || "[]")
|
||||
|
||||
// },
|
||||
async fetch() {
|
||||
this.smProducts = await fetch(
|
||||
'https://api7.siliconpin.com/items/swarnamath?offset=0&limit=90'
|
||||
).then(res => res.json())
|
||||
|
||||
this.catFruits = this.smProducts.data.filter(item => { if (item.cat == "fruits") return item });
|
||||
this.catVegetables = this.smProducts.data.filter(item => { if (item.cat == "vegetables") return item });
|
||||
this.catGrocery = this.smProducts.data.filter(item => { if (item.cat == "grocery") return item });
|
||||
this.catServices = this.smProducts.data.filter(item => { if (item.cat == "services") return item });
|
||||
this.catJewlry = this.smProducts.data.filter(item => { if (item.cat == "jewlry") return item });
|
||||
this.catCosmetics = this.smProducts.data.filter(item => { if (item.cat == "cosmetics") return item });
|
||||
this.catCloths = this.smProducts.data.filter(item => { if (item.cat == "cloths") return item });
|
||||
// console.log(this.catFruits)
|
||||
},
|
||||
fetchOnServer: false,
|
||||
head() {
|
||||
return {
|
||||
title: 'Swarna Math - Delivery App',
|
||||
meta: [
|
||||
// hid is used as unique identifier. Do not use `vmid` for it as it will not work
|
||||
{
|
||||
hid: 'description',
|
||||
name: 'description',
|
||||
content: 'Swarna Math - Delivery App'
|
||||
},
|
||||
{
|
||||
hid: 'og:description',
|
||||
name: 'og:description',
|
||||
content: 'Swarna Math - Delivery App'
|
||||
},
|
||||
{
|
||||
hid: 'og:title',
|
||||
name: 'og:title',
|
||||
content: 'Swarna Math - Delivery App'
|
||||
},
|
||||
{
|
||||
hid: 'og:url',
|
||||
name: 'og:url',
|
||||
content: 'https://swarnamath.com/'
|
||||
},
|
||||
{
|
||||
hid: 'og:image',
|
||||
name: 'og:image',
|
||||
content: 'https://api7.siliconpin.com/icon.png'
|
||||
},
|
||||
{
|
||||
hid: 'og:image:secure_url',
|
||||
name: 'og:image:secure_url',
|
||||
content: 'https://api7.siliconpin.com/icon.png'
|
||||
},
|
||||
{
|
||||
hid: 'og:type',
|
||||
name: 'og:type',
|
||||
content: 'Delivery App'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
174
pages/purchase.vue
Normal file
174
pages/purchase.vue
Normal file
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<v-container mt-4 style="padding-bottom:120px;">
|
||||
<v-card v-if="orderSuccess">
|
||||
<form @submit.prevent="purchase">
|
||||
<v-text-field v-model="phone" light class="pl-5 pr-5" label="ফোন নম্বর " required />
|
||||
<v-btn type="submit" color="success"> অর্ডার </v-btn>
|
||||
</form>
|
||||
</v-card>
|
||||
|
||||
<v-card v-else>
|
||||
<div> অর্ডার দেওয়া হয়েছে, {{phone}} নম্বর এ যোগাযোগ করে ডেলিভারি করা হবে | </div>
|
||||
</v-card>
|
||||
|
||||
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pageContent: {},
|
||||
namecustomer: "",
|
||||
phone: "",
|
||||
address: "",
|
||||
cart:[],
|
||||
totalPrice:0,
|
||||
orderSuccess:true
|
||||
// apiLink:process.env.apiLink
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// loaded() {
|
||||
// return this.$store.state.shoppingCart.status ,this.$store.state.localStorage.status , this.$store.state.sessionStorage.status
|
||||
// }
|
||||
},
|
||||
mounted() {
|
||||
/// Retrieves cart from local storage when user first loads
|
||||
|
||||
// this.shoppingCart = JSON.parse(
|
||||
// localStorage.getItem('shoppingCart') || "[]")
|
||||
if (localStorage && localStorage.cart) {
|
||||
const cart = JSON.parse(localStorage.cart);
|
||||
this.cart = cart;
|
||||
cart.forEach(element => {
|
||||
// ...use `element`...
|
||||
this.totalPrice +=element.product.price
|
||||
|
||||
});
|
||||
// console.log(this.totalPrice)
|
||||
// this.countTotals(cart);
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
calTotal(){
|
||||
|
||||
},
|
||||
purchase() {
|
||||
const rawResponse = fetch('https://api7.siliconpin.com/items/sm_cart', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({"amount": this.totalPrice, "phone": this.phone, "cart": this.cart})
|
||||
})
|
||||
.then(function(res){
|
||||
console.log(res)
|
||||
localStorage.cart=[]
|
||||
|
||||
})
|
||||
.catch(function(res){ console.log(res) }) ;
|
||||
this.orderSuccess=false
|
||||
|
||||
// const content = rawResponse.json();
|
||||
// console.log("kk")
|
||||
// console.log(rawResponse)
|
||||
|
||||
// const cartLocal = localStorage.cart || '[]';
|
||||
// const cart = JSON.parse(cartLocal)
|
||||
// let product={}
|
||||
// product["slug"]=slug
|
||||
// product["name"]=name
|
||||
// product["price"]=price
|
||||
// // const product=[slug, name, price]
|
||||
// if(process.client){
|
||||
// cart.push({
|
||||
// // ...this.selectedCard,
|
||||
// product:product
|
||||
// });
|
||||
// localStorage.cart = JSON.stringify(cart);
|
||||
// this.$router.push('/bag');
|
||||
// }
|
||||
// let exists = false
|
||||
|
||||
// for (const cartItem of this.shoppingCart) {
|
||||
// if (cartItem.slug === product.slug) {
|
||||
// cartItem.amount = cartItem.amount + 1
|
||||
// exists = true
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// if (!exists) {
|
||||
|
||||
// this.shoppingCart.push({
|
||||
// ...product,
|
||||
// amount: 1,
|
||||
// })
|
||||
// console.log(product)
|
||||
// }
|
||||
},
|
||||
},
|
||||
// async asyncData({ $axios, route }) {
|
||||
// const product = await $axios.$get(`/swarnamaths/?slug=`+route.params.slug)
|
||||
// // $route.fullPath
|
||||
// // console.log(route.params.slug);
|
||||
// // console.log(product)
|
||||
// const url=route.params.slug
|
||||
// return { product}
|
||||
// },
|
||||
// async fetch() {
|
||||
// this.pageContent = await fetch(
|
||||
// 'https://api7.siliconpin.com/items/swarnamath?filter[slug]=' + this.$route.params.slug
|
||||
// ).then(res => res.json())
|
||||
// this.name = this.pageContent.data[0].name
|
||||
// this.slug = this.pageContent.data[0].slug
|
||||
// if (this.pageContent.data[0].img) this.img = this.pageContent.data[0].img
|
||||
// },
|
||||
// head() {
|
||||
// return {
|
||||
// title: this.name,
|
||||
// meta: [
|
||||
// // hid is used as unique identifier. Do not use `vmid` for it as it will not work
|
||||
// {
|
||||
// hid: 'description',
|
||||
// name: 'description',
|
||||
// content: this.name
|
||||
// },
|
||||
// {
|
||||
// hid: 'og:description',
|
||||
// name: 'og:description',
|
||||
// content: this.name
|
||||
// },
|
||||
// {
|
||||
// hid: 'og:title',
|
||||
// name: 'og:title',
|
||||
// content: this.name
|
||||
// },
|
||||
// {
|
||||
// hid: 'og:url',
|
||||
// name: 'og:url',
|
||||
// content: 'https://swarnamath.com/' + this.slug
|
||||
// },
|
||||
// {
|
||||
// hid: 'og:image',
|
||||
// name: 'og:image',
|
||||
// content: 'https://api7.siliconpin.com' + this.img
|
||||
// },
|
||||
// {
|
||||
// hid: 'og:image:secure_url',
|
||||
// name: 'og:image:secure_url',
|
||||
// content: 'https://api7.siliconpin.com' + this.img
|
||||
// },
|
||||
// {
|
||||
// hid: 'og:type',
|
||||
// name: 'og:type',
|
||||
// content: 'News'
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// }
|
||||
}
|
||||
</script>
|
||||
7
pages/test.vue
Normal file
7
pages/test.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
<template>
|
||||
<v-card width="800" class="justify-center ">
|
||||
<v-img :src="`https://api7.siliconpin.com/assets/4aeb2707-5566-4673-ad75-bef6feddd248`" aspect-ratio="1.2"></v-img>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
466
pages/testt.vue
Normal file
466
pages/testt.vue
Normal file
@@ -0,0 +1,466 @@
|
||||
<template>
|
||||
<v-carousel cycle>
|
||||
<v-carousel-item
|
||||
|
||||
|
||||
reverse-transition="fade-transition"
|
||||
transition="fade-transition"
|
||||
>
|
||||
<!-- /////////////////////////////////////////////////////////////////////// -->
|
||||
<div><v-img height="50" :src="`https://api7.siliconpin.com/assets/${catVegetables[0].img}`" gradient="to bottom, rgba(13, 191, 43,.1), rgba(15, 43, 20,.9)">
|
||||
<h1 class="text-center mt-1 white--text">
|
||||
সবজি ।
|
||||
</h1></v-img>
|
||||
<v-row>
|
||||
<v-col cols="12" lg="6" sm="12" md="12">
|
||||
<v-card flat tile class="mx-auto mb-1 pa-2 ">
|
||||
<v-img height="300" :src="`https://api7.siliconpin.com/assets/${catVegetables[0].img}`" aspect-ratio="1.2">
|
||||
</v-img>
|
||||
<v-card-text>
|
||||
<h3> {{catVegetables[0].name}}</h3>
|
||||
</v-card-text>
|
||||
<v-rating half-increments dense size="20" v-model="catVegetables[0].rating" class="px-2 ma-0"
|
||||
background-color="orange lighten-3" color="orange"></v-rating>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;"> {{catVegetables[0].description}} <br>
|
||||
<span style="font-weight:bold"> মূল্য {{catVegetables[0].price}} টাকা ।</span>
|
||||
<span v-if="catVegetables[0].p2" style="font-weight:bold"> মূল্য {{catVegetables[0].p2}} টাকা ।</span>
|
||||
</p>
|
||||
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
<v-col cols="12" lg="6" sm="12" md="12">
|
||||
<v-row>
|
||||
<v-col cols="12" lg="12" sm="12" md="12">
|
||||
<v-row>
|
||||
<v-col lg="12" sm="12" md="12">
|
||||
<v-card flat tile class="my-2 pa-1">
|
||||
<v-row>
|
||||
<v-col cols="12" lg="6" md="12" sm="12">
|
||||
<v-img height="180" :src="`https://api7.siliconpin.com/assets/${catVegetables[1].img}`" aspect-ratio="1.2">
|
||||
</v-img>
|
||||
|
||||
</v-col>
|
||||
<v-col cols="12" lg="6" md="12" sm="12">
|
||||
<h3> {{catVegetables[1].name}}</h3>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;"> {{catVegetables[1].description}} <br>
|
||||
<span style="font-weight:bold"> মূল্য {{catVegetables[1].price}} টাকা ।</span>
|
||||
<span v-if="catVegetables[1].p2" style="font-weight:bold"> মূল্য {{catVegetables[1].p2}} টাকা
|
||||
।</span>
|
||||
</p>
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
<v-col lg="12" sm="12" md="12">
|
||||
<v-card flat tile class="my-2 pa-1">
|
||||
<v-row>
|
||||
<v-col cols="12" md="12" lg="6" sm="12">
|
||||
<v-img height="180" :src="`https://api7.siliconpin.com/assets/${catVegetables[2].img}`" aspect-ratio="1.2">
|
||||
</v-img>
|
||||
|
||||
</v-col>
|
||||
<v-col cols="12" lg="6" sm="12">
|
||||
<h3> {{catVegetables[2].name}}</h3>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;"> {{catVegetables[2].description}} <br>
|
||||
<span style="font-weight:bold"> মূল্য {{catVegetables[2].price}} টাকা ।</span>
|
||||
<span v-if="catVegetables[2].p2" style="font-weight:bold"> মূল্য {{catVegetables[2].p2}} টাকা
|
||||
।</span>
|
||||
</p>
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
|
||||
|
||||
|
||||
</v-row>
|
||||
|
||||
|
||||
|
||||
|
||||
</v-col>
|
||||
|
||||
|
||||
<v-col lg="12" sm="12" md="12">
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ///////////////////////////////////////////////////////////////////////// -->
|
||||
</v-carousel-item>
|
||||
<!-- ///////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<v-carousel-item
|
||||
|
||||
|
||||
reverse-transition="fade-transition"
|
||||
transition="fade-transition"
|
||||
>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ///////////////////////////////////////////////////////////////////////// -->
|
||||
<div><v-img height="50" :src="`https://api7.siliconpin.com/assets/${catFruits[0].img}`" gradient="to bottom, rgba(13, 191, 43,.1), rgba(15, 43, 20,.9)">
|
||||
<h1 class="text-center mt-1 white--text">
|
||||
ফল ।
|
||||
</h1></v-img>
|
||||
<v-row>
|
||||
<v-col cols="12" lg="6" sm="12" md="12">
|
||||
<v-card class="mx-auto mb-1 pa-2 ">
|
||||
<v-img height="300" :src="`https://api7.siliconpin.com/assets/${catFruits[0].img}`" aspect-ratio="1.2">
|
||||
</v-img>
|
||||
<v-card-text>
|
||||
<h3> {{catFruits[0].name}}</h3>
|
||||
</v-card-text>
|
||||
<v-rating half-increments dense size="20" v-model="catFruits[0].rating" class="px-2 ma-0"
|
||||
background-color="orange lighten-3" color="orange"></v-rating>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;"> {{catFruits[0].description}} <br>
|
||||
<span style="font-weight:bold"> মূল্য {{catFruits[0].price}} টাকা ।</span>
|
||||
<span v-if="catFruits[0].p2" style="font-weight:bold"> মূল্য {{catFruits[0].p2}} টাকা ।</span>
|
||||
</p>
|
||||
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
<v-col cols="12" lg="6" sm="12" md="12">
|
||||
<v-row>
|
||||
<v-col cols="12" lg="12" sm="12" md="12">
|
||||
<v-row>
|
||||
<v-col lg="12" sm="12" md="12">
|
||||
<v-card class="my-2 pa-1">
|
||||
<v-row>
|
||||
<v-col cols="12" lg="6" md="12" sm="12">
|
||||
<v-img height="180" :src="`https://api7.siliconpin.com/assets/${catFruits[1].img}`" aspect-ratio="1.2">
|
||||
</v-img>
|
||||
|
||||
</v-col>
|
||||
<v-col cols="12" lg="6" md="12" sm="12">
|
||||
<h3> {{catFruits[1].name}}</h3>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;"> {{catFruits[1].description}} <br>
|
||||
<span style="font-weight:bold"> মূল্য {{catFruits[1].price}} টাকা ।</span>
|
||||
<span v-if="catFruits[1].p2" style="font-weight:bold"> মূল্য {{catFruits[1].p2}} টাকা
|
||||
।</span>
|
||||
</p>
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
<v-col lg="12" sm="12" md="12">
|
||||
<v-card class="my-2 pa-1">
|
||||
<v-row>
|
||||
<v-col cols="12" md="12" lg="6" sm="12">
|
||||
<v-img height="180" :src="`https://api7.siliconpin.com/assets/${catFruits[2].img}`" aspect-ratio="1.2">
|
||||
</v-img>
|
||||
|
||||
</v-col>
|
||||
<v-col cols="12" lg="6" sm="12">
|
||||
<h3> {{catFruits[2].name}}</h3>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;"> {{catFruits[2].description}} <br>
|
||||
<span style="font-weight:bold"> মূল্য {{catFruits[2].price}} টাকা ।</span>
|
||||
<span v-if="catFruits[2].p2" style="font-weight:bold"> মূল্য {{catFruits[2].p2}} টাকা
|
||||
।</span>
|
||||
</p>
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
|
||||
|
||||
|
||||
</v-row>
|
||||
|
||||
|
||||
|
||||
|
||||
</v-col>
|
||||
|
||||
|
||||
<v-col lg="12" sm="12" md="12">
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</div>
|
||||
</v-carousel-item>
|
||||
<!-- //////////////////////////////////////////////////////////// -->
|
||||
<v-carousel-item
|
||||
|
||||
|
||||
reverse-transition="fade-transition"
|
||||
transition="fade-transition"
|
||||
>
|
||||
<div><v-img height="50" :src="`https://api7.siliconpin.com/assets/${catJewlry[0].img}`" gradient="to bottom, rgba(13, 191, 43,.1), rgba(15, 43, 20,.9)">
|
||||
<h1 class="text-center mt-1 white--text">
|
||||
জুয়েলারি ।
|
||||
</h1></v-img>
|
||||
<v-row>
|
||||
<v-col cols="12" lg="6" sm="12" md="12">
|
||||
<v-card class="mx-auto mb-1 pa-2 ">
|
||||
<v-img height="300" :src="`https://api7.siliconpin.com/assets/${catJewlry[0].img}`" aspect-ratio="1.2">
|
||||
</v-img>
|
||||
<v-card-text>
|
||||
<h3> {{catJewlry[0].name}}</h3>
|
||||
</v-card-text>
|
||||
<v-rating half-increments dense size="20" v-model="catJewlry[0].rating" class="px-2 ma-0"
|
||||
background-color="orange lighten-3" color="orange"></v-rating>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;"> {{catJewlry[0].description}} <br>
|
||||
<span style="font-weight:bold"> মূল্য {{catJewlry[0].price}} টাকা ।</span>
|
||||
<span v-if="catJewlry[0].p2" style="font-weight:bold"> মূল্য {{catJewlry[0].p2}} টাকা ।</span>
|
||||
</p>
|
||||
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
<v-col cols="12" lg="6" sm="12" md="12">
|
||||
<v-row>
|
||||
<v-col cols="12" lg="12" sm="12" md="12">
|
||||
<v-row>
|
||||
<v-col lg="12" sm="12" md="12">
|
||||
<v-card class="my-2 pa-1">
|
||||
<v-row>
|
||||
<v-col cols="12" lg="6" md="12" sm="12">
|
||||
<v-img height="150" :src="`https://api7.siliconpin.com/assets/${catJewlry[1].img}`" aspect-ratio="1.2">
|
||||
</v-img>
|
||||
|
||||
</v-col>
|
||||
<v-col cols="12" lg="6" md="12" sm="12">
|
||||
<h3> {{catJewlry[1].name}}</h3>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;"> {{catJewlry[1].description}} <br>
|
||||
<span style="font-weight:bold"> মূল্য {{catJewlry[1].price}} টাকা ।</span>
|
||||
<span v-if="catJewlry[1].p2" style="font-weight:bold"> মূল্য {{catJewlry[1].p2}} টাকা
|
||||
।</span>
|
||||
</p>
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
<v-col lg="12" sm="12" md="12">
|
||||
<v-card class="my-2 pa-1">
|
||||
<v-row>
|
||||
<v-col cols="12" md="12" lg="6" sm="12">
|
||||
<v-img height="150" :src="`https://api7.siliconpin.com/assets/${catJewlry[2].img}`" aspect-ratio="1.2">
|
||||
</v-img>
|
||||
|
||||
</v-col>
|
||||
<v-col cols="12" lg="6" sm="12">
|
||||
<h3> {{catJewlry[2].name}}</h3>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;"> {{catJewlry[2].description}} <br>
|
||||
<span style="font-weight:bold"> মূল্য {{catJewlry[2].price}} টাকা ।</span>
|
||||
<span v-if="catJewlry[2].p2" style="font-weight:bold"> মূল্য {{catJewlry[2].p2}} টাকা
|
||||
।</span>
|
||||
</p>
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
|
||||
|
||||
|
||||
</v-row>
|
||||
|
||||
|
||||
|
||||
|
||||
</v-col>
|
||||
|
||||
|
||||
<v-col lg="12" sm="12" md="12">
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</div>
|
||||
</v-carousel-item>
|
||||
<!-- //////////////////////////////////////////////// -->
|
||||
<v-carousel-item
|
||||
|
||||
|
||||
reverse-transition="fade-transition"
|
||||
transition="fade-transition"
|
||||
>
|
||||
<div><v-img height="50" :src="`https://api7.siliconpin.com/assets/${catCosmetics[0].img}`" gradient="to bottom, rgba(13, 191, 43,.1), rgba(15, 43, 20,.9)">
|
||||
<h1 class="text-center mt-1 white--text">
|
||||
প্রসাধন ।
|
||||
</h1></v-img>
|
||||
<v-row>
|
||||
<v-col cols="12" lg="6" sm="12" md="12">
|
||||
<v-card class="mx-auto mb-1 pa-2 ">
|
||||
<v-img height="300" :src="`https://api7.siliconpin.com/assets/${catCosmetics[0].img}`" aspect-ratio="1.2">
|
||||
</v-img>
|
||||
<v-card-text>
|
||||
<h3> {{catCosmetics[0].name}}</h3>
|
||||
</v-card-text>
|
||||
<v-rating half-increments dense size="20" v-model="catCosmetics[0].rating" class="px-2 ma-0"
|
||||
background-color="orange lighten-3" color="orange"></v-rating>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;"> {{catCosmetics[0].description}} <br>
|
||||
<span style="font-weight:bold"> মূল্য {{catCosmetics[0].price}} টাকা ।</span>
|
||||
<span v-if="catCosmetics[0].p2" style="font-weight:bold"> মূল্য {{catCosmetics[0].p2}} টাকা ।</span>
|
||||
</p>
|
||||
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
<v-col cols="12" lg="6" sm="12" md="12">
|
||||
<v-row>
|
||||
<v-col cols="12" lg="12" sm="12" md="12">
|
||||
<v-row>
|
||||
<v-col lg="12" sm="12" md="12">
|
||||
<v-card class="my-2 pa-1">
|
||||
<v-row>
|
||||
<v-col cols="12" lg="6" md="12" sm="12">
|
||||
<v-img height="180" :src="`https://api7.siliconpin.com/assets/${catCosmetics[1].img}`" aspect-ratio="1.2">
|
||||
</v-img>
|
||||
|
||||
</v-col>
|
||||
<v-col cols="12" lg="6" md="12" sm="12">
|
||||
<h3> {{catCosmetics[1].name}}</h3>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;"> {{catCosmetics[1].description}} <br>
|
||||
<span style="font-weight:bold"> মূল্য {{catCosmetics[1].price}} টাকা ।</span>
|
||||
<span v-if="catCosmetics[1].p2" style="font-weight:bold"> মূল্য {{catCosmetics[1].p2}} টাকা
|
||||
।</span>
|
||||
</p>
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
<v-col lg="12" sm="12" md="12">
|
||||
<v-card class="my-2 pa-1">
|
||||
<v-row>
|
||||
<v-col cols="12" md="12" lg="6" sm="12">
|
||||
<v-img height="180" :src="`https://api7.siliconpin.com/assets/${catCosmetics[2].img}`" aspect-ratio="1.2">
|
||||
</v-img>
|
||||
|
||||
</v-col>
|
||||
<v-col cols="12" lg="6" sm="12">
|
||||
<h3> {{catCosmetics[2].name}}</h3>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;"> {{catCosmetics[2].description}} <br>
|
||||
<span style="font-weight:bold"> মূল্য {{catCosmetics[2].price}} টাকা ।</span>
|
||||
<span v-if="catCosmetics[2].p2" style="font-weight:bold"> মূল্য {{catCosmetics[2].p2}} টাকা
|
||||
।</span>
|
||||
</p>
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
|
||||
|
||||
|
||||
</v-row>
|
||||
|
||||
|
||||
|
||||
|
||||
</v-col>
|
||||
|
||||
|
||||
<v-col lg="12" sm="12" md="12">
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</v-carousel-item>
|
||||
<!-- //////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</v-carousel>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
smProducts: [],
|
||||
catFruits: [],
|
||||
catVegetables: [],
|
||||
catGrocery: [],
|
||||
catServices: [],
|
||||
catJewlry: [],
|
||||
catCosmetics: [],
|
||||
catCloths: []
|
||||
}
|
||||
},
|
||||
async fetch() {
|
||||
this.smProducts = await fetch(
|
||||
'https://api7.siliconpin.com/items/swarnamath?offset=0&limit=90'
|
||||
).then(res => res.json())
|
||||
|
||||
this.catFruits = this.smProducts.data.filter(item => { if (item.cat == "fruits") return item });
|
||||
this.catVegetables = this.smProducts.data.filter(item => { if (item.cat == "vegetables") return item });
|
||||
this.catGrocery = this.smProducts.data.filter(item => { if (item.cat == "grocery") return item });
|
||||
this.catServices = this.smProducts.data.filter(item => { if (item.cat == "services") return item });
|
||||
this.catJewlry = this.smProducts.data.filter(item => { if (item.cat == "jewlry") return item });
|
||||
this.catCosmetics = this.smProducts.data.filter(item => { if (item.cat == "cosmetics") return item });
|
||||
this.catCloths = this.smProducts.data.filter(item => { if (item.cat == "cloths") return item });
|
||||
// console.log(this.catFruits)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
99
pages/tst3.vue
Normal file
99
pages/tst3.vue
Normal file
@@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<!-- *****************komli shaker chobi nei tai akta consule prolem show hocce -->
|
||||
<v-container>
|
||||
<v-layout row wrap>
|
||||
<v-row>
|
||||
<v-col v-for="Service in catServices" :key="catServices.id" sm="6" md="6" lg="2">
|
||||
<nuxt-link :to="`/${Service.slug}`">
|
||||
<v-card class="mx-auto mb-1">
|
||||
<v-img :src="`https://api7.siliconpin.com/assets/${Service.img}`" aspect-ratio="1.2"></v-img>
|
||||
|
||||
<v-card-text>
|
||||
<h3> {{Service.name}}</h3>
|
||||
</v-card-text>
|
||||
<v-rating half-increments dense size="20" v-model="Service.rating" background-color="orange lighten-3"
|
||||
color="orange"></v-rating>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;"> {{Service.description}} <br>
|
||||
<span style="font-weight:bold"> মূল্য {{Service.price}} টাকা ।</span>
|
||||
<span v-if="Service.p2" style="font-weight:bold"> মূল্য {{Service.p2}} টাকা ।</span>
|
||||
</p>
|
||||
|
||||
</v-card>
|
||||
</nuxt-link>
|
||||
</v-col>
|
||||
|
||||
<v-col v-for="Service in catServices" :key="catServices.id" sm="6" md="6" lg="2">
|
||||
<nuxt-link :to="`/${Service.slug}`">
|
||||
<v-card class="mx-auto mb-1">
|
||||
<v-img :src="`https://api7.siliconpin.com/assets/${Service.img}`" aspect-ratio="1.2"></v-img>
|
||||
|
||||
<v-card-text>
|
||||
<h3> {{Service.name}}</h3>
|
||||
</v-card-text>
|
||||
<v-rating half-increments dense size="20" v-model="Service.rating" background-color="orange lighten-3"
|
||||
color="orange"></v-rating>
|
||||
<p style="font-size:16px;padding:0 5px 10px 5px;"> {{Service.description}} <br>
|
||||
<span style="font-weight:bold"> মূল্য {{Service.price}} টাকা ।</span>
|
||||
<span v-if="Service.p2" style="font-weight:bold"> মূল্য {{Service.p2}} টাকা ।</span>
|
||||
</p>
|
||||
|
||||
</v-card>
|
||||
</nuxt-link>
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
</v-layout>
|
||||
<!-- <div>
|
||||
<p v-if="$fetchState.pending">Fetching mountains...</p>
|
||||
<p v-else-if="$fetchState.error">An error occurred :(</p>
|
||||
<div v-else>
|
||||
<h1>Nuxt Mountains {{mountains}} </h1>
|
||||
<ul>
|
||||
<li v-for="mountain of mountains">{{ mountain.title }}</li>
|
||||
</ul>
|
||||
<button @click="$fetch">Refresh</button>
|
||||
</div>
|
||||
</div> -->
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
smProducts: [],
|
||||
catFruits: [],
|
||||
catVegetables: [],
|
||||
catGrocery: [],
|
||||
catServices: [],
|
||||
catJewlry: [],
|
||||
catCosmetics: [],
|
||||
catCloths: []
|
||||
}
|
||||
},
|
||||
async fetch() {
|
||||
this.smProducts = await fetch(
|
||||
'https://api7.siliconpin.com/items/swarnamath?offset=0&limit=90'
|
||||
).then(res => res.json())
|
||||
|
||||
this.catFruits = this.smProducts.data.filter(item => { if (item.cat == "fruits") return item });
|
||||
this.catVegetables = this.smProducts.data.filter(item => { if (item.cat == "vegetables") return item });
|
||||
this.catGrocery = this.smProducts.data.filter(item => { if (item.cat == "grocery") return item });
|
||||
this.catServices = this.smProducts.data.filter(item => { if (item.cat == "services") return item });
|
||||
this.catJewlry = this.smProducts.data.filter(item => { if (item.cat == "jewlry") return item });
|
||||
this.catCosmetics = this.smProducts.data.filter(item => { if (item.cat == "cosmetics") return item });
|
||||
this.catCloths = this.smProducts.data.filter(item => { if (item.cat == "cloths") return item });
|
||||
// console.log(this.catFruits)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#flas {
|
||||
height: 100px;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user