Carrello Spesa
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import { GlobalStore, UserStore, MessageStore } from '../store/Modules'
|
||||
import { GlobalStore, UserStore, MessageStore, Products } from '../store/Modules'
|
||||
|
||||
import Component from 'vue-class-component'
|
||||
import { func_tools } from '../store/Modules/toolsext'
|
||||
@@ -48,6 +48,17 @@ export default class MixinUsers extends Vue {
|
||||
}
|
||||
}
|
||||
|
||||
get getnumItemsCart() {
|
||||
const arrcart = Products.state.cart
|
||||
if (!!arrcart) {
|
||||
if (!!arrcart.items) {
|
||||
const total = arrcart.items.reduce((sum, item) => sum + item.order.quantity, 0)
|
||||
return total
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
public getImgByMsg(msg: IMessage) {
|
||||
return `statics/` + UserStore.getters.getImgByUsername(this.getUsernameChatByMsg(msg))
|
||||
}
|
||||
@@ -62,6 +73,12 @@ export default class MixinUsers extends Vue {
|
||||
return (ris !== '') ? 'img:statics/' + ris : 'fas fa-user-circle'
|
||||
}
|
||||
|
||||
get getIconCart() {
|
||||
const iconcart = 'fas fa-shopping-cart'
|
||||
|
||||
return iconcart
|
||||
}
|
||||
|
||||
get MenuCollapse() {
|
||||
return GlobalStore.state.menuCollapse
|
||||
// return true
|
||||
|
||||
Reference in New Issue
Block a user