CodyCool
CodyCool
  • 发布:2020-11-13 18:20
  • 更新:2020-11-13 18:20
  • 阅读:1951

uniapp打包的H5单页面怎么判断安没安装app。

分类:uni-app

uniapp打包的H5单页面怎么判断安没安装app,没有安装就跳下载,有就直接打开app。
用plus.runtime一直报plus未被定义。

     testClick() {  
                            var  that  = this  
                            console.log('====================’')  
                              // #ifdef APP-PLUS  
                             plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {  
                                that.versionName = wgtinfo.version;  
                               });  
                            console.log(that.versionName)  
                                uni.request({  
                                url: 'https://app.gongminlingyuanwang.cn/api/download_app',  
                                method: 'GET',  
                                data: {  
                                 "version": that.versionName,  
                                },  
                                success: (res) => {  
                                 var data = res.data;  
                                 if (data.code == 200) {  
                                  let  url = 'https://app.gongminlingyuanwang.cn/' + data.res.dowm_url;  
                                  plus.runtime.openWeb(url);  
                                 }  
                                }  
                               });  

                            // #endif  
                              },
2020-11-13 18:20 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复