gym页面bug修复

This commit is contained in:
woohoo 2021-11-09 19:23:40 +08:00
parent f88e140655
commit e190a5cb89

View File

@ -278,7 +278,6 @@
'ACTIVATE MEMBERSHIP': '激活会员身份', 'ACTIVATE MEMBERSHIP': '激活会员身份',
'BUY MEMBERSHIP': '购买健身房会员', 'BUY MEMBERSHIP': '购买健身房会员',
'Cancel': '返回', 'Cancel': '返回',
//'Damage you make on impact':'',
'Chance of hitting opponent': '击中对手的概率', 'Chance of hitting opponent': '击中对手的概率',
"Ability to withstand damage": "承受伤害的能力", "Ability to withstand damage": "承受伤害的能力",
"Damage you make on impact": "攻击时造成的伤害", "Damage you make on impact": "攻击时造成的伤害",
@ -289,6 +288,7 @@
'Boxing': '拳击', 'Boxing': '拳击',
'Are you sure you would like to buy this membership?': '确定购买这个健身房会员吗?', 'Are you sure you would like to buy this membership?': '确定购买这个健身房会员吗?',
'Not Available': '不可用', 'Not Available': '不可用',
'Unavailable': '不可用',
}; };
const eduDict = { const eduDict = {
'Biology': '生物学', 'Biology': '生物学',
@ -485,7 +485,6 @@
return; return;
} }
/** /**
* city * city
*/ */
@ -589,11 +588,18 @@
$(e).text(gymDict[$(e).text().trim()]); $(e).text(gymDict[$(e).text().trim()]);
}); });
// 每次锻炼的花销 // 每次锻炼的花销
// $('div[class^="description"] p:nth-child(2)').each((i,e)=>{ $('div[class^="description"] p:nth-child(2)').each((i, e) => {
// const energyPerTrain=$(e).text().split(' ').length===4?$(e).text().split(' ')[0]:null; if ($(e).text().split(' ').length === 1) {
// if(gymDict[$(e).text().replace(energyPerTrain,`{$}`)]) if (gymDict[$(e).text().trim()])
// $(e).text(gymDict[$(e).text().replace(energyPerTrain,`{$}`)].replace(`{$}`,energyPerTrain)); $(e).text(gymDict[$(e).text().trim()]);
// }); return;
}
const energyPerTrain = $(e).text().split(' ')[0];
if (gymDict[$(e).text().replace(energyPerTrain, `{$}`)]) {
e.firstChild.nodeValue = gymDict[$(e).text().replace(energyPerTrain, `{$}`)].replace(`{$}`, energyPerTrain);
e.lastChild.nodeValue = '';
}
});
// 锻炼页面所有按钮 // 锻炼页面所有按钮
$('button[class^="button"]').each((i, e) => { $('button[class^="button"]').each((i, e) => {
if (gymDict[$(e).text().trim()]) if (gymDict[$(e).text().trim()])
@ -668,6 +674,10 @@
if (eduDict[$(e).text().trim()]) if (eduDict[$(e).text().trim()])
e.firstChild.nodeValue = eduDict[$(e).text().trim()]; e.firstChild.nodeValue = eduDict[$(e).text().trim()];
}); });
// 教育主页提示内容
$('#info_wrapper div.msg').find('*').contents().each((i, e) => {
console.log(e.nodeValue)
});
// 学院详情标题 // 学院详情标题
$('div.content-wrapper div.title-black').each((i, e) => { $('div.content-wrapper div.title-black').each((i, e) => {
if (e.childNodes.length === 3) if (e.childNodes.length === 3)
@ -712,14 +722,16 @@
return; return;
} }
case 'Gain': { case 'Gain': {
if(isNumber(spl[1])) {//Gain 40 intelligence upon completion if (typeof parseInt(spl[1]) === 'number') {//Gain 40 intelligence upon completion
const wsGained = spl.slice(2, -2).join(' '); const wsGained = spl.slice(2, -2).join(' ');
if (eduDict[$(e).text().trim().replace(spl[1], '{$1}') if (eduDict[$(e).text().trim().replace(spl[1], '{$1}')
.replace(wsGained, '{$2}')]) .replace(wsGained, '{$2}')])
$(e).text(eduDict[$(e).text().trim().replace(spl[1],'{$1}').replace(wsGained,'{$2}')] $(e).text(eduDict[$(e).text().trim()
.replace('{$1}',spl[1]).replace('{$2}',eduDict[wsGained]?eduDict[wsGained]:wsGained)); .replace(spl[1], '{$1}')
} .replace(wsGained, '{$2}')]
else{ .replace('{$1}', spl[1])
.replace('{$2}', eduDict[wsGained] ? eduDict[wsGained] : wsGained));
} else {
if (eduDict[$(e).text().trim()]) if (eduDict[$(e).text().trim()])
$(e).text(eduDict[$(e).text().trim()]); $(e).text(eduDict[$(e).text().trim()]);
} }
@ -730,8 +742,7 @@
$(e).text(eduDict[$(e).text().trim()]); $(e).text(eduDict[$(e).text().trim()]);
} }
} }
} } else { // 前置课程
else{ // 前置课程
if (eduDict[$(e).children().text().trim()]) if (eduDict[$(e).children().text().trim()])
$(e).children().text(eduDict[$(e).children().text().trim()]); $(e).children().text(eduDict[$(e).children().text().trim()]);
} }