Let’s see what happens first,

Ready or wx.error is executed. If true is returned, it indicates that ready is executed. JSSDK API can be called, as shown in the following example code:

this.$common.Init.call(this); This.wxjssdkinti ().then(rr => {console.log(' JSSDK initialized successfully ', rr) wx.getLocation({type: 'wgs84', success: function (res) { var latitude = res.latitude; // Latitude, floating point, 90 ~ -90 var longitude = res.longitude; // The longitude is a floating point number ranging from 180 to -180. }}); })Copy the code

Encapsulated directory structure code:

Wxjssdk. js code: this reference in config, API, requset can be