| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <!DOCTYPE html>
- <html lang="zh">
- <head>
- <meta charset="utf-8">
- <title>JSSDK 功能测试</title>
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
- <link rel="stylesheet" href="__ROOT__/static/theme/css/mobile.css">
- </head>
- <body>
- <header>
- <h1>JSSDK 功能测试</h1>
- </header>
- <div class="content">
- <button type="button" id='show-alert'>调起摄像头扫码</button>
- </div>
- <style>
- header {
- padding: 35px 0
- }
- header h1 {
- color: #3cc51f;
- font-size: 34px;
- text-align: center;
- font-weight: 400;
- }
- .content {
- padding: 15px;
- text-align: center;
- }
- .content button {
- padding: 5px
- }
- </style>
- <script src="//res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
- <script>
- wx.error(function (err) {
- alert(err.errMsg || '配置出错');
- });
- wx.config(JSON.parse('{$options|json_encode|raw}'));
- wx.ready(function () {
- alert('- 初始化成功 -');
- document.getElementById('show-alert').onclick = function () {
- wx.scanQRCode({
- needResult: 1,
- scanType: ["qrCode", "barCode"],
- success: function (res) {
- alert(res.resultStr);
- }
- });
- }
- });
- </script>
- </body>
- </html>
|