Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Velpro187
uni-app
提交
819ae541
U
uni-app
项目概览
Velpro187
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
819ae541
编写于
4月 26, 2022
作者:
d-u-a
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ad: 支持微信
上级
aee063dc
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
35 addition
and
13 deletion
+35
-13
packages/uni-cli-shared/components/ad-fullscreen-video.vue
packages/uni-cli-shared/components/ad-fullscreen-video.vue
+1
-1
packages/uni-cli-shared/components/ad-interstitial.vue
packages/uni-cli-shared/components/ad-interstitial.vue
+1
-1
packages/uni-cli-shared/components/ad-rewarded-video.vue
packages/uni-cli-shared/components/ad-rewarded-video.vue
+1
-1
packages/uni-cli-shared/components/ad.mixin.mp.js
packages/uni-cli-shared/components/ad.mixin.mp.js
+8
-1
packages/uni-cli-shared/lib/pages.js
packages/uni-cli-shared/lib/pages.js
+1
-1
packages/uni-template-compiler/lib/index.js
packages/uni-template-compiler/lib/index.js
+4
-2
packages/uni-template-compiler/lib/module.js
packages/uni-template-compiler/lib/module.js
+0
-3
packages/uni-template-compiler/lib/module.uniad.js
packages/uni-template-compiler/lib/module.uniad.js
+16
-0
packages/webpack-uni-pages-loader/lib/platforms/mp-weixin/app.json.uniad.js
...ni-pages-loader/lib/platforms/mp-weixin/app.json.uniad.js
+3
-3
未找到文件。
packages/uni-cli-shared/components/ad-fullscreen-video.vue
浏览文件 @
819ae541
...
...
@@ -2,7 +2,7 @@
<view
@
click=
"_onclick"
>
<slot
:options=
"options"
:loading=
"loading"
:error=
"errorMessage"
/>
<!-- #ifdef MP-WEIXIN -->
<uni
-ad-plugin
class=
"uni-ad-plugin"
:adpid=
"adpid"
:unit-id=
"unitId"
@
load=
"_onmpload"
@
close=
"_onmpclose"
@
error=
"_onmperror"
></uni-
ad-plugin>
<uni
ad-plugin
class=
"uni-ad-plugin"
:adpid=
"adpid"
:unit-id=
"unitId"
@
load=
"_onmpload"
@
close=
"_onmpclose"
@
error=
"_onmperror"
></uni
ad-plugin>
<!-- #endif -->
</view>
</
template
>
...
...
packages/uni-cli-shared/components/ad-interstitial.vue
浏览文件 @
819ae541
...
...
@@ -2,7 +2,7 @@
<view
@
click=
"_onclick"
>
<slot
:options=
"options"
:loading=
"loading"
:error=
"errorMessage"
/>
<!-- #ifdef MP-WEIXIN -->
<uni
-ad-plugin
class=
"uni-ad-plugin"
:adpid=
"adpid"
:unit-id=
"unitId"
@
load=
"_onmpload"
@
close=
"_onmpclose"
@
error=
"_onmperror"
></uni-
ad-plugin>
<uni
ad-plugin
class=
"uni-ad-plugin"
:adpid=
"adpid"
:unit-id=
"unitId"
@
load=
"_onmpload"
@
close=
"_onmpclose"
@
error=
"_onmperror"
></uni
ad-plugin>
<!-- #endif -->
</view>
</
template
>
...
...
packages/uni-cli-shared/components/ad-rewarded-video.vue
浏览文件 @
819ae541
...
...
@@ -2,7 +2,7 @@
<view
@
click=
"_onclick"
>
<slot
:options=
"options"
:loading=
"loading"
:error=
"errorMessage"
/>
<!-- #ifdef MP-WEIXIN -->
<uni
-ad-plugin
class=
"uni-ad-plugin"
:adpid=
"adpid"
:unit-id=
"unitId"
@
load=
"_onmpload"
@
close=
"_onmpclose"
@
error=
"_onmperror"
></uni-
ad-plugin>
<uni
ad-plugin
class=
"uni-ad-plugin"
:adpid=
"adpid"
:unit-id=
"unitId"
@
load=
"_onmpload"
@
close=
"_onmpclose"
@
error=
"_onmperror"
></uni
ad-plugin>
<!-- #endif -->
</view>
</
template
>
...
...
packages/uni-cli-shared/components/ad.mixin.mp.js
浏览文件 @
819ae541
...
...
@@ -45,7 +45,14 @@ export default {
},
methods
:
{
load
()
{
this
.
errorMessage
=
null
if
(
this
.
loading
)
{
return
}
this
.
_startLoading
()
setTimeout
(()
=>
{
this
.
loading
=
false
},
3000
)
},
show
()
{
...
...
packages/uni-cli-shared/lib/pages.js
浏览文件 @
819ae541
...
...
@@ -519,7 +519,7 @@ function parseUsingAutoImportComponents (usingAutoImportComponents) {
const
BUILT_IN_COMPONENTS
=
[
'
page-meta
'
,
'
navigation-bar
'
,
'
uni-match-media
'
]
const
BUILT_IN_EASYCOMS
=
[
'
unicloud-db
'
,
'
ad-rewarded-video
'
,
'
ad-fullscreen-video
'
,
'
ad-interstitial
'
,
'
ad-interactive
'
]
const
BUILT_IN_EASYCOMS
=
[
'
unicloud-db
'
,
'
uniad
'
,
'
ad-rewarded-video
'
,
'
ad-fullscreen-video
'
,
'
ad-interstitial
'
,
'
ad-interactive
'
]
function
isBuiltInComponent
(
name
)
{
// uni-template-compiler/lib/util.js 识别微信内置组件
return
BUILT_IN_COMPONENTS
.
includes
(
name
)
...
...
packages/uni-template-compiler/lib/index.js
浏览文件 @
819ae541
...
...
@@ -15,7 +15,8 @@ const generateScript = require('./script/generate')
const
traverseTemplate
=
require
(
'
./template/traverse
'
)
const
generateTemplate
=
require
(
'
./template/generate
'
)
const
compilerModule
=
require
(
'
./module
'
)
const
compilerModule
=
require
(
'
./module
'
)
// const compilerModuleUniad = require('./module.uniad')
const
compilerAlipayModule
=
require
(
'
./module-alipay
'
)
const
compilerToutiaoModule
=
require
(
'
./module-toutiao
'
)
...
...
@@ -90,7 +91,8 @@ module.exports = {
return
compileTemplate
(
source
,
options
,
compile
)
}
options
.
modules
.
push
(
compilerModule
)
options
.
modules
.
push
(
compilerModule
)
// options.modules.push(compilerModuleUniad)
if
(
options
.
mp
.
platform
===
'
mp-alipay
'
)
{
options
.
modules
.
push
(
compilerAlipayModule
)
...
...
packages/uni-template-compiler/lib/module.js
浏览文件 @
819ae541
...
...
@@ -15,9 +15,6 @@ module.exports = {
preTransformNode
(
el
,
{
warn
})
{
if
(
process
.
env
.
UNI_PLATFORM
===
'
app-plus
'
&&
el
.
tag
===
'
ad
'
)
{
warn
(
'
app-vue平台, <ad> 组件暂不支持非 V3 编译, 详见: https://ask.dcloud.net.cn/article/36599
'
)
}
if
(
el
.
tag
===
'
slot
'
&&
!
el
.
attrsMap
.
name
)
{
el
.
attrsList
.
push
({
name
:
'
SLOT_DEFAULT
'
,
...
...
packages/uni-template-compiler/lib/module.uniad.js
0 → 100644
浏览文件 @
819ae541
const
AD_COMPONENTS
=
[
'
uniad
'
,
'
ad-rewarded-video
'
,
'
ad-fullscreen-video
'
,
'
ad-interstitial
'
]
module
.
exports
=
{
preTransformNode
(
el
,
{
warn
})
{
if
(
process
.
env
.
UNI_PLATFORM
===
'
mp-weixin
'
)
{
if
(
el
.
tag
===
'
ad
'
&&
el
.
attrsMap
.
adpid
)
{
el
.
tag
=
'
uniad
'
}
if
(
AD_COMPONENTS
.
indexOf
(
el
.
tag
)
>
-
1
)
{
process
.
env
.
USE_UNI_AD
=
true
}
}
}
}
packages/webpack-uni-pages-loader/lib/platforms/mp-weixin/app.json.uniad.js
浏览文件 @
819ae541
...
...
@@ -4,7 +4,7 @@ module.exports = function (appJson) {
}
if
(
!
appJson
.
plugins
[
'
uni-ad
'
])
{
appJson
.
plugins
[
'
uni-ad
'
]
=
{
version
:
'
1.0.
2
'
,
version
:
'
1.0.
3
'
,
provider
:
'
wx999bf02c8e05dfc9
'
}
}
...
...
@@ -18,7 +18,7 @@ module.exports = function (appJson) {
if
(
!
appJson
.
usingComponents
)
{
appJson
.
usingComponents
=
{}
}
if
(
!
appJson
.
usingComponents
[
'
uni
-
ad-plugin
'
])
{
appJson
.
usingComponents
[
'
uni
-
ad-plugin
'
]
=
'
plugin://uni-ad/ad
'
if
(
!
appJson
.
usingComponents
[
'
uniad-plugin
'
])
{
appJson
.
usingComponents
[
'
uniad-plugin
'
]
=
'
plugin://uni-ad/ad
'
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录