瀏覽代碼

feat: 添加埋点时间戳&隐藏关闭按钮配置

huangzhichao 1 年之前
父節點
當前提交
2fe4c053fc
共有 4 個文件被更改,包括 9 次插入4 次删除
  1. 1 1
      src/pages/index/index.tsx
  2. 5 3
      src/plugin/components/custom/index.tsx
  3. 2 0
      src/plugin/share/index.ts
  4. 1 0
      types/global.d.ts

+ 1 - 1
src/pages/index/index.tsx

@@ -16,7 +16,7 @@ const Index: React.FC = () => {
   return (
     <View className='index'>
       <calendar />
-      {/* <custom props={{ adpId, width: 200, onEmitOpenMiniProgram }} /> */}
+      {/* <custom props={{ adpId, width: 200, onEmitOpenMiniProgram, closeIcon: false }} /> */}
     </View>
   )
 }

+ 5 - 3
src/plugin/components/custom/index.tsx

@@ -19,6 +19,7 @@ function YLQCustom(props: PropsWithChildren<CustomPropsType>) {
   let {
     adpId,
     width,
+    closeIcon,
     onEmitOpenMiniProgram,
     onError,
     onLoad,
@@ -196,7 +197,8 @@ function YLQCustom(props: PropsWithChildren<CustomPropsType>) {
       bidCreativeParam: JSON.stringify(bidCreativeParam || {}), // {}
       adpId,
       pqtId,
-      ownAdSystemType
+      ownAdSystemType,
+      clientTimestamp: new Date().getTime()
     }
   }
 
@@ -219,8 +221,8 @@ function YLQCustom(props: PropsWithChildren<CustomPropsType>) {
             广告
           </View>
           {/* 关闭icon */}
-          <View className='close-icon' onClick={closeCustom}>
-          </View>
+          {closeIcon && <View className='close-icon' onClick={closeCustom}>
+          </View>}
           <Custom
             width={width}
             adData={adData}

+ 2 - 0
src/plugin/share/index.ts

@@ -7,6 +7,7 @@ export function wrapProps(props: PropsWithChildren<CustomPropsType>) {
   let {
     adpId,
     width,
+    closeIcon = true,
     onEmitOpenMiniProgram = noop,
     onError = noop,
     onLoad = noop,
@@ -23,6 +24,7 @@ export function wrapProps(props: PropsWithChildren<CustomPropsType>) {
   return {
     adpId,
     width,
+    closeIcon,
     onEmitOpenMiniProgram,
     onError,
     onLoad,

+ 1 - 0
types/global.d.ts

@@ -36,6 +36,7 @@ declare namespace Taro {
 type CustomPropsType = {
   adpId: number
   width?: number
+  closeIcon?: boolean
   onEmitOpenMiniProgram(appId: string, path: string, extraData: { pqtId?: string }): void
   onError?(code: number): void
   onLoad?(): void