|
|
@@ -45,9 +45,9 @@
|
|
|
<script type="text/javascript">
|
|
|
document.addEventListener("visibilitychange",()=>{
|
|
|
if(document.hidden){
|
|
|
- init();
|
|
|
+ init('visibilitychange');
|
|
|
}else{
|
|
|
- init();
|
|
|
+ init('visibilitychange');
|
|
|
}
|
|
|
})
|
|
|
let title = decodeURIComponent(GetRequest().plateName);
|
|
|
@@ -57,7 +57,7 @@
|
|
|
(function(){
|
|
|
init();
|
|
|
})();
|
|
|
- function init(){
|
|
|
+ function init(type){
|
|
|
$.ajax({
|
|
|
url: `${baseUrl}/api/public/v1/browserLabel/client/query/${GetRequest().plateId}`,
|
|
|
type: 'get',
|
|
|
@@ -77,7 +77,9 @@
|
|
|
return
|
|
|
}
|
|
|
labelId = list[0].id;
|
|
|
- rankingGet();
|
|
|
+ if(type != 'visibilitychange'){
|
|
|
+ rankingGet();
|
|
|
+ }
|
|
|
for(let i=0; i < list.length; i++){
|
|
|
node += `<div class="tag-item ${i === index ? 'active' : ''}" data-id="${list[i].id}" data-index="${i}">${list[i].labelName}</div>`
|
|
|
}
|
|
|
@@ -87,29 +89,30 @@
|
|
|
};
|
|
|
function getType() {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- $.ajax({
|
|
|
- url: `http://localhost:9888/getType`,
|
|
|
- type: 'get',
|
|
|
- contentType:"application/json",
|
|
|
- dataType: 'json',
|
|
|
- cache: false,
|
|
|
- success: function (res) {
|
|
|
- if(res.code === 200){
|
|
|
- let cardType = res.data.devType;
|
|
|
- let phoneObj = {
|
|
|
- 'VIRTUAL_RK3399': 'VIP',
|
|
|
- 'RK_3399': 'SVIP',
|
|
|
- 'MTK_G90': 'STAR',
|
|
|
- 'QUALCOMM': 'STARPRO'
|
|
|
- }
|
|
|
- phoneType = phoneObj[cardType];
|
|
|
- resolve(phoneType);
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ resolve('SVIP');
|
|
|
+ // $.ajax({
|
|
|
+ // url: `http://localhost:9888/getType`,
|
|
|
+ // type: 'get',
|
|
|
+ // contentType:"application/json",
|
|
|
+ // dataType: 'json',
|
|
|
+ // cache: false,
|
|
|
+ // success: function (res) {
|
|
|
+ // if(res.code === 200){
|
|
|
+ // let cardType = res.data.devType;
|
|
|
+ // let phoneObj = {
|
|
|
+ // 'VIRTUAL_RK3399': 'VIP',
|
|
|
+ // 'RK_3399': 'SVIP',
|
|
|
+ // 'MTK_G90': 'STAR',
|
|
|
+ // 'QUALCOMM': 'STARPRO'
|
|
|
+ // }
|
|
|
+ // phoneType = phoneObj[cardType];
|
|
|
+ // resolve(phoneType);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
})
|
|
|
}
|
|
|
- function rankingGet(){
|
|
|
+ function rankingGet(type){
|
|
|
getType().then((phoneType) => {
|
|
|
$.ajax({
|
|
|
url: `${baseUrl}/api/public/v1/ranking/client/get`,
|
|
|
@@ -130,7 +133,9 @@
|
|
|
total = res.data.total;
|
|
|
recordFlag = true;
|
|
|
let node = '';
|
|
|
- $('.download-content').eq(0).text('');
|
|
|
+ if(type != 'down'){
|
|
|
+ $('.download-content').eq(0).text('');
|
|
|
+ }
|
|
|
for(let i=0; i < list.length; i++){
|
|
|
node += `<div class="download-item">
|
|
|
<div class="main-wrap">
|
|
|
@@ -235,6 +240,9 @@
|
|
|
// 进度条的位置也是translate,一开始是用translateX(-100%)挪到外面去
|
|
|
$('.progress')[index].style.transform = `translateX(${percentComplete * 100}%)`;
|
|
|
$('.text').eq(index).text(`${(percentComplete * 100).toFixed(1)}%`);
|
|
|
+ if((percentComplete * 100).toFixed(1) == 100){
|
|
|
+ $('.text').eq(index).text('下载完成');
|
|
|
+ }
|
|
|
}
|
|
|
}, false);
|
|
|
xhr.send();
|
|
|
@@ -260,7 +268,7 @@
|
|
|
if(recordFlag && nowlength < total && total > 0){
|
|
|
recordFlag = false;
|
|
|
pageNum++;
|
|
|
- rankingGet();
|
|
|
+ rankingGet('down');
|
|
|
}
|
|
|
}
|
|
|
});
|