微信小程序-自定义弹出层和仿微信密码输入框

html

js:

hideFlag: function () { this.setData({ flag: false }) }

toSetPasswprd: function (e) {

    var that = this;

    this.setData({

      password: e.detail.value,

      passwordLength: e.detail.cursor

    })

    if (e.detail.cursor == 6) {//do something }

  }

css:

.password-box { margin: 0 auto; border: 1px solid #ddd; border-right: 0; width: 240px; height: 40px;} .password-sigle { width: 40px; height: 40px; text-align: center; font-size: 24px; box-sizing: border-box; float: left; padding: 0px; border-right: 1px solid #ddd;} .password-sigle i { width: 10px; height: 10px; background-color: #000; border-radius: 20px; display: block; margin: 15px auto;} .password-title { text-align: center; display: block; padding-top: 20px;} .password-text-warn { font-size: 12px; margin-bottom: 10px; display: block; text-align: center;} .cash-password-main { padding: 30px 0; position: relative;} .password-input { position: absolute; left: 50%; right: 50%; border: 1px solid #ddd; width: 240px; height: 40px; margin-left: -120px; font-size: 24px; top: 30px; opacity: 0;} .cash-pop-notice { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background-color: rgba(0, 0, 0, 0.5);} .cash-pop-main { background-color: #fff; width: 270px; height: 150px; text-align: center; position: absolute; top: 20%; left: 50%; right: 50%; margin-left: -135px;} .pop-main-icon { position: absolute; right: 10px; top: 10px;} .cash-pop-title { padding-top: 25px;}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 各种纯css图标 CSS3可以实现很多漂亮的图形,我收集了32种图形,在下面列出。直接用CSS3画出这些图形,要比...
    剑残阅读 13,301评论 0 8
  • 不会用代码框,所以看着有些乱套,,,,html部分 <!DOCTYPE html> 迅雷看看 ...
    这就是个帅气的名字阅读 5,635评论 0 0
  • 1、垂直对齐 如果你用CSS,则你会有困惑:我该怎么垂直对齐容器中的元素?现在,利用CSS3的Transform,...
    kiddings阅读 8,412评论 0 11
  • 新学期刚刚开学,熊孩子们就开始刺激老师和家长们紧张脆弱的神经了。因为交不上寒假作业,他们花招迭出,也是蛮拼的。有的...
    老呐阅读 1,693评论 0 1
  • 也许这个世上存在着很多不公平的事情,也许你会遭遇到很多不公平的待遇,但有一个东西是最公平的,它是所有不公平的起源,...
    令宜阅读 3,434评论 0 0

友情链接更多精彩内容