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
},
0 个回复