import { defineComponent, onMounted, ref } from 'vue'
import { tools } from '@tools'
import { useUserStore } from '@store/UserStore'
import { useRouter } from 'vue-router'
import { useRoute } from 'vue-router'
import { useGlobalStore } from '@store/globalStore'
import { useProducts } from '@store/Products'
import { useI18n } from 'vue-i18n'
import { toolsext } from '@store/Modules/toolsext'
import { useQuasar } from 'quasar'
import { costanti } from '@costanti'
import { shared_consts } from '@src/common/shared_vuejs'
// import MixinBase from '@src/mixins/mixin-base'
import { CProductCard } from '@src/components/CProductCard'
import { COrdersCart } from '@src/components/COrdersCart'


export default defineComponent({
  name: 'orderscart',
  components: { CProductCard, COrdersCart },
  props: {},
  setup() {
    const userStore = useUserStore()
    const globalStore = useGlobalStore()
    const productStore = useProducts()
    const $router = useRouter()
    const $route = useRoute()
    const $q = useQuasar()
    const { t } = useI18n();
    const idOrdersCart = ref('')
    const cosa = ref(0)

    // const { setValDb, getValDb } = MixinBase()

    function mounted() {
      // Inizializza
      if ($route.params.idorderscart) {
        idOrdersCart.value = $route.params.idorderscart.toString()
      }

    }

    onMounted(mounted)

    return {
      userStore,
      costanti,
      tools,
      toolsext,
      shared_consts,
      idOrdersCart,
      cosa,
    }
  }
})
