index.html 中引入微信所需要的js
- uni.webview.1.5.5.js:点击查看
- jweixin-1.4.0.js:点击查看
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>大连</title>
<script type="text/javascript" src="/wx/wxSDK/jweixin-1.4.0.js"></script>
<script type="text/javascript" src="/wx/uniwebview/uni.webview.1.5.5.js"></script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
使用方法
<img @click="seeCoupon" class="button" src="@/assets/png/year/button.png">
const seeCoupon = () => {
uni.webView.navigateBack()
uni.webView.postMessage({
data: {
action: "page",
params: 'page_mall/pages/home'
}
});
}