@@ -34,6 +34,7 @@ sa.para = {
3434 } ,
3535 preset_events : {
3636 moments_page : false ,
37+ defer_track : false
3738 } ,
3839 batch_send : true
3940} ;
@@ -155,7 +156,7 @@ var ArrayProto = Array.prototype,
155156 slice = ArrayProto . slice ,
156157 toString = ObjProto . toString ,
157158 hasOwnProperty = ObjProto . hasOwnProperty ,
158- LIB_VERSION = '1.14.13 ' ,
159+ LIB_VERSION = '1.14.14 ' ,
159160 LIB_NAME = 'MiniProgram' ;
160161
161162var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term' ;
@@ -1975,8 +1976,6 @@ sa.initWithOpenid = function(options, callback) {
19751976 } ) ;
19761977} ;
19771978
1978-
1979-
19801979sa . setWebViewUrl = function ( url , after_hash ) {
19811980 if ( ! _ . isString ( url ) || url === '' ) {
19821981 logger . info ( 'error:请传入正确的 URL 格式' ) ;
@@ -1993,7 +1992,6 @@ sa.setWebViewUrl = function(url, after_hash) {
19931992 nurl = '' ;
19941993 var distinct_id = sa . store . getDistinctId ( ) || "" ,
19951994 first_id = sa . store . getFirstId ( ) || "" ,
1996- name = '_sasdk' ,
19971995 idIndex ;
19981996
19991997 if ( _ . urlSafeBase64 && _ . urlSafeBase64 . encode ) {
@@ -2238,9 +2236,6 @@ sa.quick = function() {
22382236} ;
22392237sa . appLaunch = function ( option , prop ) {
22402238 var obj = { } ;
2241- if ( _ . isObject ( prop ) ) {
2242- obj = _ . extend ( obj , prop )
2243- }
22442239 if ( option && option . scene ) {
22452240 current_scene = option . scene ;
22462241 obj . $scene = _ . getMPScene ( option . scene ) ;
@@ -2278,13 +2273,13 @@ sa.appLaunch = function(option, prop) {
22782273
22792274 obj . $url_query = _ . setQuery ( option . query ) ;
22802275
2276+ if ( _ . isObject ( prop ) ) {
2277+ obj = _ . extend ( obj , prop ) ;
2278+ }
22812279 sa . track ( '$MPLaunch' , obj ) ;
22822280}
22832281sa . appShow = function ( option , prop ) {
22842282 var obj = { } ;
2285- if ( _ . isObject ( prop ) ) {
2286- obj = _ . extend ( obj , prop )
2287- }
22882283 mpshow_time = ( new Date ( ) ) . getTime ( ) ;
22892284 if ( option && option . scene ) {
22902285 current_scene = option . scene ;
@@ -2315,19 +2310,22 @@ sa.appShow = function(option, prop) {
23152310 $latest_scene : obj . $scene
23162311 } ) ;
23172312 obj . $url_query = _ . setQuery ( option . query ) ;
2313+ if ( _ . isObject ( prop ) ) {
2314+ obj = _ . extend ( obj , prop ) ;
2315+ }
23182316 sa . track ( '$MPShow' , obj ) ;
23192317}
23202318
23212319sa . appHide = function ( prop ) {
23222320 var current_time = ( new Date ( ) ) . getTime ( ) ;
23232321 var obj = { } ;
2324- if ( _ . isObject ( prop ) ) {
2325- obj = _ . extend ( obj , prop ) ;
2326- }
23272322 obj . $url_path = _ . getCurrentPath ( ) ;
23282323 if ( mpshow_time && ( current_time - mpshow_time > 0 ) && ( ( current_time - mpshow_time ) / 3600000 < 24 ) ) {
23292324 obj . event_duration = ( current_time - mpshow_time ) / 1000 ;
23302325 }
2326+ if ( _ . isObject ( prop ) ) {
2327+ obj = _ . extend ( obj , prop ) ;
2328+ }
23312329 sa . track ( '$MPHide' , obj ) ;
23322330 sa . sendStrategy . onAppHide ( ) ;
23332331}
@@ -2356,12 +2354,12 @@ sa.pageShow = function(prop) {
23562354 obj . $url_path = router ;
23572355 sa . status . last_referrer = sa_referrer ;
23582356 obj . $url_query = currentPage . sensors_mp_url_query ? currentPage . sensors_mp_url_query : '' ;
2359- if ( _ . isObject ( prop ) ) {
2360- obj = _ . extend ( obj , prop ) ;
2361- } ;
23622357 obj = _ . extend ( obj , _ . getUtmFromPage ( ) ) ;
23632358 _ . setPageSfSource ( obj ) ;
2364- sa . track ( '$MPViewScreen' , obj )
2359+ if ( _ . isObject ( prop ) ) {
2360+ obj = _ . extend ( obj , prop ) ;
2361+ }
2362+ sa . track ( '$MPViewScreen' , obj ) ;
23652363 sa_referrer = router ;
23662364 sa . status . referrer = router ;
23672365}
0 commit comments