Examples of the WeChat mini-app custom dialog box

Source: Internet
Author: User
This article mainly introduces detailed information about examples in the mini-program custom dialog box. the instance code and implementation are provided here. For more information, see Examples of the mini-program custom dialog box

:

Click 
  
  
   
  
   
Enter content
   
   
    
    
   
   
    
   
    
   
    
Cancel
     
     
     
   
    
Confirm
    
   
 


Index. js:


Var inputinfo = ""; var app = getApp () Page ({data: {animationData: "", showModalStatus: false}, onLoad: function () {}, showModal: function () {// Display mask layer var animation = wx. createAnimation ({duration: 200, timingFunction: "linear", delay: 0}) this. animation = animation. translate( 300 ). step () this. setData ({animationData: animation. export (), showModalStatus: true}) setTimeout (function () {animation. translateY (0 ). step () this. setData ({animationData: animation. export ()})}. bind (this), 200)}, clickbtn: function () {if (this. data. showModalStatus) {this. hideModal ();} else {this. showModal () ;}, hideModal: function () {// hide mask layer var animation = wx. createAnimation ({duration: 200, timingFunction: "linear", delay: 0}) this. animation = animation. translate( 300 ). step () this. setData ({animationData: animation. export (),}) setTimeout (function () {animation. translateY (0 ). step () this. setData ({animationData: animation. export (), showModalStatus: false })}. bind (this), 200)}, click_cancel: function () {console. log ("Click to cancel"); this. hideModal () ;}, click_ OK: function () {console. log ("Click OK ===, the input information is =", inputinfo); this. hideModal () ;}, input_content: function (e) {console. log (e); inputinfo = e. detail. value ;}})

Thank you for reading this article. I hope it will help you. thank you for your support for this site!

For more details about examples in the mini-program custom dialog box, please follow the PHP Chinese network!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.