uni-app跳转其他app

39次阅读

共计 476 个字符,预计需要花费 2 分钟才能阅读完成。

<template>
<view class=”content”>
<button @tap=”test”> 跳转微信 </button>
</view>
</template>

<script>
export default {
data() {
return {

};
},
onReady: function() {},
methods: {
test() {
console.log(‘1’);

var UIApplication = plus.ios.import(‘UIApplication’);
var NSURL = plus.ios.import(‘NSURL’);
var setting = NSURL.URLWithString(‘weixin://’);
var application = UIApplication.sharedApplication();
application.openURL(setting);
plus.ios.deleteObject(setting);
plus.ios.deleteObject(application);
},

}
};
</script>

<style>
</style>

正文完
 0