|
@@ -17,6 +17,7 @@ App({
|
|
|
// #if MP
|
|
|
this.updateApplet()
|
|
|
this.checkIsIos()
|
|
|
+ // #elif ANDROID
|
|
|
// #endif
|
|
|
this.getNavbarInfo()
|
|
|
await loginLog()
|
|
@@ -50,6 +51,7 @@ App({
|
|
|
}
|
|
|
this.login(shareUid, userChannelCode)
|
|
|
}
|
|
|
+ this.initPlugin()
|
|
|
},
|
|
|
async login(shareUid, userChannelCode = '3001') {
|
|
|
let uid = wx.getStorageSync('uid')
|
|
@@ -206,6 +208,29 @@ App({
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ initPlugin() {
|
|
|
+ let miniAppPluginId = 'wxf1a06dafa3350688'
|
|
|
+ //根据模块ID初始化模块
|
|
|
+ console.log("插件ID:" + miniAppPluginId)
|
|
|
+ wx.miniapp.loadNativePlugin({
|
|
|
+ pluginId: miniAppPluginId,
|
|
|
+ success: (plugin) => {
|
|
|
+ console.log('load plugin success', plugin)
|
|
|
+ plugin.initPlugin(({}), (res) => {
|
|
|
+ if (res === "success") {
|
|
|
+ console.log("初始化plugin成功")
|
|
|
+ var device_uuid = plugin.getDeviceUuid({})
|
|
|
+ console.log("获取的uuid:" + device_uuid)
|
|
|
+ } else {
|
|
|
+ console.log("初始化plugin失败")
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail: (e) => {
|
|
|
+ console.log('load plugin fail', e)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
globalData: {
|
|
|
userInfo: null,
|
|
|
isIOS: false, // 判断设备是否为苹果
|