fixesss
This commit is contained in:
parent
930f51ee69
commit
9eb577750f
@ -62,6 +62,7 @@
|
|||||||
<li><a href="/admin/sms">СМС</a></li>
|
<li><a href="/admin/sms">СМС</a></li>
|
||||||
<li><a href="/admin/withdrawals">Вывод средств</a></li>
|
<li><a href="/admin/withdrawals">Вывод средств</a></li>
|
||||||
<li><a href="/admin/change-balance/0">Управление балансом</a></li>
|
<li><a href="/admin/change-balance/0">Управление балансом</a></li>
|
||||||
|
<li><a href="/admin/refs">Рефералы</a></li>
|
||||||
{/if}
|
{/if}
|
||||||
<!-- <li><a>Item 3</a></li> -->
|
<!-- <li><a>Item 3</a></li> -->
|
||||||
</ul>
|
</ul>
|
||||||
@ -238,6 +239,21 @@
|
|||||||
<ChevronRightIcon />
|
<ChevronRightIcon />
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<div
|
||||||
|
class="h-[1px] w-full bg-neutral flex-shrink-0 opacity-50 my-[5px]"
|
||||||
|
></div>
|
||||||
|
<li class="relative">
|
||||||
|
<a
|
||||||
|
class="text-lg"
|
||||||
|
on:click={() => {
|
||||||
|
showMenu = false;
|
||||||
|
}}
|
||||||
|
href="/admin/refs">Рефералы</a
|
||||||
|
>
|
||||||
|
<div class="absolute right-0 top-[2px] pointer-events-none">
|
||||||
|
<ChevronRightIcon />
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -235,7 +235,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full flex flex-col p-4 rounded-box bg-base-300">
|
<div class="w-full flex flex-col p-4 rounded-box bg-base-300 overflow-x-auto">
|
||||||
<div class="flex w-full justify-center items-center">
|
<div class="flex w-full justify-center items-center">
|
||||||
<button
|
<button
|
||||||
class="btn"
|
class="btn"
|
||||||
@ -298,12 +298,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</button></td
|
</button></td
|
||||||
>
|
>
|
||||||
<td class="px-2 py-2">{orderStatusMap[dep["status"]]}</td>
|
<td class="px-4 py-2">{orderStatusMap[dep["status"]]}</td>
|
||||||
<td class="px-2">{Number(dep["summa"])} {dep["currency_code"]}</td
|
<td class="px-4">{Number(dep["summa"])} {dep["currency_code"]}</td
|
||||||
>
|
>
|
||||||
<td class="px-2">{dep["bank_name"]}</td>
|
<td class="px-4">{dep["bank_name"]}</td>
|
||||||
<td class="px-2">{dep["creationtime"]}</td>
|
<td class="px-4">{dep["creationtime"]}</td>
|
||||||
<td class="px-2">{dep["trader_name"]} {dep["surname"]}</td>
|
<td class="px-4">{dep["trader_name"]} {dep["surname"]}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
92
src/routes/refs/+page.svelte
Normal file
92
src/routes/refs/+page.svelte
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
<script>
|
||||||
|
import { getAuthInfo, makeAuthHeaderForAxios } from "$lib/auth/Auth";
|
||||||
|
import { makePost } from "$lib/tools/requests/requests";
|
||||||
|
import { sayError, sayInfo } from "$lib/tools/toaster/Toaster";
|
||||||
|
|
||||||
|
let referrerValue = "";
|
||||||
|
let referralValue = "";
|
||||||
|
let bidValue = "";
|
||||||
|
let bidPlatformValue = "";
|
||||||
|
|
||||||
|
let inProcess = false;
|
||||||
|
async function addReferral() {
|
||||||
|
if (inProcess) return;
|
||||||
|
if (
|
||||||
|
referralValue.length < 5 ||
|
||||||
|
referrerValue.length < 5 ||
|
||||||
|
bidValue.length < 1 ||
|
||||||
|
bidPlatformValue.length < 1
|
||||||
|
)
|
||||||
|
return;
|
||||||
|
|
||||||
|
inProcess = true;
|
||||||
|
const res = await makePost(
|
||||||
|
"admin/users/referral/create",
|
||||||
|
{
|
||||||
|
referrer: referrerValue,
|
||||||
|
referral: referralValue,
|
||||||
|
bid: bidValue,
|
||||||
|
bid_platform: bidPlatformValue,
|
||||||
|
},
|
||||||
|
// @ts-ignore
|
||||||
|
makeAuthHeaderForAxios(getAuthInfo()?.a)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (res.error) {
|
||||||
|
sayError("Не удалось добавить реферала");
|
||||||
|
} else {
|
||||||
|
sayInfo("Реферал успешно добавлен");
|
||||||
|
}
|
||||||
|
|
||||||
|
inProcess = false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="w-full flex flex-col gap-8">
|
||||||
|
<div class="flex gap-4">
|
||||||
|
<div class="bg-accent rounded-[4px] w-[10px] h-full"></div>
|
||||||
|
<h1 class="text-2xl font-semibold">Добавление реферала</h1>
|
||||||
|
</div>
|
||||||
|
<div class="w-full flex flex-col p-4 rounded-box bg-base-300">
|
||||||
|
<label class={"input input-bordered flex items-center gap-2 "}>
|
||||||
|
Реферер UUID
|
||||||
|
<input
|
||||||
|
bind:value={referrerValue}
|
||||||
|
type="text"
|
||||||
|
class="grow text-lg text-info"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
<label class={"input input-bordered flex items-center gap-2 mt-2"}>
|
||||||
|
Реферал UUID
|
||||||
|
<input
|
||||||
|
bind:value={referralValue}
|
||||||
|
type="text"
|
||||||
|
class="grow text-lg text-info"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
<label class={"input input-bordered flex items-center gap-2 mt-2"}>
|
||||||
|
Ставка
|
||||||
|
<input bind:value={bidValue} type="text" class="grow text-lg text-info" />
|
||||||
|
</label>
|
||||||
|
<label class={"input input-bordered flex items-center gap-2 mt-2"}>
|
||||||
|
Ставка платформы
|
||||||
|
<input
|
||||||
|
bind:value={bidPlatformValue}
|
||||||
|
type="text"
|
||||||
|
class="grow text-lg text-info"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
<button
|
||||||
|
on:click={() => {
|
||||||
|
addReferral();
|
||||||
|
}}
|
||||||
|
class="btn btn-outline btn-info mt-4"
|
||||||
|
>
|
||||||
|
{#if inProcess}
|
||||||
|
<span class="loading loading-md"></span>
|
||||||
|
{:else}
|
||||||
|
Добавить
|
||||||
|
{/if}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@ -17,6 +17,7 @@
|
|||||||
from_bank_name: "Название банка",
|
from_bank_name: "Название банка",
|
||||||
from_to: "Получатель",
|
from_to: "Получатель",
|
||||||
got_from_device_uuid: "Девайс UUID",
|
got_from_device_uuid: "Девайс UUID",
|
||||||
|
device_name: "Девайс",
|
||||||
initial_text: "Текст сообщения",
|
initial_text: "Текст сообщения",
|
||||||
matched_order_uuid: "Совпадение с заявкой",
|
matched_order_uuid: "Совпадение с заявкой",
|
||||||
on_device_msg_creation: "Время сообщения на устройство",
|
on_device_msg_creation: "Время сообщения на устройство",
|
||||||
|
|||||||
@ -192,6 +192,8 @@
|
|||||||
sbp: "СБП",
|
sbp: "СБП",
|
||||||
clearing_account: "По номеру счёта",
|
clearing_account: "По номеру счёта",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let showAddRef = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="w-full flex flex-col gap-8">
|
<div class="w-full flex flex-col gap-8">
|
||||||
@ -296,7 +298,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full flex justify-start gap-2">
|
<div class="w-full flex justify-start gap-2 overflow-auto">
|
||||||
<button
|
<button
|
||||||
class="btn btn-neutral w-[100px] btn-outline rounded-lg btn-sm"
|
class="btn btn-neutral w-[100px] btn-outline rounded-lg btn-sm"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
@ -536,6 +538,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{#if showAddRef}
|
||||||
|
<div class="fixed inset-0 bg-black opacity-60"></div>
|
||||||
|
<div class="fixed inset-0 bg-transparent flex justify-center items-center">
|
||||||
|
<div class="bg-base-300 rounded-md p-4 w-full max-w-[400px]"></div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<!-- {#if showFoundedOrderWindow}
|
<!-- {#if showFoundedOrderWindow}
|
||||||
<div class="fixed z-[1000] inset-0 flex justify-center items-center bg-black bg-opacity-50">
|
<div class="fixed z-[1000] inset-0 flex justify-center items-center bg-black bg-opacity-50">
|
||||||
<div class="bg-base-100 rounded-md p-4 flex flex-col">
|
<div class="bg-base-100 rounded-md p-4 flex flex-col">
|
||||||
|
|||||||
@ -36,6 +36,7 @@ const config = {
|
|||||||
"/currencies",
|
"/currencies",
|
||||||
"/sms",
|
"/sms",
|
||||||
"/withdrawals",
|
"/withdrawals",
|
||||||
|
"/refs",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user