Commit 4c5906d7 authored by 刘春鲜's avatar 刘春鲜

Initial commit

parents
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>合同签订</title>
<script src="util.js"></script>
</head>
<body>
<div>合同签订中...</div>
<script>
window.onload = function () {
const studentId = getQueryString('studentId')
const schoolAreaId = getQueryString('schoolAreaId')
const type = getQueryString('type')
if (studentId && schoolAreaId) {
sendMessage({ type: 'batchPageUrl', __callback__: '__callback__', data: { studentId, schoolAreaId }})
}
if (type) {
sendMessage({ type: type || 'contract' })
}
window.$geek_excuteJS = (params) => {
const { data } = JSON.parse(params)
if (data) {
window.location.href = data
}
}
}
</script>
</body>
</html>
\ No newline at end of file
const isAndroid = () => {
const u = navigator.userAgent;
const android = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1;
return android;
}
const sendMessage = (data) => {
if (isAndroid()) {
window.ReactNativeWebView &&
window.ReactNativeWebView.onMessage &&
window.ReactNativeWebView.onMessage(JSON.stringify(data));
}
window.ReactNativeWebView &&
window.ReactNativeWebView.postMessage &&
window.ReactNativeWebView.postMessage(JSON.stringify(data))
}
const getQueryString = (name) => {
const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
const r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return null;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment