1404/10/28-base

This commit is contained in:
2026-01-18 13:01:46 +03:30
parent f95b0cef95
commit 9d96ae106b
455 changed files with 58164 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
import type { TableEngineOutput, TableInput, TableOutput } from '@/model/table'
import useAxios from '@/utils/useAxios'
import type { Address } from '@/models/address'
export async function createAddress(data: Address) {
return await useAxios.post('customer/address', data)
}
export async function getOneAddress(id: number) {
return await useAxios.get(`customer/address/${id}`)
}
export async function updateAddress(id: number, data: Address) {
return await useAxios.put(`customer/address/${id}`, data)
}
export async function deleteAddress(id: number) {
return await useAxios.delete(`customer/address/${id}`)
}
export async function tableAddress(tbl: TableInput) {
return await useAxios.post<TableEngineOutput<Address>>('customer/address/table', tbl)
}
export async function getDefaultAddress(): Promise<Address | null> {
const data = await useAxios.post<TableOutput<Address>>('customer/address/table', {
filters: [{ cr: 'and', field: 'default_address', type: 'boolean', op: 'eq', value: true }]
})
if (data.rows && data.rows.length > 0) return data.rows[0]
else return null
}
export async function getProvince() {
return await useAxios.get(`api/city/state`)
}
export async function getCity(id: number) {
return await useAxios.get(`api/city/${id}`)
}
+5
View File
@@ -0,0 +1,5 @@
import useAxios from "@/utils/useAxios";
export async function getConfig() {
return await useAxios.get(`https://nerkh.gold/get_user`)
}
+6
View File
@@ -0,0 +1,6 @@
import useAxios from "@/utils/useAxios";
import type {Const} from "@/models/const";
export async function getConstByKey(key:string){
return await useAxios.get<Const[]>(`/api/const/key/${key}`)
}
+4
View File
@@ -0,0 +1,4 @@
import useAxios from '@/utils/useAxios'
import type { EarnMoney } from '@/models/earnMoney'
export const getEarnMoney = async () => await useAxios.get<EarnMoney>(`/customer/i_have_referrals`)
+30
View File
@@ -0,0 +1,30 @@
import type {TableInput, TableOutput} from "@/models/table";
import type {Fund, FundTransaction} from "@/models/fund";
import useAxios from "@/utils/useAxios";
import type {Transaction} from "@/models/transaction";
export const getFundTable = async (tbl?: TableInput): Promise<TableOutput<Fund>> => {
return await useAxios.post<TableOutput<Fund>>(`/customer/fund/table`, tbl)
}
export const getFundTransactionTable = async (tbl?: TableInput): Promise<TableOutput<Transaction>> => {
return await useAxios.post<TableOutput<Transaction>>(`/customer/fund/transaction/table`, tbl)
}
export const getFundById = async (id: number) => await useAxios.get<Fund>(`/customer/fund/${id}`)
export const createFund = async (obj: Fund): Promise<any> => {
return await useAxios.post(`/customer/fund`, obj)
}
export const editFund = async (id: number, obj: Fund): Promise<any> => {
return await useAxios.put(`/customer/fund/${id}`, obj)
}
export const fundDeposit = async (obj: FundTransaction): Promise<any> => {
return await useAxios.post(`/customer/fund/deposit`, obj)
}
export const fundWithdraw = async (obj: FundTransaction): Promise<any> => {
return await useAxios.post(`/customer/fund/withdraw`, obj)
}
export const deleteFund = async (id?: number) => await useAxios.delete(`/customer/fund/${id}`)
+10
View File
@@ -0,0 +1,10 @@
import useAxios from "@/utils/useAxios";
import type {Price} from "@/models/home";
export const getChart = async () => await useAxios.get<Array<Array<any>>>(`/api/candle`)
export const getPrice = async () => await useAxios.get<Price>(`/api/price/up`)
export const getLastPrice = async () => await useAxios.get<Price>(`/api/price/last`)
export const getAllPrices = async () => await useAxios.post('/customer/prices/all')
+9
View File
@@ -0,0 +1,9 @@
import useAxios from "@/utils/useAxios";
import type {Login, User} from "@/models/login";
//customer
export const registerCustomer = async (obj: User) => await useAxios.post<User>(`/auth/register`, obj)
export const loginCustomer = async (obj: Login) => await useAxios.post<User>(`/auth/login`, obj)
// export const loginCustomerWithSMS = async (obj: User) => await useAxios.post<User>(`/auth/login`, obj)
export const verifyToken = async (obj: Login) => await useAxios.post<User>(`/auth/verify`, obj)
+8
View File
@@ -0,0 +1,8 @@
import useAxios from "@/utils/useAxios";
import type {Password, User} from "@/models/login";
// import {Login} from "@/models/login";
export const getMe = async () => await useAxios.get<User>(`/customer/me`)
export const updateMe = async (obj: User) => await useAxios.post<User>(`/customer/me/update`, obj)
export const updatePass = async (obj: User) => await useAxios.post<Password>(`/customer/me/update`, obj)
+16
View File
@@ -0,0 +1,16 @@
import useAxios from "@/utils/useAxios";
import type {Order} from "@/models/order";
import type {TableInput, TableOutput} from "@/models/table";
import type {Ref, UnwrapRef} from "vue";
import type {Transaction} from "@/models/transaction";
import {useUserStore} from "@/store/userStore";
const userStore = useUserStore()
export const createOrder = async (obj: Order): Promise<any> => {
return await useAxios.post<Order>(`/customer${!userStore.isSingle ? '' : '/single'}/order`, obj)
}
export const getOrders = async (tbl: Ref<UnwrapRef<TableInput>>): Promise<TableOutput<Transaction>> => {
return await useAxios.post<TableOutput<Order>>(`/customer${!userStore.isSingle ? '' : '/single'}/order/table`, tbl)
}
+4
View File
@@ -0,0 +1,4 @@
import useAxios from '@/utils/useAxios'
import type {Physicalreceive} from "@/models/physicalreceive";
export const physicalReceiveApi = async (obj:Object) => await useAxios.post(`/customer/wallet/withdraw_physical`, obj)
export const getPhysicalReceiveList = async (obj?:Object) => await useAxios.post<Physicalreceive>(`/customer/wallet/withdraw_physical/table`, obj)
+14
View File
@@ -0,0 +1,14 @@
import useAxios from "@/utils/useAxios";
import type {PInventory, Product} from "@/models/products";
import type { PWallet, Wallet } from '@/models/wallet'
export const getProducts = async (): Promise<any> => {
return await useAxios.get<Product[]>(`/customer/product/list`)
}
export const getProductInventory = async (): Promise<any> => {
return await useAxios.post<PInventory[]>(`/customer/wallet/product/table`)
}
export const getOneProductWallet = async (id: number): Promise<any> => {
return await useAxios.get<PWallet>(`/customer/wallet/product/${id}`)
}
+19
View File
@@ -0,0 +1,19 @@
import type {TableInput, TableOutput} from "@/models/table";
import useAxios from "@/utils/useAxios";
import type {Transaction} from "@/models/transaction";
import type {Card} from "@/models/wallet";
export const getTransactionTable = async (tbl: TableInput): Promise<TableOutput<Transaction>> => {
return await useAxios.post<TableOutput<Transaction>>(`/customer/transaction/table`, tbl)
}
export const getTransactionTable2 = async (tbl: TableInput): Promise<TableOutput<Transaction>> => {
return await useAxios.post<TableOutput<Transaction>>(`/customer/withdraw/table`, tbl)
}
export const getCardsTable = async (tbl?: TableInput): Promise<TableOutput<Card>> => {
return await useAxios.post<TableOutput<Card>>(`/customer/account/table`, tbl)
}
// export const getProducts = async (tbl: TableInput): Promise<TableOutput<Product>> => {
// return await axios.post<TableOutput<Product>>('/site/product', tbl)
// }
+17
View File
@@ -0,0 +1,17 @@
import type { Login, User } from '@/models/login'
import useAxios from '@/utils/useAxios'
import type { PriceTrigger } from '@/models/PriceTrigger'
import type { Ref, UnwrapRef } from 'vue'
import type { TableInput, TableOutput } from '@/models/table'
import type { Transaction } from '@/models/transaction'
import type { Order } from '@/models/order'
import type { Card } from '@/models/wallet'
export const createPriceTrigger = async (obj: PriceTrigger) => await useAxios.post<PriceTrigger>(`/customer/price_triggers`, obj)
export const updatePriceTrigger = async (id?: number, obj?: PriceTrigger | {
is_active: boolean
}) => await useAxios.put<PriceTrigger>(`/customer/price_triggers/${id}`, obj)
export const getPriceTriggers = async () => await useAxios.get<PriceTrigger[]>(`/customer/price_triggers`)
export const deletePriceTrigger = async (id?: number) => await useAxios.delete(`/customer/price_triggers/${id}`)
+23
View File
@@ -0,0 +1,23 @@
import useAxios from '@/utils/useAxios'
import type { Card, Wallet } from '@/models/wallet'
import type {Transaction} from '@/models/transaction'
export const getWallet = async () => await useAxios.get<Wallet>(`/customer/wallet/me`)
export const withdraw = async (obj: Transaction): Promise<any> => {
return await useAxios.post<Transaction>(`/customer/wallet/withdraw`, obj)
}
export const deposit = async (obj: Transaction): Promise<any> => {
return await useAxios.post<Transaction>(`/customer/charge_account`, obj)
}
export const createCard = async (obj: Card): Promise<any> => {
return await useAxios.post<Transaction>(`/customer/account`, obj)
}
export const getActivatedCards = async () => await useAxios.get<Card[]>(`/customer/account/active`)
export const confirmCode = async (params: WithdrawConfirm): Promise<any> => {
return await useAxios.post(`/customer/wallet/withdraw/otp` , params)
}