Home  >  Article  >  WeChat Applet  >  WeChat Mini Program Example: Implementation Code of Pop-up Window in WeChat Mini Program

WeChat Mini Program Example: Implementation Code of Pop-up Window in WeChat Mini Program

不言
不言Original
2018-08-13 16:39:092738browse

The content of this article is about the code implementation of gzip decompression in js. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

The WeChat applet needs to give the user some prompts when interacting with the user, such as whether to request data, etc. At this time, using pop-up windows is a better method.

Fortunately, the WeChat applet provides We provide an API wx.showToast

success: function (res) {
    app.globalData.allData = res.data.datas;
    if (res.data.status == 200) {

        wx.showToast({
             title: '数据搜索成功',
             icon: 'success',
             duration: 1500
        })  

        self.setData({
             list: res.data.datas
        })  
    }   
    else {
        wx.showToast({
             title: '未搜索到数据',
             icon: 'loading',
             duration: 1500
        })  
    }   
}

Related recommendations:

How to jump pages in the WeChat applet

WeChat More code examples to implement page pull-down refresh and pull-up loading in the mini program

How to set global variables (code) in the WeChat mini program

The above is the detailed content of WeChat Mini Program Example: Implementation Code of Pop-up Window in WeChat Mini Program. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn