This commit is contained in:
2026-09-04 01:50:59 +03:30
parent 3dda7fcf60
commit 57780ae99c
4 changed files with 7 additions and 12 deletions
+1 -6
View File
@@ -1,11 +1,6 @@
import useAxios from "@/utils/useAxios"; import useAxios from "@/utils/useAxios";
import type {PInventory, Product} from "@/models/products";
import type {PWallet, Wallet} from '@/models/wallet'
import type {Order} from "@/models/order"; import type {Order} from "@/models/order";
import {useUserStore} from "@/store/userStore";
const userStore = useUserStore()
export const checkoutCart = async (orders: Order[]): Promise<any> => { export const checkoutCart = async (orders: Order[]): Promise<any> => {
return await useAxios.post<Order[]>(`/customer/cart/checkout`, orders) return await useAxios.post<Order[]>(`/customer/cart/checkout`, orders)
} }
+2 -3
View File
@@ -5,10 +5,9 @@ import type {Ref, UnwrapRef} from "vue";
import type {Transaction} from "@/models/transaction"; import type {Transaction} from "@/models/transaction";
import {useUserStore} from "@/store/userStore"; import {useUserStore} from "@/store/userStore";
const userStore = useUserStore()
function customerOrderPrefix() { function customerOrderPrefix() {
return `/customer${!userStore.isSingle ? '' : '/single'}` // lazy: این ماژول ممکن است قبل از app.use(pinia) لود شود
return `/customer${!useUserStore().isSingle ? '' : '/single'}`
} }
export const createOrder = async (obj: Order): Promise<any> => { export const createOrder = async (obj: Order): Promise<any> => {
+3 -2
View File
@@ -1,14 +1,15 @@
import { createApp } from 'vue' import { createApp } from 'vue'
import { createPinia } from 'pinia' import { createPinia, setActivePinia } from 'pinia'
import VueLazyLoad from 'vue3-lazyload' import VueLazyLoad from 'vue3-lazyload'
import VueApexCharts from 'vue3-apexcharts' import VueApexCharts from 'vue3-apexcharts'
import App from '@/App.vue' import App from '@/App.vue'
import router from '@/router' import router from '@/router'
export function createVueApp() { export function createVueApp() {
const app = createApp(App)
const pinia = createPinia() const pinia = createPinia()
setActivePinia(pinia)
const app = createApp(App)
app.use(pinia) app.use(pinia)
app.use(VueLazyLoad, {}) app.use(VueLazyLoad, {})
app.use(router) app.use(router)
+1 -1
View File
@@ -144,7 +144,6 @@ export const justNumber = () => {
message: 'لطفا اطلاعات را به صورت عدد و نقطه وارد کنید' message: 'لطفا اطلاعات را به صورت عدد و نقطه وارد کنید'
} }
} }
const walletCash = useWalletStore()
let priceP = 0 let priceP = 0
let methodP = 'cash' let methodP = 'cash'
let amountP = 0 let amountP = 0
@@ -152,6 +151,7 @@ let isBuyP = true
let NumP = 0 let NumP = 0
let gatewayP = false let gatewayP = false
const checkNumber = async (_rule: Rule, value: number) => { const checkNumber = async (_rule: Rule, value: number) => {
const walletCash = useWalletStore()
if (!value) { if (!value) {
return Promise.reject('تعداد محصول را مشخص کنید') return Promise.reject('تعداد محصول را مشخص کنید')
} }