Return value to our scenario, we can make a different treatment according to different scenarios based on micro-channel small program, we divide more convenient to use scene
Currently supported scene values are:
1001 : Discovery Bar applet main entrance, "most recently used" lists (basic library 2. 2 from version .4 contain "my little program" list) 1005 : the top of the search results page the search box 1006 : Main program found a small bar inlet search box search results page 1007 : single applet chat session message card 1008 : group chat applet session message card 1011 : scanning two-dimensional code 1012 : press picture identification dimensional code 1013 : select Mobile album two-dimensional code 1014 : applet template message 1017 : Go to the trial version of the portal page 1019 : micro-channel wallet 1020 : public number profile page related applets list 1022 : top of the chat top applet entrance 1023 : Andrews desktop icon 1024 : applet profile page 1025 : one-dimensional code scanning 1026 : near a small program list 1027 : "used applet" search box at the top list of the search results page 1028: My card package 1029 card coupon details page: 1030 to open a small program in automated test: 1031 : Press picture identification one-dimensional code 1032 : phone album Select one-dimensional code 1034 : micro-channel payment completion page 1035 : Public Number custom menu 1036 : App Share message card 1037 : a small applet program opens 1038 : returns from another small program 1039 : shake TV 1042 : Add friend search box of the search results page 1043 : No public message templates 1044 : small news program card with shareTicket of 1045 : circle of friends ad 1046 : circle of friends ad details page 1047 : scan applet code 1048 : press picture identification applet code 1049 : Mobile albums selected applet code 1052 : suitable for store card bills list 1053 : search a search results page 1054: The top of the search box small program shortcut entrance 1056 : the music player menu 1057 : wallet card details page 1058 : Public Number Article 1059 : trial version applets binding invitation page 1064 : micro-channel connecting the Wi- Fi status bar 1067 : Public No article Advertising 1068 : near a small list of programs Advertising 1069 : mobile applications 1071 : Bank card list page wallet in 1072 : two-dimensional code collection page 1073 : the list of messages sent by the customer applet message card 1074 : number issued public session applet message card 1077 : shake surrounding 1078 : even Wi- success page Fi 1079 micro letter game Center: 1081 : send the customer a message under the text links 1082 : issued public number of the session text links 1084 : circle of friends Advertising native page 1089 : micro-channel pull-down main chat interface, "most recently used" column (basic library 2. 2Since .4 version will include "my little program" column) 1090 : Press applet upper right corner of the menu brings up the recent use history 1091 : Public Goods Card No. Articles 1092 : City Service Entrance 1095 : applet advertising component 1096 : chats 1097 : micro-channel pay subscription page 1099 : embedded plug-in page 1102 : public service number profile page preview
In the above scenario may be acquired values and the App onLaunch onShow, the lower part of the scene can also obtain the value appId source application, or applets public number
We can get to the scene value in onLaunch, onShow function.
onLaunch, onShow parameters
Field | Types of | Explanation |
---|---|---|
path | String | Open the path applet |
query | Object | Open query applet |
scene | Number | Open the scene value applet |
shareTicket | String | |
referrerInfo | Object | When the scene is opened by the applet, or from another public number or App, return this field |
referrerInfo.appId | String | Sources applet or the public or the App number of appId |
referrerInfo.extraData | Object | Sources applet pass over the data, scene = support during 1037 or 1038 |
Here a simple scenario do Description: Free applet micro-channel micro-channel secret signing
The App ({ onShow (RES) { IF (res.scene === 1038 ) { // scene values 1038: Return from applet is opened const {for appId, extraData} = res.referrerInfo IF (for appId == ' wxbd687630cd02ce1d ' ) { // for appId as wxbd687630cd02ce1d: jump back from the contract applet IF ( typeof extraData == ' undefined ' ) { // the TODO // client signed applet uncertain result, a subscription request determination result back to the merchant side return ; } IF (extraData.return_code == 'SUCCESS ' ) { // the TODO // client applet subscription is successful, and the results of subscription request confirmation to the merchant back side var contract_id = extraData.contract_id return ; } the else { // the TODO // subscription failure return ; } } } } } )