<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. nodepad++如何多行同时编辑

    notepad++ 可以选中alt按键进行选择 支持同时编辑多行

  2. CH5E26 扑克牌 (计数类DP)

    $ CH~5E26~\times ~ $ 扑克牌: (计数类DP) $ solution: $ 唉,计数类DP总是这么有套路,就是想不到. 这道题我们首先可以发现牌的花色没有价值,只需要知道每种牌有 ...

  3. tensorflow图像处理函数(1)

    1.tensorflow中对jpeg格式图像的编码/解码函数: import matplotlib.pyplot as plt import tensorflow as tf image_raw_da ...

  4. A1001

    两数相加,结果每三位添加一个逗号.一开始没有注意到%03d的问题,因为有某些数据逗号分割后高位带0,因此需要用0来补充空位. #include<iostream> #include< ...

  5. Feign调用远程服务报错:Caused by: java.lang.IllegalStateException: Method getMemberInfo not annotated with HTTP method type (ex. GET, POST)

    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ord ...

  6. MongoDB与阿里云达成战略合作,最新数据库独家上线阿里云!

    11月26日,开源数据库厂商MongoDB与阿里云在北京达成战略合作,作为合作的第一步,最新版MongoDB 4.2数据库产品正式上线阿里云平台. 目前阿里云成为全球唯一可提供最新版MongoDB服务 ...

  7. ckeditor如何能实现直接粘贴把图片上传到服务器中?

    在之前在工作中遇到在富文本编辑器中粘贴图片不能展示的问题,于是各种网上扒拉,终于找到解决方案,在这里感谢一下知乎中众大神以及TheViper. 通过知乎提供的思路找到粘贴的原理,通过TheViper找 ...

  8. 状压DP常用操作

    1. 判断一个数字x二进制下第i位是不是等于1. 方法:if ( ( ( 1 << ( i - 1 ) ) & x ) > 0) 将1左移i-1位,相当于制造了一个只有第i位 ...

  9. Android签名机制之---签名验证过程详解

    一.前言 今天是元旦,也是Single Dog的嚎叫之日,只能写博客来祛除寂寞了,今天我们继续来看一下Android中的签名机制的姊妹篇:Android中是如何验证一个Apk的签名.在前一篇文章中我们 ...

  10. Emmet基本使用教程

    转载来自:http://www.iteye.com/news/27580 Emmet的前身是大名鼎鼎的Zen coding,如果你从事Web前端开发的话,对该插件一定不会陌生.它使用仿CSS选择器的语 ...