4 changed files with 141 additions and 77 deletions
@ -0,0 +1,51 @@ |
|||
<template> |
|||
<div class="navi-container"> |
|||
<div class="fake-btn" id="weappBtn">点击跳转小程序</div> |
|||
<wx-open-launch-weapp @launch="launch" appid="wx6163d215ef686f78" path="pages/home/index.html" |
|||
style="position: absolute;top: 0;left: 0;width: 100%;height: 50px;z-index: 10;"> |
|||
<script type="text/wxtag-template"> |
|||
<style>.btn {width: 100%;height: 50px;position: absolute;left: 0;top: 0;z-index: 99;background: transparent;border: none;}</style> |
|||
<button class="btn" id="NaviToMini"></button> |
|||
</script> |
|||
</wx-open-launch-weapp> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
import { setConfig } from '@/utils/jweixin' |
|||
|
|||
export default { |
|||
data() { |
|||
return {} |
|||
}, |
|||
mounted() { |
|||
setConfig() |
|||
}, |
|||
methods: { |
|||
launch(e) { |
|||
console.log("获取小程序 允许 按钮 操作回调", e) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="less" scoped> |
|||
.navi-container { |
|||
position: relative; |
|||
width: 200px; |
|||
height: 30px; |
|||
margin: 18px auto; |
|||
|
|||
.fake-btn { |
|||
width: 180px; |
|||
height: 30px; |
|||
margin: 0 auto; |
|||
border-radius: 25px; |
|||
border: 1px solid rgba(62, 134, 255); |
|||
color: #fff; |
|||
font-size: 16px; |
|||
text-align: center; |
|||
line-height: 30px; |
|||
z-index: 1; |
|||
background: linear-gradient(to right, #3e86ff, #5f9af9); |
|||
} |
|||
} |
|||
</style> |
Loading…
Reference in new issue