mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-10-22 20:55:25 +00:00
优化popup,增加更多的游戏开发工具
This commit is contained in:
@@ -34,7 +34,7 @@ export default defineComponent({
|
||||
console.log(`not find any ad`);
|
||||
return;
|
||||
}
|
||||
ads.value = data.data;
|
||||
ads.value = data.data.filter((item) => item.valid);
|
||||
console.log("get ads ", toRaw(ads.value));
|
||||
|
||||
ga(GA_EventName.ShowAd);
|
||||
|
||||
@@ -12,7 +12,7 @@ export class AdItem {
|
||||
/**
|
||||
* 插件的试用地址
|
||||
*/
|
||||
try: string = "";
|
||||
try: string | Array<{ name: string; url: string }> = "";
|
||||
/**
|
||||
* 广告的store购买链接
|
||||
*/
|
||||
@@ -29,6 +29,14 @@ export class AdItem {
|
||||
* 背景图
|
||||
*/
|
||||
img: string = "";
|
||||
getTryInfos(): Array<{ name: string; url: string }> {
|
||||
if (typeof this.try === "string" && this.try) {
|
||||
return [{ name: this.name, url: this.try }];
|
||||
} else if (Array.isArray(this.try)) {
|
||||
return this.try;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
parse(data: AdItem) {
|
||||
this.name = data.name;
|
||||
this.store = data.store || "";
|
||||
@@ -95,10 +103,6 @@ export class AdData {
|
||||
console.warn(`add failed, ad.duration is ${item.duration}, ${JSON.stringify(item)}`);
|
||||
return;
|
||||
}
|
||||
if (!item.valid) {
|
||||
console.warn(`add failed, ad is invalid, ${JSON.stringify(item)}`);
|
||||
return;
|
||||
}
|
||||
this.data.push(item);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user