<div style=“width:100%;height:100px;position:fixed”>
<wx-open-launch-app id=“launch-btn” appid=“wx1e01dbf98bb007f3” extinfo=“id=1&userid=1&type=goods”>
<template >
<style>
.btn {
width: 200px;
height: 45px;
line-height: 45px;
text-align: center;
font-size: 17px;
border-radius: 22.5px;
color: #fff;
}
</style>
<div class=“btn”>启动APP</div>
</template>
</wx-open-launch-app>
</div>
<script>
var btn = document.getElementById(‘launch-btn’);
btn.addEventListener(‘launch’, function (e) {
console.log(‘success’);
});
btn.addEventListener(‘error’, function (e) {
console.log(‘fail’, e.detail);
});
</script>