<template>
<div>
<a @click="isShow">half-screen-dialog</a>
<!--BEGIN half-screen-dialog-->
<!-- mpvue微信小程序不支持vue中的transition -->
<div v-if="show">
<div class="weui-mask"
@click="isShow">
</div>
<div class="weui-half-screen-dialog">
<div class="weui-half-screen-dialog__hd">
<div class="weui-half-screen-dialog__hd__main">
<strong class="weui-half-screen-dialog__title_center">标题</strong>
</div>
</div>
<div class="weui-half-screen-dialog__bd">
可放自定义内容
</div>
</div>
</div>
<!--END half-screen-dialog-->
</div>
</template> <script>
import '../../../static/weui/weui.css'
export default {
data () {
return {
show: true,
animationData: {}
}
},
methods: {
isShow () {
this.show = !this.show
}
}
}
</script> <style scoped>
.weui-mask {
position: fixed;
z-index: 1000;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
} /* Half Screen Dialog Styles*/
.weui-half-screen-dialog {
position: fixed;
left: 0;
right: 0;
bottom: 0;
height: 35%;
max-height: 75%;
z-index: 5000;
line-height: 1.4;
background-color: #ffffff;
border-top-left-radius: 12px;
border-top-right-radius: 12px;
overflow: hidden;
padding: 0 calc(24px + constant(safe-area-inset-right))
constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left));
padding: 0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom)
calc(24px + env(safe-area-inset-left));
}
.weui-half-screen-dialog__hd {
font-size: 8px;
height: 8em;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
}
.weui-half-screen-dialog__hd .weui-icon-btn {
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
.weui-half-screen-dialog__hd__side {
position: relative;
}
.weui-half-screen-dialog__hd__main {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
}
.weui-half-screen-dialog__hd__side + .weui-half-screen-dialog__hd__main {
text-align: center;
padding: 0 40px;
}
.weui-half-screen-dialog__hd__main
+ .weui-half-screen-dialog__hd__side
.weui-icon-btn {
right: 0;
}
.weui-half-screen-dialog__title {
display: block;
color: rgba(0, 0, 0, 0.9);
font-weight: 700;
font-size: 15px;
}
.weui-half-screen-dialog__title_center {
display: block;
color: rgba(0, 0, 0, 0.9);
font-weight: 700;
font-size: 15px;
text-align: center;
}
.weui-half-screen-dialog__subtitle {
display: block;
color: rgba(0, 0, 0, 0.5);
font-size: 10px;
}
.weui-half-screen-dialog__bd {
word-wrap: break-word;
-webkit-hyphens: auto;
hyphens: auto;
overflow-y: auto;
}
.weui-half-screen-dialog__desc {
padding-top: 4px;
font-size: 17px;
color: rgba(0, 0, 0, 0.9);
line-height: 1.4;
}
.weui-half-screen-dialog__tips {
padding-top: 16px;
font-size: 14px;
color: rgba(0, 0, 0, 0.3);
line-height: 1.4;
}
.weui-half-screen-dialog__ft {
padding: 40px 24px 32px;
text-align: center;
}
.weui-half-screen-dialog__ft .weui-btn {
display: inline-block;
vertical-align: top;
margin: 0 8px;
width: 120px;
}
</style>

效果如下:

mpvue 微信小程序半屏弹框(half-screen-dialog)的更多相关文章

  1. 微信小程序之底部弹框预约插件

    代码地址如下:http://www.demodashi.com/demo/13982.html 一.前期准备工作: 软件环境:微信开发者工具 官方下载地址:https://mp.weixin.qq.c ...

  2. 微信小程序 --- action-sheet底部弹框

    action-sheet:从屏幕底部弹出一个菜单,选择: 使用的时候,在给不同的 action-sheet-item 添加不同的事件. 效果: (这里的确定可以有多个) 代码: <button ...

  3. 微信小程序 - 骨架屏

    骨架屏 - “与其等待网络加载,不如提前给点暗示” 注:不适用复杂交互效果 演示 示例解释以及使用全在index.wxml中,观看需了解组件使用. 示例下载:微信小程序-骨架屏演示

  4. mpvue微信小程序http请求终极解决方案-fly.js

    fly.js是什么? 一个支持所有JavaScript运行环境的基于Promise的.支持请求转发.强大的http请求库.可以让您在多个端上尽可能大限度的实现代码复用(官网解释) fly.js有什么特 ...

  5. 微信小程序半周问题总结

    新产品要做一个微信小程序,不想吐槽老板没给任何准备就给出了需求和原型图,好像默认小程序闭着眼睛就可以很顺利开发好.现在半周下来(五一结束开始到今天)完成了差不多所有的界面,网络请求部分还跟服务端兄弟耗 ...

  6. 【微信小程序】自定义模态框实例

    原文链接:https://mp.weixin.qq.com/s/23wPVFUGY-lsTiQBtUdhXA 1 概述 由于官方API提供的显示模态弹窗,只能简单地显示文字内容,不能对对话框内容进行自 ...

  7. mpvue微信小程序多列选择器用法:实现省份城市选择

    前言 微信小程序默认给我们提供了一个省市区的picker选择器,只需将mode设置为region即可 <picker mode="region" bindchange=&qu ...

  8. 微信小程序——加入购物车弹层

    对于网上商城,加入购物车是一个必备功能了.俺今天就来说下在微信小程序里如何造一个购物车弹层. 先上图: 主要用到的微信API:wx.createAnimation(OBJECT) 说下思路: 1.wx ...

  9. mpvue微信小程序分包

    ## 微信小程序分包(mpvue) 使用mpvue分包示例:1.下载vue脚手架(先有node环境,v8.12.0) npm install -g vue-cli 2.先用vue初始化一个mpvue小 ...

随机推荐

  1. CSS3 nth-of-type(n)选择器 last-of-type选择器 nth-last-of-type(n)选择器 CSS3 only-child选择器 only-of-type选择器

    CSS3 nth-of-type(n)选择器 “:nth-of-type(n)”选择器和“:nth-child(n)”选择器非常类似,不同的是它只计算父元素中指定的某种类型的子元素.当某个元素中的子元 ...

  2. CSS--使用CSS Grid(网格)布局

    .一 CSS Grid(网格布局)简介 CSS Grid 布局由两个核心组成部分是父元素和子元素,父元素 是实际的 grid(网格),子元素是 grid(网格) 内的内容.下面是一个父元素和六个子元素 ...

  3. Ubuntu Server下MySql数据库备份脚本代码

    明: 我这里要把MySql数据库存放目录/var/lib/mysql下面的pw85数据库备份到/home/mysql_data里面,并且保存为mysqldata_bak_2012_04_11.tar. ...

  4. man VGCREATE

    VGCREATE(8)                                                        VGCREATE(8) NAME/名称       vgcreat ...

  5. CGfsb

    这里补充一下%n是代表向参数赋值打印的字符个数 例如printf("AAAA%n",&a); 代表的是向a写入4 printf("AAAA%1n", & ...

  6. 日志管理工具logrotate

    工作所需,需要管理脚本的打印日志,百度一圈,发现了logrotate这款工具,经测试确实挺好的! 话不多说,直接上重点,以便于以后需要时查看 命令: whereis logrotate 可以看到log ...

  7. spring boot整合WebSocket示例

    1.运行环境 开发工具:intellij idea JDK版本:1.8 项目管理工具:Maven 4.0.0 2.GITHUB地址 https://github.com/nbfujx/springBo ...

  8. Windows定时任务+bat文件+WinRar处理Mysql数据库的定时自动备份

    服务器环境 Windows Server 2003 ,服务器上采用的是IIS+mysql的集成工具phpStudy.MySQL的安装目录D:\phpStudy4IIS , WinRAR 安装目录 C: ...

  9. 如何修改运行中的docker容器的端口映射

    在docker run创建并运行容器的时候,可以通过-p指定端口映射规则.但是,我们经常会遇到刚开始忘记设置端口映射或者设置错了需要修改.当docker start运行容器后并没有提供一个-p选项或设 ...

  10. Vue通信、传值的多种方式,详解(都是干货)

    Vue通信.传值的多种方式,详解(都是干货) 可参考博客: https://blog.csdn.net/qq_35430000/article/details/79291287