Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 99.59 KB | None | 0 0
  1. /* eslint-disable */
  2. import React from 'react';
  3. import connect from '@vkontakte/vk-connect';
  4. import { View, platform, ModalRoot, ModalPage, ModalCard, Div, Avatar, Root, ActionSheet, ActionSheetItem, Button, ScreenSpinner, ConfigProvider, List, Cell, InfoRow, Snackbar, HeaderButton, TabbarItem, Epic, Tabbar, FormLayoutGroup, ModalPageHeader, Input, FormLayout, Alert} from '@vkontakte/vkui';
  5. import '@vkontakte/vkui/dist/vkui.css';
  6. import qr from '@vkontakte/vk-qr';
  7. import eruda from 'eruda'
  8. import Icon24Dismiss from '@vkontakte/icons/dist/24/dismiss';
  9. import Icon24Home from '@vkontakte/icons/dist/24/home';
  10. import Icon24Bug from '@vkontakte/icons/dist/24/bug';
  11. import Icon56GiftOutline from '@vkontakte/icons/dist/56/gift_outline';
  12. import Icon16Done from '@vkontakte/icons/dist/16/done';
  13. import Home from './panels/Home';
  14. import Persik from './panels/Persik';
  15. import Icon56CheckCircleDeviceOutline from '@vkontakte/icons/dist/56/check_circle_device_outline';
  16. import SystemFunctions from "./SystemFunctions";
  17. import House from './panels/House';
  18. import Pet from './panels/Pet';
  19. import MyPet from './panels/MyPet';
  20. import MyHouse from './panels/MyHouse';
  21. import Test from './panels/Test';
  22. import Dop from './panels/Dop';
  23. import Top from './panels/Top';
  24. import Reit from './panels/Reit';
  25. import Sett from './panels/Sett';
  26. import Referals from './panels/Referals';
  27. import Cases from './panels/Cases';
  28. import Chat from './panels/Chat';
  29. import ChangeNickname from './panels/ChangeNickname';
  30. import Transfer from './panels/Transfer';
  31. import TransferTest from './panels/TransferTest';
  32. import Transferinfo from './panels/Transferinfo';
  33. import Admin from './panels/Admin';
  34. import Katalog from './panels/Katalog';
  35. import Imus from './panels/Imus';
  36. import Icon28HelpOutline from '@vkontakte/icons/dist/28/help_outline';
  37. const MODAL_PAGE_FILTERS = 'filters';
  38. import vkConnect from '@vkontakte/vk-connect';
  39. const MODAL_PAGE_USER_INFO = 'user-info';
  40. import Upgrade from './panels/Upgrade';
  41. import Bonuse from './panels/Bonuse';
  42.  
  43. function openTab(url) {
  44.  
  45. // Create link in memory
  46.  
  47. let a = window.document.createElement("a");
  48.  
  49. a.target = '_blank';
  50.  
  51. a.href = url;
  52.  
  53. // Dispatch fake click
  54.  
  55. let e = window.document.createEvent("MouseEvents");
  56.  
  57. e.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  58.  
  59. a.dispatchEvent(e);
  60.  
  61. };
  62. const blueBackground = {
  63. backgroundColor: 'var(--accent)'
  64. };
  65. const MODAL_CARD_MONEY_SEND = 'money-send';
  66.  
  67. var ua = window.navigator.userAgent;
  68.  
  69.  
  70. class App extends React.Component {
  71. constructor(props) {
  72. super(props);
  73.  
  74. this.state = {
  75. activePanel: 'home',
  76. activeTab1: 'recomendations',
  77. activeTab2: 'all',
  78. activeTab3: 'all',
  79. activeTab4: 'test',
  80. activeTab5: 'events',
  81. app_id: 7003049,
  82. activeTab6: 'all',
  83. contextOpened: true,
  84. fetchedUser: null,
  85. userAcc: null,
  86. activeTab6: 'all',
  87. qr_data: null,
  88. qrSvg: null,
  89. qrSvgProfile: null,
  90. qrSvgUser: null,
  91. clicks: 0,
  92. bank: null,
  93. reputation: 0,
  94. speed: 0,
  95. ban: false,
  96. activeModal: null,
  97. aspeed: 0,
  98. priv: null,
  99. name: false,
  100. popout: null,
  101. calcRep: 0,
  102. nick: null,
  103. toid: 0,
  104. stageTimer: SystemFunctions.calcCloseData(1584284400),
  105. history: 0,
  106. history1: null,
  107. history2: null,
  108. history3: null,
  109. history4: null,
  110. history5: null,
  111. history6: null,
  112. history7: null,
  113. history8: null,
  114. history9: null,
  115. activeStory: 'home',
  116. history10: null,
  117. h_id1: 0,
  118. h_id2: 0,
  119. promo1: 0,
  120. promo2: 0,
  121. promo3: 0,
  122. promo_s1: 0,
  123. promo_s2:0,
  124. promo_s3:0,
  125. h_id3: 0,
  126. h_id4: 0,
  127. h_id5: 0,
  128. h_id6: 0,
  129. h_id7: 0,
  130. h_id8: 0,
  131. h_id9: 0,
  132. h_id10: 0,
  133. h_s1: 0,
  134. h_s2: 0,
  135. h_s3: 0,
  136. h_s4: 0,
  137. h_s5: 0,
  138. h_s6: 0,
  139. qr_data: null,
  140. qrSvg: null,
  141. qrSvgProfile: null,
  142. qrSvgUser: null,
  143. h_s7: 0,
  144. h_s8: 0,
  145. h_s9: 0,
  146. h_s10: 0,
  147. viv: 0,
  148. indexStringProgress : 0,
  149. v1: null,
  150. v2: null,
  151. v3: null,
  152. v4: null,
  153. v5: null,
  154. v6: null,
  155. v7: null,
  156. v8: null,
  157. v9: null,
  158. v10: null,
  159. v_id1: 0,
  160. v_id2: 0,
  161. v_id3: 0,
  162. v_id4: 0,
  163. v_id5: 0,
  164. v_id6: 0,
  165. v_id7: 0,
  166. v_id8: 0,
  167. v_id9: 0,
  168. v_id10: 0,
  169. v_s1: 0,
  170. v_s2: 0,
  171. v_s3: 0,
  172. v_s4: 0,
  173. modalHistory: [],
  174. v_s5: 0,
  175. v_s6: 0,
  176. v_s7: 0,
  177. v_s8: 0,
  178. v_s9: 0,
  179. v_s10: 0,
  180. transferCoins: 0,
  181. qr_data: null,
  182. qrSvg: null,
  183. qrSvgProfile: null,
  184. qrSvgUser: null,
  185. usersTop: null,
  186. groupsTop: null,
  187. activeTabUpgrades: 'click',
  188. activeTabTop: 'users',
  189. text: '',
  190. snackbar: null,
  191. activeTabTrans: 'ishod',
  192. upgradesOne: null,
  193. text: '',
  194. snackbar: null,
  195. upgradesTwo: null,
  196. usersTopReputation: null,
  197. usersTopAutomine: null,
  198. chat_u1: 0,
  199. chat_u2: 0,
  200. chat_u3: 0,
  201. chat_u4: 0,
  202. chat_u5: 0,
  203. chat_u6: 0,
  204. chat_u7: 0,
  205. chat_u8: 0,
  206. chat_u9: 0,
  207. chat_u10: 0,
  208. chat_un1: 0,
  209. chat_un2: 0,
  210. chat_un3: 0,
  211. chat_un4: 0,
  212. chat_un5: 0,
  213. chat_un6: 0,
  214. chat_un7: 0,
  215. chat_un8: 0,
  216. chat_un9: 0,
  217. chat_un10: 0,
  218. chat_message1:0,
  219. chat_message2:0,
  220. chat_message3:0,
  221. chat_message4:0,
  222. chat_message5:0,
  223. chat_message6:0,
  224. chat_message7:0,
  225. chat_message8:0,
  226. chat_message9:0,
  227. chat_message10:0,
  228. chat_d1:0,
  229. chat_d2:0,
  230. chat_d3:0,
  231. chat_d4:0,
  232. chat_d5:0,
  233. chat_d6:0,
  234. chat_d7:0,
  235. chat_d8:0,
  236. chat_d9:0,
  237. chat_d10:0,
  238. sp: 0
  239. };
  240. this.openDefault = this.openDefault.bind(this);
  241. this.openDefaulte = this.openDefaulte.bind(this);
  242. this.openDef = this.openDef.bind(this);
  243. this.openBase = this.openBase.bind(this);
  244. this.closePopout = this.closePopout.bind(this);
  245. this.clickQrcode = this.clickQrcode.bind(this);
  246. this.stories = this.stories.bind(this);
  247. this.buyCase = this.buyCase.bind(this);
  248. this.post = this.post.bind(this);
  249. this.buyBonuse = this.buyBonuse.bind(this);
  250. this.handleReputationChange = this.handleReputationChange.bind(this);
  251. this.handleReputationSubmit = this.handleReputationSubmit.bind(this);
  252. this.handleNickChange = this.handleNickChange.bind(this);
  253. this.handleNickSubmit = this.handleNickSubmit.bind(this);
  254. this.onChangeText = this.onChangeText.bind(this);
  255. this.handleTransferChange = this.handleTransferChange.bind(this);
  256. this.handleTransferSubmit = this.handleTransferSubmit.bind(this);
  257. this.handlePromoChange = this.handlePromoChange.bind(this);
  258. this.handlePromoSubmit = this.handlePromoSubmit.bind(this);
  259. this.handleTransferChangee = this.handleTransferChange.bind(this);
  260. this.handleeTransferSubmit = this.handleTransferSubmit.bind(this);
  261. this.buyPet = this.buyPet.bind(this);
  262. this.sellPet = this.sellPet.bind(this);
  263. this.pohodPet = this.pohodPet.bind(this);
  264. this.buyHouse = this.buyHouse.bind(this);
  265. this.onStoryChange = this.onStoryChange.bind(this);
  266. this.sellHouse = this.sellHouse.bind(this);
  267. this.pohodHouse = this.pohodHouse.bind(this);
  268. this.setActiveTabUpgrades = this.setActiveTabUpgrades.bind(this);
  269. this.setActiveTabTop = this.setActiveTabTop.bind(this);
  270. this.setActiveTabTrans = this.setActiveTabTrans.bind(this);
  271. this.buyUpgrade = this.buyUpgrade.bind(this);
  272. this.openDestructive = this.openDestructive.bind(this);
  273. this.openDestructiv = this.openDestructiv.bind(this);
  274. this.toggleContext = this.toggleContext.bind(this);
  275. this.clickShare = this.clickShare.bind(this);
  276. this.select = this.select.bind(this);
  277. this.openBase = this.openBase.bind(this);
  278. this.getUpgradesOne = this.getUpgradesOne.bind(this);
  279. this.getUpgradesTwo = this.getUpgradesTwo.bind(this);
  280. this.autoMine = this.autoMine.bind(this);
  281. this.onRefresh = () => {
  282. this.getUsersTop();
  283. this.getGroupsTop();
  284. }
  285. this.modalBack = () => {
  286. this.setActiveModal(this.state.modalHistory[this.state.modalHistory.length - 2]);
  287. }
  288. setInterval(() => {
  289. this.setState({
  290. stageTimer: SystemFunctions.calcCloseData(1584284400),
  291. });
  292. }, 1000);
  293. }
  294. // Поделиться приложением
  295. clickShare() {
  296.  
  297. connect.subscribe((e) => {
  298. switch (e.detail.type) {
  299. case 'VKWebAppShowWallPostBoxResult':
  300.  
  301. this.setState({
  302. popout: <Alert
  303. actions={[{
  304. title: 'Закрыть',
  305. autoclose: true,
  306. style: 'cancel'
  307. }]}
  308. onClose={this.closePopout}
  309. >
  310. <h2>Успешно</h2>
  311. <p>Вы успешно опубликовали ссылку для перевода Вам монет, проверьте свою стену.</p>
  312. </Alert>
  313. })
  314.  
  315. break;
  316.  
  317. case 'VKWebAppShowWallPostBoxFailed':
  318. // Не опубликовал
  319. break;
  320.  
  321. default:
  322. console.log(e.detail.type);
  323. }
  324. });
  325.  
  326. connect.send("VKWebAppShowWallPostBox", {
  327. "link_title": "FastClick",
  328. "link_image": "https://sun9-55.userapi.com/c857028/v857028809/deb7b/1G-0k8UwblE.jpg",
  329. "attachments": "https://vk.com/app" + this.state.app_id + "#u=" + this.state.fetchedUser.id,
  330. "message": "#FastClick",
  331. "link_button": "open_url"
  332. });
  333.  
  334. }
  335. openBase (title, msg, actions) {
  336. if (this.state.snackbar) return;
  337. this.setState({ snackbar:
  338. <Snackbar
  339. layout="vertical"
  340. onClose={() => this.setState({ snackbar: null })}
  341. before={<Avatar size={24} style={blueBackground}><Icon16Done fill="#fff" width={14} height={14} /></Avatar>}
  342. >
  343. {msg}
  344. </Snackbar>
  345. });
  346. }
  347. setActiveModal(activeModal) {
  348. activeModal = activeModal || null;
  349. let modalHistory = this.state.modalHistory ? [...this.state.modalHistory] : [];
  350.  
  351. if (activeModal === null) {
  352. modalHistory = [];
  353. } else if (modalHistory.indexOf(activeModal) !== -1) {
  354. modalHistory = modalHistory.splice(0, modalHistory.indexOf(activeModal) + 1);
  355. } else {
  356. modalHistory.push(activeModal);
  357. }
  358.  
  359. this.setState({
  360. activeModal,
  361. modalHistory
  362. });
  363. };
  364.  
  365. onChangeText() {
  366.  
  367. var summ_trans = document.getElementById('summ_trans').value;
  368. if (summ_trans > 0) {
  369. this.setState({ summ_trans: summ_trans });
  370. } else {
  371. this.setState({ summ_trans: null });
  372. }
  373.  
  374. }
  375. openDefault(title, msg, actions) {
  376. this.setState({
  377. popout:
  378. <Alert
  379. actions={[actions]}
  380. onClose={this.closePopout}
  381. >
  382. <h2>{title}</h2>
  383. <p>{msg}</p>
  384. </Alert>
  385. });
  386. }
  387.  
  388. story() {
  389. let url = `https://vk.com/app7003049`
  390. connect.send("VKWebAppShowStoryBox", { "background_type" : "image", "url" : "https://sun9-55.userapi.com/c857720/v857720739/180c3e/JHc_Yxj7Los.jpg", "locked" : "true", "attachment" : {
  391. "text": "open",
  392. "type": "url",
  393. "url": url
  394. } });
  395. }
  396.  
  397. vkpost() {
  398. connect.send("VKWebAppShowWallPostBox", {"message": "Привет! Я играю в сервис FastClick! Давай и ты! Прокачивавай свой профиль, покупай ускорители, выходи в ТОП! Ссылка - https://vk.com/app7003049 #FastClick"});
  399.  
  400. }
  401. openDestructive () {
  402. this.setState({ popout:
  403. <Alert
  404. actionsLayout="vertical"
  405. actions={[{
  406. title: 'Понятно',
  407. autoclose: true,
  408. style: 'cancel'
  409. }]}
  410. onClose={this.closePopout}
  411. >
  412. <h2>Обновление</h2>
  413. <p>Достижения станут активными через: {this.state.stageTimer}</p>
  414. </Alert>
  415. });
  416. }
  417. openDestructiv () {
  418. this.setState({ popout:
  419. <Alert
  420. actionsLayout="vertical"
  421. actions={[{
  422. title: 'Продолжить',
  423. autoclose: true,
  424. style: 'cancel'
  425. }]}
  426. onClose={this.closePopout}
  427. >
  428. <h2>С возвращением! </h2>
  429. <p>{`${fetchedUser.first_name} ${fetchedUser.last_name}`}, здравствуйте! </p>
  430. </Alert>
  431. });
  432. }
  433. res () {
  434. window.location.reload()
  435. }
  436. openDef(title, msg, actions) {
  437. this.setState({
  438. popout:
  439. <Alert
  440. actions={[actions]}
  441. onClose={this.closePopout}
  442. >
  443. <h2>тест</h2>
  444. <p>тест</p>
  445. </Alert>
  446. });
  447. }
  448.  
  449.  
  450. closePopout() {
  451. this.setState({ popout: null });
  452. }
  453.  
  454. openBase () {
  455. if (this.state.snackbar) return;
  456. this.setState({ snackbar:
  457. <Snackbar
  458. layout="vertical"
  459. onClose={() => this.setState({ snackbar: null })}
  460. before={<Avatar size={24} style={blueBackground}><Icon16Done fill="#fff" width={14} height={14} /></Avatar>}
  461. >
  462. Уведомления о подкастах включены
  463. </Snackbar>
  464. });
  465. }
  466.  
  467. componentDidMount() {
  468. window.addEventListener('popstate', e => e.preventDefault() & this.menu(e));
  469. window.history.pushState( { panel: 'home' }, `home` );
  470. connect.subscribe((e) => {
  471.  
  472. switch (e.detail.type) {
  473. case 'VKWebAppGetUserInfoResult':
  474. this.setState({ fetchedUser: e.detail.data });
  475. // if (navigator.userAgent.match(/(android|iphone|ipad|ipod)/i) == null) {
  476. // this.setState({ activePanel : 'admin' })
  477. // }
  478. let hash = this.getLocationHash()
  479. if (hash === 'profile') {
  480. this.setState({ activePanel : 'katalog' })
  481. }
  482. if (this.state.status === true) {
  483. this.setState({ activePanel : 'admin' })
  484. }
  485. if (hash === 'transfer') {
  486. this.setState({ activePanel : 'TransferTest' })
  487. }
  488. if (hash === 'banned') {
  489. this.setState({ activePanel : 'admin' })
  490. }
  491. if (hash === 'case') {
  492. this.setState({ activePanel : 'cases' })
  493. }
  494. if (hash === 'games') {
  495. this.setState({ activePanel : 'sett' })
  496. }
  497. if (hash === 'bank') {
  498. this.setState({ activePanel : 'imus' })
  499. }
  500. if (hash === 'progress') {
  501. this.setState({ activePanel : 'myHouse' })
  502. }
  503. if (hash === 'shop') {
  504. this.setState({ activePanel : 'persik' })
  505. }
  506. if (hash === 'home') {
  507. this.setState({ activePanel : 'home' })
  508. }
  509. if (hash === 'top') {
  510. this.setState({ activePanel : 'top' })
  511. }
  512. if (hash === 'help') {
  513. this.setState({ activePanel : 'Test' })
  514. }
  515. if (hash === 'test_scheme_android') {
  516. document.body.setAttribute('scheme', 'android_theme')
  517. connect.send('VKWebAppSetViewSettings', { 'status_bar_style': 'dark', 'action_bar_color': '#ffcc00' })
  518. }
  519. console.log(e.detail.data)
  520. this.createUser(e.detail.data);
  521. this.openBase()
  522. this.setState({ popout: <ScreenSpinner /> });
  523. setTimeout(() => {
  524. this.setState({ popout: null }) }, 2000);
  525. this.getUsersTop();
  526. this.getGroupsTop();
  527. this.getUsersTopReputation();
  528. this.getUsersTopAutomine();
  529. this.getUpgradesOne()
  530. this.getUpgradesTwo()
  531. // Создаем QR-code
  532. var text = 'https://vk.com/app' + this.state.app_id + '#u=' + this.state.fetchedUser.id;
  533. var isShowVkLogo = true;
  534. var qrSvg = qr.createQR(text, 256, 'qr-code-class', isShowVkLogo)
  535. var qrSvg = qr.createQR(text, 256, 'qr-code-class', isShowVkLogo);
  536. this.setState({ qrSvgProfile: qrSvg })
  537. this.setState({ qrSvgUser: qrSvg })
  538. break;
  539. case 'VKWebAppShowStoryBoxResult':
  540. this.stories();
  541. break;
  542. case 'VKWebAppShowWallPostBoxResult':
  543. this.post();
  544. break;
  545. case 'VKWebAppGetClientVersion':
  546. break;
  547. default:
  548. console.log(e.detail.type);
  549. }
  550. });
  551. connect.send('VKWebAppGetUserInfo', {});
  552. console.log(window.location)
  553. setInterval(() => {
  554. //this.autoMine();
  555. this.getChat();
  556. this.getGroupsTop();
  557. this.getUsersTopAutomine();
  558. this.getUsersTopReputation();
  559. console.log(1);
  560. }, 1000)
  561. }
  562. go = (e) => {
  563. window.history.pushState( { panel: e.currentTarget.dataset.to }, `${e.currentTarget.dataset.to}` );
  564. this.setState({ popout: <ScreenSpinner /> });
  565. setTimeout(() => { this.setState({ popout: null }) }, 500);
  566. this.setState({ activePanel: e.currentTarget.dataset.to })
  567. if(e.currentTarget.dataset.to === "top") {
  568. this.getUsersTop();
  569. this.getGroupsTop();
  570. }
  571. }
  572. storywin = () => {
  573. let clicks = Number(this.state.clicks) + 7777;
  574. //this.setState({ clicks: clicks })
  575. this.updateUserClicks(this.state.fetchedUser.id, clicks)
  576. }
  577. menu (e) {
  578. if(e.state) {
  579. this.setState( { activePanel: e.state.panel } );
  580. } else {
  581. this.setState( { activePanel: 'home', search: '' } );
  582. window.history.pushState( { panel: 'home' }, `home` );
  583. }
  584. }
  585. getChat = async (id, toid, count) => {
  586. fetch("/api.php", {
  587. method: 'post',
  588. headers: {
  589. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  590. },
  591. body: `method=get.chat.message`
  592. })
  593. .then((response) => response.json())
  594. .then((response) => {
  595. console.log("CHAT!!!");
  596. console.log(response)
  597. switch (response.status) {
  598. case 'success':
  599. this.openDefault("Успех", response.msg, {
  600. title: 'ОК',
  601. autoclose: true,
  602. })
  603. break;
  604. case 'error':
  605. this.openDefault("Ошибка", response.msg, {
  606. title: 'ОК',
  607. autoclose: true,
  608. style: "destructive"
  609. })
  610. break;
  611. default: break;
  612. }
  613. this.setState({ userAcc: response })
  614. this.setState({chat_photo1: response[0].photo})
  615. this.setState({chat_photo2: response[1].photo})
  616. this.setState({chat_photo3: response[2].photo})
  617. this.setState({chat_photo4: response[3].photo})
  618. this.setState({chat_photo5: response[4].photo})
  619. this.setState({chat_photo6: response[5].photo})
  620. this.setState({chat_photo7: response[6].photo})
  621. this.setState({chat_photo8: response[7].photo})
  622. this.setState({chat_photo9: response[8].photo})
  623. this.setState({chat_photo10: response[9].photo})
  624. this.setState({ chat_u1: response[0].user, chat_un1: response[0].username, chat_message1: response[0].sms, chat_d1: response[0].date })
  625. this.setState({ chat_u2: response[1].user, chat_un2: response[1].username, chat_message2: response[1].sms, chat_d2: response[1].date })
  626. this.setState({ chat_u3: response[2].user, chat_un3: response[2].username, chat_message3: response[2].sms, chat_d3: response[2].date })
  627. this.setState({ chat_u4: response[3].user, chat_un4: response[3].username, chat_message4: response[3].sms, chat_d4: response[3].date })
  628. this.setState({ chat_u5: response[4].user, chat_un5: response[4].username, chat_message5: response[4].sms, chat_d5: response[4].date })
  629. this.setState({ chat_u6: response[5].user, chat_un6: response[5].username, chat_message6: response[5].sms, chat_d6: response[5].date })
  630. this.setState({ chat_u7: response[6].user, chat_un7: response[6].username, chat_message7: response[6].sms, chat_d7: response[6].date })
  631. this.setState({ chat_u8: response[7].user, chat_un8: response[7].username, chat_message8: response[7].sms, chat_d8: response[7].date })
  632. this.setState({ chat_u9: response[8].user, chat_un9: response[8].username, chat_message9: response[8].sms, chat_d9: response[8].date })
  633. this.setState({ chat_u10: response[9].user, chat_un10: response[9].username, chat_message10: response[9].sms, chat_d10: response[9].date })
  634.  
  635. })
  636. .catch((error) => {
  637. console.error(error)
  638. })
  639. }
  640.  
  641. getUsersTopReputation = () => {
  642. fetch("/api.php", {
  643. method: 'post',
  644. headers: {
  645. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  646. },
  647. body: `method=get.users.top.reputation`
  648. })
  649. .then((response) => response.json())
  650. .then((response) => {
  651. this.setState({ usersTopReputation: response });
  652. console.log('reputation', response)
  653. })
  654. .catch((error) => {
  655. console.error(error)
  656. })
  657. }
  658. getUsersTopAutomine = () => {
  659. fetch("/api.php", {
  660. method: 'post',
  661. headers: {
  662. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  663. },
  664. body: `method=get.users.top.automine`
  665. })
  666. .then((response) => response.json())
  667. .then((response) => {
  668. this.setState({ usersTopAutomine: response });
  669. console.log('reputation', response)
  670. })
  671. .catch((error) => {
  672. console.error(error)
  673. })
  674. }
  675. clickQrcode() {
  676.  
  677. connect.subscribe((e) => {
  678. switch (e.detail.type) {
  679. case 'VKWebAppOpenQRResult':
  680. this.setState({ qr_data: e.detail.data });
  681.  
  682. const link = e.detail.data.qr_data;
  683. var urlapi = require('url'),
  684. url = urlapi.parse(link);
  685. var app_id = url.pathname.replace(/^.{4}/, '');
  686. if (url.hash != null) {
  687. var hash = url.hash.replace(/^.{1}/, '');
  688. } else {
  689. var hash = null;
  690. }
  691.  
  692. connect.send("VKWebAppOpenApp", { "app_id": app_id, link: hash });
  693. break;
  694.  
  695. case 'VKWebAppOpenQRFailed':
  696. // alert('QR-code не был отсканирован');
  697. break;
  698.  
  699. default:
  700. console.log(e.detail.type);
  701. }
  702. });
  703.  
  704. connect.send("VKWebAppOpenQR");
  705.  
  706. }
  707. dont = ()=> {
  708. this.setState({activePanel: "katalog"})
  709. }
  710.  
  711. share = (e) => {
  712. connect.send("VKWebAppShowStoryBox", { "background_type" : "image", "url" : "https://sun9-65.userapi.com/c850136/v850136098/1b77eb/0YK6suXkY24.jpg" });
  713. }
  714. buyCase(case_id) {
  715. fetch("/api.php", {
  716. method: 'post',
  717. headers: {
  718. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  719. },
  720. body: `method=user.buy.case&user_vk=${this.state.fetchedUser.id}&case_id=${case_id}`
  721. })
  722. .then((response) => response.json())
  723. .then((response) => {
  724. //console.log(response)
  725. switch(response.status) {
  726. case 'success':
  727. this.openDefault("Успех", response.msg, {
  728. title: 'ОК',
  729. autoclose: true,
  730. })
  731. break;
  732. case 'error':
  733. this.openDefault("Ошибка", response.msg, {
  734. title: 'ОК',
  735. autoclose: true,
  736. style: "destructive"
  737. })
  738. break;
  739. default: break;
  740. }
  741. this.setState({ userAcc: response })
  742. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  743. })
  744. .catch((error) => {
  745. console.error(error)
  746. })
  747. }
  748. buyBonuse(bonuse_id) {
  749. fetch("/api.php", {
  750. method: 'post',
  751. headers: {
  752. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  753. },
  754. body: `method=user.bonuse&user_vk=${this.state.fetchedUser.id}&bonuse_id=${bonuse_id}`
  755. })
  756. .then((response) => response.json())
  757. .then((response) => {
  758. //console.log(response)
  759. switch(response.status) {
  760. case 'success':
  761. this.openDefault("Успех", response.msg, {
  762. title: 'ОК',
  763. autoclose: true,
  764. })
  765. break;
  766. case 'error':
  767. this.openDefault("Ошибка", response.msg, {
  768. title: 'ОК',
  769. autoclose: true,
  770. style: "destructive"
  771. })
  772. break;
  773. default: break;
  774. }
  775. this.setState({ userAcc: response })
  776. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  777. })
  778. .catch((error) => {
  779. console.error(error)
  780. })
  781. }
  782. createUser = (data) => {
  783. fetch("/api.php", {
  784. method: 'post',
  785. headers: {
  786. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  787. },
  788. body: `method=user.create`
  789. })
  790. .then((response) => response.json())
  791. .then((response) => {
  792. this.setState({ ban: response.ban })
  793. this.setState({ history: response.history })
  794. this.setState({ bank: response.bank })
  795. this.setState({ history1: response.history1 })
  796. this.setState({ history2: response.history2 })
  797. this.setState({ history3: response.history3 })
  798. this.setState({ history4: response.history4 })
  799. this.setState({ history5: response.history5 })
  800. this.setState({ promo1: response.promo1 })
  801. this.setState({ promo2: response.promo2 })
  802. this.setState({ promo3: response.promo3})
  803. this.setState({ history6: response.history6 })
  804. this.setState({ history7: response.history7 })
  805. this.setState({ history8: response.history8 })
  806. this.setState({ history9: response.history9 })
  807. this.setState({ history10: response.history10 })
  808. this.setState({ h_id1: response.h_id1 })
  809. this.setState({ h_id2: response.h_id2 })
  810. this.setState({ h_id3: response.h_id3 })
  811. this.setState({ h_id4: response.h_id4 })
  812. this.setState({ h_id5: response.h_id5 })
  813. this.setState({ h_id7: response.h_id7 })
  814. this.setState({ h_id8: response.h_id8 })
  815. this.setState({ h_id9: response.h_id9 })
  816. this.setState({ h_id10: response.h_id10 })
  817. this.setState({ h_id6: response.h_id6 })
  818. this.setState({ h_s1: response.h_s1 })
  819. this.setState({ h_s2: response.h_s2 })
  820. this.setState({ h_s3: response.h_s3 })
  821. this.setState({ h_s4: response.h_s4 })
  822. this.setState({ h_s5: response.h_s5 })
  823. this.setState({ h_s6: response.h_s6 })
  824. this.setState({ h_s7: response.h_s7 })
  825. this.setState({ h_s8: response.h_s8 })
  826. this.setState({ h_s9: response.h_s9 })
  827. this.setState({ h_s10: response.h_s10 })
  828. this.setState({ viv: response.viv })
  829. this.setState({ v1: response.v1 })
  830. this.setState({ v2: response.v2 })
  831. this.setState({ v3: response.v3 })
  832. this.setState({ v4: response.v4 })
  833. this.setState({ v5: response.v5 })
  834. this.setState({ v6: response.v6 })
  835. this.setState({ v7: response.v7 })
  836. this.setState({ v8: response.v8 })
  837. this.setState({ v9: response.v9 })
  838. this.setState({ v10: response.v10 })
  839. this.setState({ v_id1: response.v_id1 })
  840. this.setState({ v_id2: response.v_id2 })
  841. this.setState({ v_id3: response.v_id3 })
  842. this.setState({ v_id4: response.v_id4 })
  843. this.setState({ v_id5: response.v_id5 })
  844. this.setState({ v_id7: response.v_id7 })
  845. this.setState({ v_id8: response.v_id8 })
  846. this.setState({ v_id9: response.v_id9 })
  847. this.setState({ v_id10: response.v_id10 })
  848. this.setState({ v_id6: response.v_id6 })
  849. this.setState({ v_s1: response.v_s1 })
  850. this.setState({ v_s2: response.v_s2 })
  851. this.setState({ v_s3: response.v_s3 })
  852. this.setState({ v_s4: response.v_s4 })
  853. this.setState({ v_s5: response.v_s5 })
  854. this.setState({ v_s6: response.v_s6 })
  855. this.setState({ v_s7: response.v_s7 })
  856. this.setState({ v_s8: response.v_s8 })
  857. this.setState({ v_s9: response.v_s9 })
  858. this.setState({ v_s10: response.v_s10 })
  859. // console.log(response)
  860. this.setState({ userAcc: response })
  861. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  862. //console.log(this.state.userAcc)
  863. })
  864. .catch((error) => {
  865. console.log(error)
  866. })
  867. }
  868.  
  869. getLocationHash() {
  870. return window.location.hash.replace('#','')
  871. }
  872.  
  873.  
  874. updateUserClicks = async (id) => {
  875. fetch("/api.php", {
  876. method: 'post',
  877. headers: {
  878. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  879. },
  880. body: `method=user.update.click&user_vk=${id}`
  881. })
  882. .then((response) => response.json())
  883. .then((response) => {
  884. //console.log('user', response)
  885. this.setState({ userAcc: response })
  886. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  887. this.setState({ history: response.history })
  888. this.setState({ history1: response.history1 })
  889. this.setState({ bank: response.bank })
  890. this.setState({ ban: response.ban })
  891. this.setState({ history2: response.history2 })
  892. this.setState({ history3: response.history3 })
  893. this.setState({ history4: response.history4 })
  894. this.setState({ history5: response.history5 })
  895. this.setState({ history6: response.history6 })
  896. this.setState({ history7: response.history7 })
  897. this.setState({ history8: response.history8 })
  898. this.setState({ history9: response.history9 })
  899. this.setState({ history10: response.history10 })
  900. this.setState({ h_id1: response.h_id1 })
  901. this.setState({ h_id2: response.h_id2 })
  902. this.setState({ h_id3: response.h_id3 })
  903. this.setState({ h_id4: response.h_id4 })
  904. this.setState({ h_id5: response.h_id5 })
  905. this.setState({ h_id7: response.h_id7 })
  906. this.setState({ h_id8: response.h_id8 })
  907. this.setState({ h_id9: response.h_id9 })
  908. this.setState({ h_id10: response.h_id10 })
  909. this.setState({ h_id6: response.h_id6 })
  910. this.setState({ h_s1: response.h_s1 })
  911. this.setState({ h_s2: response.h_s2 })
  912. this.setState({ h_s3: response.h_s3 })
  913. this.setState({ h_s4: response.h_s4 })
  914. this.setState({ h_s5: response.h_s5 })
  915. this.setState({ h_s6: response.h_s6 })
  916. this.setState({ h_s7: response.h_s7 })
  917. this.setState({ h_s8: response.h_s8 })
  918. this.setState({ h_s9: response.h_s9 })
  919. this.setState({ h_s10: response.h_s10 })
  920. this.setState({ viv: response.viv })
  921. this.setState({ v1: response.v1 })
  922. this.setState({ v2: response.v2 })
  923. this.setState({ v3: response.v3 })
  924. this.setState({ v4: response.v4 })
  925. this.setState({ v5: response.v5 })
  926. this.setState({ v6: response.v6 })
  927. this.setState({ v7: response.v7 })
  928. this.setState({ v8: response.v8 })
  929. this.setState({ v9: response.v9 })
  930. this.setState({ v10: response.v10 })
  931. this.setState({ v_id1: response.v_id1 })
  932. this.setState({ v_id2: response.v_id2 })
  933. this.setState({ v_id3: response.v_id3 })
  934. this.setState({ v_id4: response.v_id4 })
  935. this.setState({ v_id5: response.v_id5 })
  936. this.setState({ v_id7: response.v_id7 })
  937. this.setState({ v_id8: response.v_id8 })
  938. this.setState({ v_id9: response.v_id9 })
  939. this.setState({ v_id10: response.v_id10 })
  940. this.setState({ v_id6: response.v_id6 })
  941. this.setState({ v_s1: response.v_s1 })
  942. this.setState({ v_s2: response.v_s2 })
  943. this.setState({ v_s3: response.v_s3 })
  944. this.setState({ v_s4: response.v_s4 })
  945. this.setState({ v_s5: response.v_s5 })
  946. this.setState({ v_s6: response.v_s6 })
  947. this.setState({ v_s7: response.v_s7 })
  948. this.setState({ v_s8: response.v_s8 })
  949. this.setState({ v_s9: response.v_s9 })
  950. this.setState({ v_s10: response.v_s10 })
  951. })
  952. .catch((error) => {
  953. console.error(error)
  954. })
  955. }
  956.  
  957. BankUserPlus = async (id) => {
  958. fetch("/api.php", {
  959. method: 'post',
  960. headers: {
  961. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  962. },
  963. body: `method=user.bank.plus&user_vk=${id}`
  964. })
  965. .then((response) => response.json())
  966. .then((response) => {
  967. //console.log('user', response)
  968. this.setState({ userAcc: response })
  969. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  970. this.setState({ history: response.history })
  971. this.setState({ history1: response.history1 })
  972. this.setState({ bank: response.bank })
  973. this.setState({ history2: response.history2 })
  974. this.setState({ history3: response.history3 })
  975. this.setState({ history4: response.history4 })
  976. this.setState({ history5: response.history5 })
  977. this.setState({ history6: response.history6 })
  978. this.setState({ history7: response.history7 })
  979. this.setState({ history8: response.history8 })
  980. this.setState({ history9: response.history9 })
  981. this.setState({ history10: response.history10 })
  982. this.setState({ h_id1: response.h_id1 })
  983. this.setState({ h_id2: response.h_id2 })
  984. this.setState({ h_id3: response.h_id3 })
  985. this.setState({ h_id4: response.h_id4 })
  986. this.setState({ h_id5: response.h_id5 })
  987. this.setState({ h_id7: response.h_id7 })
  988. this.setState({ h_id8: response.h_id8 })
  989. this.setState({ h_id9: response.h_id9 })
  990. this.setState({ h_id10: response.h_id10 })
  991. this.setState({ h_id6: response.h_id6 })
  992. this.setState({ h_s1: response.h_s1 })
  993. this.setState({ h_s2: response.h_s2 })
  994. this.setState({ h_s3: response.h_s3 })
  995. this.setState({ h_s4: response.h_s4 })
  996. this.setState({ h_s5: response.h_s5 })
  997. this.setState({ h_s6: response.h_s6 })
  998. this.setState({ h_s7: response.h_s7 })
  999. this.setState({ h_s8: response.h_s8 })
  1000. this.setState({ h_s9: response.h_s9 })
  1001. this.setState({ h_s10: response.h_s10 })
  1002. this.setState({ viv: response.viv })
  1003. this.setState({ v1: response.v1 })
  1004. this.setState({ v2: response.v2 })
  1005. this.setState({ v3: response.v3 })
  1006. this.setState({ v4: response.v4 })
  1007. this.setState({ v5: response.v5 })
  1008. this.setState({ v6: response.v6 })
  1009. this.setState({ v7: response.v7 })
  1010. this.setState({ v8: response.v8 })
  1011. this.setState({ v9: response.v9 })
  1012. this.setState({ v10: response.v10 })
  1013. this.setState({ v_id1: response.v_id1 })
  1014. this.setState({ v_id2: response.v_id2 })
  1015. this.setState({ v_id3: response.v_id3 })
  1016. this.setState({ v_id4: response.v_id4 })
  1017. this.setState({ v_id5: response.v_id5 })
  1018. this.setState({ v_id7: response.v_id7 })
  1019. this.setState({ v_id8: response.v_id8 })
  1020. this.setState({ v_id9: response.v_id9 })
  1021. this.setState({ v_id10: response.v_id10 })
  1022. this.setState({ v_id6: response.v_id6 })
  1023. this.setState({ v_s1: response.v_s1 })
  1024. this.setState({ v_s2: response.v_s2 })
  1025. this.setState({ v_s3: response.v_s3 })
  1026. this.setState({ v_s4: response.v_s4 })
  1027. this.setState({ v_s5: response.v_s5 })
  1028. this.setState({ v_s6: response.v_s6 })
  1029. this.setState({ v_s7: response.v_s7 })
  1030. this.setState({ v_s8: response.v_s8 })
  1031. this.setState({ v_s9: response.v_s9 })
  1032. this.setState({ v_s10: response.v_s10 })
  1033. this.setState({ bank: response.bank })
  1034.  
  1035. })
  1036. .catch((error) => {
  1037. console.error(error)
  1038. })
  1039. }
  1040.  
  1041. Ban = async (id) => {
  1042. fetch("/api.php", {
  1043. method: 'post',
  1044. headers: {
  1045. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1046. },
  1047. body: `method=user.bank.plus&user_vk=${id}`
  1048. })
  1049. .then((response) => response.json())
  1050. .then((response) => {
  1051. //console.log('user', response)
  1052. this.setState({ ban: response.ban })
  1053.  
  1054. })
  1055. .catch((error) => {
  1056. console.error(error)
  1057. })
  1058. }
  1059. UserNewBank = (id, bankkk) => {
  1060.  
  1061.  
  1062.  
  1063. fetch("/api.php", {
  1064. method: 'post',
  1065. headers: {
  1066. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1067. },
  1068. body: `method=user.bank&user_vk=${id}&bank=${bankkk}`
  1069. })
  1070. .then((response) => response.json())
  1071. .then((response) => {
  1072. //console.log(response)
  1073.  
  1074. switch (response.status) {
  1075. case 'success':
  1076. this.openDefault("Успешно", response.msg, {
  1077. title: 'ОК',
  1078. autoclose: true,
  1079. })
  1080. break;
  1081. case 'error':
  1082. this.openDefault("Ошибка", response.msg, {
  1083. title: 'ОК',
  1084. autoclose: true,
  1085. style: "destructive"
  1086. })
  1087. break;
  1088. }
  1089.  
  1090. this.setState({ bank: response.bank })
  1091. this.setState({ history: response.history })
  1092. this.setState({ history1: response.history1 })
  1093. this.setState({ history2: response.history2 })
  1094. this.setState({ history3: response.history3 })
  1095. this.setState({ history4: response.history4 })
  1096. this.setState({ history5: response.history5 })
  1097. this.setState({ history6: response.history6 })
  1098. this.setState({ history7: response.history7 })
  1099. this.setState({ history8: response.history8 })
  1100. this.setState({ history9: response.history9 })
  1101. this.setState({ history10: response.history10 })
  1102. this.setState({ h_id1: response.h_id1 })
  1103. this.setState({ h_id2: response.h_id2 })
  1104. this.setState({ h_id3: response.h_id3 })
  1105. this.setState({ h_id4: response.h_id4 })
  1106. this.setState({ h_id5: response.h_id5 })
  1107. this.setState({ h_id7: response.h_id7 })
  1108. this.setState({ h_id8: response.h_id8 })
  1109. this.setState({ h_id9: response.h_id9 })
  1110. this.setState({ h_id10: response.h_id10 })
  1111. this.setState({ h_id6: response.h_id6 })
  1112. this.setState({ h_s1: response.h_s1 })
  1113. this.setState({ h_s2: response.h_s2 })
  1114. this.setState({ h_s3: response.h_s3 })
  1115. this.setState({ h_s4: response.h_s4 })
  1116. this.setState({ h_s5: response.h_s5 })
  1117. this.setState({ h_s6: response.h_s6 })
  1118. this.setState({ h_s7: response.h_s7 })
  1119. this.setState({ h_s8: response.h_s8 })
  1120. this.setState({ h_s9: response.h_s9 })
  1121. this.setState({ h_s10: response.h_s10 })
  1122. this.setState({ viv: response.viv })
  1123. this.setState({ v1: response.v1 })
  1124. this.setState({ v2: response.v2 })
  1125. this.setState({ v3: response.v3 })
  1126. this.setState({ v4: response.v4 })
  1127. this.setState({ v5: response.v5 })
  1128. this.setState({ v6: response.v6 })
  1129. this.setState({ v7: response.v7 })
  1130. this.setState({ v8: response.v8 })
  1131. this.setState({ v9: response.v9 })
  1132. this.setState({ v10: response.v10 })
  1133. this.setState({ v_id1: response.v_id1 })
  1134. this.setState({ v_id2: response.v_id2 })
  1135. this.setState({ v_id3: response.v_id3 })
  1136. this.setState({ v_id4: response.v_id4 })
  1137. this.setState({ v_id5: response.v_id5 })
  1138. this.setState({ v_id7: response.v_id7 })
  1139. this.setState({ v_id8: response.v_id8 })
  1140. this.setState({ v_id9: response.v_id9 })
  1141. this.setState({ v_id10: response.v_id10 })
  1142. this.setState({ v_id6: response.v_id6 })
  1143. this.setState({ v_s1: response.v_s1 })
  1144. this.setState({ v_s2: response.v_s2 })
  1145. this.setState({ v_s3: response.v_s3 })
  1146. this.setState({ v_s4: response.v_s4 })
  1147. this.setState({ v_s5: response.v_s5 })
  1148. this.setState({ v_s6: response.v_s6 })
  1149. this.setState({ v_s7: response.v_s7 })
  1150. this.setState({ v_s8: response.v_s8 })
  1151. this.setState({ v_s9: response.v_s9 })
  1152. this.setState({ v_s10: response.v_s10 })
  1153. })
  1154. .catch((error) => {
  1155. console.error(error)
  1156. })
  1157. }
  1158. updateUserReputation = (id, reputation) => {
  1159. fetch("/api.php", {
  1160. method: 'post',
  1161. headers: {
  1162. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1163. },
  1164. body: `method=user.update.reputation&user_vk=${id}&reputation_new=${reputation}`
  1165. })
  1166. .then((response) => response.json())
  1167. .then((response) => {
  1168. //console.log(response)
  1169. switch (response.status) {
  1170. case 'success':
  1171. this.openDefault("Успех", response.msg, {
  1172. title: 'ОК',
  1173. autoclose: true,
  1174. })
  1175. break;
  1176. case 'error':
  1177. this.openDefault("Ошибка", response.msg, {
  1178. title: 'ОК',
  1179. autoclose: true,
  1180. style: "destructive"
  1181. })
  1182. break;
  1183. default: break;
  1184. }
  1185. this.setState({ userAcc: response })
  1186. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  1187. this.setState({ history: response.history })
  1188. this.setState({ history1: response.history1 })
  1189. this.setState({ history2: response.history2 })
  1190. this.setState({ history3: response.history3 })
  1191. this.setState({ history4: response.history4 })
  1192. this.setState({ history5: response.history5 })
  1193. this.setState({ history6: response.history6 })
  1194. this.setState({ history7: response.history7 })
  1195. this.setState({ history8: response.history8 })
  1196. this.setState({ history9: response.history9 })
  1197. this.setState({ history10: response.history10 })
  1198. this.setState({ h_id1: response.h_id1 })
  1199. this.setState({ h_id2: response.h_id2 })
  1200. this.setState({ h_id3: response.h_id3 })
  1201. this.setState({ h_id4: response.h_id4 })
  1202. this.setState({ h_id5: response.h_id5 })
  1203. this.setState({ h_id7: response.h_id7 })
  1204. this.setState({ h_id8: response.h_id8 })
  1205. this.setState({ h_id9: response.h_id9 })
  1206. this.setState({ h_id10: response.h_id10 })
  1207. this.setState({ h_id6: response.h_id6 })
  1208. this.setState({ h_s1: response.h_s1 })
  1209. this.setState({ h_s2: response.h_s2 })
  1210. this.setState({ h_s3: response.h_s3 })
  1211. this.setState({ h_s4: response.h_s4 })
  1212. this.setState({ h_s5: response.h_s5 })
  1213. this.setState({ h_s6: response.h_s6 })
  1214. this.setState({ h_s7: response.h_s7 })
  1215. this.setState({ h_s8: response.h_s8 })
  1216. this.setState({ h_s9: response.h_s9 })
  1217. this.setState({ h_s10: response.h_s10 })
  1218. this.setState({ viv: response.viv })
  1219. this.setState({ v1: response.v1 })
  1220. this.setState({ v2: response.v2 })
  1221. this.setState({ v3: response.v3 })
  1222. this.setState({ v4: response.v4 })
  1223. this.setState({ v5: response.v5 })
  1224. this.setState({ v6: response.v6 })
  1225. this.setState({ v7: response.v7 })
  1226. this.setState({ v8: response.v8 })
  1227. this.setState({ v9: response.v9 })
  1228. this.setState({ v10: response.v10 })
  1229. this.setState({ v_id1: response.v_id1 })
  1230. this.setState({ v_id2: response.v_id2 })
  1231. this.setState({ v_id3: response.v_id3 })
  1232. this.setState({ v_id4: response.v_id4 })
  1233. this.setState({ v_id5: response.v_id5 })
  1234. this.setState({ v_id7: response.v_id7 })
  1235. this.setState({ v_id8: response.v_id8 })
  1236. this.setState({ v_id9: response.v_id9 })
  1237. this.setState({ v_id10: response.v_id10 })
  1238. this.setState({ v_id6: response.v_id6 })
  1239. this.setState({ v_s1: response.v_s1 })
  1240. this.setState({ v_s2: response.v_s2 })
  1241. this.setState({ v_s3: response.v_s3 })
  1242. this.setState({ v_s4: response.v_s4 })
  1243. this.setState({ v_s5: response.v_s5 })
  1244. this.setState({ v_s6: response.v_s6 })
  1245. this.setState({ v_s7: response.v_s7 })
  1246. this.setState({ v_s8: response.v_s8 })
  1247. this.setState({ v_s9: response.v_s9 })
  1248. this.setState({ v_s10: response.v_s10 })
  1249. })
  1250. .catch((error) => {
  1251. console.error(error)
  1252. })
  1253. }
  1254.  
  1255. updateUserNickname = (id, nickname) => {
  1256. fetch("/api.php", {
  1257. method: 'post',
  1258. headers: {
  1259. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1260. },
  1261. body: `method=user.update.nickname&user_vk=${id}&nickname=${nickname}`
  1262. })
  1263. .then((response) => response.json())
  1264. .then((response) => {
  1265. //console.log(response)
  1266. switch (response.status) {
  1267. case 'success':
  1268. this.openDefault("Успех", response.msg, {
  1269. title: 'ОК',
  1270. autoclose: true,
  1271. })
  1272. break;
  1273. case 'error':
  1274. this.openDefault("Ошибка", response.msg, {
  1275. title: 'ОК',
  1276. autoclose: true,
  1277. style: "destructive"
  1278. })
  1279. break;
  1280. default: break;
  1281. }
  1282. this.setState({ userAcc: response })
  1283. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  1284. })
  1285. .catch((error) => {
  1286. console.error(error)
  1287. })
  1288. }
  1289.  
  1290. addv = () => {
  1291. connect.send("VKWebAppAddToCommunity", {});
  1292. }
  1293.  
  1294. sendTransfer = async (id, toid, count) => {
  1295. fetch("/api.php", {
  1296. method: 'post',
  1297. headers: {
  1298. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1299. },
  1300. body: `method=user.send.transfer&user_vk=${id}&toid=${toid}&count=${count}`
  1301. })
  1302. .then((response) => response.json())
  1303. .then((response) => {
  1304. //console.log(response)
  1305. switch (response.status) {
  1306. case 'success':
  1307. this.openDefault("Успех", response.msg, {
  1308. title: 'ОК',
  1309. autoclose: true,
  1310. })
  1311. break;
  1312. case 'error':
  1313. this.openDefault("Ошибка", response.msg, {
  1314. title: 'ОК',
  1315. autoclose: true,
  1316. style: "destructive"
  1317. })
  1318. break;
  1319. default: break;
  1320. }
  1321. this.setState({ userAcc: response })
  1322. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  1323. this.setState({ history: response.history })
  1324. this.setState({ history1: response.history1 })
  1325. this.setState({ history2: response.history2 })
  1326. this.setState({ history3: response.history3 })
  1327. this.setState({ history4: response.history4 })
  1328. this.setState({ history5: response.history5 })
  1329. this.setState({ history6: response.history6 })
  1330. this.setState({ history7: response.history7 })
  1331. this.setState({ history8: response.history8 })
  1332. this.setState({ history9: response.history9 })
  1333. this.setState({ history10: response.history10 })
  1334. this.setState({ h_id1: response.h_id1 })
  1335. this.setState({ h_id2: response.h_id2 })
  1336. this.setState({ h_id3: response.h_id3 })
  1337. this.setState({ h_id4: response.h_id4 })
  1338. this.setState({ h_id5: response.h_id5 })
  1339. this.setState({ h_id7: response.h_id7 })
  1340. this.setState({ h_id8: response.h_id8 })
  1341. this.setState({ h_id9: response.h_id9 })
  1342. this.setState({ h_id10: response.h_id10 })
  1343. this.setState({ h_id6: response.h_id6 })
  1344. this.setState({ h_s1: response.h_s1 })
  1345. this.setState({ h_s2: response.h_s2 })
  1346. this.setState({ h_s3: response.h_s3 })
  1347. this.setState({ h_s4: response.h_s4 })
  1348. this.setState({ h_s5: response.h_s5 })
  1349. this.setState({ h_s6: response.h_s6 })
  1350. this.setState({ h_s7: response.h_s7 })
  1351. this.setState({ h_s8: response.h_s8 })
  1352. this.setState({ h_s9: response.h_s9 })
  1353. this.setState({ h_s10: response.h_s10 })
  1354. this.setState({ viv: response.viv })
  1355. this.setState({ v1: response.v1 })
  1356. this.setState({ v2: response.v2 })
  1357. this.setState({ v3: response.v3 })
  1358. this.setState({ v4: response.v4 })
  1359. this.setState({ v5: response.v5 })
  1360. this.setState({ v6: response.v6 })
  1361. this.setState({ v7: response.v7 })
  1362. this.setState({ v8: response.v8 })
  1363. this.setState({ v9: response.v9 })
  1364. this.setState({ v10: response.v10 })
  1365. this.setState({ v_id1: response.v_id1 })
  1366. this.setState({ v_id2: response.v_id2 })
  1367. this.setState({ v_id3: response.v_id3 })
  1368. this.setState({ v_id4: response.v_id4 })
  1369. this.setState({ v_id5: response.v_id5 })
  1370. this.setState({ v_id7: response.v_id7 })
  1371. this.setState({ v_id8: response.v_id8 })
  1372. this.setState({ v_id9: response.v_id9 })
  1373. this.setState({ v_id10: response.v_id10 })
  1374. this.setState({ v_id6: response.v_id6 })
  1375. this.setState({ v_s1: response.v_s1 })
  1376. this.setState({ v_s2: response.v_s2 })
  1377. this.setState({ v_s3: response.v_s3 })
  1378. this.setState({ v_s4: response.v_s4 })
  1379. this.setState({ v_s5: response.v_s5 })
  1380. this.setState({ v_s6: response.v_s6 })
  1381. this.setState({ v_s7: response.v_s7 })
  1382. this.setState({ v_s8: response.v_s8 })
  1383. this.setState({ v_s9: response.v_s9 })
  1384. this.setState({ v_s10: response.v_s10 })
  1385. })
  1386. .catch((error) => {
  1387. console.error(error)
  1388. })
  1389. }
  1390.  
  1391. getUsersTop = async () => {
  1392. fetch("/api.php", {
  1393. method: 'post',
  1394. headers: {
  1395. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1396. },
  1397. body: `method=get.users.top`
  1398. })
  1399. .then((response) => response.json())
  1400. .then((response) => {
  1401. this.setState({ usersTop: response })
  1402. })
  1403. .catch((error) => {
  1404. console.error(error)
  1405. })
  1406. }
  1407. getUsersTopRating = async () => {
  1408. fetch("/api.php", {
  1409. method: 'post',
  1410. headers: {
  1411. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1412. },
  1413. body: `method=get.users.toprating`
  1414. })
  1415. .then((response) => response.json())
  1416. .then((response) => {
  1417. this.setState({ usersTop: response })
  1418. })
  1419. .catch((error) => {
  1420. console.error(error)
  1421. })
  1422. }
  1423. getGroupsTop = () => {
  1424. fetch("/api.php", {
  1425. method: 'post',
  1426. headers: {
  1427. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1428. },
  1429. body: `method=get.groups.top`
  1430. })
  1431. .then((response) => response.json())
  1432. .then((response) => {
  1433. this.setState({ groupsTop: response });
  1434. })
  1435. .catch((error) => {
  1436. console.error(error)
  1437. })
  1438. }
  1439.  
  1440. handleReputationChange(event) {
  1441. const price = event.target.value;
  1442. this.setState({ calcRep: price * 10000});
  1443. this.setState({ sp: price });
  1444. }
  1445.  
  1446. handleReputationSubmit(event) {
  1447. if (this.state.clicks < 9999) {
  1448. this.openDefault("Ошибка!!", "Недостаточно денег для покупки рейтинга. Курс: 1 рейтинг = 10000 FC", {
  1449. title: 'ОК',
  1450. autoclose: true,
  1451. style: "destructive"
  1452. })
  1453. }
  1454. else {
  1455. this.updateUserReputation(this.state.fetchedUser.id, this.state.sp)
  1456. }
  1457. event.preventDefault();
  1458. }
  1459.  
  1460. handleNickChange(event) {
  1461. //console.log(event.target)
  1462. this.setState({ nick: event.target.value})
  1463. }
  1464. handleNickSubmit(event) {
  1465. if (this.state.nick === null || this.state.nick === "") {
  1466. return this.openDefault("Ошибка", "Введите ник", {
  1467. title: 'ОК',
  1468. autoclose: true,
  1469. style: "destructive"
  1470. })
  1471. }
  1472. else this.updateUserNickname(this.state.fetchedUser.id, this.state.nick)
  1473. event.preventDefault();
  1474. }
  1475.  
  1476. handlePromoChange(event) {
  1477. //console.log(event.target)
  1478. const target = event.target;
  1479. const name = target.name;
  1480. const value = target.value;
  1481. this.setState({ [name]: value })
  1482. }
  1483. handlePromoSubmit(event) {
  1484. if (!this.state.toId) {
  1485. return this.openDefault("Ошибка", "Введите промокод", {
  1486. title: 'ОК',
  1487. autoclose: true,
  1488. style: "destructive"
  1489. })
  1490. }
  1491. this.sendPromo(this.state.fetchedUser.id, this.state.toId)
  1492. this.setState({ promo1: response.promo1 })
  1493. this.setState({ promo2: response.promo2 })
  1494. this.setState({ promo3: response.promo3})
  1495. this.setState({ promo_s1: response.promo_s1 })
  1496. this.setState({ promo_s2: response.promo_s2 })
  1497. this.setState({ promo_s3: response.promo_s3 })
  1498. event.preventDefault();
  1499. }
  1500.  
  1501. handleTransferChange(event) {
  1502. //console.log(event.target)
  1503. const target = event.target;
  1504. const name = target.name;
  1505. const value = target.value;
  1506. this.setState({ [name]: value })
  1507. }
  1508.  
  1509. handleTransferSubmit(event) {
  1510. if (this.state.toid === 0 && this.state.transferCoins === 0) return false
  1511. else this.sendTransfer(this.state.fetchedUser.id, this.state.toId, this.state.transferCoins)
  1512. event.preventDefault();
  1513. }
  1514.  
  1515.  
  1516. handleeTransferChange(event) {
  1517. //console.log(event.target)
  1518. var hash = url.hash.replace(/^.{1}/, '');
  1519. const target = event.target;
  1520. const name = target.name;
  1521. const value = target.value;
  1522. this.setState({ [name]: value })
  1523. }
  1524.  
  1525. handleeTransferSubmit(event) {
  1526. if (this.state.toid === 0 && this.state.transferCoins === 0) return false
  1527. else this.sendTransfer(this.state.fetchedUser.id, this.state.hash, this.state.transferCoins)
  1528. event.preventDefault();
  1529. }
  1530. buyPet(pet_id) {
  1531. fetch("/api.php", {
  1532. method: 'post',
  1533. headers: {
  1534. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1535. },
  1536. body: `method=user.buy.pet&user_vk=${this.state.fetchedUser.id}&pet_id=${pet_id}`
  1537. })
  1538. .then((response) => response.json())
  1539. .then((response) => {
  1540. //console.log(response)
  1541. switch(response.status) {
  1542. case 'success':
  1543. this.openDefault("Успех", response.msg, {
  1544. title: 'ОК',
  1545. autoclose: true,
  1546. })
  1547. break;
  1548. case 'error':
  1549. this.openDefault("Ошибка", response.msg, {
  1550. title: 'ОК',
  1551. autoclose: true,
  1552. style: "destructive"
  1553. })
  1554. break;
  1555. default: break;
  1556. }
  1557. this.setState({ userAcc: response })
  1558. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  1559. })
  1560. .catch((error) => {
  1561. console.error(error)
  1562. })
  1563. }
  1564.  
  1565. sellPet(pet_id) {
  1566. fetch("/api.php", {
  1567. method: 'post',
  1568. headers: {
  1569. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1570. },
  1571. body: `method=user.sell.pet&user_vk=${this.state.fetchedUser.id}&pet_id=${pet_id}`
  1572. })
  1573. .then((response) => response.json())
  1574. .then((response) => {
  1575. //console.log(response)
  1576. switch (response.status) {
  1577. case 'success':
  1578. this.openDefault("Успех", response.msg, {
  1579. title: 'ОК',
  1580. autoclose: true,
  1581. })
  1582. break;
  1583. case 'error':
  1584. this.openDefault("Ошибка", response.msg, {
  1585. title: 'ОК',
  1586. autoclose: true,
  1587. style: "destructive"
  1588. })
  1589. break;
  1590. default: break;
  1591. }
  1592. this.setState({ userAcc: response })
  1593. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  1594. this.setState({ activePanel: "home" })
  1595. })
  1596. .catch((error) => {
  1597. console.error(error)
  1598. })
  1599. }
  1600.  
  1601. pohodPet() {
  1602. fetch("/api.php", {
  1603. method: 'post',
  1604. headers: {
  1605. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1606. },
  1607. body: `method=user.pohod.pet&user_vk=${this.state.fetchedUser.id}`
  1608. })
  1609. .then((response) => response.json())
  1610. .then((response) => {
  1611. //console.log(response)
  1612. switch (response.status) {
  1613. case 'success':
  1614. this.openDefault("Успех", response.msg, {
  1615. title: 'ОК',
  1616. autoclose: true,
  1617. })
  1618. break;
  1619. case 'error':
  1620. this.openDefault("Ошибка", response.msg, {
  1621. title: 'ОК',
  1622. autoclose: true,
  1623. style: "destructive"
  1624. })
  1625. break;
  1626. default: break;
  1627. }
  1628. this.setState({ userAcc: response })
  1629. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  1630. })
  1631. .catch((error) => {
  1632. console.error(error)
  1633. })
  1634. }
  1635.  
  1636. stories() {
  1637. fetch("/api.php", {
  1638. method: 'post',
  1639. headers: {
  1640. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1641. },
  1642. body: `method=user.bonuse.stories&user_vk=${this.state.fetchedUser.id}`
  1643. })
  1644. .then((response) => response.json())
  1645. .then((response) => {
  1646. //console.log(response)
  1647. switch (response.status) {
  1648. case 'success':
  1649. this.openDefault("Успех", response.msg, {
  1650. title: 'ОК',
  1651. autoclose: true,
  1652. })
  1653. break;
  1654. case 'error':
  1655. this.openDefault("Ошибка", response.msg, {
  1656. title: 'ОК',
  1657. autoclose: true,
  1658. style: "destructive"
  1659. })
  1660. break;
  1661. default: break;
  1662. }
  1663. this.setState({ userAcc: response })
  1664. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  1665. })
  1666. .catch((error) => {
  1667. console.error(error)
  1668. })
  1669. }
  1670. post () {
  1671. fetch("/api.php", {
  1672. method: 'post',
  1673. headers: {
  1674. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1675. },
  1676. body: `method=user.bonuse.post&user_vk=${this.state.fetchedUser.id}`
  1677. })
  1678. .then((response) => response.json())
  1679. .then((response) => {
  1680. //console.log(response)
  1681. switch (response.status) {
  1682. case 'success':
  1683. this.openDefault("Успех", response.msg, {
  1684. title: 'ОК',
  1685. autoclose: true,
  1686. })
  1687. break;
  1688. case 'error':
  1689. this.openDefault("Ошибка", response.msg, {
  1690. title: 'ОК',
  1691. autoclose: true,
  1692. style: "destructive"
  1693. })
  1694. break;
  1695. default: break;
  1696. }
  1697. this.setState({ userAcc: response })
  1698. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  1699. })
  1700. .catch((error) => {
  1701. console.error(error)
  1702. })
  1703. }
  1704. buyHouse(house_id) {
  1705. fetch("/api.php", {
  1706. method: 'post',
  1707. headers: {
  1708. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1709. },
  1710. body: `method=user.buy.house&user_vk=${this.state.fetchedUser.id}&house_id=${house_id}`
  1711. })
  1712. .then((response) => response.json())
  1713. .then((response) => {
  1714. //console.log(response)
  1715. switch(response.status) {
  1716. case 'success':
  1717. this.openDefault("Успех", response.msg, {
  1718. title: 'ОК',
  1719. autoclose: true,
  1720. })
  1721. break;
  1722. case 'error':
  1723. this.openDefault("Ошибка", response.msg, {
  1724. title: 'ОК',
  1725. autoclose: true,
  1726. style: "destructive"
  1727. })
  1728. break;
  1729. default: break;
  1730. }
  1731. this.setState({ userAcc: response })
  1732. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  1733. })
  1734. .catch((error) => {
  1735. console.error(error)
  1736. })
  1737. }
  1738.  
  1739. sellHouse(house_id) {
  1740. fetch("/api.php", {
  1741. method: 'post',
  1742. headers: {
  1743. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1744. },
  1745. body: `method=user.sell.house&user_vk=${this.state.fetchedUser.id}&house_id=${house_id}`
  1746. })
  1747. .then((response) => response.json())
  1748. .then((response) => {
  1749. //console.log(response)
  1750. switch (response.status) {
  1751. case 'success':
  1752. this.openDefault("Успех", response.msg, {
  1753. title: 'ОК',
  1754. autoclose: true,
  1755. })
  1756. break;
  1757. case 'error':
  1758. this.openDefault("Ошибка", response.msg, {
  1759. title: 'ОК',
  1760. autoclose: true,
  1761. style: "destructive"
  1762. })
  1763. break;
  1764. default: break;
  1765. }
  1766. this.setState({ userAcc: response })
  1767. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  1768. this.setState({ activePanel: "home" })
  1769. })
  1770. .catch((error) => {
  1771. console.error(error)
  1772. })
  1773. }
  1774.  
  1775. pohodHouse() {
  1776. fetch("/api.php", {
  1777. method: 'post',
  1778. headers: {
  1779. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1780. },
  1781. body: `method=user.pohod.house&user_vk=${this.state.fetchedUser.id}`
  1782. })
  1783. .then((response) => response.json())
  1784. .then((response) => {
  1785. //console.log(response)
  1786. switch (response.status) {
  1787. case 'success':
  1788. this.openDefault("Успех", response.msg, {
  1789. title: 'ОК',
  1790. autoclose: true,
  1791. })
  1792. break;
  1793. case 'error':
  1794. this.openDefault("Ошибка", response.msg, {
  1795. title: 'ОК',
  1796. autoclose: true,
  1797. style: "destructive"
  1798. })
  1799. break;
  1800. default: break;
  1801. }
  1802. this.setState({ userAcc: response })
  1803. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  1804. })
  1805. .catch((error) => {
  1806. console.error(error)
  1807. })
  1808. }
  1809.  
  1810. buyUpgrade(type, name) {
  1811. fetch("/api.php", {
  1812. method: 'post',
  1813. headers: {
  1814. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1815. },
  1816. body: `method=user.buy.upgrade&user_vk=${this.state.fetchedUser.id}&type=${type}&up_name=${name}`
  1817. })
  1818. .then((response) => response.json())
  1819. .then((response) => {
  1820. //console.log(response)
  1821. switch(response.status) {
  1822. case 'error':
  1823. this.openDefault("Ошибка", response.msg, {
  1824. title: 'ОК',
  1825. autoclose: true,
  1826. style: "destructive"
  1827. })
  1828. break;
  1829. }
  1830. this.setState({ userAcc: response })
  1831. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  1832. this.getUpgradesOne()
  1833. this.getUpgradesTwo()
  1834. })
  1835. .catch((error) => {
  1836. console.error(error)
  1837. })
  1838. }
  1839.  
  1840.  
  1841. getUpgradesOne() {
  1842. fetch("/api.php", {
  1843. method: 'post',
  1844. headers: {
  1845. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1846. },
  1847. body: `method=get.upgrades.one`
  1848. })
  1849. .then((response) => response.json())
  1850. .then((response) => {
  1851. console.log(response)
  1852. this.setState({ upgradesOne: response });
  1853. })
  1854. .catch((error) => {
  1855. console.error(error)
  1856. })
  1857. }
  1858.  
  1859.  
  1860. getUpgradesTwo() {
  1861. fetch("/api.php", {
  1862. method: 'post',
  1863. headers: {
  1864. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1865. },
  1866. body: `method=get.upgrades.two`
  1867. })
  1868. .then((response) => response.json())
  1869. .then((response) => {
  1870. console.log(response)
  1871. this.setState({ upgradesTwo: response });
  1872. })
  1873. .catch((error) => {
  1874. console.error(error)
  1875. })
  1876. }
  1877.  
  1878. autoMine() {
  1879. fetch("/api.php", {
  1880. method: 'post',
  1881. headers: {
  1882. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  1883. },
  1884. body: `method=user.auto.mine&user_vk=${this.state.fetchedUser.id}`
  1885. })
  1886. .then((response) => response.json())
  1887. .then((response) => {
  1888. console.log(response)
  1889. this.setState({ userAcc: response })
  1890. this.setState({ promo1: response.promo1 })
  1891. this.setState({ promo2: response.promo2 })
  1892. this.setState({ promo3: response.promo3})
  1893. this.setState({ promo_s1: response.promo_s1 })
  1894. this.setState({ promo_s2: response.promo_s2 })
  1895. this.setState({ promo_s3: response.promo_s3 })
  1896. this.setState({chat_photo1: response[0].photo})
  1897. this.setState({chat_photo2: response[1].photo})
  1898. this.setState({chat_photo3: response[2].photo})
  1899. this.setState({chat_photo4: response[3].photo})
  1900. this.setState({chat_photo5: response[4].photo})
  1901. this.setState({chat_photo6: response[5].photo})
  1902. this.setState({chat_photo7: response[6].photo})
  1903. this.setState({chat_photo8: response[7].photo})
  1904. this.setState({chat_photo9: response[8].photo})
  1905. this.setState({chat_photo10: response[9].photo})
  1906. this.setState({ chat_u1: response[0].user, chat_un1: response[0].username, chat_message1: response[0].sms, chat_d1: response[0].date })
  1907. this.setState({ chat_u2: response[1].user, chat_un2: response[1].username, chat_message2: response[1].sms, chat_d2: response[1].date })
  1908. this.setState({ chat_u3: response[2].user, chat_un3: response[2].username, chat_message3: response[2].sms, chat_d3: response[2].date })
  1909. this.setState({ chat_u4: response[3].user, chat_un4: response[3].username, chat_message4: response[3].sms, chat_d4: response[3].date })
  1910. this.setState({ chat_u5: response[4].user, chat_un5: response[4].username, chat_message5: response[4].sms, chat_d5: response[4].date })
  1911. this.setState({ chat_u6: response[5].user, chat_un6: response[5].username, chat_message6: response[5].sms, chat_d6: response[5].date })
  1912. this.setState({ chat_u7: response[6].user, chat_un7: response[6].username, chat_message7: response[6].sms, chat_d7: response[6].date })
  1913. this.setState({ chat_u8: response[7].user, chat_un8: response[7].username, chat_message8: response[7].sms, chat_d8: response[7].date })
  1914. this.setState({ chat_u9: response[8].user, chat_un9: response[8].username, chat_message9: response[8].sms, chat_d9: response[8].date })
  1915. this.setState({ chat_u10: response[9].user, chat_un10: response[9].username, chat_message10: response[9].sms, chat_d10: response[9].date })
  1916. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  1917. })
  1918. .catch((error) => {
  1919. console.error(error)
  1920. })
  1921. }
  1922. setActiveTabUpgrades = (value) => {
  1923. this.setState({ activeTabUpgrades: `${value}` });
  1924. }
  1925.  
  1926. setActiveTabTop = (value) => {
  1927. this.setState({ activeTabTop: `${value}` });
  1928. }
  1929. setActiveTabTrans = (value) => {
  1930. this.setState({ activeTabTrans: `${value}` });
  1931. }
  1932.  
  1933.  
  1934. add1 = () => {
  1935. this.updateUserClicks(this.state.fetchedUser.id)
  1936. this.setState({chat_photo1: response[0].photo})
  1937. this.setState({chat_photo2: response[1].photo})
  1938. this.setState({chat_photo3: response[2].photo})
  1939. this.setState({chat_photo4: response[3].photo})
  1940. this.setState({chat_photo5: response[4].photo})
  1941. this.setState({chat_photo6: response[5].photo})
  1942. this.setState({chat_photo7: response[6].photo})
  1943. this.setState({chat_photo8: response[7].photo})
  1944. this.setState({chat_photo9: response[8].photo})
  1945. this.setState({chat_photo10: response[9].photo})
  1946. this.setState({ chat_u1: response[0].user, chat_un1: response[0].username, chat_message1: response[0].sms, chat_d1: response[0].date })
  1947. this.setState({ chat_u2: response[1].user, chat_un2: response[1].username, chat_message2: response[1].sms, chat_d2: response[1].date })
  1948. this.setState({ chat_u3: response[2].user, chat_un3: response[2].username, chat_message3: response[2].sms, chat_d3: response[2].date })
  1949. this.setState({ chat_u4: response[3].user, chat_un4: response[3].username, chat_message4: response[3].sms, chat_d4: response[3].date })
  1950. this.setState({ chat_u5: response[4].user, chat_un5: response[4].username, chat_message5: response[4].sms, chat_d5: response[4].date })
  1951. this.setState({ chat_u6: response[5].user, chat_un6: response[5].username, chat_message6: response[5].sms, chat_d6: response[5].date })
  1952. this.setState({ chat_u7: response[6].user, chat_un7: response[6].username, chat_message7: response[6].sms, chat_d7: response[6].date })
  1953. this.setState({ chat_u8: response[7].user, chat_un8: response[7].username, chat_message8: response[7].sms, chat_d8: response[7].date })
  1954. this.setState({ chat_u9: response[8].user, chat_un9: response[8].username, chat_message9: response[8].sms, chat_d9: response[8].date })
  1955. this.setState({ chat_u10: response[9].user, chat_un10: response[9].username, chat_message10: response[9].sms, chat_d10: response[9].date })
  1956. }
  1957.  
  1958.  
  1959. dark = () => {
  1960. document.body.setAttribute( 'scheme','client_dark' );
  1961. }
  1962.  
  1963. onStoryChange (e) {
  1964. this.setState({ activeStory: e.currentTarget.dataset.story })
  1965. this.setState({ popout: <ScreenSpinner /> });
  1966. setTimeout(() => { this.setState({ popout: null }) }, 200);
  1967. }
  1968. share = () => {
  1969. connect.send("VKWebAppShowWallPostBox", {"message": "Привет! Я играю в сервисе - https://vk.com/app7003049! Тематика простая: кликаешь, зарабатываешь FC! #FastClick"});
  1970. }
  1971.  
  1972. toggleContext () {
  1973. this.setState({ contextOpened: !this.state.contextOpened });
  1974. }
  1975.  
  1976. select (e) {
  1977. const mode = e.currentTarget.dataset.mode;
  1978. this.setState({ mode });
  1979. requestAnimationFrame(this.toggleContext);
  1980. }
  1981. bbank = () => {
  1982.  
  1983. function bankk(length) {
  1984. var result = '';
  1985. var characters = '123456789';
  1986. var charactersLength = characters.length;
  1987. for ( var i = 0; i < length; i++ ) {
  1988. result += characters.charAt(Math.floor(Math.random() * charactersLength));
  1989. }
  1990. return result;
  1991. }
  1992.  
  1993. if (this.state.bank_ > 1) {
  1994. this.openDefault("Ошибка", "Токен уже получали.", {
  1995. title: 'ОК',
  1996. autoclose: true,
  1997. style: "destructive"
  1998. })
  1999. }
  2000. else {
  2001.  
  2002. let bankkk = bankk(18);
  2003. //this.setState({ clicks: clicks })
  2004. this.UserNewBank(this.state.fetchedUser.id, bankkk)
  2005. }
  2006. }
  2007. shares = () => {
  2008. connect.send("VKWebAppCopyText", {text: "Этот текст будет скопирован в буфер обмена."});
  2009. }
  2010. ttoken = () => {
  2011.  
  2012. function tokenn(length) {
  2013. var result = '';
  2014. var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#%^&*{}[]';
  2015. var charactersLength = characters.length;
  2016. for ( var i = 0; i < length; i++ ) {
  2017. result += characters.charAt(Math.floor(Math.random() * charactersLength));
  2018. }
  2019. return result;
  2020. }
  2021.  
  2022. if (this.state.token_ > 1) {
  2023. this.openDefault("Ошибка", "Токен уже получали.", {
  2024. title: 'ОК',
  2025. autoclose: true,
  2026. style: "destructive"
  2027. })
  2028. }
  2029. else {
  2030.  
  2031. let tokennn = tokenn(20);
  2032. //this.setState({ clicks: clicks })
  2033. this.UserNewToken(this.state.fetchedUser.id, tokennn)
  2034. }
  2035. }
  2036. openDefaulte () {
  2037. this.setState({ popout:
  2038. <Alert
  2039. actions={[{
  2040. title: 'Отмена',
  2041. autoclose: true,
  2042. mode: 'cancel'
  2043. }, {
  2044. title: 'Повторить',
  2045. autoclose: true,
  2046. action: () => this.openDefaulte,
  2047. }]}
  2048. onClose={this.closePopout}
  2049. >
  2050. <h2>Возникла ошибка! </h2>
  2051. <p>Возникла ошибка при активации промокода, возможно: <br /> — Промокод неактивен <br /> — Ошибка на сервере <br /> — Активации промокода закончились </p>
  2052. </Alert>
  2053. });
  2054. }
  2055. sendPromo = async (id, toid, count) => {
  2056. fetch("/api.php", {
  2057. method: 'post',
  2058. headers: {
  2059. "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  2060. },
  2061. body: `method=user.promo.activ&user_vk=${id}&promo=${toid}`
  2062. })
  2063. .then((response) => response.json())
  2064. .then((response) => {
  2065. console.log("PROMO!!!");
  2066. console.log(response)
  2067. switch (response.status) {
  2068. case 'success':
  2069. this.openDefault("Успех", response.msg, {
  2070. title: 'ОК',
  2071. autoclose: true,
  2072. })
  2073. break;
  2074. case 'error':
  2075. this.openDefault("Ошибка", response.msg, {
  2076. title: 'ОК',
  2077. autoclose: true,
  2078. style: "destructive"
  2079. })
  2080. break;
  2081. default: break;
  2082. }
  2083. this.setState({ userAcc: response })
  2084. this.setState({ clicks: response.clicks, reputation: response.reputation, speed: response.speed, aspeed: response.aspeed })
  2085. this.setState({ history: response.history })
  2086. this.setState({ history1: response.history1 })
  2087. this.setState({ history2: response.history2 })
  2088. this.setState({ history3: response.history3 })
  2089. this.setState({ history4: response.history4 })
  2090. this.setState({ history5: response.history5 })
  2091. this.setState({ history6: response.history6 })
  2092. this.setState({ history7: response.history7 })
  2093. this.setState({ history8: response.history8 })
  2094. this.setState({ history9: response.history9 })
  2095. this.setState({ history10: response.history10 })
  2096. this.setState({ h_id1: response.h_id1 })
  2097. this.setState({ h_id2: response.h_id2 })
  2098. this.setState({ h_id3: response.h_id3 })
  2099. this.setState({ h_id4: response.h_id4 })
  2100. this.setState({ h_id5: response.h_id5 })
  2101. this.setState({ h_id7: response.h_id7 })
  2102. this.setState({ h_id8: response.h_id8 })
  2103. this.setState({ h_id9: response.h_id9 })
  2104. this.setState({ h_id10: response.h_id10 })
  2105. this.setState({ h_id6: response.h_id6 })
  2106. this.setState({ h_s1: response.h_s1 })
  2107. this.setState({ h_s2: response.h_s2 })
  2108. this.setState({ h_s3: response.h_s3 })
  2109. this.setState({ h_s4: response.h_s4 })
  2110. this.setState({ h_s5: response.h_s5 })
  2111. this.setState({ h_s6: response.h_s6 })
  2112. this.setState({ h_s7: response.h_s7 })
  2113. this.setState({ h_s8: response.h_s8 })
  2114. this.setState({ h_s9: response.h_s9 })
  2115. this.setState({ h_s10: response.h_s10 })
  2116. this.setState({ viv: response.viv })
  2117. this.setState({ v1: response.v1 })
  2118. this.setState({ v2: response.v2 })
  2119. this.setState({ v3: response.v3 })
  2120. this.setState({ v4: response.v4 })
  2121. this.setState({ v5: response.v5 })
  2122. this.setState({ v6: response.v6 })
  2123. this.setState({ v7: response.v7 })
  2124. this.setState({ v8: response.v8 })
  2125. this.setState({ v9: response.v9 })
  2126. this.setState({ v10: response.v10 })
  2127. this.setState({ v_id1: response.v_id1 })
  2128. this.setState({ v_id2: response.v_id2 })
  2129. this.setState({ v_id3: response.v_id3 })
  2130. this.setState({ v_id4: response.v_id4 })
  2131. this.setState({ v_id5: response.v_id5 })
  2132. this.setState({ v_id7: response.v_id7 })
  2133. this.setState({ v_id8: response.v_id8 })
  2134. this.setState({ v_id9: response.v_id9 })
  2135. this.setState({ v_id10: response.v_id10 })
  2136. this.setState({ v_id6: response.v_id6 })
  2137. this.setState({ v_s1: response.v_s1 })
  2138. this.setState({ v_s2: response.v_s2 })
  2139. this.setState({ v_s3: response.v_s3 })
  2140. this.setState({ v_s4: response.v_s4 })
  2141. this.setState({ v_s5: response.v_s5 })
  2142. this.setState({ v_s6: response.v_s6 })
  2143. this.setState({ v_s7: response.v_s7 })
  2144. this.setState({ v_s8: response.v_s8 })
  2145. this.setState({ v_s9: response.v_s9 })
  2146. this.setState({ v_s10: response.v_s10 })
  2147. })
  2148. .catch((error) => {
  2149. console.error(error)
  2150. })
  2151. }
  2152. render() {
  2153. const MODAL_PAGE_USER_INFO = 'user-info';
  2154. const modal = (
  2155. <ModalRoot activeModal={this.state.activeModal}>
  2156. <ModalCard
  2157. id={MODAL_CARD_MONEY_SEND}
  2158. onClose={() => this.setActiveModal(null)}
  2159. icon={<Icon56GiftOutline />}
  2160. title="Доступен новый дизайн! "
  2161. actions={[{
  2162. title: 'Попробовать',
  2163. mode: 'primary',
  2164. action: () => {
  2165. document.body.setAttribute('scheme', 'android_theme');
  2166. connect.send('VKWebAppSetViewSettings', { 'status_bar_style': 'dark', 'action_bar_color': '#ffcc00' });
  2167. this.setActiveModal(null);
  2168. }
  2169. }]}
  2170. >
  2171.  
  2172. </ModalCard>
  2173. </ModalRoot>
  2174. );
  2175. return (
  2176.  
  2177. <View modal={modal} popout={this.state.popout} activePanel={this.state.activePanel}>
  2178.  
  2179. <Home id="home" tokenn={this.tokenn} token={this.token} openDestructive={this.openDestructive} stageTimer={this.stageTimer} story={this.story} usersTop={this.state.usersTop} getUsersTopRating={this.state.getUsersTopRating} groupsTop={this.state.groupsTop} activeTab={this.state.activeTabTop} setTab={this.setActiveTabTop} activeTab={this.state.activeTabTop} setTab={this.setActiveTabTop} usersTop={this.state.usersTop} groupsTop={this.state.groupsTop} addv={this.addv}res={this.res} share={this.share} add1={this.add1} userAcc={this.state.userAcc} dark={this.dark} light={this.light} clicks={this.state.clicks} speed={this.state.speed} aspeed={this.state.aspeed} reputation={this.state.reputation} name={this.name} fetchedUser={this.state.fetchedUser} go={this.go} />
  2180. <Persik id="persik" go={this.go} name={this.name} fetchedUser={this.state.fetchedUser} userAcc={this.state.userAcc} />
  2181. <Transfer id="Transfer" clickShare={this.clickShare} qr_data={this.state.qr_data} qrSvg={this.state.qrSvg} qrSvgUser={this.state.qrSvgUser} clickQrcode={this.clickQrcode} shares={this.shares} activeTab4={this.activeTab4} fetchedUser={this.state.fetchedUser} setTab={this.setActiveTabTrans} go={this.go} handleTransferChange={this.handleTransferChange} clicks={this.state.clicks} fetchedUser={this.state.fetchedUser} h_id1={this.state.h_id1} h_id2={this.state.h_id2} h_id3={this.state.h_id3} h_id4={this.state.h_id4} h_id5={this.state.h_id5} h_id6={this.state.h_id6} h_id7={this.state.h_id7} h_id8={this.state.h_id8} h_id9={this.state.h_id9} h_id10={this.state.h_id10} h_s1={this.state.h_s1} h_s2={this.state.h_s2} h_s3={this.state.h_s3} h_s4={this.state.h_s4} h_s5={this.state.h_s5} h_s6={this.state.h_s6} h_s7={this.state.h_s7} h_s8={this.state.h_s8} h_s9={this.state.h_s9} h_s10={this.state.h_s10} history={this.state.history} history1={this.state.history1} history2={this.state.history2} history3={this.state.history3} history4={this.state.history4} history5={this.state.history5} history6={this.state.history6} history7={this.state.history7} history8={this.state.history8} history9={this.state.history9} history10={this.state.history10} v_id1={this.state.v_id1} v_id2={this.state.v_id2} v_id3={this.state.v_id3} v_id4={this.state.v_id4} v_id5={this.state.v_id5} v_id6={this.state.v_id6} v_id7={this.state.v_id7} v_id8={this.state.v_id8} v_id9={this.state.v_id9} v_id10={this.state.v_id10} v_s1={this.state.v_s1} v_s2={this.state.v_s2} v_s3={this.state.v_s3} v_s4={this.state.v_s4} v_s5={this.state.v_s5} v_s6={this.state.v_s6} v_s7={this.state.v_s7} v_s8={this.state.v_s8} v_s9={this.state.v_s9} v_s10={this.state.v_s10} viv={this.state.viv} v1={this.state.v1} v2={this.state.v2} v3={this.state.v3} v4={this.state.v4} v5={this.state.v5} v6={this.state.v6} v7={this.state.v7} v8={this.state.v8} v9={this.state.v9} v10={this.state.v10} handleTransferSubmit={this.handleTransferSubmit} userAcc={this.state.userAcc} />
  2182. <Transferinfo id="Transferinfo" clickShare={this.clickShare} qr_data={this.state.qr_data} qrSvg={this.state.qrSvg} qrSvgUser={this.state.qrSvgUser} clickQrcode={this.clickQrcode} shares={this.shares} activeTab4={this.activeTab4} fetchedUser={this.state.fetchedUser} setTab={this.setActiveTabTrans} go={this.go} handleTransferChange={this.handleTransferChange} clicks={this.state.clicks} fetchedUser={this.state.fetchedUser} h_id1={this.state.h_id1} h_id2={this.state.h_id2} h_id3={this.state.h_id3} h_id4={this.state.h_id4} h_id5={this.state.h_id5} h_id6={this.state.h_id6} h_id7={this.state.h_id7} h_id8={this.state.h_id8} h_id9={this.state.h_id9} h_id10={this.state.h_id10} h_s1={this.state.h_s1} h_s2={this.state.h_s2} h_s3={this.state.h_s3} h_s4={this.state.h_s4} h_s5={this.state.h_s5} h_s6={this.state.h_s6} h_s7={this.state.h_s7} h_s8={this.state.h_s8} h_s9={this.state.h_s9} h_s10={this.state.h_s10} history={this.state.history} history1={this.state.history1} history2={this.state.history2} history3={this.state.history3} history4={this.state.history4} history5={this.state.history5} history6={this.state.history6} history7={this.state.history7} history8={this.state.history8} history9={this.state.history9} history10={this.state.history10} v_id1={this.state.v_id1} v_id2={this.state.v_id2} v_id3={this.state.v_id3} v_id4={this.state.v_id4} v_id5={this.state.v_id5} v_id6={this.state.v_id6} v_id7={this.state.v_id7} v_id8={this.state.v_id8} v_id9={this.state.v_id9} v_id10={this.state.v_id10} v_s1={this.state.v_s1} v_s2={this.state.v_s2} v_s3={this.state.v_s3} v_s4={this.state.v_s4} v_s5={this.state.v_s5} v_s6={this.state.v_s6} v_s7={this.state.v_s7} v_s8={this.state.v_s8} v_s9={this.state.v_s9} v_s10={this.state.v_s10} viv={this.state.viv} v1={this.state.v1} v2={this.state.v2} v3={this.state.v3} v4={this.state.v4} v5={this.state.v5} v6={this.state.v6} v7={this.state.v7} v8={this.state.v8} v9={this.state.v9} v10={this.state.v10} handleTransferSubmit={this.handleTransferSubmit} userAcc={this.state.userAcc} />
  2183. <House id="house" onChangeText={this.onChangeText} go={this.go} buy={this.buyHouse} />
  2184. <Imus id="imus" activeTabik1={this.state.activeTabik1} activeTabik2={this.state.activeTabik2} clicks={this.state.clicks} bbank={this.bbank} bank={this.state.bank} go={this.go} />
  2185. <MyHouse id="myHouse" go={this.go} userAcc={this.state.userAcc} sell={this.sellHouse} pohod={this.pohodHouse} />
  2186. <MyPet id="myPet" go={this.go} userAcc={this.state.userAcc} sell={this.sellPet} pohod={this.pohodPet} />
  2187. <Upgrade id="upgrades" userAcc={this.state.userAcc} sell={this.sellHouse} pohod={this.pohodHouse} buy={this.buyHouse} upgradesOne={this.state.upgradesOne} upgradesTwo={this.state.upgradesTwo} go={this.go} activeTab={this.state.activeTabUpgrades} setTab={this.setActiveTabUpgrades} buyUpgrade={this.buyUpgrade} />
  2188. <Pet id="pet" go={this.go} buy={this.buyPet} />
  2189. <Dop id="dop" go={this.go} />
  2190. <Bonuse id="bonuse" story={this.story} vkpost={this.vkpost} buy={this.buyBonuse} go={this.go} />
  2191. <Test id="Test" promo1={this.state.promo1} promo2={this.state.promo2} promo3={this.state.promo3} promo_s1={this.state.promo_s1} promo_s2={this.state.promo_s2} promo_s3={this.state.promo_s3} handlePromoSubmit={this.handlePromoSubmit} handlePromoChange={this.handlePromoChange} openDefaulte={this.openDefaulte} go={this.go} />
  2192. <Admin id="admin" go={this.go} />
  2193. <Referals id="referals" clickShare={this.clickShare} qr_data={this.state.qr_data} qrSvg={this.state.qrSvg} qrSvgUser={this.state.qrSvgUser} clickQrcode={this.clickQrcode} shares={this.shares} activeTab4={this.activeTab4} fetchedUser={this.state.fetchedUser} setTab={this.setActiveTabTrans} go={this.go} handleTransferChange={this.handleTransferChange} clicks={this.state.clicks} fetchedUser={this.state.fetchedUser} h_id1={this.state.h_id1} h_id2={this.state.h_id2} h_id3={this.state.h_id3} h_id4={this.state.h_id4} h_id5={this.state.h_id5} h_id6={this.state.h_id6} h_id7={this.state.h_id7} h_id8={this.state.h_id8} h_id9={this.state.h_id9} h_id10={this.state.h_id10} h_s1={this.state.h_s1} h_s2={this.state.h_s2} h_s3={this.state.h_s3} h_s4={this.state.h_s4} h_s5={this.state.h_s5} h_s6={this.state.h_s6} h_s7={this.state.h_s7} h_s8={this.state.h_s8} h_s9={this.state.h_s9} h_s10={this.state.h_s10} history={this.state.history} history1={this.state.history1} history2={this.state.history2} history3={this.state.history3} history4={this.state.history4} history5={this.state.history5} history6={this.state.history6} history7={this.state.history7} history8={this.state.history8} history9={this.state.history9} history10={this.state.history10} v_id1={this.state.v_id1} v_id2={this.state.v_id2} v_id3={this.state.v_id3} v_id4={this.state.v_id4} v_id5={this.state.v_id5} v_id6={this.state.v_id6} v_id7={this.state.v_id7} v_id8={this.state.v_id8} v_id9={this.state.v_id9} v_id10={this.state.v_id10} v_s1={this.state.v_s1} v_s2={this.state.v_s2} v_s3={this.state.v_s3} v_s4={this.state.v_s4} v_s5={this.state.v_s5} v_s6={this.state.v_s6} v_s7={this.state.v_s7} v_s8={this.state.v_s8} v_s9={this.state.v_s9} v_s10={this.state.v_s10} viv={this.state.viv} v1={this.state.v1} v2={this.state.v2} v3={this.state.v3} v4={this.state.v4} v5={this.state.v5} v6={this.state.v6} v7={this.state.v7} v8={this.state.v8} v9={this.state.v9} v10={this.state.v10} handleTransferSubmit={this.handleTransferSubmit} userAcc={this.state.userAcc} />
  2194. <Chat id="chat" chat_photo1={this.state.chat_photo1} chat_photo2={this.state.chat_photo2} chat_photo3={this.state.chat_photo3} chat_photo4={this.state.chat_photo4} chat_photo5={this.state.chat_photo5} chat_photo6={this.state.chat_photo6} chat_photo7={this.state.chat_photo7} chat_photo8={this.state.chat_photo8} chat_photo9={this.state.chat_photo9} chat_photo10={this.state.chat_photo10} chat_u1={this.state.chat_u1} chat_u2={this.state.chat_u2} chat_u3={this.state.chat_u3} chat_u4={this.state.chat_u4} chat_u5={this.state.chat_u5} chat_u6={this.state.chat_u6} chat_u7={this.state.chat_u7} chat_u8={this.state.chat_u8} chat_u9={this.state.chat_u9} chat_u10={this.state.chat_u10} chat_un1={this.state.chat_un1} chat_un2={this.state.chat_un2} chat_un3={this.state.chat_un3} chat_un4={this.state.chat_un4} chat_un5={this.state.chat_un5} chat_un6={this.state.chat_un6} chat_un7={this.state.chat_un7} chat_un8={this.state.chat_un8} chat_un9={this.state.chat_un9} chat_un10={this.state.chat_un10} chat_d1={this.state.chat_d1} chat_d2={this.state.chat_d2} chat_d3={this.state.chat_d3} chat_d4={this.state.chat_d4} chat_d5={this.state.chat_d5} chat_d6={this.state.chat_d6} chat_d7={this.state.chat_d7} chat_d8={this.state.chat_d8} chat_d9={this.state.chat_d9} chat_d10={this.state.chat_d10} chat_message1={this.state.chat_message1} chat_message2={this.state.chat_message2} chat_message3={this.state.chat_message3} chat_message4={this.state.chat_message4} chat_message5={this.state.chat_message5} chat_message6={this.state.chat_message6} chat_message7={this.state.chat_message7} chat_message8={this.state.chat_message8} chat_message9={this.state.chat_message9} chat_message10={this.state.chat_message10} stageTimer={this.stageTimer} calcChat={this.calcChat} handleChatChange={this.handleChatChange} go={this.go} />
  2195. <Cases id="cases" buy={this.buyCase} go={this.go} />
  2196. <TransferTest id="TransferTest" handleTransferChangee={this.handleTransferChangee} handleeTransferChange={this.handleeTransferChange} go={this.go} />
  2197. <Top id="top" usersTopAutomine={this.state.usersTopAutomine} usersTopReputation={this.state.usersTopReputation} onRefresh={this.onRefresh} go={this.go} usersTop={this.state.usersTop} groupsTop={this.state.groupsTop} activeTab={this.state.activeTabTop} setTab={this.setActiveTabTop} />
  2198. <Reit id="reit" clicks={this.state.clicks} reputation={this.state.reputation} go={this.go} handleReputationChange={this.handleReputationChange} handleReputationSubmit={this.handleReputationSubmit} calcRep={this.state.calcRep} />
  2199. <Sett id="sett" go={this.go} dark={this.dark} light={this.light} />
  2200. <ChangeNickname id="changeNickname" go={this.go} handleNickChange={this.handleNickChange} handleNickSubmit={this.handleNickSubmit} userAcc={this.state.userAcc} />
  2201. <Katalog id="katalog" buy={this.buyBonuse} token={this.token} setActiveModal={this.setActiveModal} fetchedUser={this.state.fetchedUser} reputation={this.state.reputation} clicks={this.state.clicks} speed={this.state.speed} aspeed={this.state.aspeed} reputation={this.state.reputation} go={this.go} />
  2202. </View>
  2203. );
  2204. }
  2205. }
  2206.  
  2207. export default App;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement