yxxh5/public/index.html

69 lines
3.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
})
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<script type="text/javascript" src="https://cdn-cp.tmuyun.com/jssdk/v1/zjrb-cp.v1.min.js" charset="UTF-8"></script>
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
</head>
<body>
<noscript>
<strong>Please enable JavaScript to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
<!-- 山海万象 -->
<script>
let zjrbCp = document.createElement('script');
zjrbCp.async = "async";
zjrbCp.src = 'https://cdn-cp.tmuyun.com/jssdk/v1/zjrb-cp.v1.min.js';
zjrbCp.charset = "UTF-8";
document.body.appendChild(zjrbCp);
zjrbCp.onload = function () {
//初始化jssdk
if (CP && typeof CP.ready === 'function') {
CP.ready({
debug: false, //可选,是否是开启调试模式, 默认false
es6Require: false, //可选是否需要加载es6库默认false
wxOption: { //可选,内容需要二次分享时请配置此项
debug: false, //是否是开启微信调试模式
appid: 'xxxx', //授权的微信公众号的appid 微信二次分享使用,具体使用方式请参照 附录:微信及微信二次分享
method: 'getShareSign', //获取微信信息方法,写死
uploadImage: '', //使用微信录音,图片上传等功能时需要的上传后台服务器地址
redirect: location.href.split('#')[0], //回调域名,一般为加载后签名时页面,如跳转可能会签名失败 附录:微信及微信二次分享
jsApiList: [
'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone',
'startRecord', 'stopRecord', 'onVoiceRecordEnd', 'onVoicePlayEnd', 'uploadVoice', 'playVoice', 'getLocation',
'chooseImage', 'uploadImage', 'stopVoice', 'pauseVoice', 'previewImage', 'translateVoice', 'updateAppMessageShareData', 'updateTimelineShareData'
] // 分享到微信必填需要使用的微信JS接口列表所有JS接口列表见 附录微信JS接口列表
},
ready: function (client_info) {
//jssdk加载完成调用此方法
//client_info > { client_code: 'web', version: '1.0', detail: ''} clientInfo 接口返回数据
main();// 业务逻辑初始化的main函数
},
error: function (error) {
console.log(error, 'error');
//jssdk运行时报错但不会阻断程序运行
//error > {code: 4000, msg: res.errMsg, data: res} res为原生报错 微信的报错也在这处理
}
});
}
}
</script>
</html>