The method of the micro-channel program chain of the micro channel small number of public

Recently received a demand, require the addition of small programs within the micro-channel micro-channel public concern number of ways and give solutions, after several days turned the official website of the document, check the surrounding information, ask a senior technician, initially given two solutions:

 

Digression:

  Easy moving bricks, construction difficult, moving bricks small partners please indicate the source of the article, respecting the original, thanks!

 

One way: micro-channel official documents applet = "open capability =" Official-the Account Component

  Description : No public concern component. When the user opens scan applet applet code, developers can be disposed within a small number of public concern program components, user numbers fast public attention, can be nested within the native components.

  Before You Start : Basic Library 2.3.0 started to support low-compatible version needs to be done deal

  Precautions :

  1. Before using components, you need to go to the applet background, in the "Settings" - set to show the public number> "public concern number" in. Note: The number to be consistent with the public and the small body of the program settings.

  2. In the life cycle of a small program, only to enter the applet from the scene, it has demonstrated the ability to guide public concern number of the components:

    • When the applet is opened the scavenging applet code (Scene value 1047, the value of the scene 1124)
    • When the state of small programs (scene value 1089) from the top of the chat scene in the open, "most recently used" inside, if not destroyed before the applet, then the assembly is held once open applet
    • When returning applet (scene value 1038) from another applet, if not destroyed before the applet, the component holding state when last opened applet
  3. To facilitate developers to debug, basic library  2.7.3 version from the development version of the applet to add the following scenario shows number of public assembly:

    • Developer Edition applet open from sweeping the two-dimensional code (scene value 1011) - applet opens trial version
  4. Assembly defining a minimum width 300px, height is constant 84px.

  5. Each page can have only one of the components.

Second way:

 

 

Service News, FIG = "Support Interface - a message is set according to business needs and documentation

 

During the detour to go and new knowledge (pit are stepped over me step by step, it is clear that the footprints)

  1. Micro letter applet does not recognize the picture of the two-dimensional code other than the applet code (do not ask why, in front of the official micro-channel micro letter to ask the technician, walking them off)

  2. Micro letter applet want to press and identify micro-channel two-dimensional code applet, it can only be wx.previewImage, the ditto

  3. Test results:

    When you preview a local picture, the picture is not loaded when out, only read from the Internet or mobile phone camera captured images selected album can only be successful show, and can only scan small program code.

 

Solemnly declare once again:

  Easy moving bricks, construction difficult, moving bricks small partners please indicate the source of the article, respecting the original, thanks!

 

Guess you like

Origin www.cnblogs.com/T172/p/11128196.html