From 445e75ced7efa05737d4831f4b4376a008b0149d Mon Sep 17 00:00:00 2001 From: Hepatica Date: Wed, 13 Dec 2023 21:13:04 +0100 Subject: [PATCH 1/8] Change amount number 1->0 --- luckydiamond/src/components/PaymentsModal.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luckydiamond/src/components/PaymentsModal.vue b/luckydiamond/src/components/PaymentsModal.vue index c8cbfde..e00d7d8 100644 --- a/luckydiamond/src/components/PaymentsModal.vue +++ b/luckydiamond/src/components/PaymentsModal.vue @@ -53,7 +53,7 @@ export default { ], data() { return { - amount: 1, + amount: 0, card: 0, clickedBtn: '', url: '', From 64199167f6685dfeea3b7e0f92c3c5c0f0c3d705 Mon Sep 17 00:00:00 2001 From: Kostya Date: Wed, 13 Dec 2023 23:51:57 +0300 Subject: [PATCH 2/8] added checking amount --- luckydiamond/src/components/PaymentsModal.vue | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/luckydiamond/src/components/PaymentsModal.vue b/luckydiamond/src/components/PaymentsModal.vue index 0cebd3b..b2ba961 100644 --- a/luckydiamond/src/components/PaymentsModal.vue +++ b/luckydiamond/src/components/PaymentsModal.vue @@ -64,22 +64,24 @@ export default { watch: { amount(newAmount) { console.log(newAmount) - this.offBtn = true - console.log('OFFBTN', this.offBtn) - setTimeout(() => { - try { - GettingMoneyOperation(newAmount) - .then((response) => { - console.log('Payments Modal Working!: ', response) - this.url = response.url - this.offBtn = false - console.log('ONBTN', this.offBtn) - }) - } - catch (e) { - console.error('Error in PaymentModal!', e) - } - }, 2000) + if (!this.amount < 0 && this.amount !== '' ) { + this.offBtn = true + console.log('OFFBTN', this.offBtn) + setTimeout(() => { + try { + GettingMoneyOperation(newAmount) + .then((response) => { + console.log('Payments Modal Working!: ', response) + this.url = response.url + this.offBtn = false + console.log('ONBTN', this.offBtn) + }) + } + catch (e) { + console.error('Error in PaymentModal!', e) + } + }, 2000) + } } }, methods: { From 74b543afe7af07c656f9b095c8c49e094d21d620 Mon Sep 17 00:00:00 2001 From: Kostya Date: Wed, 13 Dec 2023 23:53:59 +0300 Subject: [PATCH 3/8] fix bug with checker in payments modal --- luckydiamond/src/components/PaymentsModal.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luckydiamond/src/components/PaymentsModal.vue b/luckydiamond/src/components/PaymentsModal.vue index 7e9df19..476ccee 100644 --- a/luckydiamond/src/components/PaymentsModal.vue +++ b/luckydiamond/src/components/PaymentsModal.vue @@ -64,7 +64,7 @@ export default { watch: { amount(newAmount) { console.log(newAmount) - if (!this.amount < 0 && this.amount !== '' ) { + if (this.amount > 0 && this.amount !== '' ) { this.offBtn = true console.log('OFFBTN', this.offBtn) setTimeout(() => { From f797aa17d7ebf6ccbd6e0618e75c1a7bc1e9046e Mon Sep 17 00:00:00 2001 From: Kostya Date: Wed, 13 Dec 2023 23:55:38 +0300 Subject: [PATCH 4/8] changed logic for offbtn in watcher, payments modal --- luckydiamond/src/components/PaymentsModal.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/luckydiamond/src/components/PaymentsModal.vue b/luckydiamond/src/components/PaymentsModal.vue index 476ccee..456e3d1 100644 --- a/luckydiamond/src/components/PaymentsModal.vue +++ b/luckydiamond/src/components/PaymentsModal.vue @@ -63,10 +63,8 @@ export default { }, watch: { amount(newAmount) { - console.log(newAmount) + this.offBtn = true if (this.amount > 0 && this.amount !== '' ) { - this.offBtn = true - console.log('OFFBTN', this.offBtn) setTimeout(() => { try { GettingMoneyOperation(newAmount) @@ -74,7 +72,6 @@ export default { console.log('Payments Modal Working!: ', response) this.url = response.url this.offBtn = false - console.log('ONBTN', this.offBtn) }) } catch (e) { From c1ed27254a3ab13cbe0ad691789edf7afca4c56d Mon Sep 17 00:00:00 2001 From: Kostya Date: Thu, 14 Dec 2023 20:15:24 +0300 Subject: [PATCH 5/8] added vision for balance from request in profile page --- luckydiamond/src/pages/ProfilePage.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/luckydiamond/src/pages/ProfilePage.vue b/luckydiamond/src/pages/ProfilePage.vue index 834926a..d7aff51 100644 --- a/luckydiamond/src/pages/ProfilePage.vue +++ b/luckydiamond/src/pages/ProfilePage.vue @@ -59,6 +59,7 @@ import HeaderComponent from "@/components/HeaderComponent.vue"; import PaymentsModal from "@/components/PaymentsModal.vue"; import { GetCookie } from "@/assets/js/storage/CookieStorage"; import '@/assets/css/PagesStyles/profile.css' +import {GetCurrentMoney} from "@/assets/js/rest/RestMethods"; export default { components: { HeaderComponent, AsideBarComponent, ChatComponent, PaymentsModal }, @@ -66,7 +67,7 @@ export default { return { username: 'Artemka', imageUrl: '', - balance: 25000, + balance: 0, openModal: false, payments: true, arrayHistory: [], @@ -74,6 +75,11 @@ export default { }, created() { this.username = GetCookie('SpUserName') + this.balance = GetCurrentMoney( + GetCookie('AUTHTOKEN'), + GetCookie('SearchToken') + ) + console.log('Created Hook - Profile page = balance = ', this.balance) this.imageUrl = `https://visage.surgeplay.com/front/256/${this.username}` }, methods: { From 63dacbf122dafefe043a1852336a67cc37d871a4 Mon Sep 17 00:00:00 2001 From: Kostya Date: Thu, 14 Dec 2023 20:18:16 +0300 Subject: [PATCH 6/8] added test for auth and search token get from cookie in profile page --- luckydiamond/src/pages/ProfilePage.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luckydiamond/src/pages/ProfilePage.vue b/luckydiamond/src/pages/ProfilePage.vue index d7aff51..422df4a 100644 --- a/luckydiamond/src/pages/ProfilePage.vue +++ b/luckydiamond/src/pages/ProfilePage.vue @@ -76,8 +76,8 @@ export default { created() { this.username = GetCookie('SpUserName') this.balance = GetCurrentMoney( - GetCookie('AUTHTOKEN'), - GetCookie('SearchToken') + { authToken: GetCookie('AUTHTOKEN') }, + { serachToken: GetCookie('SearchToken') } ) console.log('Created Hook - Profile page = balance = ', this.balance) this.imageUrl = `https://visage.surgeplay.com/front/256/${this.username}` From 5b4ab39655be5f0d85e9c58b0dd460c35bf46c2e Mon Sep 17 00:00:00 2001 From: Kostya Date: Thu, 14 Dec 2023 20:21:40 +0300 Subject: [PATCH 7/8] fixed get auth and search token/code --- luckydiamond/src/pages/ProfilePage.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/luckydiamond/src/pages/ProfilePage.vue b/luckydiamond/src/pages/ProfilePage.vue index 422df4a..9a922ca 100644 --- a/luckydiamond/src/pages/ProfilePage.vue +++ b/luckydiamond/src/pages/ProfilePage.vue @@ -75,10 +75,11 @@ export default { }, created() { this.username = GetCookie('SpUserName') - this.balance = GetCurrentMoney( - { authToken: GetCookie('AUTHTOKEN') }, - { serachToken: GetCookie('SearchToken') } - ) + const authcode = GetCookie('AUTHTOKEN') + const searchtoken = GetCookie('SearchToken') + console.log('AUTHCODE AND SEARCH TOKEN - ', authcode, searchtoken) + + this.balance = GetCurrentMoney(authcode, searchtoken) console.log('Created Hook - Profile page = balance = ', this.balance) this.imageUrl = `https://visage.surgeplay.com/front/256/${this.username}` }, From 2079f6b4dc5d7f9955c8366b2932f0b7a233d255 Mon Sep 17 00:00:00 2001 From: Kostya Date: Thu, 14 Dec 2023 20:25:03 +0300 Subject: [PATCH 8/8] fixed getting money in profile page --- luckydiamond/src/pages/ProfilePage.vue | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/luckydiamond/src/pages/ProfilePage.vue b/luckydiamond/src/pages/ProfilePage.vue index 9a922ca..4654eaa 100644 --- a/luckydiamond/src/pages/ProfilePage.vue +++ b/luckydiamond/src/pages/ProfilePage.vue @@ -75,12 +75,16 @@ export default { }, created() { this.username = GetCookie('SpUserName') - const authcode = GetCookie('AUTHTOKEN') - const searchtoken = GetCookie('SearchToken') - console.log('AUTHCODE AND SEARCH TOKEN - ', authcode, searchtoken) - this.balance = GetCurrentMoney(authcode, searchtoken) - console.log('Created Hook - Profile page = balance = ', this.balance) + GetCurrentMoney(GetCookie('AUTHTOKEN'), GetCookie('SearchToken')) + .then((response) => { + this.balance = response.currentMoney + console.log('balance in profile', this.balance) + }) + .catch((error) => { + console.error('error in profile, get money', error) + }) + this.imageUrl = `https://visage.surgeplay.com/front/256/${this.username}` }, methods: {