Mini Program - Share a small program code generated by the page

I have encountered this requirement twice. One is to jump to other pages after recognizing the QR code, and the other is to enter the current page where the applet code is generated after recognizing the QR code.

On the 21st, a small program for sending red envelopes was launched. When I met a hacker, I was so dumbfounded! ! ! ! Sadness flows like river! ! ! ! ! !

The server is down and the page can't load. The server traffic is up to 100Mb.

Well, let's not talk about it, it's all hurt! ! ! ! !

I have a dream to be a hacker! ! ! ! ! !

I have a dream to be a hacker! ! ! ! ! !

I have a dream to be a hacker! ! ! ! ! !

I have a dream to be a hacker! ! ! ! ! !

I have a dream to be a hacker! ! ! ! ! !

I have a dream to be a hacker! ! ! ! ! !

I have a dream to be a hacker! ! ! ! ! !

I have a dream to be a hacker! ! ! ! ! !

 

 

 

 

js in applet

wx.request({
       url: '',
       method: 'POST',
       data: {
       ModuleName: "", // Each interface in the space name interface document will be marked as required
       MethodName: "GetQrCode", //Each interface in the method name interface document will be marked as required
       Guid: "", //The value obtained by the token is required (except for the get token interface)
       Token: "", //The token value generated by using the token md5 encryption is required (except for the get token interface)
           Data: {
                cid: X, //The parameters obtained need to be placed on the applet code
                page: "pages/index/index" After identifying the applet code, specify the link address of the page to jump to
            }
        },
       header: {
                'content-type': 'application/json'
       },
      success: function (ewm) {
       //canvas draw and generate pictures
      }
});
 
 
 
The page entered after identifying the applet code receives the parameters on the applet code
onLoad:function(options){       
 // options 中的 scene 需要使用 decodeURIComponent 才能获取到生成二维码时传入的 scene
    var scene = decodeURIComponent(options.scene)
//因为上面我小程序码上传的参数cid=X,所以我接收到的参数scene=X
}
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324801183&siteId=291194637