mirror of
				https://github.com/tidys/cc-inspector-chrome
				synced 2025-11-04 11:05:24 +00:00 
			
		
		
		
	控制广告的地方
This commit is contained in:
		@@ -9,7 +9,7 @@ function i18n(key: string) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const manifest: CocosPluginManifest = {
 | 
					const manifest: CocosPluginManifest = {
 | 
				
			||||||
  name: pkgName,
 | 
					  name: pkgName,
 | 
				
			||||||
  version: "2.1.8",
 | 
					  version: "2.1.9",
 | 
				
			||||||
  description: "Debug games made with CocosCreator and display node trees and node properties",
 | 
					  description: "Debug games made with CocosCreator and display node trees and node properties",
 | 
				
			||||||
  store: "https://store.cocos.com/app/detail/2002",
 | 
					  store: "https://store.cocos.com/app/detail/2002",
 | 
				
			||||||
  author: "xu_yanfeng",
 | 
					  author: "xu_yanfeng",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -34,7 +34,7 @@ export default defineComponent({
 | 
				
			|||||||
        console.log(`not find any ad`);
 | 
					        console.log(`not find any ad`);
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      ads.value = data.data.filter((item) => item.valid);
 | 
					      ads.value = data.data.filter((item) => item.where === "list");
 | 
				
			||||||
      console.log("get ads ", toRaw(ads.value));
 | 
					      console.log("get ads ", toRaw(ads.value));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      sendGaEvent(GA_EventName.ShowAd);
 | 
					      sendGaEvent(GA_EventName.ShowAd);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,9 +27,13 @@ export class AdItem {
 | 
				
			|||||||
   */
 | 
					   */
 | 
				
			||||||
  duration: number = 0;
 | 
					  duration: number = 0;
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * 广告的有效性
 | 
					   * 广告展示的位置
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
  valid: boolean = true;
 | 
					  where: "popup" | "list" = "list";
 | 
				
			||||||
 | 
					  /**
 | 
				
			||||||
 | 
					   * 广告是否有效
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
 | 
					  visible: boolean = true;
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * 背景图
 | 
					   * 背景图
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
@@ -53,7 +57,8 @@ export class AdItem {
 | 
				
			|||||||
    this.tip = data.tip || "";
 | 
					    this.tip = data.tip || "";
 | 
				
			||||||
    this.type = data.type || "";
 | 
					    this.type = data.type || "";
 | 
				
			||||||
    this.duration = data.duration || 0;
 | 
					    this.duration = data.duration || 0;
 | 
				
			||||||
    this.valid = !!data.valid;
 | 
					    this.where = data.where || "popup";
 | 
				
			||||||
 | 
					    this.visible = data.visible === false ? false : true;
 | 
				
			||||||
    const img = data.img || "";
 | 
					    const img = data.img || "";
 | 
				
			||||||
    this.img = githubMirrorMgr.getFileUrl(img);
 | 
					    this.img = githubMirrorMgr.getFileUrl(img);
 | 
				
			||||||
    return this;
 | 
					    return this;
 | 
				
			||||||
@@ -110,10 +115,9 @@ export class AdData {
 | 
				
			|||||||
          return;
 | 
					          return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        const item = new AdItem().parse(el);
 | 
					        const item = new AdItem().parse(el);
 | 
				
			||||||
        if (!item.duration) {
 | 
					        if (item.visible) {
 | 
				
			||||||
          // console.warn(`add failed, ad.duration is ${item.duration}, ${JSON.stringify(item)}`);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
          this.data.push(item);
 | 
					          this.data.push(item);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user