<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. 前端学习记录(HTML篇)

    HTML Hyper Text Markup Language,超文本标记语言,不是一种编程语言,而是一种标记语言 思想:网页中有很多数据,不同的数据可能需要不同的显示效果,一个标签相当于一个容器,想 ...

  2. git & gerrit & shell

    g公司使用Gerrit改善评审流程. 比较麻烦.gerrit提交后会触发vertifyCI, 实施代码扫描. 这一堆过程, 打印出一堆信息, 都在log中, 所以处理log就需要自己写shell了. ...

  3. Python---基础---水仙花数和三色球

    一.编写一个程序,求100~999之间的所有水仙花数 如果一个3位数等于其各位数字的立方和,则称这个数为水仙花数.例如:153 = 1^3 + 5^3 + 3^3,因此153就是一个水仙花数 for ...

  4. python学习笔记(十六)python操作redis数据库

    Redis是一个key-value存储系统,它支持丰富的数据类型,如:string.list.set.zset(sorted set).hash. Redis特点 Redis以内存作为数据存储介质,所 ...

  5. 使用随机森林实现OSM路网城市多车道信息提取

    Multilane roads extracted from the OpenStreetMap urban road network using random forests.,DOI:10.111 ...

  6. 为应用程序池 ''DefaultAppPool'' 提供服务的进程意外终止。进程 ID 是 ''xxx''问题的解决方法

    网上提供了很多办法,都未解决. 解决过程一波三折,依次用了下列方法: 1.解决办法 点击“开始”-“控制面板”-“管理工具”-“组件服务”-“计算机”-“我的电脑”-“DCOM”选项, 选择其下的“I ...

  7. Crazy Binary String

    Crazy Binary String 最长01个数相等的子串和子序列 字串用二分做的,有hack数据 :8 00111100 好像数据太水,直接放过去了 下面为二分代码 #include<bi ...

  8. Java控制台输入字符串及字符串比较

    需求描述:茵茵很喜欢研究车牌号码,从车牌号码上可以看出号码注册的早晚,据研究发现,车牌号码是按字典序发放的,现在她收集了很多车牌号码,请你设计程序帮她判断注册较早的号码.车牌号码由5个字母或数字组成. ...

  9. Ubuntu 18.04 截图工具-flameshot(安装及使用)

    安装flameshot:https://github.com/lupoDharkael/flameshot 安装命令: sudo apt-get install flameshot 设置>设备& ...

  10. 多个springboot项目部署到tomcat,Error deploying web application archive

    每个springboot单独部署到tomcat下可以正常启动,多个一个就发生异常 Error deploying web application archive 解决:配置文件加上配置区分 sprin ...