@bi-nova/ui-taro 1.1.0-beta.202605161224

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,132 @@
1
+ /**
2
+ * @Description Taro Banner 广告样式
3
+ * @Author wutao
4
+ * @Date 2026-04-14
5
+ * @LastEditors wutao
6
+ * @LastEditTime 2026-04-14
7
+ */
8
+ .bi-banner-ad {
9
+ position: relative;
10
+ display: flex;
11
+ width: 100%;
12
+ min-height: 180rpx;
13
+ border-radius: 24rpx;
14
+ overflow: hidden;
15
+ background: #ffffff;
16
+ box-shadow: 0 12rpx 36rpx rgba(15, 23, 42, 0.12);
17
+ }
18
+
19
+ .bi-banner-ad__surface {
20
+ display: flex;
21
+ flex: 1;
22
+ min-width: 0;
23
+ }
24
+
25
+ .bi-banner-ad__media {
26
+ position: relative;
27
+ flex: 0 0 240rpx;
28
+ height: 180rpx;
29
+ overflow: hidden;
30
+ }
31
+
32
+ .bi-banner-ad__image {
33
+ width: 100%;
34
+ height: 100%;
35
+ display: block;
36
+ }
37
+
38
+ .bi-banner-ad__badge {
39
+ display: inline-flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ min-width: 72rpx;
43
+ height: 38rpx;
44
+ padding: 0 12rpx;
45
+ border-radius: 19rpx;
46
+ background: rgba(0, 0, 0, 0.52);
47
+ color: #ffffff;
48
+ font-size: 20rpx;
49
+ line-height: 38rpx;
50
+ }
51
+
52
+ .bi-banner-ad__badge--overlay {
53
+ position: absolute;
54
+ top: 16rpx;
55
+ left: 16rpx;
56
+ z-index: 2;
57
+ }
58
+
59
+ .bi-banner-ad__content {
60
+ display: flex;
61
+ flex: 1;
62
+ min-width: 0;
63
+ flex-direction: column;
64
+ justify-content: space-between;
65
+ padding: 24rpx 28rpx;
66
+ box-sizing: border-box;
67
+ }
68
+
69
+ .bi-banner-ad__body,
70
+ .bi-banner-ad__footer {
71
+ min-width: 0;
72
+ }
73
+
74
+ .bi-banner-ad__title {
75
+ display: block;
76
+ color: #1f2937;
77
+ font-size: 30rpx;
78
+ font-weight: 600;
79
+ line-height: 1.5;
80
+ }
81
+
82
+ .bi-banner-ad__description {
83
+ display: block;
84
+ margin-bottom: 16rpx;
85
+ color: #6b7280;
86
+ font-size: 24rpx;
87
+ line-height: 1.6;
88
+ }
89
+
90
+ .bi-banner-ad__button {
91
+ display: inline-flex;
92
+ align-items: center;
93
+ justify-content: center;
94
+ width: auto;
95
+ min-width: 160rpx;
96
+ height: 64rpx;
97
+ margin: 0;
98
+ padding: 0 24rpx;
99
+ border: none;
100
+ border-radius: 999rpx;
101
+ background: linear-gradient(135deg, #1677ff, #38bdf8);
102
+ color: #ffffff;
103
+ font-size: 24rpx;
104
+ line-height: 64rpx;
105
+ }
106
+
107
+ .bi-banner-ad__button::after {
108
+ display: none;
109
+ }
110
+
111
+ .bi-banner-ad__close {
112
+ position: absolute;
113
+ top: 12rpx;
114
+ right: 12rpx;
115
+ z-index: 3;
116
+ width: 44rpx;
117
+ height: 44rpx;
118
+ min-height: 0;
119
+ padding: 0;
120
+ border: none;
121
+ border-radius: 50%;
122
+ background: rgba(15, 23, 42, 0.45);
123
+ color: #ffffff;
124
+ font-size: 28rpx;
125
+ line-height: 44rpx;
126
+ text-align: center;
127
+ }
128
+
129
+ .bi-banner-ad__close::after {
130
+ display: none;
131
+ }
132
+
@@ -0,0 +1,226 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * @Description Taro 广告组件公共类型定义
5
+ * @Author wutao
6
+ * @Date 2026-04-14
7
+ * @LastEditors wutao
8
+ * @LastEditTime 2026-04-14
9
+ */
10
+ /**
11
+ * 广告提供方类型
12
+ */
13
+ type BiAdProvider = 'wechat' | 'custom';
14
+ /**
15
+ * 广告展示类型
16
+ */
17
+ type BiAdType = 'banner' | 'splash';
18
+ /**
19
+ * 广告事件基础数据
20
+ */
21
+ interface BiBaseAdEventDetail {
22
+ provider: BiAdProvider;
23
+ type: BiAdType;
24
+ [key: string]: unknown;
25
+ }
26
+ /**
27
+ * 广告自定义数据基础结构
28
+ */
29
+ interface BiBaseCustomAd {
30
+ title?: string;
31
+ description?: string;
32
+ buttonText?: string;
33
+ badgeText?: string;
34
+ }
35
+ /**
36
+ * 展示广告支持的统一自定义广告结构
37
+ */
38
+ interface BiDisplayCustomAd$1 extends BiBaseCustomAd {
39
+ image?: string;
40
+ video?: string;
41
+ poster?: string;
42
+ loadTimeout?: number;
43
+ timeout?: number;
44
+ adLabel?: string;
45
+ jumpSeconds?: number;
46
+ muted?: boolean;
47
+ adSpec?: number;
48
+ spec?: number;
49
+ videoWidth?: number;
50
+ videoHeight?: number;
51
+ width?: number;
52
+ height?: number;
53
+ appId?: string;
54
+ miniProgramAppId?: string;
55
+ jumpAppId?: string;
56
+ path?: string;
57
+ pagePath?: string;
58
+ jumpPath?: string;
59
+ targetUrl?: string;
60
+ url?: string;
61
+ webUrl?: string;
62
+ h5Url?: string;
63
+ }
64
+
65
+ /**
66
+ * @Description Taro Banner 广告组件
67
+ * @Author wutao
68
+ * @Date 2026-04-14
69
+ * @LastEditors wutao
70
+ * @LastEditTime 2026-04-14
71
+ */
72
+
73
+ /**
74
+ * 自定义 Banner 广告数据
75
+ */
76
+ interface BiBannerCustomAd extends BiDisplayCustomAd$1 {
77
+ image?: string;
78
+ }
79
+ /**
80
+ * Banner 广告事件数据
81
+ */
82
+ interface BiBannerAdEventDetail extends BiBaseAdEventDetail {
83
+ provider: 'wechat' | 'custom';
84
+ type: 'banner';
85
+ url?: string;
86
+ errCode?: string | number;
87
+ errMsg?: string;
88
+ }
89
+ /**
90
+ * Banner 广告组件属性
91
+ */
92
+ interface BiBannerAdProps {
93
+ unitId?: string;
94
+ customAd?: BiBannerCustomAd | null;
95
+ adIntervals?: number;
96
+ className?: string;
97
+ onLoad?: (detail: BiBannerAdEventDetail | Record<string, unknown>) => void;
98
+ onError?: (detail: BiBannerAdEventDetail | Record<string, unknown>) => void;
99
+ onClose?: (detail: BiBannerAdEventDetail | Record<string, unknown>) => void;
100
+ onAction?: (detail: BiBannerAdEventDetail) => void;
101
+ onOpenWebview?: (detail: BiBannerAdEventDetail) => void;
102
+ }
103
+ /**
104
+ * Taro Banner 广告组件
105
+ * 优先展示微信原生广告,缺省时退化为自定义广告。
106
+ */
107
+ declare const BiBannerAd: React.FC<BiBannerAdProps>;
108
+
109
+ /**
110
+ * @Description Taro 开屏广告组件
111
+ * @Author wutao
112
+ * @Date 2026-04-14
113
+ * @LastEditors wutao
114
+ * @LastEditTime 2026-04-14
115
+ */
116
+
117
+ /**
118
+ * 自定义开屏广告数据
119
+ */
120
+ interface BiSplashCustomAd extends BiDisplayCustomAd$1 {
121
+ }
122
+ /**
123
+ * 开屏广告事件数据
124
+ */
125
+ interface BiSplashAdEventDetail extends BiBaseAdEventDetail {
126
+ provider: 'wechat' | 'custom';
127
+ type: 'splash';
128
+ nativeSplash?: boolean;
129
+ url?: string;
130
+ errCode?: string | number;
131
+ errMsg?: string;
132
+ reason?: string;
133
+ error?: unknown;
134
+ rawErrCode?: string | number;
135
+ rawErrMsg?: string;
136
+ }
137
+ /**
138
+ * 开屏广告组件属性
139
+ */
140
+ interface BiSplashAdProps {
141
+ unitId?: string;
142
+ customAd?: BiSplashCustomAd | null;
143
+ show?: boolean;
144
+ zIndex?: number;
145
+ pictureInPicture?: boolean;
146
+ jumpSeconds?: number;
147
+ className?: string;
148
+ onLoad?: (detail: BiSplashAdEventDetail | Record<string, unknown>) => void;
149
+ onError?: (detail: BiSplashAdEventDetail | Record<string, unknown>) => void;
150
+ onClose?: (detail: BiSplashAdEventDetail | Record<string, unknown>) => void;
151
+ onAction?: (detail: BiSplashAdEventDetail) => void;
152
+ onHide?: (detail: BiSplashAdEventDetail) => void;
153
+ onOpenWebview?: (detail: BiSplashAdEventDetail) => void;
154
+ }
155
+ /**
156
+ * Taro 开屏广告组件
157
+ */
158
+ declare const BiSplashAd: React.FC<BiSplashAdProps>;
159
+
160
+ /**
161
+ * @Description Taro 展示广告顶层分发组件
162
+ * @Author wutao
163
+ * @Date 2026-04-14
164
+ * @LastEditors wutao
165
+ * @LastEditTime 2026-04-23
166
+ */
167
+
168
+ /**
169
+ * 支持的展示广告类型
170
+ */
171
+ type BiDisplayAdType = 'banner' | 'splash';
172
+ /**
173
+ * 展示广告配置事件数据
174
+ */
175
+ interface BiDisplayAdConfigEventDetail {
176
+ type: BiDisplayAdType;
177
+ adId?: string;
178
+ requestOptions?: Record<string, unknown>;
179
+ data?: Record<string, unknown> | null;
180
+ errCode?: string | number;
181
+ errMsg?: string;
182
+ rawResult?: unknown;
183
+ error?: unknown;
184
+ }
185
+ /**
186
+ * 展示广告统一事件数据
187
+ */
188
+ type BiDisplayAdEventDetail = BiBannerAdEventDetail | BiSplashAdEventDetail | Record<string, unknown>;
189
+ /**
190
+ * 展示广告统一自定义广告数据
191
+ */
192
+ interface BiDisplayCustomAd extends BiDisplayCustomAd$1 {
193
+ }
194
+ /**
195
+ * 展示广告组件属性
196
+ */
197
+ interface BiDisplayAdProps {
198
+ adId?: string;
199
+ unitId?: string;
200
+ type?: BiDisplayAdType | string;
201
+ customAd?: BiDisplayCustomAd | null;
202
+ adOptions?: Record<string, unknown> | null;
203
+ sdkKey?: string;
204
+ autoLoad?: boolean;
205
+ adIntervals?: number;
206
+ show?: boolean;
207
+ zIndex?: number;
208
+ pictureInPicture?: boolean;
209
+ jumpSeconds?: number;
210
+ className?: string;
211
+ onLoad?: (detail: BiDisplayAdEventDetail) => void;
212
+ onError?: (detail: BiDisplayAdEventDetail) => void;
213
+ onClose?: (detail: BiDisplayAdEventDetail) => void;
214
+ onAction?: (detail: BiDisplayAdEventDetail) => void;
215
+ onHide?: (detail: BiDisplayAdEventDetail) => void;
216
+ onOpenWebview?: (detail: BiDisplayAdEventDetail) => void;
217
+ onConfigLoad?: (detail: BiDisplayAdConfigEventDetail) => void;
218
+ onConfigError?: (detail: BiDisplayAdConfigEventDetail) => void;
219
+ }
220
+ /**
221
+ * 展示广告顶层分发组件
222
+ * 根据广告类型分发到 Banner 或开屏广告实现。
223
+ */
224
+ declare const BiDisplayAd: React.FC<BiDisplayAdProps>;
225
+
226
+ export { type BiAdProvider, type BiAdType, BiBannerAd, type BiBannerAdEventDetail, type BiBannerAdProps, type BiBannerCustomAd, type BiBaseAdEventDetail, type BiBaseCustomAd, BiDisplayAd, type BiDisplayAdConfigEventDetail, type BiDisplayAdEventDetail, type BiDisplayAdProps, type BiDisplayAdType, type BiDisplayCustomAd, BiSplashAd, type BiSplashAdEventDetail, type BiSplashAdProps, type BiSplashCustomAd };
@@ -0,0 +1,226 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * @Description Taro 广告组件公共类型定义
5
+ * @Author wutao
6
+ * @Date 2026-04-14
7
+ * @LastEditors wutao
8
+ * @LastEditTime 2026-04-14
9
+ */
10
+ /**
11
+ * 广告提供方类型
12
+ */
13
+ type BiAdProvider = 'wechat' | 'custom';
14
+ /**
15
+ * 广告展示类型
16
+ */
17
+ type BiAdType = 'banner' | 'splash';
18
+ /**
19
+ * 广告事件基础数据
20
+ */
21
+ interface BiBaseAdEventDetail {
22
+ provider: BiAdProvider;
23
+ type: BiAdType;
24
+ [key: string]: unknown;
25
+ }
26
+ /**
27
+ * 广告自定义数据基础结构
28
+ */
29
+ interface BiBaseCustomAd {
30
+ title?: string;
31
+ description?: string;
32
+ buttonText?: string;
33
+ badgeText?: string;
34
+ }
35
+ /**
36
+ * 展示广告支持的统一自定义广告结构
37
+ */
38
+ interface BiDisplayCustomAd$1 extends BiBaseCustomAd {
39
+ image?: string;
40
+ video?: string;
41
+ poster?: string;
42
+ loadTimeout?: number;
43
+ timeout?: number;
44
+ adLabel?: string;
45
+ jumpSeconds?: number;
46
+ muted?: boolean;
47
+ adSpec?: number;
48
+ spec?: number;
49
+ videoWidth?: number;
50
+ videoHeight?: number;
51
+ width?: number;
52
+ height?: number;
53
+ appId?: string;
54
+ miniProgramAppId?: string;
55
+ jumpAppId?: string;
56
+ path?: string;
57
+ pagePath?: string;
58
+ jumpPath?: string;
59
+ targetUrl?: string;
60
+ url?: string;
61
+ webUrl?: string;
62
+ h5Url?: string;
63
+ }
64
+
65
+ /**
66
+ * @Description Taro Banner 广告组件
67
+ * @Author wutao
68
+ * @Date 2026-04-14
69
+ * @LastEditors wutao
70
+ * @LastEditTime 2026-04-14
71
+ */
72
+
73
+ /**
74
+ * 自定义 Banner 广告数据
75
+ */
76
+ interface BiBannerCustomAd extends BiDisplayCustomAd$1 {
77
+ image?: string;
78
+ }
79
+ /**
80
+ * Banner 广告事件数据
81
+ */
82
+ interface BiBannerAdEventDetail extends BiBaseAdEventDetail {
83
+ provider: 'wechat' | 'custom';
84
+ type: 'banner';
85
+ url?: string;
86
+ errCode?: string | number;
87
+ errMsg?: string;
88
+ }
89
+ /**
90
+ * Banner 广告组件属性
91
+ */
92
+ interface BiBannerAdProps {
93
+ unitId?: string;
94
+ customAd?: BiBannerCustomAd | null;
95
+ adIntervals?: number;
96
+ className?: string;
97
+ onLoad?: (detail: BiBannerAdEventDetail | Record<string, unknown>) => void;
98
+ onError?: (detail: BiBannerAdEventDetail | Record<string, unknown>) => void;
99
+ onClose?: (detail: BiBannerAdEventDetail | Record<string, unknown>) => void;
100
+ onAction?: (detail: BiBannerAdEventDetail) => void;
101
+ onOpenWebview?: (detail: BiBannerAdEventDetail) => void;
102
+ }
103
+ /**
104
+ * Taro Banner 广告组件
105
+ * 优先展示微信原生广告,缺省时退化为自定义广告。
106
+ */
107
+ declare const BiBannerAd: React.FC<BiBannerAdProps>;
108
+
109
+ /**
110
+ * @Description Taro 开屏广告组件
111
+ * @Author wutao
112
+ * @Date 2026-04-14
113
+ * @LastEditors wutao
114
+ * @LastEditTime 2026-04-14
115
+ */
116
+
117
+ /**
118
+ * 自定义开屏广告数据
119
+ */
120
+ interface BiSplashCustomAd extends BiDisplayCustomAd$1 {
121
+ }
122
+ /**
123
+ * 开屏广告事件数据
124
+ */
125
+ interface BiSplashAdEventDetail extends BiBaseAdEventDetail {
126
+ provider: 'wechat' | 'custom';
127
+ type: 'splash';
128
+ nativeSplash?: boolean;
129
+ url?: string;
130
+ errCode?: string | number;
131
+ errMsg?: string;
132
+ reason?: string;
133
+ error?: unknown;
134
+ rawErrCode?: string | number;
135
+ rawErrMsg?: string;
136
+ }
137
+ /**
138
+ * 开屏广告组件属性
139
+ */
140
+ interface BiSplashAdProps {
141
+ unitId?: string;
142
+ customAd?: BiSplashCustomAd | null;
143
+ show?: boolean;
144
+ zIndex?: number;
145
+ pictureInPicture?: boolean;
146
+ jumpSeconds?: number;
147
+ className?: string;
148
+ onLoad?: (detail: BiSplashAdEventDetail | Record<string, unknown>) => void;
149
+ onError?: (detail: BiSplashAdEventDetail | Record<string, unknown>) => void;
150
+ onClose?: (detail: BiSplashAdEventDetail | Record<string, unknown>) => void;
151
+ onAction?: (detail: BiSplashAdEventDetail) => void;
152
+ onHide?: (detail: BiSplashAdEventDetail) => void;
153
+ onOpenWebview?: (detail: BiSplashAdEventDetail) => void;
154
+ }
155
+ /**
156
+ * Taro 开屏广告组件
157
+ */
158
+ declare const BiSplashAd: React.FC<BiSplashAdProps>;
159
+
160
+ /**
161
+ * @Description Taro 展示广告顶层分发组件
162
+ * @Author wutao
163
+ * @Date 2026-04-14
164
+ * @LastEditors wutao
165
+ * @LastEditTime 2026-04-23
166
+ */
167
+
168
+ /**
169
+ * 支持的展示广告类型
170
+ */
171
+ type BiDisplayAdType = 'banner' | 'splash';
172
+ /**
173
+ * 展示广告配置事件数据
174
+ */
175
+ interface BiDisplayAdConfigEventDetail {
176
+ type: BiDisplayAdType;
177
+ adId?: string;
178
+ requestOptions?: Record<string, unknown>;
179
+ data?: Record<string, unknown> | null;
180
+ errCode?: string | number;
181
+ errMsg?: string;
182
+ rawResult?: unknown;
183
+ error?: unknown;
184
+ }
185
+ /**
186
+ * 展示广告统一事件数据
187
+ */
188
+ type BiDisplayAdEventDetail = BiBannerAdEventDetail | BiSplashAdEventDetail | Record<string, unknown>;
189
+ /**
190
+ * 展示广告统一自定义广告数据
191
+ */
192
+ interface BiDisplayCustomAd extends BiDisplayCustomAd$1 {
193
+ }
194
+ /**
195
+ * 展示广告组件属性
196
+ */
197
+ interface BiDisplayAdProps {
198
+ adId?: string;
199
+ unitId?: string;
200
+ type?: BiDisplayAdType | string;
201
+ customAd?: BiDisplayCustomAd | null;
202
+ adOptions?: Record<string, unknown> | null;
203
+ sdkKey?: string;
204
+ autoLoad?: boolean;
205
+ adIntervals?: number;
206
+ show?: boolean;
207
+ zIndex?: number;
208
+ pictureInPicture?: boolean;
209
+ jumpSeconds?: number;
210
+ className?: string;
211
+ onLoad?: (detail: BiDisplayAdEventDetail) => void;
212
+ onError?: (detail: BiDisplayAdEventDetail) => void;
213
+ onClose?: (detail: BiDisplayAdEventDetail) => void;
214
+ onAction?: (detail: BiDisplayAdEventDetail) => void;
215
+ onHide?: (detail: BiDisplayAdEventDetail) => void;
216
+ onOpenWebview?: (detail: BiDisplayAdEventDetail) => void;
217
+ onConfigLoad?: (detail: BiDisplayAdConfigEventDetail) => void;
218
+ onConfigError?: (detail: BiDisplayAdConfigEventDetail) => void;
219
+ }
220
+ /**
221
+ * 展示广告顶层分发组件
222
+ * 根据广告类型分发到 Banner 或开屏广告实现。
223
+ */
224
+ declare const BiDisplayAd: React.FC<BiDisplayAdProps>;
225
+
226
+ export { type BiAdProvider, type BiAdType, BiBannerAd, type BiBannerAdEventDetail, type BiBannerAdProps, type BiBannerCustomAd, type BiBaseAdEventDetail, type BiBaseCustomAd, BiDisplayAd, type BiDisplayAdConfigEventDetail, type BiDisplayAdEventDetail, type BiDisplayAdProps, type BiDisplayAdType, type BiDisplayCustomAd, BiSplashAd, type BiSplashAdEventDetail, type BiSplashAdProps, type BiSplashCustomAd };
@@ -0,0 +1 @@
1
+ "use strict";var Ze=Object.create;var he=Object.defineProperty,et=Object.defineProperties,tt=Object.getOwnPropertyDescriptor,nt=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertyNames,Me=Object.getOwnPropertySymbols,it=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable;var Re=(e,t,r)=>t in e?he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,B=(e,t)=>{for(var r in t||(t={}))ke.call(t,r)&&Re(e,r,t[r]);if(Me)for(var r of Me(t))st.call(t,r)&&Re(e,r,t[r]);return e},Z=(e,t)=>et(e,nt(t));var at=(e,t)=>{for(var r in t)he(e,r,{get:t[r],enumerable:!0})},Le=(e,t,r,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of rt(t))!ke.call(e,u)&&u!==r&&he(e,u,{get:()=>t[u],enumerable:!(f=tt(t,u))||f.enumerable});return e};var ot=(e,t,r)=>(r=e!=null?Ze(it(e)):{},Le(t||!e||!e.__esModule?he(r,"default",{value:e,enumerable:!0}):r,e)),lt=e=>Le(he({},"__esModule",{value:!0}),e);var ft={};at(ft,{BiBannerAd:()=>ve,BiDisplayAd:()=>Ge,BiSplashAd:()=>_e});module.exports=lt(ft);var Nt=require("./banner/index.scss"),Mt=require("./splash/index.scss");var Y=require("react"),b=require("@tarojs/components");var pe=ot(require("@tarojs/taro"));function Ce(){return typeof wx!="undefined"?wx:null}function re(e,t){let r=e==null?void 0:e.detail;return r&&typeof r=="object"?B(B({},t),r):e&&typeof e=="object"?B(B({},t),e):B({},t)}function Ue(e){return e&&(e.image||e.video)||""}function Oe(e,t=""){return e&&(e.poster||e.image||t)||""}function We(e,t=""){return e?e.video?!1:e.image?!0:/\.(jpg|jpeg|png|gif|bmp|webp|svg|ico)$/i.test(String(t).trim()):!0}function Ve(e){if(!e)return 2;let t=Number(e.adSpec||e.spec||0);if(t===1||t===2)return t;let r=Number(e.videoWidth||e.width||0),f=Number(e.videoHeight||e.height||0);return r>0&&f>0?r>f?1:2:e.video?1:2}function Se(e){return e&&(e.badgeText||e.adLabel)||"\u5E7F\u544A"}function Fe(e,t=5){let r=e==null?void 0:e.jumpSeconds,f=r!=null?r:t;return Math.min(99,Math.max(0,Number(f)||0))}function Be(e){var r;let t=(r=e==null?void 0:e.loadTimeout)!=null?r:e==null?void 0:e.timeout;return Math.max(1e3,Number(t)||5e3)}function ut(e){return e?e.appId||e.miniProgramAppId||e.jumpAppId?"miniProgram":e.path||e.pagePath||e.jumpPath||e.targetUrl?"internal":e.url||e.webUrl||e.h5Url?"web":"none":"none"}function ct(e){return e&&(e.appId||e.miniProgramAppId||e.jumpAppId)||""}function pt(e){return e&&(e.path||e.pagePath||e.jumpPath||e.targetUrl)||""}function dt(e){return e&&(e.url||e.webUrl||e.h5Url)||""}function be(e){let{customAd:t,actionDetail:r,onOpenWebview:f,onError:u,miniProgramErrorCode:A,navigateErrorCode:v,miniProgramUnsupportedErrorCode:$}=e;if(!t)return;let M=ut(t),_=ct(t),j=pt(t),H=dt(t);if(M==="miniProgram"&&_){let E=Ce();if(!E||typeof E.navigateToMiniProgram!="function"){u==null||u(Z(B({},r),{errCode:$||A,errMsg:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u8DF3\u8F6C\u5230\u5176\u4ED6\u5C0F\u7A0B\u5E8F"}));return}E.navigateToMiniProgram({appId:_,path:j||"",fail:q=>{u==null||u(Z(B({},r),{errCode:A,errMsg:(q==null?void 0:q.errMsg)||"\u8DF3\u8F6C\u5230\u5176\u4ED6\u5C0F\u7A0B\u5E8F\u5931\u8D25"}))}});return}if(M==="internal"&&j){pe.navigateTo({url:j,fail:E=>{u==null||u(Z(B({},r),{errCode:v,errMsg:(E==null?void 0:E.errMsg)||"\u9875\u9762\u8DF3\u8F6C\u5931\u8D25"}))}});return}M==="web"&&H&&(f==null||f(Z(B({},r),{url:H})))}function $e(){let e=Ce(),t=e&&typeof e.getMenuButtonBoundingClientRect=="function"?e.getMenuButtonBoundingClientRect():{},r=e&&typeof e.getWindowInfo=="function"?e.getWindowInfo():typeof pe.getSystemInfoSync=="function"?pe.getSystemInfoSync():{},f=r.windowHeight===r.screenHeight,u=16,A=16,v=16,$=32,M=f&&t.top?t.top:u,_=f&&t.height?t.height:$;return{top:`${M}px`,height:`${_}px`,lineHeight:`${_}px`,borderRadius:`${Math.round(_/2)}px`,left:f?`${v}px`:void 0,right:f?void 0:`${A}px`}}function je(){var u;let e=typeof pe.getSystemInfoSync=="function"?pe.getSystemInfoSync():{},t=Math.max(0,Number(e.screenHeight||0)-Number(((u=e.safeArea)==null?void 0:u.bottom)||e.windowHeight||0)),r=t>0?t+42:84,f=t>0?t+88:130;return{contentStyle:{bottom:`${r}rpx`},badgeStyle:{bottom:`${f}rpx`}}}var L=require("react/jsx-runtime"),mt=b.AdCustom,ve=({unitId:e="",customAd:t,adIntervals:r=30,className:f,onLoad:u,onError:A,onClose:v,onAction:$,onOpenWebview:M})=>{let _=(0,Y.useRef)(null),j=(0,Y.useRef)(!1),H=(0,Y.useRef)(!1),[E,q]=(0,Y.useState)(!1),c=t||null,U=(0,Y.useMemo)(()=>`bi-banner-ad${f?` ${f}`:""}`,[f]),R=o=>({provider:o,type:"banner"}),y=(0,Y.useCallback)(()=>{_.current&&(clearTimeout(_.current),_.current=null)},[]),w=(0,Y.useCallback)((o,S)=>{H.current||(H.current=!0,y(),q(!0),A==null||A(B(B({},re(o,R("custom"))),S)))},[y,A]);(0,Y.useEffect)(()=>{if(y(),j.current=!1,H.current=!1,q(!1),!(e||!(c!=null&&c.image)))return _.current=setTimeout(()=>{w(void 0,{errCode:"BI_BANNER_CUSTOM_MEDIA_LOAD_TIMEOUT",errMsg:"Banner \u5E7F\u544A\u7D20\u6750\u52A0\u8F7D\u8D85\u65F6"})},Be(c)),()=>{y()}},[y,c,w,e]);let ue=o=>{u==null||u(re(o,R("wechat")))},x=o=>{A==null||A(re(o,R("wechat")))},oe=o=>{v==null||v(re(o,R("wechat")))},k=()=>{j.current||H.current||(y(),j.current=!0,u==null||u(R("custom")))},J=o=>{w(o,{errCode:"BI_BANNER_CUSTOM_MEDIA_LOAD_FAIL",errMsg:"Banner \u5E7F\u544A\u7D20\u6750\u52A0\u8F7D\u5931\u8D25"})},m=o=>{var I;(I=o==null?void 0:o.stopPropagation)==null||I.call(o);let S=R("custom");$==null||$(S),be({customAd:c,actionDetail:S,onOpenWebview:W=>{M==null||M(W)},onError:W=>{A==null||A(W)},miniProgramErrorCode:"BI_BANNER_NAVIGATE_MINI_PROGRAM_FAIL",navigateErrorCode:"BI_BANNER_NAVIGATE_FAIL"})},O=o=>{var S;(S=o==null?void 0:o.stopPropagation)==null||S.call(o),v==null||v(R("custom"))};return e?(0,L.jsx)(mt,{className:U,unitId:e,adIntervals:r,onLoad:ue,onError:x,onClose:oe}):!c||!c.image||E?null:(0,L.jsxs)(b.View,{className:U,children:[(0,L.jsxs)(b.View,{className:"bi-banner-ad__surface",onClick:m,children:[(0,L.jsxs)(b.View,{className:"bi-banner-ad__media",children:[(0,L.jsx)(b.Text,{className:"bi-banner-ad__badge bi-banner-ad__badge--overlay",children:Se(c)}),(0,L.jsx)(b.Image,{className:"bi-banner-ad__image",src:c.image||"",mode:"aspectFill",onLoad:k,onError:J})]}),(0,L.jsxs)(b.View,{className:"bi-banner-ad__content",children:[(0,L.jsx)(b.View,{className:"bi-banner-ad__body",children:c.title?(0,L.jsx)(b.Text,{className:"bi-banner-ad__title",children:c.title}):null}),(0,L.jsxs)(b.View,{className:"bi-banner-ad__footer",children:[c.description?(0,L.jsx)(b.Text,{className:"bi-banner-ad__description",children:c.description}):null,(0,L.jsx)(b.Button,{className:"bi-banner-ad__button",onClick:m,children:c.buttonText||"\u7ACB\u5373\u67E5\u770B"})]})]})]}),(0,L.jsx)(b.Button,{className:"bi-banner-ad__close",onClick:O,children:"\xD7"})]})};var s=require("react"),g=require("@tarojs/components");var h=require("react/jsx-runtime"),gt=g.AdCustom,_e=({unitId:e="",customAd:t,show:r=!0,zIndex:f=999,pictureInPicture:u=!1,jumpSeconds:A=5,className:v,onLoad:$,onError:M,onClose:_,onAction:j,onHide:H,onOpenWebview:E})=>{let[q,c]=(0,s.useState)(!1),[U,R]=(0,s.useState)(!!e),[y,w]=(0,s.useState)(!1),[ue,x]=(0,s.useState)(0),[oe,k]=(0,s.useState)(!1),[J,m]=(0,s.useState)(!1),O=(0,s.useRef)(null),o=(0,s.useRef)(null),S=(0,s.useRef)(null),I=(0,s.useRef)(null),W=(0,s.useRef)(null),le=(0,s.useRef)(0),V=(0,s.useRef)(!1),P=(0,s.useRef)($),C=(0,s.useRef)(M),G=(0,s.useRef)(_),ie=(0,s.useRef)(j),ee=(0,s.useRef)(H),K=(0,s.useRef)(E),p=t||null,se=(0,s.useMemo)(()=>Ue(p),[p]),Ae=(0,s.useMemo)(()=>Oe(p,se),[p,se]),z=!!se,we=(0,s.useMemo)(()=>We(p,se),[p,se]),Te=(0,s.useMemo)(()=>Ve(p),[p]),Ee=(0,s.useMemo)(()=>Se(p),[p]),te=(0,s.useMemo)(()=>Fe(p,A),[p,A]),xe=(0,s.useMemo)(()=>$e(),[]),{contentStyle:ye,badgeStyle:ae}=(0,s.useMemo)(()=>je(),[]),De=(0,s.useMemo)(()=>{let a=["bi-splash-ad"];return y&&a.push("bi-splash-ad--pip"),J&&a.push("bi-splash-ad--pip-animating"),v&&a.push(v),a.join(" ")},[v,J,y]);(0,s.useEffect)(()=>{P.current=$,C.current=M,G.current=_,ie.current=j,ee.current=H,K.current=E},[j,_,M,H,$,E]);let X=a=>({provider:a,type:"splash"}),ne=(0,s.useCallback)(()=>{O.current&&(clearInterval(O.current),O.current=null),o.current&&(clearTimeout(o.current),o.current=null)},[]),ce=(0,s.useCallback)(()=>{S.current&&(clearTimeout(S.current),S.current=null)},[]),N=(0,s.useCallback)(()=>{I.current&&(clearTimeout(I.current),I.current=null)},[]),me=(0,s.useCallback)(()=>{W.current&&(clearTimeout(W.current),W.current=null)},[]),n=(0,s.useCallback)(()=>{ne(),ce(),N(),me()},[ne,ce,me,N]),i=(0,s.useCallback)(a=>{var d;n(),c(!1),w(!1),x(0),k(!1),V.current=!1,m(!1),(d=G.current)==null||d.call(G,a)},[n]),l=(0,s.useCallback)(()=>{let a=U?"wechat":"custom";if(u){ne(),ce(),me(),m(!0),W.current=setTimeout(()=>{var d;W.current=null,w(!0),m(!1),(d=ee.current)==null||d.call(ee,X(a))},280);return}i({type:"splash",provider:a})},[ne,ce,me,i,U,u]),Q=(0,s.useCallback)(()=>{if(ne(),te<=0){l();return}x(te),O.current=setInterval(()=>{x(a=>a<=1?(ne(),o.current=setTimeout(()=>{o.current=null,l()},0),0):a-1)},1e3)},[ne,te,l]),ge=(0,s.useCallback)(()=>{let a=!!(e||z);n(),R(!!e),c(a),w(!1),x(te),k(!1),V.current=!1,m(!1),a&&!e&&z&&(S.current=setTimeout(()=>{var d;V.current||(n(),c(!1),w(!1),x(0),k(!1),V.current=!1,m(!1),(d=C.current)==null||d.call(C,Z(B({},X("custom")),{errCode:"BI_SPLASH_CUSTOM_MEDIA_LOAD_TIMEOUT",errMsg:"\u5F00\u5C4F\u81EA\u5B9A\u4E49\u5E7F\u544A\u7D20\u6750\u52A0\u8F7D\u8D85\u65F6"})))},Be(p)))},[n,te,z,p,e]),T=(0,s.useCallback)(()=>{if(!r)return;let a=Ce();if(!a||typeof a.getShowSplashAdStatus!="function"||le.current>=3){c(!!(e||z));return}a.getShowSplashAdStatus({success:d=>{var F;if((d==null?void 0:d.code)===-1){le.current+=1,N(),I.current=setTimeout(()=>{I.current=null,T()},300);return}if((d==null?void 0:d.code)===1){c(!1),(F=P.current)==null||F.call(P,{provider:"wechat",type:"splash",nativeSplash:!0});return}c(!!(e||z))},fail:()=>{c(!!(e||z))}})},[N,z,r,e]);(0,s.useEffect)(()=>{if(!r){n(),c(!1),R(!!e),w(!1),x(0),k(!1),V.current=!1,m(!1);return}return le.current=0,ge(),T(),()=>{n()}},[T,n,ge,r,e]);let Ye=a=>{var d;Q(),(d=P.current)==null||d.call(P,re(a,X("wechat")))},qe=a=>{var d;if(U){if(n(),z){R(!1),c(!0),w(!1),x(te),k(!1),V.current=!1,m(!1),S.current=setTimeout(()=>{var F;V.current||(n(),c(!1),w(!1),x(0),k(!1),V.current=!1,m(!1),(F=C.current)==null||F.call(C,Z(B({},X("custom")),{errCode:"BI_SPLASH_CUSTOM_MEDIA_LOAD_TIMEOUT",errMsg:"\u5F00\u5C4F\u81EA\u5B9A\u4E49\u5E7F\u544A\u7D20\u6750\u52A0\u8F7D\u8D85\u65F6"})))},Be(p));return}c(!1),w(!1),x(0),k(!1),V.current=!1,m(!1),(d=G.current)==null||d.call(G,{provider:"wechat",type:"splash",reason:"wechatAdLoadFail",error:a})}},Je=a=>{var de;let d=a&&typeof a.detail=="object"?a.detail:{},F=Z(B({},re(a,X("wechat"))),{errCode:"BI_SPLASH_WECHAT_AD_LOAD_FAIL",errMsg:String(d.errMsg||"\u5FAE\u4FE1\u5F00\u5C4F\u5E7F\u544A\u52A0\u8F7D\u5931\u8D25"),rawErrCode:d.errCode,rawErrMsg:d.errMsg});(de=C.current)==null||de.call(C,F),qe(F)},Ke=a=>{i(re(a,X("wechat")))},Pe=()=>{var a;V.current||(ce(),V.current=!0,k(!0),Q(),(a=P.current)==null||a.call(P,X("custom")))},ze=(a,d)=>{var F;n(),c(!1),w(!1),x(0),k(!1),V.current=!1,m(!1),(F=C.current)==null||F.call(C,B(B({},re(a,X("custom"))),d))},Ne=a=>{ze(a,{errCode:"BI_SPLASH_CUSTOM_MEDIA_LOAD_FAIL",errMsg:"\u5F00\u5C4F\u81EA\u5B9A\u4E49\u5E7F\u544A\u7D20\u6750\u52A0\u8F7D\u5931\u8D25"})},Xe=()=>{var F;let a=U?"wechat":"custom",d=X(a);(F=ie.current)==null||F.call(ie,d),a==="custom"&&be({customAd:p,actionDetail:d,onOpenWebview:de=>{var fe;(fe=K.current)==null||fe.call(K,de)},onError:de=>{var fe;(fe=C.current)==null||fe.call(C,de)},miniProgramErrorCode:"BI_SPLASH_NAVIGATE_MINI_PROGRAM_FAIL",navigateErrorCode:"BI_SPLASH_NAVIGATE_FAIL"})},Qe=()=>{i({type:"splash",provider:U?"wechat":"custom"})};return!q||!U&&!z?null:(0,h.jsxs)(g.View,{className:De,style:{zIndex:f},children:[U?(0,h.jsx)(g.View,{className:"bi-splash-ad__popup",children:(0,h.jsx)(g.View,{className:`bi-splash-ad__media-wrapper${y?" bi-splash-ad__media-wrapper--pip":""}`,children:(0,h.jsx)(gt,{className:"bi-splash-ad__wechat-unit",unitId:e,onLoad:Ye,onError:Je,onClose:Ke})})}):(0,h.jsx)(g.View,{className:"bi-splash-ad__popup",children:(0,h.jsxs)(g.View,{className:"bi-splash-ad__media-shell",onClick:Xe,children:[we?(0,h.jsx)(g.Image,{className:"bi-splash-ad__media bi-splash-ad__media--background",src:se,mode:"aspectFill",onLoad:Pe,onError:Ne}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g.Image,{className:"bi-splash-ad__media bi-splash-ad__media--background",src:Ae,mode:"aspectFill"}),(0,h.jsx)(g.Video,{className:`bi-splash-ad__video${Te===1?" bi-splash-ad__video--landscape":""}`,src:se,poster:Ae,autoplay:!0,muted:(p==null?void 0:p.muted)!==!1,loop:!0,objectFit:"cover",showCenterPlayBtn:!1,showPlayBtn:!1,controls:!1,onLoadedMetaData:Pe,onError:Ne})]}),y?(0,h.jsx)(g.View,{className:"bi-splash-ad__pip-mask"}):null,y?null:(0,h.jsx)(g.View,{className:"bi-splash-ad__badge",style:ae,children:Ee}),p&&(p.title||!y&&(p.description||p.buttonText))?(0,h.jsxs)(g.View,{className:"bi-splash-ad__content",style:ye,children:[p.title?(0,h.jsx)(g.Text,{className:"bi-splash-ad__title",children:p.title}):null,!y&&p.description?(0,h.jsx)(g.Text,{className:"bi-splash-ad__description",children:p.description}):null,!y&&p.buttonText?(0,h.jsx)(g.Button,{className:"bi-splash-ad__action",children:p.buttonText}):null]}):null]})}),y?(0,h.jsx)(g.View,{className:"bi-splash-ad__pip-close",onClick:Qe,children:(0,h.jsx)(g.View,{className:"bi-splash-ad__pip-close-text",children:"\u5173\u95ED"})}):null,y?null:(0,h.jsxs)(g.View,{className:"bi-splash-ad__skip",style:xe,onClick:l,children:[(0,h.jsxs)(g.Text,{children:[ue,"s"]}),(0,h.jsx)(g.View,{className:"bi-splash-ad__skip-divider"}),(0,h.jsx)(g.Text,{className:"bi-splash-ad__skip-text",children:"\u8DF3\u8FC7"})]})]})};var D=require("react");var Ie=require("react/jsx-runtime"),He=["banner","splash"],Ge=({adId:e="",unitId:t,type:r="banner",customAd:f,adOptions:u=null,sdkKey:A="biNova",autoLoad:v=!0,adIntervals:$=30,show:M=!0,zIndex:_=999,pictureInPicture:j=!1,jumpSeconds:H=5,className:E,onLoad:q,onError:c,onClose:U,onAction:R,onHide:y,onOpenWebview:w,onConfigLoad:ue,onConfigError:x})=>{let oe=(0,D.useRef)(0),k=(0,D.useRef)(""),J=(0,D.useRef)(q),m=(0,D.useRef)(c),O=(0,D.useRef)(U),o=(0,D.useRef)(R),S=(0,D.useRef)(y),I=(0,D.useRef)(w),W=(0,D.useRef)(ue),le=(0,D.useRef)(x),[V,P]=(0,D.useState)(!1),[C,G]=(0,D.useState)(!1),[ie,ee]=(0,D.useState)(null);(0,D.useEffect)(()=>{J.current=q,m.current=c,O.current=U,o.current=R,S.current=y,I.current=w,W.current=ue,le.current=x},[R,U,x,ue,c,y,q,w]);let K=(0,D.useMemo)(()=>He.includes(r)?r:"banner",[r]),p=()=>!!(v&&e),se=()=>{var Q;let n=globalThis.getApp,i=typeof n=="function"?n():null;if(!i)return null;let l=i;return l[A]||((Q=l.globalData)==null?void 0:Q[A])||null},Ae=()=>{var n;try{if(typeof wx!="undefined"&&typeof wx.getAccountInfoSync=="function"){let i=wx.getAccountInfoSync();return((n=i==null?void 0:i.miniProgram)==null?void 0:n.appId)||""}}catch(i){return""}return""},z=()=>{oe.current=0,k.current="",P(!1),G(!1),ee(null)},we=()=>{let n=u&&typeof u=="object"?u:{},i=Ae();return Z(B({},n),{adId:e,placementId:n.placementId||e,appId:n.appId||i,type:K})},Te=n=>{try{return JSON.stringify(n||{})}catch(i){return`${String(n.appId||"")}_${String(n.placementId||"")}`}},Ee=n=>{let i=(n==null?void 0:n.unitId)||"",l=(n==null?void 0:n.customAd)||(n==null?void 0:n.custom)||null,Q=typeof(n==null?void 0:n.show)=="boolean"?n.show:!!(i||l);return{unitId:i,customAd:l,show:Q}},te=n=>{var i,l;(i=le.current)==null||i.call(le,n),(l=m.current)==null||l.call(m,n)},xe=async()=>{var ge;if(!p())return;let n=we(),i=Te(n);if(k.current===i&&(V||C))return;let l=se();if(!(l!=null&&l.ads)||typeof l.ads.getDisplayAdConfig!="function"){z(),te({type:K,adId:e,errCode:"DISPLAY_AD_SDK_NOT_READY",errMsg:"\u672A\u83B7\u53D6\u5230\u53EF\u7528\u7684\u5E7F\u544A\u670D\u52A1 SDK\uFF0C\u8BF7\u5148\u6CE8\u5165\u5168\u5C40 biNova \u5B9E\u4F8B"});return}let Q=oe.current+1;oe.current=Q,k.current=i,P(!0),G(!1),ee(null);try{let T=await l.ads.getDisplayAdConfig(n);if(Q!==oe.current)return;if(!T||T.code!==0||!T.data){P(!1),G(!0),ee(null),te({type:K,adId:e,errCode:"DISPLAY_AD_REMOTE_CONFIG_FAIL",errMsg:(T==null?void 0:T.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25",rawResult:T||null});return}P(!1),G(!0),ee(T.data),(ge=W.current)==null||ge.call(W,{type:K,adId:e,requestOptions:n,data:T.data})}catch(T){if(Q!==oe.current)return;P(!1),G(!0),ee(null),te({type:K,adId:e,errCode:"DISPLAY_AD_REMOTE_CONFIG_EXCEPTION",errMsg:T instanceof Error?T.message:"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",error:T})}};(0,D.useEffect)(()=>{var n;He.includes(r)||(n=m.current)==null||n.call(m,{type:"banner",errCode:"UNSUPPORTED_DISPLAY_AD_TYPE",errMsg:`\u4E0D\u652F\u6301\u7684\u5C55\u793A\u5E7F\u544A\u7C7B\u578B\uFF1A${r}\uFF0C\u8BF7\u4F7F\u7528 "banner" \u6216 "splash"`})},[r]),(0,D.useEffect)(()=>{if(!e){z();return}xe()},[e,u,v,K,A]);let ye=p(),ae=ye?Ee(ie):null,De=ae?ae.unitId:t||"",X=ae?ae.customAd:f||null,ne=!!(M&&(!ye||!e||!C||ae!=null&&ae.show)),ce=e||(ie==null?void 0:ie.adId)||"",N=n=>B({adId:ce},n);return K==="splash"?(0,Ie.jsx)(_e,B({},{unitId:De,customAd:X,show:ne,zIndex:_,pictureInPicture:j,jumpSeconds:H,className:E,onLoad:i=>{var l;(l=J.current)==null||l.call(J,N(i))},onError:i=>{var l;(l=m.current)==null||l.call(m,N(i))},onClose:i=>{var l;(l=O.current)==null||l.call(O,N(i))},onAction:i=>{var l;(l=o.current)==null||l.call(o,N(i))},onHide:i=>{var l;(l=S.current)==null||l.call(S,N(i))},onOpenWebview:i=>{var l;(l=I.current)==null||l.call(I,N(i))}})):ne?(0,Ie.jsx)(ve,B({},{unitId:De,customAd:X,adIntervals:$,className:E,onLoad:n=>{var i;(i=J.current)==null||i.call(J,N(n))},onError:n=>{var i;(i=m.current)==null||i.call(m,N(n))},onClose:n=>{var i;(i=O.current)==null||i.call(O,N(n))},onAction:n=>{var i;(i=o.current)==null||i.call(o,N(n))},onOpenWebview:n=>{var i;(i=I.current)==null||i.call(I,N(n))}})):null};0&&(module.exports={BiBannerAd,BiDisplayAd,BiSplashAd});
@@ -0,0 +1 @@
1
+ var lt=Object.defineProperty,ut=Object.defineProperties;var ct=Object.getOwnPropertyDescriptors;var Ve=Object.getOwnPropertySymbols;var pt=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var Fe=(e,r,i)=>r in e?lt(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,m=(e,r)=>{for(var i in r||(r={}))pt.call(r,i)&&Fe(e,i,r[i]);if(Ve)for(var i of Ve(r))dt.call(r,i)&&Fe(e,i,r[i]);return e},K=(e,r)=>ut(e,ct(r));import"./banner/index.scss";import"./splash/index.scss";import{useCallback as Ke,useEffect as Bt,useMemo as At,useRef as Ne,useState as yt}from"react";import{AdCustom as Dt,View as me,Image as Ct,Button as ze,Text as Me}from"@tarojs/components";import*as pe from"@tarojs/taro";function ve(){return typeof wx!="undefined"?wx:null}function Z(e,r){let i=e==null?void 0:e.detail;return i&&typeof i=="object"?m(m({},r),i):e&&typeof e=="object"?m(m({},r),e):m({},r)}function $e(e){return e&&(e.image||e.video)||""}function je(e,r=""){return e&&(e.poster||e.image||r)||""}function He(e,r=""){return e?e.video?!1:e.image?!0:/\.(jpg|jpeg|png|gif|bmp|webp|svg|ico)$/i.test(String(r).trim()):!0}function Ge(e){if(!e)return 2;let r=Number(e.adSpec||e.spec||0);if(r===1||r===2)return r;let i=Number(e.videoWidth||e.width||0),g=Number(e.videoHeight||e.height||0);return i>0&&g>0?i>g?1:2:e.video?1:2}function _e(e){return e&&(e.badgeText||e.adLabel)||"\u5E7F\u544A"}function Ye(e,r=5){let i=e==null?void 0:e.jumpSeconds,g=i!=null?i:r;return Math.min(99,Math.max(0,Number(g)||0))}function ye(e){var i;let r=(i=e==null?void 0:e.loadTimeout)!=null?i:e==null?void 0:e.timeout;return Math.max(1e3,Number(r)||5e3)}function mt(e){return e?e.appId||e.miniProgramAppId||e.jumpAppId?"miniProgram":e.path||e.pagePath||e.jumpPath||e.targetUrl?"internal":e.url||e.webUrl||e.h5Url?"web":"none":"none"}function gt(e){return e&&(e.appId||e.miniProgramAppId||e.jumpAppId)||""}function ft(e){return e&&(e.path||e.pagePath||e.jumpPath||e.targetUrl)||""}function ht(e){return e&&(e.url||e.webUrl||e.h5Url)||""}function we(e){let{customAd:r,actionDetail:i,onOpenWebview:g,onError:p,miniProgramErrorCode:f,navigateErrorCode:y,miniProgramUnsupportedErrorCode:U}=e;if(!r)return;let x=mt(r),D=gt(r),O=ft(r),W=ht(r);if(x==="miniProgram"&&D){let b=ve();if(!b||typeof b.navigateToMiniProgram!="function"){p==null||p(K(m({},i),{errCode:U||f,errMsg:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u8DF3\u8F6C\u5230\u5176\u4ED6\u5C0F\u7A0B\u5E8F"}));return}b.navigateToMiniProgram({appId:D,path:O||"",fail:$=>{p==null||p(K(m({},i),{errCode:f,errMsg:($==null?void 0:$.errMsg)||"\u8DF3\u8F6C\u5230\u5176\u4ED6\u5C0F\u7A0B\u5E8F\u5931\u8D25"}))}});return}if(x==="internal"&&O){pe.navigateTo({url:O,fail:b=>{p==null||p(K(m({},i),{errCode:y,errMsg:(b==null?void 0:b.errMsg)||"\u9875\u9762\u8DF3\u8F6C\u5931\u8D25"}))}});return}x==="web"&&W&&(g==null||g(K(m({},i),{url:W})))}function qe(){let e=ve(),r=e&&typeof e.getMenuButtonBoundingClientRect=="function"?e.getMenuButtonBoundingClientRect():{},i=e&&typeof e.getWindowInfo=="function"?e.getWindowInfo():typeof pe.getSystemInfoSync=="function"?pe.getSystemInfoSync():{},g=i.windowHeight===i.screenHeight,p=16,f=16,y=16,U=32,x=g&&r.top?r.top:p,D=g&&r.height?r.height:U;return{top:`${x}px`,height:`${D}px`,lineHeight:`${D}px`,borderRadius:`${Math.round(D/2)}px`,left:g?`${y}px`:void 0,right:g?void 0:`${f}px`}}function Je(){var p;let e=typeof pe.getSystemInfoSync=="function"?pe.getSystemInfoSync():{},r=Math.max(0,Number(e.screenHeight||0)-Number(((p=e.safeArea)==null?void 0:p.bottom)||e.windowHeight||0)),i=r>0?r+42:84,g=r>0?r+88:130;return{contentStyle:{bottom:`${i}rpx`},badgeStyle:{bottom:`${g}rpx`}}}import{jsx as le,jsxs as De}from"react/jsx-runtime";var St=Dt,Re=({unitId:e="",customAd:r,adIntervals:i=30,className:g,onLoad:p,onError:f,onClose:y,onAction:U,onOpenWebview:x})=>{let D=Ne(null),O=Ne(!1),W=Ne(!1),[b,$]=yt(!1),l=r||null,N=At(()=>`bi-banner-ad${g?` ${g}`:""}`,[g]),I=a=>({provider:a,type:"banner"}),h=Ke(()=>{D.current&&(clearTimeout(D.current),D.current=null)},[]),C=Ke((a,A)=>{W.current||(W.current=!0,h(),$(!0),f==null||f(m(m({},Z(a,I("custom"))),A)))},[h,f]);Bt(()=>{if(h(),O.current=!1,W.current=!1,$(!1),!(e||!(l!=null&&l.image)))return D.current=setTimeout(()=>{C(void 0,{errCode:"BI_BANNER_CUSTOM_MEDIA_LOAD_TIMEOUT",errMsg:"Banner \u5E7F\u544A\u7D20\u6750\u52A0\u8F7D\u8D85\u65F6"})},ye(l)),()=>{h()}},[h,l,C,e]);let ue=a=>{p==null||p(Z(a,I("wechat")))},v=a=>{f==null||f(Z(a,I("wechat")))},ae=a=>{y==null||y(Z(a,I("wechat")))},P=()=>{O.current||W.current||(h(),O.current=!0,p==null||p(I("custom")))},j=a=>{C(a,{errCode:"BI_BANNER_CUSTOM_MEDIA_LOAD_FAIL",errMsg:"Banner \u5E7F\u544A\u7D20\u6750\u52A0\u8F7D\u5931\u8D25"})},d=a=>{var _;(_=a==null?void 0:a.stopPropagation)==null||_.call(a);let A=I("custom");U==null||U(A),we({customAd:l,actionDetail:A,onOpenWebview:R=>{x==null||x(R)},onError:R=>{f==null||f(R)},miniProgramErrorCode:"BI_BANNER_NAVIGATE_MINI_PROGRAM_FAIL",navigateErrorCode:"BI_BANNER_NAVIGATE_FAIL"})},M=a=>{var A;(A=a==null?void 0:a.stopPropagation)==null||A.call(a),y==null||y(I("custom"))};return e?le(St,{className:N,unitId:e,adIntervals:i,onLoad:ue,onError:v,onClose:ae}):!l||!l.image||b?null:De(me,{className:N,children:[De(me,{className:"bi-banner-ad__surface",onClick:d,children:[De(me,{className:"bi-banner-ad__media",children:[le(Me,{className:"bi-banner-ad__badge bi-banner-ad__badge--overlay",children:_e(l)}),le(Ct,{className:"bi-banner-ad__image",src:l.image||"",mode:"aspectFill",onLoad:P,onError:j})]}),De(me,{className:"bi-banner-ad__content",children:[le(me,{className:"bi-banner-ad__body",children:l.title?le(Me,{className:"bi-banner-ad__title",children:l.title}):null}),De(me,{className:"bi-banner-ad__footer",children:[l.description?le(Me,{className:"bi-banner-ad__description",children:l.description}):null,le(ze,{className:"bi-banner-ad__button",onClick:d,children:l.buttonText||"\u7ACB\u5373\u67E5\u770B"})]})]})]}),le(ze,{className:"bi-banner-ad__close",onClick:M,children:"\xD7"})]})};import{useCallback as ee,useEffect as Xe,useMemo as se,useRef as F,useState as ge}from"react";import{AdCustom as bt,View as q,Image as Qe,Video as vt,Button as _t,Text as Te}from"@tarojs/components";import{Fragment as Tt,jsx as E,jsxs as fe}from"react/jsx-runtime";var wt=bt,ke=({unitId:e="",customAd:r,show:i=!0,zIndex:g=999,pictureInPicture:p=!1,jumpSeconds:f=5,className:y,onLoad:U,onError:x,onClose:D,onAction:O,onHide:W,onOpenWebview:b})=>{let[$,l]=ge(!1),[N,I]=ge(!!e),[h,C]=ge(!1),[ue,v]=ge(0),[ae,P]=ge(!1),[j,d]=ge(!1),M=F(null),a=F(null),A=F(null),_=F(null),R=F(null),oe=F(0),k=F(!1),w=F(U),B=F(x),V=F(D),ne=F(O),z=F(W),H=F(b),u=r||null,re=se(()=>$e(u),[u]),Ce=se(()=>je(u,re),[u,re]),G=!!re,Ee=se(()=>He(u,re),[u,re]),xe=se(()=>Ge(u),[u]),Ie=se(()=>_e(u),[u]),X=se(()=>Ye(u,f),[u,f]),Pe=se(()=>qe(),[]),{contentStyle:Se,badgeStyle:ie}=se(()=>Je(),[]),be=se(()=>{let s=["bi-splash-ad"];return h&&s.push("bi-splash-ad--pip"),j&&s.push("bi-splash-ad--pip-animating"),y&&s.push(y),s.join(" ")},[y,j,h]);Xe(()=>{w.current=U,B.current=x,V.current=D,ne.current=O,z.current=W,H.current=b},[O,D,x,W,U,b]);let Y=s=>({provider:s,type:"splash"}),Q=ee(()=>{M.current&&(clearInterval(M.current),M.current=null),a.current&&(clearTimeout(a.current),a.current=null)},[]),ce=ee(()=>{A.current&&(clearTimeout(A.current),A.current=null)},[]),T=ee(()=>{_.current&&(clearTimeout(_.current),_.current=null)},[]),he=ee(()=>{R.current&&(clearTimeout(R.current),R.current=null)},[]),t=ee(()=>{Q(),ce(),T(),he()},[Q,ce,he,T]),n=ee(s=>{var c;t(),l(!1),C(!1),v(0),P(!1),k.current=!1,d(!1),(c=V.current)==null||c.call(V,s)},[t]),o=ee(()=>{let s=N?"wechat":"custom";if(p){Q(),ce(),he(),d(!0),R.current=setTimeout(()=>{var c;R.current=null,C(!0),d(!1),(c=z.current)==null||c.call(z,Y(s))},280);return}n({type:"splash",provider:s})},[Q,ce,he,n,N,p]),J=ee(()=>{if(Q(),X<=0){o();return}v(X),M.current=setInterval(()=>{v(s=>s<=1?(Q(),a.current=setTimeout(()=>{a.current=null,o()},0),0):s-1)},1e3)},[Q,X,o]),Be=ee(()=>{let s=!!(e||G);t(),I(!!e),l(s),C(!1),v(X),P(!1),k.current=!1,d(!1),s&&!e&&G&&(A.current=setTimeout(()=>{var c;k.current||(t(),l(!1),C(!1),v(0),P(!1),k.current=!1,d(!1),(c=B.current)==null||c.call(B,K(m({},Y("custom")),{errCode:"BI_SPLASH_CUSTOM_MEDIA_LOAD_TIMEOUT",errMsg:"\u5F00\u5C4F\u81EA\u5B9A\u4E49\u5E7F\u544A\u7D20\u6750\u52A0\u8F7D\u8D85\u65F6"})))},ye(u)))},[t,X,G,u,e]),S=ee(()=>{if(!i)return;let s=ve();if(!s||typeof s.getShowSplashAdStatus!="function"||oe.current>=3){l(!!(e||G));return}s.getShowSplashAdStatus({success:c=>{var L;if((c==null?void 0:c.code)===-1){oe.current+=1,T(),_.current=setTimeout(()=>{_.current=null,S()},300);return}if((c==null?void 0:c.code)===1){l(!1),(L=w.current)==null||L.call(w,{provider:"wechat",type:"splash",nativeSplash:!0});return}l(!!(e||G))},fail:()=>{l(!!(e||G))}})},[T,G,i,e]);Xe(()=>{if(!i){t(),l(!1),I(!!e),C(!1),v(0),P(!1),k.current=!1,d(!1);return}return oe.current=0,Be(),S(),()=>{t()}},[S,t,Be,i,e]);let tt=s=>{var c;J(),(c=w.current)==null||c.call(w,Z(s,Y("wechat")))},nt=s=>{var c;if(N){if(t(),G){I(!1),l(!0),C(!1),v(X),P(!1),k.current=!1,d(!1),A.current=setTimeout(()=>{var L;k.current||(t(),l(!1),C(!1),v(0),P(!1),k.current=!1,d(!1),(L=B.current)==null||L.call(B,K(m({},Y("custom")),{errCode:"BI_SPLASH_CUSTOM_MEDIA_LOAD_TIMEOUT",errMsg:"\u5F00\u5C4F\u81EA\u5B9A\u4E49\u5E7F\u544A\u7D20\u6750\u52A0\u8F7D\u8D85\u65F6"})))},ye(u));return}l(!1),C(!1),v(0),P(!1),k.current=!1,d(!1),(c=V.current)==null||c.call(V,{provider:"wechat",type:"splash",reason:"wechatAdLoadFail",error:s})}},rt=s=>{var de;let c=s&&typeof s.detail=="object"?s.detail:{},L=K(m({},Z(s,Y("wechat"))),{errCode:"BI_SPLASH_WECHAT_AD_LOAD_FAIL",errMsg:String(c.errMsg||"\u5FAE\u4FE1\u5F00\u5C4F\u5E7F\u544A\u52A0\u8F7D\u5931\u8D25"),rawErrCode:c.errCode,rawErrMsg:c.errMsg});(de=B.current)==null||de.call(B,L),nt(L)},it=s=>{n(Z(s,Y("wechat")))},Oe=()=>{var s;k.current||(ce(),k.current=!0,P(!0),J(),(s=w.current)==null||s.call(w,Y("custom")))},st=(s,c)=>{var L;t(),l(!1),C(!1),v(0),P(!1),k.current=!1,d(!1),(L=B.current)==null||L.call(B,m(m({},Z(s,Y("custom"))),c))},We=s=>{st(s,{errCode:"BI_SPLASH_CUSTOM_MEDIA_LOAD_FAIL",errMsg:"\u5F00\u5C4F\u81EA\u5B9A\u4E49\u5E7F\u544A\u7D20\u6750\u52A0\u8F7D\u5931\u8D25"})},at=()=>{var L;let s=N?"wechat":"custom",c=Y(s);(L=ne.current)==null||L.call(ne,c),s==="custom"&&we({customAd:u,actionDetail:c,onOpenWebview:de=>{var Ae;(Ae=H.current)==null||Ae.call(H,de)},onError:de=>{var Ae;(Ae=B.current)==null||Ae.call(B,de)},miniProgramErrorCode:"BI_SPLASH_NAVIGATE_MINI_PROGRAM_FAIL",navigateErrorCode:"BI_SPLASH_NAVIGATE_FAIL"})},ot=()=>{n({type:"splash",provider:N?"wechat":"custom"})};return!$||!N&&!G?null:fe(q,{className:be,style:{zIndex:g},children:[N?E(q,{className:"bi-splash-ad__popup",children:E(q,{className:`bi-splash-ad__media-wrapper${h?" bi-splash-ad__media-wrapper--pip":""}`,children:E(wt,{className:"bi-splash-ad__wechat-unit",unitId:e,onLoad:tt,onError:rt,onClose:it})})}):E(q,{className:"bi-splash-ad__popup",children:fe(q,{className:"bi-splash-ad__media-shell",onClick:at,children:[Ee?E(Qe,{className:"bi-splash-ad__media bi-splash-ad__media--background",src:re,mode:"aspectFill",onLoad:Oe,onError:We}):fe(Tt,{children:[E(Qe,{className:"bi-splash-ad__media bi-splash-ad__media--background",src:Ce,mode:"aspectFill"}),E(vt,{className:`bi-splash-ad__video${xe===1?" bi-splash-ad__video--landscape":""}`,src:re,poster:Ce,autoplay:!0,muted:(u==null?void 0:u.muted)!==!1,loop:!0,objectFit:"cover",showCenterPlayBtn:!1,showPlayBtn:!1,controls:!1,onLoadedMetaData:Oe,onError:We})]}),h?E(q,{className:"bi-splash-ad__pip-mask"}):null,h?null:E(q,{className:"bi-splash-ad__badge",style:ie,children:Ie}),u&&(u.title||!h&&(u.description||u.buttonText))?fe(q,{className:"bi-splash-ad__content",style:Se,children:[u.title?E(Te,{className:"bi-splash-ad__title",children:u.title}):null,!h&&u.description?E(Te,{className:"bi-splash-ad__description",children:u.description}):null,!h&&u.buttonText?E(_t,{className:"bi-splash-ad__action",children:u.buttonText}):null]}):null]})}),h?E(q,{className:"bi-splash-ad__pip-close",onClick:ot,children:E(q,{className:"bi-splash-ad__pip-close-text",children:"\u5173\u95ED"})}):null,h?null:fe(q,{className:"bi-splash-ad__skip",style:Pe,onClick:o,children:[fe(Te,{children:[ue,"s"]}),E(q,{className:"bi-splash-ad__skip-divider"}),E(Te,{className:"bi-splash-ad__skip-text",children:"\u8DF3\u8FC7"})]})]})};import{useEffect as Le,useMemo as Et,useRef as te,useState as Ue}from"react";import{jsx as et}from"react/jsx-runtime";var Ze=["banner","splash"],xt=({adId:e="",unitId:r,type:i="banner",customAd:g,adOptions:p=null,sdkKey:f="biNova",autoLoad:y=!0,adIntervals:U=30,show:x=!0,zIndex:D=999,pictureInPicture:O=!1,jumpSeconds:W=5,className:b,onLoad:$,onError:l,onClose:N,onAction:I,onHide:h,onOpenWebview:C,onConfigLoad:ue,onConfigError:v})=>{let ae=te(0),P=te(""),j=te($),d=te(l),M=te(N),a=te(I),A=te(h),_=te(C),R=te(ue),oe=te(v),[k,w]=Ue(!1),[B,V]=Ue(!1),[ne,z]=Ue(null);Le(()=>{j.current=$,d.current=l,M.current=N,a.current=I,A.current=h,_.current=C,R.current=ue,oe.current=v},[I,N,v,ue,l,h,$,C]);let H=Et(()=>Ze.includes(i)?i:"banner",[i]),u=()=>!!(y&&e),re=()=>{var J;let t=globalThis.getApp,n=typeof t=="function"?t():null;if(!n)return null;let o=n;return o[f]||((J=o.globalData)==null?void 0:J[f])||null},Ce=()=>{var t;try{if(typeof wx!="undefined"&&typeof wx.getAccountInfoSync=="function"){let n=wx.getAccountInfoSync();return((t=n==null?void 0:n.miniProgram)==null?void 0:t.appId)||""}}catch(n){return""}return""},G=()=>{ae.current=0,P.current="",w(!1),V(!1),z(null)},Ee=()=>{let t=p&&typeof p=="object"?p:{},n=Ce();return K(m({},t),{adId:e,placementId:t.placementId||e,appId:t.appId||n,type:H})},xe=t=>{try{return JSON.stringify(t||{})}catch(n){return`${String(t.appId||"")}_${String(t.placementId||"")}`}},Ie=t=>{let n=(t==null?void 0:t.unitId)||"",o=(t==null?void 0:t.customAd)||(t==null?void 0:t.custom)||null,J=typeof(t==null?void 0:t.show)=="boolean"?t.show:!!(n||o);return{unitId:n,customAd:o,show:J}},X=t=>{var n,o;(n=oe.current)==null||n.call(oe,t),(o=d.current)==null||o.call(d,t)},Pe=async()=>{var Be;if(!u())return;let t=Ee(),n=xe(t);if(P.current===n&&(k||B))return;let o=re();if(!(o!=null&&o.ads)||typeof o.ads.getDisplayAdConfig!="function"){G(),X({type:H,adId:e,errCode:"DISPLAY_AD_SDK_NOT_READY",errMsg:"\u672A\u83B7\u53D6\u5230\u53EF\u7528\u7684\u5E7F\u544A\u670D\u52A1 SDK\uFF0C\u8BF7\u5148\u6CE8\u5165\u5168\u5C40 biNova \u5B9E\u4F8B"});return}let J=ae.current+1;ae.current=J,P.current=n,w(!0),V(!1),z(null);try{let S=await o.ads.getDisplayAdConfig(t);if(J!==ae.current)return;if(!S||S.code!==0||!S.data){w(!1),V(!0),z(null),X({type:H,adId:e,errCode:"DISPLAY_AD_REMOTE_CONFIG_FAIL",errMsg:(S==null?void 0:S.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25",rawResult:S||null});return}w(!1),V(!0),z(S.data),(Be=R.current)==null||Be.call(R,{type:H,adId:e,requestOptions:t,data:S.data})}catch(S){if(J!==ae.current)return;w(!1),V(!0),z(null),X({type:H,adId:e,errCode:"DISPLAY_AD_REMOTE_CONFIG_EXCEPTION",errMsg:S instanceof Error?S.message:"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",error:S})}};Le(()=>{var t;Ze.includes(i)||(t=d.current)==null||t.call(d,{type:"banner",errCode:"UNSUPPORTED_DISPLAY_AD_TYPE",errMsg:`\u4E0D\u652F\u6301\u7684\u5C55\u793A\u5E7F\u544A\u7C7B\u578B\uFF1A${i}\uFF0C\u8BF7\u4F7F\u7528 "banner" \u6216 "splash"`})},[i]),Le(()=>{if(!e){G();return}Pe()},[e,p,y,H,f]);let Se=u(),ie=Se?Ie(ne):null,be=ie?ie.unitId:r||"",Y=ie?ie.customAd:g||null,Q=!!(x&&(!Se||!e||!B||ie!=null&&ie.show)),ce=e||(ne==null?void 0:ne.adId)||"",T=t=>m({adId:ce},t);return H==="splash"?et(ke,m({},{unitId:be,customAd:Y,show:Q,zIndex:D,pictureInPicture:O,jumpSeconds:W,className:b,onLoad:n=>{var o;(o=j.current)==null||o.call(j,T(n))},onError:n=>{var o;(o=d.current)==null||o.call(d,T(n))},onClose:n=>{var o;(o=M.current)==null||o.call(M,T(n))},onAction:n=>{var o;(o=a.current)==null||o.call(a,T(n))},onHide:n=>{var o;(o=A.current)==null||o.call(A,T(n))},onOpenWebview:n=>{var o;(o=_.current)==null||o.call(_,T(n))}})):Q?et(Re,m({},{unitId:be,customAd:Y,adIntervals:U,className:b,onLoad:t=>{var n;(n=j.current)==null||n.call(j,T(t))},onError:t=>{var n;(n=d.current)==null||n.call(d,T(t))},onClose:t=>{var n;(n=M.current)==null||n.call(M,T(t))},onAction:t=>{var n;(n=a.current)==null||n.call(a,T(t))},onOpenWebview:t=>{var n;(n=_.current)==null||n.call(_,T(t))}})):null};export{Re as BiBannerAd,xt as BiDisplayAd,ke as BiSplashAd};
@@ -0,0 +1,211 @@
1
+ /**
2
+ * @Description Taro 开屏广告样式
3
+ * @Author wutao
4
+ * @Date 2026-04-14
5
+ * @LastEditors wutao
6
+ * @LastEditTime 2026-04-14
7
+ */
8
+ .bi-splash-ad {
9
+ position: fixed;
10
+ inset: 0;
11
+ transform: scale(1);
12
+ transform-origin: right bottom;
13
+ }
14
+
15
+ .bi-splash-ad--pip {
16
+ inset: auto 24rpx 24rpx auto;
17
+ width: 320rpx;
18
+ height: 420rpx;
19
+ border-radius: 24rpx;
20
+ overflow: hidden;
21
+ box-shadow: 0 16rpx 48rpx rgba(0, 0, 0, 0.32);
22
+ }
23
+
24
+ .bi-splash-ad--pip .bi-splash-ad__popup {
25
+ width: 100%;
26
+ height: 100%;
27
+ border-radius: 24rpx;
28
+ }
29
+
30
+ .bi-splash-ad--pip-animating {
31
+ transition: all 0.28s ease-in-out;
32
+ }
33
+
34
+ .bi-splash-ad__popup {
35
+ position: relative;
36
+ width: 100vw;
37
+ height: 100vh;
38
+ z-index: 10;
39
+ background-color: #000000;
40
+ box-sizing: border-box;
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ overflow: hidden;
45
+ }
46
+
47
+ .bi-splash-ad__media-wrapper {
48
+ position: relative;
49
+ width: 100vw;
50
+ height: 100vh;
51
+ }
52
+
53
+ .bi-splash-ad__media-wrapper--pip {
54
+ width: 100%;
55
+ height: 100%;
56
+ }
57
+
58
+ .bi-splash-ad__wechat-unit {
59
+ position: relative;
60
+ display: block;
61
+ width: 100%;
62
+ height: 100%;
63
+ }
64
+
65
+ .bi-splash-ad__media-shell {
66
+ position: relative;
67
+ width: 100%;
68
+ height: 100%;
69
+ }
70
+
71
+ .bi-splash-ad__media {
72
+ width: 100%;
73
+ height: 100%;
74
+ }
75
+
76
+ .bi-splash-ad__media--background {
77
+ display: block;
78
+ }
79
+
80
+ .bi-splash-ad__video {
81
+ position: absolute;
82
+ z-index: 2;
83
+ top: 0;
84
+ left: 0;
85
+ width: 100vw;
86
+ height: 100vh;
87
+ }
88
+
89
+ .bi-splash-ad__video--landscape {
90
+ top: 50%;
91
+ left: 50%;
92
+ width: 100vw;
93
+ max-width: 100vw;
94
+ height: 500rpx;
95
+ transform: translate(-50%, -50%);
96
+ }
97
+
98
+ .bi-splash-ad__pip-mask {
99
+ position: absolute;
100
+ inset: 0;
101
+ z-index: 3;
102
+ background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.32));
103
+ }
104
+
105
+ .bi-splash-ad__content {
106
+ position: absolute;
107
+ left: 40rpx;
108
+ right: 40rpx;
109
+ z-index: 4;
110
+ padding: 28rpx;
111
+ border-radius: 24rpx;
112
+ background: linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.76));
113
+ color: #ffffff;
114
+ box-sizing: border-box;
115
+ }
116
+
117
+ .bi-splash-ad__badge {
118
+ position: absolute;
119
+ right: 32rpx;
120
+ z-index: 4;
121
+ min-width: 72rpx;
122
+ height: 38rpx;
123
+ padding: 0 12rpx;
124
+ box-sizing: border-box;
125
+ border-radius: 19rpx;
126
+ background: rgba(0, 0, 0, 0.52);
127
+ color: #ffffff;
128
+ font-size: 20rpx;
129
+ line-height: 38rpx;
130
+ text-align: center;
131
+ }
132
+
133
+ .bi-splash-ad__title {
134
+ display: block;
135
+ margin-bottom: 12rpx;
136
+ font-size: 36rpx;
137
+ font-weight: 600;
138
+ line-height: 1.4;
139
+ }
140
+
141
+ .bi-splash-ad__description {
142
+ display: block;
143
+ margin-bottom: 20rpx;
144
+ font-size: 26rpx;
145
+ line-height: 1.6;
146
+ }
147
+
148
+ .bi-splash-ad__action {
149
+ display: inline-flex;
150
+ align-items: center;
151
+ justify-content: center;
152
+ min-width: 196rpx;
153
+ height: 72rpx;
154
+ margin: 0;
155
+ padding: 0 28rpx;
156
+ border: none;
157
+ border-radius: 999rpx;
158
+ background: #ffffff;
159
+ color: #1677ff;
160
+ font-size: 28rpx;
161
+ font-weight: 600;
162
+ line-height: 72rpx;
163
+ }
164
+
165
+ .bi-splash-ad__action::after {
166
+ display: none;
167
+ }
168
+
169
+ .bi-splash-ad__skip {
170
+ position: fixed;
171
+ top: 16px;
172
+ right: 16px;
173
+ z-index: 20;
174
+ display: inline-flex;
175
+ align-items: center;
176
+ min-width: 132rpx;
177
+ padding: 0 18rpx;
178
+ background: rgba(0, 0, 0, 0.45);
179
+ color: #ffffff;
180
+ font-size: 24rpx;
181
+ box-sizing: border-box;
182
+ }
183
+
184
+ .bi-splash-ad__skip-divider {
185
+ width: 1px;
186
+ height: 24rpx;
187
+ margin: 0 12rpx;
188
+ background: rgba(255, 255, 255, 0.35);
189
+ }
190
+
191
+ .bi-splash-ad__skip-text {
192
+ opacity: 0.9;
193
+ }
194
+
195
+ .bi-splash-ad__pip-close {
196
+ position: fixed;
197
+ right: 24rpx;
198
+ bottom: 456rpx;
199
+ z-index: 21;
200
+ }
201
+
202
+ .bi-splash-ad__pip-close-text {
203
+ min-width: 88rpx;
204
+ padding: 10rpx 18rpx;
205
+ border-radius: 999rpx;
206
+ background: rgba(15, 23, 42, 0.72);
207
+ color: #ffffff;
208
+ font-size: 24rpx;
209
+ text-align: center;
210
+ }
211
+
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import { BiAdCardProps as BiAdCardProps$1 } from '@bi-nova/ui';
3
+
4
+ interface BiAdCardProps extends BiAdCardProps$1 {
5
+ className?: string;
6
+ }
7
+ declare const BiAdCard: FC<BiAdCardProps>;
8
+
9
+ export { BiAdCard, type BiAdCardProps };
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import { BiAdCardProps as BiAdCardProps$1 } from '@bi-nova/ui';
3
+
4
+ interface BiAdCardProps extends BiAdCardProps$1 {
5
+ className?: string;
6
+ }
7
+ declare const BiAdCard: FC<BiAdCardProps>;
8
+
9
+ export { BiAdCard, type BiAdCardProps };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var C=(d,a)=>{for(var o in a)s(d,o,{get:a[o],enumerable:!0})},_=(d,a,o,t)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of B(a))!n.call(d,e)&&e!==o&&s(d,e,{get:()=>a[e],enumerable:!(t=l(a,e))||t.enumerable});return d};var A=d=>_(s({},"__esModule",{value:!0}),d);var b={};C(b,{BiAdCard:()=>m});module.exports=A(b);var r=require("@tarojs/components"),x=require("./styles/ad-card.scss"),i=require("react/jsx-runtime"),m=({image:d,title:a="\u5E7F\u544A",description:o,buttonText:t="\u7ACB\u5373\u67E5\u770B",onClose:e,onAction:p,className:c})=>(0,i.jsxs)(r.View,{className:`bi-ad-card${c?` ${c}`:""}`,children:[(0,i.jsx)(r.Button,{className:"bi-ad-card__close","aria-label":"\u5173\u95ED",onClick:e,children:"\xD7"}),(0,i.jsx)(r.Image,{className:"bi-ad-card__image",src:d,mode:"aspectFill"}),(0,i.jsxs)(r.View,{className:"bi-ad-card__content",children:[(0,i.jsx)(r.Text,{className:"bi-ad-card__description",children:o}),(0,i.jsx)(r.Button,{className:"bi-ad-card__button",onClick:p,children:t})]})]});0&&(module.exports={BiAdCard});
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{View as d,Image as p,Button as i,Text as l}from"@tarojs/components";import"./styles/ad-card.scss";import{jsx as a,jsxs as e}from"react/jsx-runtime";var B=({image:o,title:n="\u5E7F\u544A",description:t,buttonText:s="\u7ACB\u5373\u67E5\u770B",onClose:c,onAction:m,className:r})=>e(d,{className:`bi-ad-card${r?` ${r}`:""}`,children:[a(i,{className:"bi-ad-card__close","aria-label":"\u5173\u95ED",onClick:c,children:"\xD7"}),a(p,{className:"bi-ad-card__image",src:o,mode:"aspectFill"}),e(d,{className:"bi-ad-card__content",children:[a(l,{className:"bi-ad-card__description",children:t}),a(i,{className:"bi-ad-card__button",onClick:m,children:s})]})]});export{B as BiAdCard};
@@ -0,0 +1,65 @@
1
+ .bi-ad-card {
2
+ position: relative;
3
+ background: var(--bi-bg, #ffffff);
4
+ border-radius: var(--bi-radius, 16rpx);
5
+ box-shadow: var(--bi-shadow, 0 4rpx 16rpx rgba(0, 0, 0, 0.15));
6
+ overflow: hidden;
7
+ max-width: 640rpx;
8
+ }
9
+
10
+ .bi-ad-card__close {
11
+ position: absolute;
12
+ top: 16rpx;
13
+ right: 16rpx;
14
+ width: 48rpx;
15
+ height: 48rpx;
16
+ padding: 0;
17
+ min-height: 0;
18
+ border: none;
19
+ background: rgba(0, 0, 0, 0.5);
20
+ color: white;
21
+ border-radius: 50%;
22
+ font-size: 36rpx;
23
+ line-height: 48rpx;
24
+ text-align: center;
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ z-index: 1;
29
+ }
30
+
31
+
32
+ .bi-ad-card__image {
33
+ width: 100%;
34
+ height: 360rpx;
35
+ object-fit: cover;
36
+ display: block;
37
+ }
38
+
39
+ .bi-ad-card__content {
40
+ padding: 32rpx;
41
+ }
42
+
43
+ .bi-ad-card__description {
44
+ display: block;
45
+ margin: 0 0 24rpx 0;
46
+ color: var(--bi-text-secondary, #666666);
47
+ font-size: 28rpx;
48
+ line-height: 1.5;
49
+ }
50
+
51
+ .bi-ad-card__button {
52
+ width: 100%;
53
+ padding: 20rpx 32rpx;
54
+ min-height: 0;
55
+ background-color: #1677ff;
56
+ color: white;
57
+ border: none;
58
+ border-radius: 16rpx;
59
+ font-size: 28rpx;
60
+ line-height: 1.5;
61
+ box-sizing: border-box;
62
+ }
63
+ .bi-ad-card__button:after {
64
+ display: none;
65
+ }
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@bi-nova/ui-taro",
3
+ "version": "1.1.0-beta.202605161224",
4
+ "description": "BI Nova SDK Taro React UI",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ },
14
+ "./ad": {
15
+ "types": "./dist/ad/index.d.ts",
16
+ "import": "./dist/ad/index.mjs",
17
+ "require": "./dist/ad/index.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "peerDependencies": {
24
+ "@tarojs/components": ">=3.6.0",
25
+ "@tarojs/taro": ">=3.6.0",
26
+ "react": ">=18.0.0"
27
+ },
28
+ "devDependencies": {
29
+ "@types/react": "^18.0.0"
30
+ },
31
+ "dependencies": {
32
+ "@bi-nova/core": "1.0.1-beta.202605161224",
33
+ "@bi-nova/ui": "1.0.0-beta.202605161224"
34
+ },
35
+ "license": "ISC",
36
+ "publishConfig": {
37
+ "registry": "https://registry.npmjs.org",
38
+ "access": "public"
39
+ },
40
+ "scripts": {
41
+ "build": "tsup"
42
+ }
43
+ }