@@ -26,7 +26,7 @@ var ArrayProto = Array.prototype,
2626 slice = ArrayProto . slice ,
2727 toString = ObjProto . toString ,
2828 hasOwnProperty = ObjProto . hasOwnProperty ,
29- LIB_VERSION = '1.10.2 ' ,
29+ LIB_VERSION = '1.10.3 ' ,
3030 LIB_NAME = 'MiniProgram' ;
3131
3232var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term' ;
@@ -758,6 +758,7 @@ _.setUtm = function (para, prop) {
758758 query = _ . extend ( { } , para . query ) ;
759759 var scene = query . scene ;
760760 if ( scene ) {
761+ scene = _ . decodeURIComponent ( scene ) ;
761762 if ( scene . indexOf ( "?" ) !== - 1 ) {
762763 scene = '?' + scene . replace ( / \? / g, '' ) ;
763764 } else {
@@ -1090,15 +1091,9 @@ sa.openid = {
10901091 if ( storageId ) {
10911092 callback ( storageId ) ;
10921093 } else {
1093- this . getRequest ( function ( openid ) {
1094- if ( openid ) {
1095- callback ( openid ) ;
1096- }
1097- } ) ;
1094+ this . getRequest ( callback ) ;
10981095 }
10991096 }
1100-
1101-
11021097} ;
11031098
11041099
@@ -1238,12 +1233,7 @@ sa.setOpenid = function (openid, isCover) {
12381233} ;
12391234
12401235sa . initWithOpenid = function ( options ) {
1241- if ( _ . isObject ( options ) ) {
1242- options = _ . extend ( sa . para , options ) ;
1243- } else {
1244- options = { } ;
1245- }
1246- //options = options || {};
1236+ options = options || { } ;
12471237 sa . openid . getOpenid ( function ( openid ) {
12481238 if ( openid ) {
12491239 sa . setOpenid ( openid , options . isCoverLogin ) ;
@@ -1409,14 +1399,22 @@ if(sa.para.autoTrack !== false){
14091399
14101400 var oldPage = Page ;
14111401 Page = function ( option ) {
1412-
1413-
14141402 e ( option , "onLoad" , function ( para ) {
14151403 if ( para && _ . isObject ( para ) ) {
14161404 var query = _ . extend ( { } , para ) ;
14171405 if ( para . q ) {
14181406 _ . extend ( query , _ . getObjFromQuery ( _ . decodeURIComponent ( para . q ) ) ) ;
14191407 }
1408+ if ( para . scene ) {
1409+ var scene = para . scene ;
1410+ scene = _ . decodeURIComponent ( scene ) ;
1411+ if ( scene . indexOf ( "?" ) !== - 1 ) {
1412+ scene = '?' + scene . replace ( / \? / g, '' ) ;
1413+ } else {
1414+ scene = '?' + scene ;
1415+ }
1416+ _ . extend ( query , _ . getObjFromQuery ( scene ) ) ;
1417+ }
14201418 var utms = _ . getUtm ( query , '$' , '$latest_' ) ;
14211419 this . sensors_mp_load_utm = utms . pre1 ;
14221420 }
0 commit comments