|
@@ -28,18 +28,60 @@
|
|
|
<script type="text/javascript" th:inline="javascript">
|
|
|
let node = document.getElementById('index-what');
|
|
|
let phone = document.getElementById('index-phone');
|
|
|
+ let currIosVersionNumber = navigator.userAgent.split('iosVersionNumber/')[1];
|
|
|
+ let serveIosVersionNumber = '';
|
|
|
+ //获取版本号
|
|
|
+ function switchControl(){
|
|
|
+ $.ajax({
|
|
|
+ url: baseUrl + '/api/public/v4/access/user/switchControl',
|
|
|
+ type: 'get',
|
|
|
+ contentType:"application/json",
|
|
|
+ dataType: 'json',
|
|
|
+ cache: false,
|
|
|
+ success: function (res) {
|
|
|
+ serveIosVersionNumber = res.data.iosVersionNumber;
|
|
|
+ let result = versionStringCompare(currIosVersionNumber, serveIosVersionNumber);
|
|
|
+ if(result === 1) {
|
|
|
+ phone.style.display = 'none';
|
|
|
+ } else {
|
|
|
+ phone.style.display = 'block';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ switchControl();
|
|
|
node.addEventListener('click', () => {
|
|
|
window.location.href = 'https://www.baidu.com/'
|
|
|
})
|
|
|
phone.addEventListener('click', () => {
|
|
|
- window.location.href = 'https://client.phone.androidscloud.com/cloud/phone/web/#/pages/index/index'
|
|
|
+ window.location.href = baseUrl + '/cloud/phone/web/#/pages/index/index'
|
|
|
})
|
|
|
+ function versionStringCompare(preVersion='', lastVersion='') {
|
|
|
+ var sources = preVersion.split('.');
|
|
|
+ var dests = lastVersion.split('.');
|
|
|
+ var maxL = Math.max(sources.length, dests.length);
|
|
|
+ var result = 0;
|
|
|
+ for (let i = 0; i < maxL; i++) {
|
|
|
+ let preValue = sources.length>i ? sources[i]:0;
|
|
|
+ let preNum = isNaN(Number(preValue)) ? preValue.charCodeAt() : Number(preValue);
|
|
|
+ let lastValue = dests.length>i ? dests[i]:0;
|
|
|
+ let lastNum = isNaN(Number(lastValue)) ? lastValue.charCodeAt() : Number(lastValue);
|
|
|
+ if (preNum < lastNum) {
|
|
|
+ result = -1;
|
|
|
+ break;
|
|
|
+ } else if (preNum > lastNum) {
|
|
|
+ result = 1;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+}
|
|
|
</script>
|
|
|
</body>
|
|
|
<style>
|
|
|
.container{
|
|
|
width: 100%;
|
|
|
- height: 98vh;
|
|
|
+ height: 100vh;
|
|
|
padding-top: 0.2rem;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
@@ -55,6 +97,9 @@
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
+ #index-phone{
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
#toast-container>.toast-error {
|
|
|
background-image: none !important;
|
|
|
}
|