Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_38335589
uni-app
提交
5bbb21db
U
uni-app
项目概览
weixin_38335589
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5bbb21db
编写于
10月 30, 2018
作者:
hbcui1984
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增 插屏弹窗 模板(感谢网友hcoder-深海)
上级
2d9424a3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
73 addition
and
0 deletion
+73
-0
examples/hello-uniapp/pages/template/sbanner/sbanner.vue
examples/hello-uniapp/pages/template/sbanner/sbanner.vue
+73
-0
未找到文件。
examples/hello-uniapp/pages/template/sbanner/sbanner.vue
0 → 100755
浏览文件 @
5bbb21db
<
template
>
<view>
<page-head
:title=
"title"
></page-head>
<view
style=
"padding:200upx 15%;"
>
<button
type=
"primary"
@
tap=
"showBanner"
>
打开弹窗
</button>
</view>
<!-- 弹出层 -->
<view
class=
"grace-banner"
style=
"background:#FFFFFF;"
v-if=
"bannerShow"
>
<view
style=
"justify-content:flex-end;"
@
tap=
"closeBanner"
>
<view
style=
"justify-content:flex-end; text-align:right; padding:20upx;"
>
<text
class=
"uni-icon uni-icon-close"
></text>
</view>
</view>
<view>
<image
src=
"https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/shuijiao.jpg"
style=
"width:100%;"
mode=
"widthFix"
></image>
</view>
<view
style=
"padding:50upx 0; padding-bottom:68upx;"
>
<button
type=
'warn'
class=
"mini-btn"
style=
"background:#F6644D; margin:0 80upx;"
>
一个按钮
</button>
</view>
</view>
<view
class=
"grace-mask"
v-if=
"bannerShow"
></view>
<!-- 弹出层 -->
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
title
:
'
插屏弹窗
'
,
bannerShow
:
true
}
},
onBackPress
()
{
if
(
this
.
bannerShow
)
{
this
.
bannerShow
=
false
;
return
true
;
}
},
methods
:
{
closeBanner
:
function
()
{
this
.
bannerShow
=
false
;
},
showBanner
:
function
()
{
this
.
bannerShow
=
true
;
},
}
}
</
script
>
<
style
>
/* 遮罩层 */
.grace-mask
{
background
:
rgba
(
0
,
0
,
0
,
0.6
);
position
:
fixed
;
width
:
100%
;
height
:
100%
;
left
:
0
;
top
:
0
;
z-index
:
1
;
}
/* 弹出层形式的广告 */
.grace-banner
{
width
:
70%
;
position
:
fixed
;
left
:
50%
;
top
:
50%
;
background
:
#FFF
;
border-radius
:
10
upx
;
z-index
:
99
;
transform
:
translate
(
-50%
,
-50%
);
}
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录