@@ -143,7 +143,7 @@ var ArrayProto = Array.prototype,
143143 slice = ArrayProto . slice ,
144144 toString = ObjProto . toString ,
145145 hasOwnProperty = ObjProto . hasOwnProperty ,
146- LIB_VERSION = '1.14.9 ' ,
146+ LIB_VERSION = '1.14.10 ' ,
147147 LIB_NAME = 'MiniProgram' ;
148148
149149var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term' ;
@@ -941,19 +941,23 @@ try {
941941 logger . info ( err ) ;
942942}
943943
944- _ . getPageTitle = function ( e ) {
944+ _ . getPageTitle = function ( route ) {
945+ if ( route === '未取到' || ! route ) {
946+ return false ;
947+ }
945948 var title = '' ;
946- var route = e . route ;
947949 try {
948950 if ( __wxConfig ) {
949951 var wxConfig = __wxConfig ;
950952 var currentPageConfig = wxConfig . page [ route ] || wxConfig . page [ route + '.html' ] ;
951- var globalConfigTitle = {
952- titleVal : wxConfig . global . window . navigationBarTitleText
953- } ;
954- var pageConfigTitle = {
955- titleVal : currentPageConfig . window . navigationBarTitleText
956- } ;
953+ var globalConfigTitle = { } ,
954+ pageConfigTitle = { } ;
955+ if ( wxConfig . global && wxConfig . global . window && wxConfig . global . window . navigationBarTitleText ) {
956+ globalConfigTitle . titleVal = wxConfig . global . window . navigationBarTitleText ;
957+ }
958+ if ( currentPageConfig && currentPageConfig . window && currentPageConfig . window . navigationBarTitleText ) {
959+ pageConfigTitle . titleVal = currentPageConfig . window . navigationBarTitleText
960+ }
957961 _ . each ( globalTitle , function ( v , k ) {
958962 if ( k === route ) {
959963 return title = v ;
@@ -1036,6 +1040,13 @@ _.compareSDKVersion = function(v1, v2) {
10361040 return 0 ;
10371041} ;
10381042
1043+ _ . setUpperCase = function ( value ) {
1044+ if ( _ . isString ( value ) ) {
1045+ return value . toLocaleUpperCase ( )
1046+ }
1047+ return value
1048+ }
1049+
10391050_ . info = {
10401051 currentProps : { } ,
10411052 properties : {
@@ -1049,7 +1060,7 @@ _.info = {
10491060 function getNetwork ( ) {
10501061 wx . getNetworkType ( {
10511062 "success" : function ( t ) {
1052- e . $network_type = t [ "networkType" ]
1063+ e . $network_type = _ . setUpperCase ( t [ "networkType" ] )
10531064 } ,
10541065 "complete" : getSystemInfo
10551066 } )
@@ -1069,6 +1080,7 @@ _.info = {
10691080 function getSystemInfo ( ) {
10701081 wx . getSystemInfo ( {
10711082 "success" : function ( t ) {
1083+ e . $brand = _ . setUpperCase ( t [ "brand" ] ) ;
10721084 e . $manufacturer = t [ "brand" ] ;
10731085 e . $model = t [ "model" ] ;
10741086 e . $screen_width = Number ( t [ "screenWidth" ] ) ;
@@ -1564,7 +1576,8 @@ sa.getLocation = function() {
15641576 success : function ( res ) {
15651577 sa . registerApp ( {
15661578 $latitude : res . latitude * Math . pow ( 10 , 6 ) ,
1567- $longitude : res . longitude * Math . pow ( 10 , 6 )
1579+ $longitude : res . longitude * Math . pow ( 10 , 6 ) ,
1580+ $geo_coordinate_system : _ . setUpperCase ( sa . para . preset_properties . location . type )
15681581 } )
15691582 } ,
15701583 fail : function ( err ) {
@@ -2128,7 +2141,7 @@ sa.autoTrackCustom = {
21282141 pageShow : function ( ) {
21292142 var prop = { } ;
21302143 var router = _ . getCurrentPath ( ) ;
2131- var title = _ . getPageTitle ( this ) ;
2144+ var title = _ . getPageTitle ( router ) ;
21322145 prop . $referrer = sa_referrer ;
21332146 prop . $url_path = router ;
21342147 sa . status . last_referrer = sa_referrer ;
@@ -2365,6 +2378,7 @@ sa.appHide = function(prop) {
23652378sa . pageShow = function ( prop ) {
23662379 var obj = { } ;
23672380 var router = _ . getCurrentPath ( ) ;
2381+ var title = _ . getPageTitle ( router ) ;
23682382 if ( _ . isObject ( prop ) ) {
23692383 obj = _ . extend ( obj , prop ) ;
23702384 }
@@ -2380,6 +2394,9 @@ sa.pageShow = function(prop) {
23802394 $url_path : router
23812395 } ) ;
23822396 }
2397+ if ( title ) {
2398+ obj . $title = title ;
2399+ }
23832400 obj . $referrer = sa_referrer ;
23842401 obj . $url_path = router ;
23852402 sa . status . last_referrer = sa_referrer ;
0 commit comments