|
@@ -1,4 +1,4 @@
|
|
|
-import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
|
|
|
|
|
|
|
+import { Component, OnInit, ViewChild, ElementRef, ChangeDetectorRef } from '@angular/core';
|
|
|
import { CommonModule } from '@angular/common';
|
|
import { CommonModule } from '@angular/common';
|
|
|
import { LoginModalComponent } from './login-modal.component';
|
|
import { LoginModalComponent } from './login-modal.component';
|
|
|
|
|
|
|
@@ -48,6 +48,8 @@ interface OrderData {
|
|
|
export class App implements OnInit {
|
|
export class App implements OnInit {
|
|
|
@ViewChild('qrCanvas', { static: false }) qrCanvasRef!: ElementRef<HTMLCanvasElement>;
|
|
@ViewChild('qrCanvas', { static: false }) qrCanvasRef!: ElementRef<HTMLCanvasElement>;
|
|
|
|
|
|
|
|
|
|
+ constructor(private cdr: ChangeDetectorRef) {}
|
|
|
|
|
+
|
|
|
// URL params
|
|
// URL params
|
|
|
authId = '';
|
|
authId = '';
|
|
|
userId = '';
|
|
userId = '';
|
|
@@ -168,10 +170,11 @@ export class App implements OnInit {
|
|
|
this.apigListLoading = true;
|
|
this.apigListLoading = true;
|
|
|
try {
|
|
try {
|
|
|
const query: any = {
|
|
const query: any = {
|
|
|
- where: JSON.stringify({ priceStep: { $exists: true } }),
|
|
|
|
|
|
|
+ where: JSON.stringify({
|
|
|
|
|
+ objectId: { $in: ['Vo3ROWEvDy'] }
|
|
|
|
|
+ }),
|
|
|
keys: 'title,content,priceStep',
|
|
keys: 'title,content,priceStep',
|
|
|
- order: '-updatedAt',
|
|
|
|
|
- limit: '20'
|
|
|
|
|
|
|
+ limit: '10'
|
|
|
};
|
|
};
|
|
|
const resp = await fetch(API_BASE + '/parse/classes/APIG?' + new URLSearchParams(query), {
|
|
const resp = await fetch(API_BASE + '/parse/classes/APIG?' + new URLSearchParams(query), {
|
|
|
headers: { 'X-Parse-Application-Id': APP_ID }
|
|
headers: { 'X-Parse-Application-Id': APP_ID }
|
|
@@ -183,6 +186,7 @@ export class App implements OnInit {
|
|
|
} else {
|
|
} else {
|
|
|
console.log('[APIG] 未查询到可用 API');
|
|
console.log('[APIG] 未查询到可用 API');
|
|
|
}
|
|
}
|
|
|
|
|
+ this.cdr.detectChanges();
|
|
|
} catch (e: any) {
|
|
} catch (e: any) {
|
|
|
console.warn('[APIG] 查询 API 列表失败:', e.message);
|
|
console.warn('[APIG] 查询 API 列表失败:', e.message);
|
|
|
} finally {
|
|
} finally {
|
|
@@ -300,6 +304,13 @@ export class App implements OnInit {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
applyTestTier(): void {
|
|
applyTestTier(): void {
|
|
|
|
|
+ if (this.apig?.priceStep) {
|
|
|
|
|
+ // 套餐价格翻倍
|
|
|
|
|
+ this.apig.priceStep = this.apig.priceStep.map(t => ({
|
|
|
|
|
+ ...t,
|
|
|
|
|
+ price: t.price * 2
|
|
|
|
|
+ }));
|
|
|
|
|
+ }
|
|
|
const params = new URLSearchParams(window.location.search);
|
|
const params = new URLSearchParams(window.location.search);
|
|
|
if (params.get('test') === '1' && this.apig?.priceStep) {
|
|
if (params.get('test') === '1' && this.apig?.priceStep) {
|
|
|
this.apig.priceStep.unshift({ count: 1, price: 0.01 });
|
|
this.apig.priceStep.unshift({ count: 1, price: 0.01 });
|