dev #14607 Море. Правки по сайту:

change agree info;
remove add to apple wallet notification;
fix apple wallet generation;
This commit is contained in:
nikolay 2023-07-04 15:45:43 +04:00
parent 7fe4b6de52
commit 9fd031f423
6 changed files with 68 additions and 50 deletions

View File

@ -59,7 +59,9 @@ export class NavbarComponent implements OnInit {
} }
addToWallet = () => { addToWallet = () => {
this.appleWalletService.addCardToWallet(); if (this.authService.userInfo) {
this.appleWalletService.addCardToWallet(this.authService.userInfo);
}
} }
deleteToken = (): void => { deleteToken = (): void => {

View File

@ -1,3 +1,4 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { MatBottomSheet } from '@angular/material/bottom-sheet'; import { MatBottomSheet } from '@angular/material/bottom-sheet';
import { ExitComponent } from 'src/app/components/exit/exit.component'; import { ExitComponent } from 'src/app/components/exit/exit.component';
@ -34,8 +35,6 @@ export class GuestCardComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.negativeBalance = !Array.isArray(this.authService.userInfo?.walletBalances); this.negativeBalance = !Array.isArray(this.authService.userInfo?.walletBalances);
this.showBack = getTypeDevice() === DeviceType.android; this.showBack = getTypeDevice() === DeviceType.android;
this.requestPermission();
} }
requestPermission() { requestPermission() {

View File

@ -30,13 +30,13 @@
</ngx-mat-intl-tel-input> </ngx-mat-intl-tel-input>
</mat-form-field> </mat-form-field>
</div> </div>
<p class="agree-info">
Используя приложение, вы принимаете
условия и соглашаетесь на получение
рекламно-информационных сообщений
</p>
<button mat-raised-button color="primary">Принять участие</button> <button mat-raised-button color="primary">Принять участие</button>
</form> </form>
<p class="agree-info">
Используя приложение, вы принимаете условия
соглашения и соглашаетесь на получение рекламно-информационных
сообщений
</p>
</div> </div>
<ng-template #smsCode> <ng-template #smsCode>
<div class="wrapper"> <div class="wrapper">

View File

@ -17,8 +17,9 @@
.agree-info { .agree-info {
text-align: center; text-align: center;
margin: 0 auto; margin: 0 auto;
margin-top: 40px;
max-width: 80%; max-width: 80%;
font-size: 12px;
margin-bottom: 20px;
} }
.logo { .logo {
text-align: center; text-align: center;

View File

@ -5,6 +5,7 @@ import { environment } from 'src/environments/environment';
import { CookiesService } from './cookies.service'; import { CookiesService } from './cookies.service';
import { RpcService, JsonrpcService } from 'src/app/services/jsonrpc.service'; import { RpcService, JsonrpcService } from 'src/app/services/jsonrpc.service';
import { DOCUMENT } from '@angular/common'; import { DOCUMENT } from '@angular/common';
import { UserInfo } from 'src/app/interface/data';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
@ -41,9 +42,24 @@ export class AppleWalletService {
} }
async addCardToWallet() { async addCardToWallet(userInfo: UserInfo) {
const token = this.cookiesService.getItem('token'); const token = this.cookiesService.getItem('token');
try { try {
this.jsonrpc.rpc(
{
method: 'updateAdditionalInfo',
params: [
{
first_name: userInfo.name,
birth_day: '01.01.1999'
},
],
},
RpcService.authService,
true
).subscribe({
next: async () => {
const accountData = ( const accountData = (
await lastValueFrom( await lastValueFrom(
this.jsonrpc.rpc( this.jsonrpc.rpc(
@ -67,9 +83,9 @@ export class AppleWalletService {
}, },
}); });
} }
}});
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
} }
} }

View File

@ -180,7 +180,7 @@ export class AuthService {
await this.getUserInfo(); await this.getUserInfo();
if (getTypeDevice() === DeviceType.ios) { if (getTypeDevice() === DeviceType.ios) {
this.appleWalletService.addCardToWallet(); this.appleWalletService.addCardToWallet(this.userInfo!);
} }
} else if (result.code === 230) { } else if (result.code === 230) {
this.messageService.clear(); this.messageService.clear();
@ -280,7 +280,7 @@ export class AuthService {
this.router.navigate(['/']); this.router.navigate(['/']);
await this.getUserInfo(); await this.getUserInfo();
if (getTypeDevice() === DeviceType.ios) { if (getTypeDevice() === DeviceType.ios) {
this.appleWalletService.addCardToWallet(); this.appleWalletService.addCardToWallet(this.userInfo!);
} }
}, },
error: () => { error: () => {