feat(order-service): 주문
- 주문 기능 추가
This commit is contained in:
@@ -16,33 +16,9 @@ export default {
|
||||
getCategoryList(){
|
||||
return axios.get(process.env.VUE_APP_CUSTOMER_SERVICE_BASEURL+'/store-service/category/');
|
||||
},
|
||||
putCategoryList(data){
|
||||
return axios({
|
||||
method:'put',
|
||||
url:process.env.VUE_APP_CUSTOMER_SERVICE_BASEURL+'/store-service/category',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json;charset=UTF-8'
|
||||
},
|
||||
data: data,
|
||||
responseType:'json'
|
||||
})
|
||||
},
|
||||
getItemById(itemId){
|
||||
fetchItem(itemId){
|
||||
return axios.get(process.env.VUE_APP_STORE_API_URL+'/item/'+itemId)
|
||||
},
|
||||
saveItem(method, itemData){
|
||||
return axios({
|
||||
method:method,
|
||||
url: process.env.VUE_APP_CUSTOMER_SERVICE_BASEURL+'/store-service/item',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json;charset=UTF-8'
|
||||
},
|
||||
data: itemData,
|
||||
responseType:'json'
|
||||
})
|
||||
},
|
||||
getFavoriteStore(latitude, longitude,){
|
||||
const options = {
|
||||
params: {
|
||||
|
||||
@@ -60,7 +60,7 @@ const routes = [
|
||||
component: () => import('../views/LoginPage')
|
||||
},
|
||||
{
|
||||
path: "/item/:storeId/:itemId",
|
||||
path: "/item/:itemId",
|
||||
name: 'itemDetail',
|
||||
component: () => import('../views/ItemDetail')
|
||||
},
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
append-outer-icon="mdi-plus"
|
||||
prepend-icon="mdi-minus"
|
||||
filled
|
||||
type="number"
|
||||
hide-details
|
||||
@click:append-outer="addItemCount(1)"
|
||||
@click:prepend="addItemCount(-1)"
|
||||
/>
|
||||
@@ -91,7 +91,6 @@ export default {
|
||||
name: "ItemDetail",
|
||||
async beforeMount() {
|
||||
console.log(this.$route.params)
|
||||
this.storeId = this.$route.params.storeId
|
||||
this.itemId = this.$route.params.itemId
|
||||
this.setItem.storeId = this.storeId;
|
||||
await this.getItemData()
|
||||
@@ -102,7 +101,7 @@ export default {
|
||||
},
|
||||
otherGroup:function(){
|
||||
return this.parseGroup('OTHER')
|
||||
}
|
||||
},
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
@@ -123,12 +122,14 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getItemData: async function (){
|
||||
storeApi.getItemById(this.itemId)
|
||||
storeApi.fetchItem(this.itemId)
|
||||
.then(response=>{
|
||||
console.log(response)
|
||||
this.itemData = response.data.data;
|
||||
this.setItem.itemId = this.itemData.id;
|
||||
this.setItem.price = this.itemData.price;
|
||||
this.itemData = response.data.data
|
||||
this.setItem.itemId = this.itemData.id
|
||||
this.setItem.price = this.itemData.price
|
||||
this.storeId = this.itemData.storeId
|
||||
this.setItem.storeId = this.itemData.storeId
|
||||
})
|
||||
.catch(error=>{
|
||||
console.log(error)
|
||||
|
||||
@@ -19,21 +19,22 @@
|
||||
<v-list-item-title class="text-h5 mb-3">
|
||||
{{ orderItem.itemId }}
|
||||
</v-list-item-title>
|
||||
<v-list-item-subtitle class="mb-5">
|
||||
수량 : {{ orderItem.count }}
|
||||
</v-list-item-subtitle>
|
||||
<div class="text-body-1 mb-5">
|
||||
{{ orderItem.itemOptionIds.join(', ')}}
|
||||
</div>
|
||||
<div class="text--primary">
|
||||
합계 : <b> {{ orderItem.price }} 원</b>
|
||||
합계 : <b> {{ orderItem.count * orderItem.price }} 원</b>
|
||||
</div>
|
||||
</v-list-item-content>
|
||||
|
||||
<v-list-item-avatar
|
||||
tile
|
||||
size="100"
|
||||
>
|
||||
<v-img :src="require('@/assets/store.jpeg')"></v-img>
|
||||
</v-list-item-avatar>
|
||||
|
||||
</v-list-item>
|
||||
|
||||
<v-card-actions class="pb-2">
|
||||
@@ -76,6 +77,7 @@ export default {
|
||||
itemId:Number,
|
||||
itemOptionIds:Array,
|
||||
price:Number,
|
||||
count:Number,
|
||||
}],
|
||||
totalPrice:Number,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user