Skip to content

Commit

Permalink
V1.8.8
Browse files Browse the repository at this point in the history
1.修复登录页面的相关错误
2.修复直播页面的错误问题
3.其他小问题修复
  • Loading branch information
zixing131 committed Mar 26, 2024
1 parent 3038a0d commit b1d9d18
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 21 deletions.
2 changes: 2 additions & 0 deletions application/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,10 @@ $.extend({
getQueryVar: function (variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
console.log(vars)
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
console.log(pair)
if (pair[0] == variable) { return pair[1]; }
}
return (false);
Expand Down
14 changes: 13 additions & 1 deletion application/dydetail/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
$(function(){
document.activeElement.addEventListener('keydown', handleKeydown);
});

});
function handleKeydown(e) {
$.clearEvent(e);
switch (e.key) {
case 'E':
case 'Backspace':
case 'SoftRight':
//window.location.href = '../dynamic/index.html';
window.history.back();
break;
}
}
4 changes: 2 additions & 2 deletions application/live/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ function nav(move) {
}

function getLiveRoomNumer(uid) {
var id, link = 'https://api.bilibili.com/x/space/acc/info?mid=' + uid;
var id, link ='https://api.live.bilibili.com/xlive/web-room/v1/index/getRoomBaseInfo?uids='+uid+'&req_biz=video';//'https://api.bilibili.com/x/space/acc/info?mid=' + uid;
$.ajax({
url: link,
async: false,
success: function (result) {
id = result.data.live_room.roomid.toString();
id = result.data.by_uids[uid].room_id.toString();
var name = result.data.name;
var sign = result.data.sign;
var title = result.data.live_room.title;
Expand Down
2 changes: 1 addition & 1 deletion application/manifest.webapp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "哔哩哔哩",
"description": "哔哩哔哩KaiOS版",
"version": "1.8.7",
"version": "1.8.8",
"launch_path": "/index.html",
"type": "privileged",
"origin": "app://kai.baiyang.bilibili",
Expand Down
1 change: 1 addition & 0 deletions application/user/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<li class="menuitem" data-tag="dy">动态</li>
<li class="menuitem" data-tag="ct">收藏</li>
<li class="menuitem" data-tag="at">关注</li>
<li class="menuitem" data-tag="logout">注销</li>
</ul>
</div>
<script src="./index.js"></script>
Expand Down
55 changes: 38 additions & 17 deletions application/user/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let userId = 0;
let isOpen = false, self = false;
let isOpen = false, selfvalue = false;

let urlQrCode = "https://passport.bilibili.com/x/passport-login/web/qrcode/generate?source=main-fe-header"
//urlQrCode = "http://passport.bilibili.com/qrcode/getLoginUrl"
Expand Down Expand Up @@ -39,7 +39,7 @@ function loadLoginQrCode()
var dataPoll = $.postApi(urlPoll,'local_id=0&auth_code='+qrcode_key,tv);

//var dataPoll = $.postApi(urlPoll,"oauthKey="+qrcode_key);
console.log(dataPoll)
//console.log(dataPoll)
var code = dataPoll.code
if (code == 0) {
clearInterval(intervalCheck)
Expand Down Expand Up @@ -73,14 +73,14 @@ function loadLoginQrCode()
}
},1000)
}

$(function () {
function refresh_self() {
var mid = $.getQueryVar('mid');
if (mid === false) {
self = true;
if (!mid) {
selfvalue = true;
var id = $.getData('mid');
if (typeof id != 'undefined' && id != null && id != '') {
userId = parseInt(id);
$('#softkey-left').text('刷新');
setUserInfo();
}
else {
Expand All @@ -91,16 +91,19 @@ $(function () {
}
}
else {
$('#softkey-left').text('刷新');
var id = $.getData('mid');
if (id == mid) {
self = true;
softkey("", "", "选项");
selfvalue = true;
softkey("刷新", "", "选项");
}
userId = mid;
setUserInfo();
}
document.activeElement.addEventListener('keydown', handleKeydown);
});
}

$(refresh_self);

function handleKeydown(e) {
$.clearEvent(e);
Expand All @@ -115,10 +118,16 @@ function handleKeydown(e) {
case 'SoftLeft':
if (!isOpen) {
if (userId == 0)
{
loadLoginQrCode();
//login();
else
logout();
}
else{
//logout();
selfvalue=false;
setUserInfo();
refresh_self();
}
}
else {
navigate();
Expand Down Expand Up @@ -152,6 +161,11 @@ function navigate() {
case 'at':
window.location.href = '../attention/index.html';
break;
case 'logout':
logout();
showhideMenu();
break;

}
}

Expand All @@ -162,14 +176,20 @@ function showhideMenu() {
isOpen = false;
}
else {
if (!self) {
if (!selfvalue) {
$('*[data-tag="at"]').hide();
$('*[data-tag="ct"]').hide();
}
menuIndex=0;
$("#menu").show();
var items = document.querySelectorAll('.menuitem');
items.forEach(function (item, index) {
$(item).removeClass('select');
});
var items = document.querySelectorAll('.menuitem:not([style*="display:none"]):not([style*="display: none"]');
items[0].focus();
softkey("选择", "", "返回");
$(items[0]).addClass('select');
softkey("选择", "主页", "返回");
isOpen = true;
}
}
Expand Down Expand Up @@ -213,7 +233,8 @@ function nav(move) {
}
else {
var next = menuIndex + move;
var items = document.querySelectorAll('.menuitem');
var items = document.querySelectorAll('.menuitem:not([style*="display:none"]):not([style*="display: none"]');
//console.log(items)
if (next >= items.length) {
next = items.length - 1;
}
Expand Down Expand Up @@ -260,7 +281,7 @@ function login() {

function setUserInfo() {
var userInfo = null;
if (self)
if (selfvalue)
userInfo = $.getData('userInfo');
if (typeof userInfo == 'undefined' || userInfo == null || userInfo == '') {
var url = 'https://app.bilibili.com/x/v2/space?ps=10&vmid=' + userId;
Expand All @@ -278,9 +299,9 @@ function setUserInfo() {
$('#fans').text(' 粉丝 ' + info.data.card.fans);
$('#sign').text(info.data.card.sign);
}
if (self) {
if (selfvalue) {
localStorage.setItem('userInfo', userInfo);
$('#softkey-left').text('注销');
//$('#softkey-left').text('注销');
}
$(".login").hide();
$(".info").show();
Expand Down

0 comments on commit b1d9d18

Please sign in to comment.