Commit 303d1d23 authored by mercury233's avatar mercury233

fix duel end popup

parent 1be81b4b
......@@ -2,14 +2,14 @@
<html>
<head>
<meta charset="utf-8">
<link href="./node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
<link href="../node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
<style>
@font-face {
font-family: 'Mogra';
font-style: normal;
font-weight: 400;
src: url('font/Mogra-Regular.ttf');
src: url('../font/Mogra-Regular.ttf');
}
html,div,body,td,tr{
background: rgba(0,0,0,0);
......
......@@ -36,7 +36,7 @@ let data_str = data_url.get('data');
let data = JSON.parse(data_str!);
let titleStr;
let icon = 'https://ygobbs.com/user_avatar/ygobbs.com/' + data.myname + '/25/1.png';
let icon = 'https://ygobbs.com/user_avatar/ygobbs.com/' + data.myname + '/120/1.png';
let myMame = data.myname;
let winTimes, loseTimes, rank, rank_up, DP, DP_up, DP_up_sum, EXP, EXP_up;
let winOrLose = 0;
......
......@@ -621,7 +621,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
data.exp_rank_ex = exp_rank_ex;
data.arena_rank_ex = arena_rank_ex;
if (start_time !== data.start_time) {
this.appsService.showResult('end_YGOPro_single.html', data, 202, 222);
this.appsService.showResult('app/end_YGOPro_single.html', data, 202, 222);
}
});
} catch (error) {
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="./node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
<style>
html,div,body,td,tr{
background: rgba(0,0,0,0);
font-size:14px;
font-family:-apple-system, Arial, 'Source Sans Pro', "Microsoft YaHei", 'Microsoft JhengHei', "WenQuanYi Micro Hei", sans-serif;
padding:0;
margin:0;
color:#00a4d9;
}
i:hover{
color:#0b88b1;
}
td{
text-align:center;
width:50px;
height:20px;
line-height: 20px;
padding:2px;
}
td:nth-child(1){
width:auto;
}
td:nth-child(2){
text-align:left;
width:150px
}
img{
display: block;
height: 100%;
}
.window{
position:relative;
width:320px;
height:180px;
background:linear-gradient(to bottom, #bfcdd2, rgba(218, 218, 218, 0.17));
padding:5px;
}
.myIcon{
float:left;
height:100%
}
.close{
position:absolute;
top:5px;
right:5px
}
.title{
/*display: table;*/
height:50px;
line-height:30px;
padding:5px;
border-bottom:1px #fff solid;
color:#00a4d9
}
.winOrLose{
font-size:30px;
display:table-cell;
vertical-align:middle;
padding-right:10px;
display: none;
}
.myInfo_tr{background:linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0.5));}
#myName{
height:50%;
line-height:100%;
font-size:25px;
}
#myScore{font-size:25px; padding-right: 10px}
#myExp{font-size:15px; color:green; padding-right: 10px}
#myGold{font-size:15px; color:#ec6d20; padding-right: 10px}
#win{color:green;}
#lose{color:red;}
#users_info{border-collapse:collapse;}
</style>
</head>
<body>
<div class="window">
<i onclick="window.opener=null;window.close();" class="fa fa-times close" title="关闭"></i>
<div class="title">
<div class="myIcon">
<img id="myIcon" >
</div>
<div style="float:left; padding-left:10px">
<div id="myName"></div>
<div style="height:50%;">
<span id="myScore"></span>
<span id="myExp"></span>
<span id="myGold"></span>
</div>
</div>
<div style="height:100%; float:right; display:table;">
<span id="win" class="winOrLose"></span>
<span id="lose" class="winOrLose"></span>
</div>
</div>
<div class="clear:both"></div>
<div style="padding:5px;">
<table id="users_info">
<tr>
<th colspan="2">玩家</th>
<th>评价</th>
<th>经验</th>
<th>金币</th>
</tr>
</table>
</div>
</div>
<script>
window.exports = {}
</script>
<script src="end.js"></script>
</body>
</html>
/**
* Created by break on 2017/6/9.
*/
import * as $ from 'jquery';
let data_url = (new URL(document.location.toString())).searchParams;
let data_str = data_url.get('data');
console.log(data_str);
// data={
// 'win':true,
// 'users_info':[{
// 'isPlay':true,
// 'icon':'http://himg.bdimg.com/sys/portrait/item/55c177633531343132333435f20c.jpg',
// 'name':'刘大耳',
// 'score':'5555',
// 'exp':'123',
// 'gold':'321'
// },{
// 'isPlay':false,
// 'icon':'http://himg.bdimg.com/sys/portrait/item/55c177633531343132333435f20c.jpg',
// 'name':'关绿帽',
// 'score':'008',
// 'exp':'789',
// 'gold':'999'
// }
// ]
// }
let data = JSON.parse(data_str!);
console.log(data);
let win = data.win;
let users_info = data.users_info;
let my_info;
if (win) {
$('#win').show();
} else {
$('#lose').show();
}
console.log(data);
for (let user_info of users_info) {
let tr_style = '';
if (user_info.isPlay) {
tr_style = ' class="myInfo_tr"';
my_info = user_info;
}
let tr = '<tr' + tr_style + '> <td><img src="' + user_info.icon + '"></td><td>' + user_info.name + '</td><td>' + user_info.score + '</td><td>' + user_info.exp + '</td><td>' + user_info.gold + '</td></tr>';
$('#users_info').append(tr);
}
$('#myIcon').attr('src', my_info.icon);
$('#myName').html(my_info.name);
$('#myScore').html(my_info.score);
$('#myExp').html(my_info.exp);
$('#myGold').html(my_info.gold);
let t = setTimeout(function () {
window.opener = null;
window.close();
}, 5000);
$('html').hover(function () {
clearTimeout(t);
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="./node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
<style>
html,div,body,td,tr{
background: rgba(0,0,0,0);
font-size:14px;
font-family:-apple-system, Arial, 'Source Sans Pro', "Microsoft YaHei", 'Microsoft JhengHei', "WenQuanYi Micro Hei", sans-serif;
padding:0;
margin:0;
color:#00a4d9;
}
i:hover{
color:#0b88b1;
}
td{
text-align:center;
width:50px;
height:20px;
line-height: 20px;
padding:2px;
}
td:nth-child(1){
width:auto;
}
td:nth-child(2){
text-align:left;
width:150px
}
img{
display: block;
height: 100%;
}
.window{
position:relative;
width:320px;
height:180px;
background:linear-gradient(to bottom, #bfcdd2, rgba(218, 218, 218, 0.17));
padding:5px;
}
.myIcon{
float:left;
height:100%
}
.close{
position:absolute;
top:5px;
right:5px
}
.title{
/*display: table;*/
height:50px;
line-height:30px;
padding:5px;
border-bottom:1px #fff solid;
color:#00a4d9
}
.winOrLose{
font-size:30px;
display:table-cell;
vertical-align:middle;
padding-right:10px;
display: none;
}
.myInfo_tr{background:linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0.5));}
#myName{
height:50%;
line-height:100%;
font-size:25px;
}
#myScore{font-size:25px; padding-right: 10px}
#myExp{font-size:15px; color:green; padding-right: 10px}
#myGold{font-size:15px; color:#ec6d20; padding-right: 10px}
#win{color:green;}
#lose{color:red;}
#users_info{border-collapse:collapse;}
</style>
</head>
<body>
<div class="window">
<i onclick="window.opener=null;window.close();" class="fa fa-times close" title="关闭"></i>
<div class="title">
<div class="myIcon">
<img id="myIcon" >
</div>
<div style="float:left; padding-left:10px">
<div id="myName"></div>
<div style="height:50%;">
<span id="myScore"></span>
<span id="myExp"></span>
<span id="myGold"></span>
</div>
</div>
<div style="height:100%; float:right; display:table;">
<span id="win" class="winOrLose"></span>
<span id="lose" class="winOrLose"></span>
<span id="a_draw" class="winOrLose"></span>
</div>
</div>
<div class="clear:both"></div>
<div style="padding:5px;">
<table id="users_info">
<tr>
<th colspan="2">玩家</th>
<th>评价</th>
<th>经验</th>
<th>金币</th>
</tr>
</table>
</div>
</div>
<script>
window.exports = {}
</script>
<script src="end_YGOPro.js"></script>
</body>
</html>
/**
* Created by break on 2017/6/9.
*/
import * as $ from 'jquery';
let data_url = (new URL(document.location.toString())).searchParams;
let data_str = data_url.get('data');
console.log(data_str);
// {"usernamea": "loyi",
// "usernameb": "saten",
// "userscorea": 2,
// "userscoreb": 0,
// "expa": 36.5,
// "expb": 9,
// "expa_ex": 35.5,
// "expb_ex": 8.5,
// "pta": 479.950607945308,
// "ptb": 494.012345698275,
// "pta_ex": 479.950607945308,
// "ptb_ex": 494.012345698275,
// "type": "entertain",
// "start_time": "2017-06-12T17:07:54.000Z",
// "end_time": "2017-06-12T17:23:16.000Z"}
let data = JSON.parse(data_str!);
let icona = 'https://ygobbs.com/user_avatar/ygobbs.com/' + data.usernamea + '/25/1.png';
let iconb = 'https://ygobbs.com/user_avatar/ygobbs.com/' + data.usernameb + '/25/1.png';
console.log(data);
if (data.usernamea === data.myname) {
if ( data.userscorea > data.userscoreb) {
$('#win').show();
}else if ( data.userscorea < data.userscoreb) {
$('#lose').show();
}else {
$('#a_draw').show();
}
$('#myIcon').attr('src', icona);
$('#myName').html(data.usernamea);
$('#myScore').html(data.userscorea);
$('#myExp').html(parseInt(data.expa).toString());
$('#myGold').html(parseInt(data.pta).toString());
let tr = '<tr class="myInfo_tr"><td><img src="' + icona + '"></td><td>' + data.usernamea + '</td><td>' + data.userscorea + '</td><td>' + parseInt(data.expa).toString() + '</td><td>' + parseInt(data.pta).toString() + '</td></tr>';
$('#users_info').append(tr);
tr = '<tr><td><img src="' + iconb + '"></td><td>' + data.usernameb + '</td><td>' + data.userscoreb + '</td><td>' + parseInt(data.expb).toString() + '</td><td>' + parseInt(data.ptb).toString() + '</td></tr>';
$('#users_info').append(tr);
}else {
if ( data.userscorea > data.userscoreb) {
$('#lose').show();
}else if ( data.userscorea < data.userscoreb) {
$('#win').show();
}else {
$('#a_draw').show();
}
$('#myIcon').attr('src', iconb);
$('#myName').html(data.usernameb);
$('#myScore').html(data.userscoreb);
$('#myExp').html(parseInt(data.expb).toString());
$('#myGold').html(parseInt(data.ptb).toString());
let tr = '<tr><td><img src="' + icona + '"></td><td>' + data.usernamea + '</td><td>' + data.userscorea + '</td><td>' + parseInt(data.expa).toString() + '</td><td>' + parseInt(data.pta).toString() + '</td></tr>';
$('#users_info').append(tr);
tr = '<tr class="myInfo_tr"><td><img src="' + iconb + '"></td><td>' + data.usernameb + '</td><td>' + data.userscoreb + '</td><td>' + parseInt(data.expb).toString() + '</td><td>' + parseInt(data.ptb).toString() + '</td></tr>';
$('#users_info').append(tr);
}
let t = setTimeout(function () {
window.opener = null;
window.close();
}, 5000);
$('html').hover(function () {
clearTimeout(t);
});
// let {ipcRenderer} = require('electron');
// setTimeout( function(){ipcRenderer.send('massage', '')} , 1000);
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