Commit 4660d50d authored by 神楽坂玲奈's avatar 神楽坂玲奈

游戏信息

parent f19ab53e
...@@ -50,36 +50,14 @@ ...@@ -50,36 +50,14 @@
</div> </div>
<!--<div class="d-flex">--> <!--<div class="d-flex">--><!--<div class="panel" id="game_info">--><!--<p>--><!--《东方红魔乡 ~ the Embodiment of Scarlet Devil.》(东方红魔郷 ~ the Embodiment of Scarlet Devil.)是由同人组织上海爱丽丝幻乐团所制作的纵弹幕射击游戏,于2002年6月10日发布体验版,2002年8月11日(Comic Market62)正式发售,9月27日在各同人商店开始了委托贩卖。该作是东方Project的第6作,也是东方Project在Windows平台上的第一作。 </p>--><!--<div id="tags">--><!--<div class="btn btn-xs btn-danger" style="padding:3px 10px; margin:2px">弹幕</div>--><!--<div class="btn btn-xs btn-danger" style="padding:3px 10px; margin:2px">射击</div>--><!--<div class="btn btn-xs btn-danger" style="padding:3px 10px; margin:2px">单机</div>--><!--</div>--><!--</div>--><!--<div class="panel" id="game_info_2">--><!--<dl>--><!--<dt>开发</dt>--><!--<dd>上海爱丽丝幻乐团</dd>--><!--<dt>出版</dt>--><!--<dd>上海爱丽丝幻乐团</dd>--><!--<dt>发行日期</dt>--><!--<dd>2002年8月11日</dd>--><!--</dl>--><!--</div>--><!--</div>-->
<!--<div class="panel" id="game_info">-->
<!--<p>-->
<!--《东方红魔乡 ~ the Embodiment of Scarlet Devil.》(东方红魔郷 ~ the Embodiment of Scarlet Devil.)是由同人组织上海爱丽丝幻乐团所制作的纵弹幕射击游戏,于2002年6月10日发布体验版,2002年8月11日(Comic Market62)正式发售,9月27日在各同人商店开始了委托贩卖。该作是东方Project的第6作,也是东方Project在Windows平台上的第一作。 </p>-->
<!--<div id="tags">-->
<!--<div class="btn btn-xs btn-danger" style="padding:3px 10px; margin:2px">弹幕</div>-->
<!--<div class="btn btn-xs btn-danger" style="padding:3px 10px; margin:2px">射击</div>-->
<!--<div class="btn btn-xs btn-danger" style="padding:3px 10px; margin:2px">单机</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="panel" id="game_info_2">-->
<!--<dl>-->
<!--<dt>开发</dt>-->
<!--<dd>上海爱丽丝幻乐团</dd>-->
<!--<dt>出版</dt>-->
<!--<dd>上海爱丽丝幻乐团</dd>-->
<!--<dt>发行日期</dt>-->
<!--<dd>2002年8月11日</dd>-->
<!--</dl>-->
<!--</div>-->
<!--</div>-->
<div class="d-flex"> <div class="d-flex">
<div class="panel" id="game_info"> <div class="panel" id="game_info">
<p> <p>
《东方红魔乡 ~ the Embodiment of Scarlet Devil.》(东方红魔郷 ~ the Embodiment of Scarlet Devil.)是由同人组织上海爱丽丝幻乐团所制作的纵弹幕射击游戏,于2002年6月10日发布体验版,2002年8月11日(Comic Market62)正式发售,9月27日在各同人商店开始了委托贩卖。该作是东方Project的第6作,也是东方Project在Windows平台上的第一作。 </p> 《东方红魔乡 ~ the Embodiment of Scarlet Devil.》(东方红魔郷 ~ the Embodiment of Scarlet Devil.)是由同人组织上海爱丽丝幻乐团所制作的纵弹幕射击游戏,于2002年6月10日发布体验版,2002年8月11日(Comic Market62)正式发售,9月27日在各同人商店开始了委托贩卖。该作是东方Project的第6作,也是东方Project在Windows平台上的第一作。 </p>
<div id="tags"> <div id="tags" *ngIf="currentApp.tags">
<div class="btn btn-xs btn-danger" style="padding:3px 10px; margin:2px">弹幕</div> <div *ngFor="let tag of currentApp.tags" class="btn btn-xs btn-danger" style="padding:3px 10px; margin:2px">{{tags[tag] || tag}}</div>
<div class="btn btn-xs btn-danger" style="padding:3px 10px; margin:2px">射击</div>
<div class="btn btn-xs btn-danger" style="padding:3px 10px; margin:2px">单机</div>
</div> </div>
</div> </div>
<div class="panel" id="game_info_2"> <div class="panel" id="game_info_2">
...@@ -144,7 +122,7 @@ ...@@ -144,7 +122,7 @@
<h2 i18n>新闻</h2> <h2 i18n>新闻</h2>
<div id="news" *ngFor="let item of news"> <div id="news" *ngFor="let item of news">
<h3>{{item.title}}</h3> <h3>{{item.title}}</h3>
<span>2017-01-18</span> <span>{{item.updated_at | date:'shortDate'}}</span>
<p>{{item.text}}</p> <p>{{item.text}}</p>
<a i18n *ngIf="item.url" [href]="item.url" target="_blank">了解更多</a> <a i18n *ngIf="item.url" [href]="item.url" target="_blank">了解更多</a>
</div> </div>
......
...@@ -40,9 +40,25 @@ export class AppDetailComponent implements OnInit, OnChanges { ...@@ -40,9 +40,25 @@ export class AppDetailComponent implements OnInit, OnChanges {
points: Points; points: Points;
tags: {};
constructor(private appsService: AppsService, private settingsService: SettingsService, constructor(private appsService: AppsService, private settingsService: SettingsService,
private downloadService: DownloadService, private ref: ChangeDetectorRef, private el: ElementRef, private downloadService: DownloadService, private ref: ChangeDetectorRef, private el: ElementRef,
private http: Http) { private http: Http) {
this.tags = this.settingsService.getLocale().startsWith('zh') ? {
'recommend': '推荐',
'mysterious': '迷之物体',
'touhou': '东方 Project',
'touhou-pc98': '东方旧作',
'language': '语言包'
} : {
'recommend': 'Recommended',
'mysterious': 'Something',
'touhou': 'Touhou Project',
'touhou-pc98': 'Touhou old series',
'language': 'Language Pack'
};
} }
async ngOnChanges(changes: SimpleChanges) { async ngOnChanges(changes: SimpleChanges) {
......
...@@ -55,6 +55,8 @@ export class App { ...@@ -55,6 +55,8 @@ export class App {
description: string; // i18n description: string; // i18n
author: string; // English Only author: string; // English Only
homepage: string; homepage: string;
developers: {name: string, url: string}[];
released_at: Date;
category: Category; category: Category;
parent?: App; parent?: App;
...@@ -62,7 +64,7 @@ export class App { ...@@ -62,7 +64,7 @@ export class App {
references: Map<string, App>; references: Map<string, App>;
dependencies: Map<string, App>; dependencies: Map<string, App>;
locales: string[]; locales: string[];
news: {title: string, url: string, image: string}[]; news: {title: string, url: string, image: string, updated_at: Date}[];
network: any; network: any;
tags: string[]; tags: string[];
version: string; version: string;
...@@ -154,6 +156,8 @@ export class App { ...@@ -154,6 +156,8 @@ export class App {
this.id = app.id; this.id = app.id;
this.name = app.name; this.name = app.name;
this.description = app.description; this.description = app.description;
this.developers = app.developers;
this.released_at = app.released_at;
this.author = app.author; this.author = app.author;
this.homepage = app.homepage; this.homepage = app.homepage;
this.category = Category[app.category as string]; this.category = Category[app.category as string];
......
...@@ -239,13 +239,9 @@ export class AppsService { ...@@ -239,13 +239,9 @@ export class AppsService {
} }
// 去除无关语言 // 去除无关语言
for (let key of ['name', 'description', 'news']) { for (let key of ['name', 'description', 'news', 'developers', 'publishers']) {
if (app[key]) { if (app[key]) {
let value = app[key][locale]; app[key] = app[key][locale] || app[key]['zh-CN'] || Object.values(app[key])[0];
if (!value) {
value = app[key]['zh-CN'];
}
app[key] = value;
} }
} }
...@@ -259,6 +255,17 @@ export class AppsService { ...@@ -259,6 +255,17 @@ export class AppsService {
} }
} }
} }
// 时间
if (app.released_at) {
app.released_at = new Date(app.released_at);
}
if (app.news) {
for (let item of app.news) {
item.updated_at = new Date(item.updated_at);
}
}
apps.set(item.id, app); apps.set(item.id, app);
} }
...@@ -418,7 +425,7 @@ export class AppsService { ...@@ -418,7 +425,7 @@ export class AppsService {
}); });
} }
async verifyFiles (app: App, checksumFiles: Map<string, string>, callback: () => void): Promise<Map<string, string>> { async verifyFiles(app: App, checksumFiles: Map<string, string>, callback: () => void): Promise<Map<string, string>> {
let result = new Map<string, string>(); let result = new Map<string, string>();
for (let [file, checksum] of checksumFiles) { for (let [file, checksum] of checksumFiles) {
let filePath = path.join(app.local!.path, file); let filePath = path.join(app.local!.path, file);
...@@ -662,7 +669,7 @@ export class AppsService { ...@@ -662,7 +669,7 @@ export class AppsService {
} }
await this.doInstall(task); await this.doInstall(task);
}; };
const addDownloadTask = async (_app: App, dir: string): Promise<{app: App, files: string[]} > => { const addDownloadTask = async(_app: App, dir: string): Promise<{app: App, files: string[]} > => {
let locale = this.settingsService.getLocale(); let locale = this.settingsService.getLocale();
if (!['zh-CN', 'en-US', 'ja-JP'].includes(locale)) { if (!['zh-CN', 'en-US', 'ja-JP'].includes(locale)) {
locale = 'en-US'; locale = 'en-US';
...@@ -1147,7 +1154,7 @@ export class AppsService { ...@@ -1147,7 +1154,7 @@ export class AppsService {
} }
} }
async getChecksumFile (app: App): Promise<Map<string, string> > { async getChecksumFile(app: App): Promise<Map<string, string> > {
let locale = this.settingsService.getLocale(); let locale = this.settingsService.getLocale();
if (!['zh-CN', 'en-US', 'ja-JP'].includes(locale)) { if (!['zh-CN', 'en-US', 'ja-JP'].includes(locale)) {
......
<div id="candy"></div> <div id="candy"></div>
\ No newline at end of file <roster [roster]="roster" (chat)="chat($event)"></roster>
\ No newline at end of file
...@@ -219,6 +219,7 @@ export class CandyComponent implements OnInit, OnChanges { ...@@ -219,6 +219,7 @@ export class CandyComponent implements OnInit, OnChanges {
jid: string; jid: string;
password: string; password: string;
nickname: string; nickname: string;
roster: any[] = [];
constructor(private loginService: LoginService, private settingsService: SettingsService, private element: ElementRef) { constructor(private loginService: LoginService, private settingsService: SettingsService, private element: ElementRef) {
} }
...@@ -280,13 +281,21 @@ export class CandyComponent implements OnInit, OnChanges { ...@@ -280,13 +281,21 @@ export class CandyComponent implements OnInit, OnChanges {
Candy.Core.connect(this.jid, this.password, this.nickname); Candy.Core.connect(this.jid, this.password, this.nickname);
$(Candy).on('candy:core:roster:loaded', (event: JQueryEventObject, data: any) => {
// $(Candy).on('candy:core.chat.connection', (event: any, args: any) => { this.roster = Object.values(data.roster.getAll());
// if (args.status === Strophe.Status.CONNECTED) { });
// Candy.Core.Action.Jabber.Roster(); $(Candy).on('candy:core:roster:fetched', (event: JQueryEventObject, data: any) => {
// Candy.Core.getConnection().send($iq({type: 'get'}).c('vCard', {xmlns: 'vcard-temp'}).tree()); this.roster = Object.values(data.roster.getAll());
// } });
// }); $(Candy).on('candy:core:roster:removed', (event: JQueryEventObject, data: any) => {
this.roster = Object.values(Candy.Core.getRoster().getAll());
});
$(Candy).on('candy:core:roster:added', (event: JQueryEventObject, data: any) => {
this.roster = Object.values(Candy.Core.getRoster().getAll());
});
$(Candy).on('candy:core:roster:updated', (event: JQueryEventObject, data: any) => {
this.roster = Object.values(Candy.Core.getRoster().getAll());
});
} }
ngOnChanges(changes: SimpleChanges): void { ngOnChanges(changes: SimpleChanges): void {
...@@ -310,6 +319,10 @@ export class CandyComponent implements OnInit, OnChanges { ...@@ -310,6 +319,10 @@ export class CandyComponent implements OnInit, OnChanges {
} }
} }
chat(jid: string) {
console.log(jid);
}
// ngOnDestroy () { // ngOnDestroy () {
// if (Candy.Core.getConnection()) { // if (Candy.Core.getConnection()) {
// Candy.Core.disconnect(); // Candy.Core.disconnect();
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<div id="right"> <div id="right">
<div id="main"> <div id="main">
<app-detail class="scroll" *ngIf="currentApp" [currentApp]="currentApp"></app-detail> <app-detail class="scroll" *ngIf="currentApp" [currentApp]="currentApp"></app-detail>
<roster class="scroll"></roster> <!--<roster class="scroll"></roster>-->
</div> </div>
<div id="candy-wrapper" class="resize-wrapper resize-top"> <div id="candy-wrapper" class="resize-wrapper resize-top">
......
#friend_list>ul>li>div>p{ :host {
font-size:12px; position: fixed;
padding:3px 5px; top: 0;
margin:0; right: 0;
cursor:default; background: white;
} }
#friend_list>ul>li>img{ #friend_list > ul > li > div > p {
border-radius:25.5px; font-size: 12px;
} padding: 3px 5px;
margin: 0;
cursor: default;
}
#friend_list>ul>li{ #friend_list > ul > li > img {
padding:3px; border-radius: 25.5px;
list-style-type:none;
position:relative;
} }
#friend_list>ul>li:hover{
padding:3px; #friend_list > ul > li {
list-style-type:none; padding: 3px;
position:relative; list-style-type: none;
background:#aaa; position: relative;
} }
#friend_list>ul>li>i{ #friend_list > ul > li:hover {
position:absolute; padding: 3px;
top:38px; list-style-type: none;
left:38px; position: relative;
background: #aaa;
} }
#friend_list>ul{ #friend_list > ul > li > i {
padding:0; position: absolute;
top: 38px;
left: 38px;
} }
.fl{float:left;} #friend_list > ul {
padding: 0;
}
#friend_list i{font-size:10px;} .fl {
float: left;
}
.red{color:red;} #friend_list i {
font-size: 10px;
}
.red {
color: red;
}
.green_light {
color: #8f8;
}
.red_light {
color: #f88;
}
.grey {
color: grey;
}
.green_light{color:#8f8;} .blue_light {
.red_light{color:#f88;} color: #88f;
.grey{color:grey;} }
.blue_light{color:#88f;} \ No newline at end of file
\ No newline at end of file
<!--<link href="roster.component.css" type="text/css" rel="stylesheet">--> <!--<link href="roster.component.css" type="text/css" rel="stylesheet">--><!--<link rel="stylesheet" href="../node_modules/font-awesome/css/font-awesome.min.css">--><!--<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">--><!--<script src="../node_modules/core-js/client/shim.min.js"></script>-->
<!--<link rel="stylesheet" href="../node_modules/font-awesome/css/font-awesome.min.css">-->
<!--<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">-->
<!--<script src="../node_modules/core-js/client/shim.min.js"></script>-->
<!--<script src="../node_modules/zone.js/dist/zone.js"></script>--> <!--<script src="../node_modules/zone.js/dist/zone.js"></script>--><!--<script src="../node_modules/reflect-metadata/Reflect.js"></script>--><!--<script src="../node_modules/systemjs/dist/system.src.js"></script>-->
<!--<script src="../node_modules/reflect-metadata/Reflect.js"></script>-->
<!--<script src="../node_modules/systemjs/dist/system.src.js"></script>-->
<!--<script src="../systemjs.config.js"></script>--> <!--<script src="../systemjs.config.js"></script>-->
<div > <!--<div>-->
<div class="input-group" id="friend_search"> <!--<div class="input-group" id="friend_search">-->
<div class="input-group "> <!--<div class="input-group ">-->
<i class="fa fa-search input-group-addon search" id="basic-addon1"></i> <!--<i class="fa fa-search input-group-addon search" id="basic-addon1"></i>-->
<input type="text" class="form-control" aria-label="Amount (to the nearest dollar)"> <!--<input type="text" class="form-control" aria-label="Amount (to the nearest dollar)">-->
<!--<span class="input-group-addon">+</span>--> <!--&lt;!&ndash;<span class="input-group-addon">+</span>&ndash;&gt;-->
<button type="button" class="input-group-addon btn btn-sm btn-primary blue_light">+</button> <!--<button type="button" class="input-group-addon btn btn-sm btn-primary blue_light">+</button>-->
</div> <!--</div>-->
</div> <!--</div>-->
<div id="friend_list"> <!--<div id="friend_list">-->
<ul> <!--<ul>-->
<li> <!--<li *ngFor="let contact of roster">-->
<img class="fl" src="https://ygobbs.com//letter_avatar_proxy/v2/letter/q/cdc98d/45.png"> <!--<img class="fl" src="https://ygobbs.com//letter_avatar_proxy/v2/letter/q/cdc98d/45.png">-->
<i class="fa fa-circle green_light"></i> <!--<i class="fa fa-circle green_light"></i>-->
<div class="fl"> <!--<div class="fl">-->
<p>我叫什么名来着</p> <!--<p>{{contact.getName()}}</p>-->
<p>发呆ing</p> <!--<p *ngIf="contact.getSubscription() != 'both'">等待确认</p>-->
</div> <!--<p *ngIf="contact.getSubscription() == 'both'">{{contact.getStatus()}}</p>-->
<div style="clear: both"></div>
</li>
<li> <!--</div>-->
<img class="fl" src="https://ygobbs.com/user_avatar/ygobbs.com/sky%E7%A5%9E%E6%99%BA/45/16501_1.png"> <!--<div style="clear: both"></div>-->
<i class="fa fa-play-circle red_light"></i> <!--</li>-->
<div class="fl"> <!--<li>-->
<p>我叫什么名来着</p> <!--<img class="fl" src="https://ygobbs.com//letter_avatar_proxy/v2/letter/q/cdc98d/45.png">-->
<p class="red">东方妖妖梦</p> <!--<i class="fa fa-circle green_light"></i>-->
</div> <!--<div class="fl">-->
<div style="clear: both"></div> <!--<p>我叫什么名来着</p>-->
</li> <!--<p>发呆ing</p>-->
<!--</div>-->
<!--<div style="clear: both"></div>-->
<!--</li>-->
<li> <!--<li>-->
<img class="fl" src="https://ygobbs.com/user_avatar/ygobbs.com/%E6%98%9F%E5%85%89pokeboy/45/10237_1.png"> <!--<img class="fl" src="https://ygobbs.com/user_avatar/ygobbs.com/sky%E7%A5%9E%E6%99%BA/45/16501_1.png">-->
<i class="fa fa-question-circle blue_light"></i> <!--<i class="fa fa-play-circle red_light"></i>-->
<div class="fl"> <!--<div class="fl">-->
<p>我叫什么名来着</p> <!--<p>我叫什么名来着</p>-->
<p>发呆ing</p> <!--<p class="red">东方妖妖梦</p>-->
</div> <!--</div>-->
<div style="clear: both"></div> <!--<div style="clear: both"></div>-->
</li> <!--</li>-->
<li> <!--<li>-->
<img class="fl" src="https://ygobbs.com//user_avatar/ygobbs.com/%E7%B1%B3%E7%B1%B3%E7%B1%B3%E5%BE%B7%E6%8B%89%E4%BB%80/45/17187_1.png"> <!--<img class="fl" src="https://ygobbs.com/user_avatar/ygobbs.com/%E6%98%9F%E5%85%89pokeboy/45/10237_1.png">-->
<i class="fa fa-clock-o grey"></i> <!--<i class="fa fa-question-circle blue_light"></i>-->
<div class="fl"> <!--<div class="fl">-->
<p>我叫什么名来着</p> <!--<p>我叫什么名来着</p>-->
<p>发呆ing</p> <!--<p>发呆ing</p>-->
</div> <!--</div>-->
<div style="clear: both"></div> <!--<div style="clear: both"></div>-->
</li> <!--</li>-->
</ul>
</div> <!--<li>-->
</div> <!--<img class="fl" src="https://ygobbs.com//user_avatar/ygobbs.com/%E7%B1%B3%E7%B1%B3%E7%B1%B3%E5%BE%B7%E6%8B%89%E4%BB%80/45/17187_1.png">-->
<!--<i class="fa fa-clock-o grey"></i>-->
<!--<div class="fl">-->
<!--<p>我叫什么名来着</p>-->
<!--<p>发呆ing</p>-->
<!--</div>-->
<!--<div style="clear: both"></div>-->
<!--</li>-->
<!--</ul>-->
<!--</div>-->
<!--</div>-->
/** /**
* Created by zh99998 on 16/9/2. * Created by zh99998 on 16/9/2.
*/ */
import {Component} from '@angular/core'; import {Component, Input, EventEmitter, Output, OnInit, OnChanges} from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'roster', selector: 'roster',
templateUrl: 'roster.component.html', templateUrl: 'roster.component.html',
styleUrls: ['roster.component.css'], styleUrls: ['roster.component.css'],
}) })
export class RosterComponent { export class RosterComponent implements OnInit, OnChanges {
@Input()
roster: any;
@Output()
chat = new EventEmitter<string>();
ngOnInit() {
console.log(this.roster);
}
ngOnChanges() {
console.log(this.roster);
}
} }
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