Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaoye
mycard
Commits
53d81371
Commit
53d81371
authored
Sep 07, 2016
by
h3remi7
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add app-detail
parent
f401a953
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
185 additions
and
64 deletions
+185
-64
app/app-detail.component.css
app/app-detail.component.css
+10
-3
app/app-detail.component.html
app/app-detail.component.html
+38
-39
app/app-detail.component.ts
app/app-detail.component.ts
+70
-12
app/apps.component.html
app/apps.component.html
+1
-1
app/apps.component.ts
app/apps.component.ts
+17
-0
app/apps.service.ts
app/apps.service.ts
+1
-0
apps.json
apps.json
+48
-9
No files found.
app/app-detail.component.css
View file @
53d81371
...
@@ -4,6 +4,13 @@
...
@@ -4,6 +4,13 @@
overflow-y
:
auto
;
overflow-y
:
auto
;
}
}
.hidden
{
display
:
none
;
.list-group
{
}
width
:
20rem
;
\ No newline at end of file
}
.news-block
{
padding
:
0
;
}
app/app-detail.component.html
View file @
53d81371
...
@@ -15,49 +15,48 @@
...
@@ -15,49 +15,48 @@
<br>
<br>
<h2>
新闻
</h2>
<h2>
新闻
</h2>
<p>
这里是新闻
</p>
<br>
<p
*ngIf=
"!news"
>
没有新闻
</p>
<div
*ngIf=
"news"
>
<div
class=
"list-group"
>
<a
*ngFor=
"let item of news"
href=
"{{item.url}}"
class=
"list-group-item"
>
{{item.title}}
</a>
</div>
<h2>
好友
</h2>
</div>
<p>
好友信息
</p>
<br>
<br>
<h2>
成就
</h2>
<div
*ngIf=
"friends"
>
<p>
成就信息
</p>
<h2>
好友
</h2>
<p>
好友信息
</p>
<br>
</div>
<br>
<div
*ngIf=
"achievement"
>
<h2>
成就
</h2>
<p>
成就信息
</p>
<br>
</div>
<h2>
Mods
</h2>
<div
*ngIf=
"mods"
>
<h2>
Mods
</h2>
<table
class=
"table table-striped"
>
<table
class=
"table table-striped"
>
<thead>
<thead>
<tr>
<tr>
<th>
#
</th>
<th>
#
</th>
<th>
名称
</th>
<th>
名称
</th>
<th>
类型
</th>
<th>
类型
</th>
<th>
启用
</th>
<th>
操作
</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr>
<tr
*ngFor=
"let mod of mods; let i = index"
>
<th
scope=
"row"
>
1
</th>
<th
scope=
"row"
>
{{i + 1}}
</th>
<td>
东方绯想天
</td>
<td>
{{searchApp(mod.id).name[searchApp(mod.id).locales[0]]}}
</td>
<td>
依赖
</td>
<td>
{{mod.type}}
</td>
<td>
√
</td>
<td
*ngIf=
"checkInstall(mod.id)"
><button
type=
"button"
class=
"btn btn-danger btn-sm"
>
卸载
</button></td>
</tr>
<td
*ngIf=
"!checkInstall(mod.id)"
><button
type=
"button"
class=
"btn btn-primary btn-sm"
>
安装
</button></td>
<tr>
</tr>
<th
scope=
"row"
>
2
</th>
</tbody>
<td>
简体中文包
</td>
</table>
<td>
语言
</td>
</div>
<td>
√
</td>
</tr>
<tr>
<th
scope=
"row"
>
3
</th>
<td>
东方绯想天则OST
</td>
<td>
OST
</td>
<td>
√
</td>
</tr>
</tbody>
</table>
app/app-detail.component.ts
View file @
53d81371
import
{
Component
}
from
'
@angular/core
'
;
import
{
Component
}
from
'
@angular/core
'
;
import
{
AppsService
}
from
'
./apps.service
'
import
{
AppsService
}
from
'
./apps.service
'
import
{
RoutingService
}
from
'
./routing.service
'
import
{
RoutingService
}
from
'
./routing.service
'
//import 'rxjs/Rx';
import
{
App
}
from
"
./app
"
;
import
{
App
}
from
"
./app
"
;
declare
var
process
;
@
Component
({
@
Component
({
selector
:
'
app-detail
'
,
selector
:
'
app-detail
'
,
templateUrl
:
'
app/app-detail.component.html
'
,
templateUrl
:
'
app/app-detail.component.html
'
,
...
@@ -13,14 +14,7 @@ export class AppDetailComponent {
...
@@ -13,14 +14,7 @@ export class AppDetailComponent {
_currentApp
;
_currentApp
;
get
currentApp
():
App
{
get
currentApp
():
App
{
return
this
.
searchApp
(
this
.
routingService
.
app
);
let
data
=
this
.
appsService
.
data
;
let
tmp
;
if
(
data
)
{
tmp
=
data
.
find
((
v
)
=>
v
.
id
===
this
.
routingService
.
app
);
return
tmp
;
}
else
{
}
}
}
_name
;
_name
;
...
@@ -33,16 +27,80 @@ export class AppDetailComponent {
...
@@ -33,16 +27,80 @@ export class AppDetailComponent {
_isInstalled
;
_isInstalled
;
get
isInstalled
()
{
get
isInstalled
()
{
return
this
.
checkInstall
(
this
.
routingService
.
app
);
}
_news
;
get
news
()
{
if
(
this
.
currentApp
)
{
if
(
this
.
currentApp
)
{
if
(
this
.
currentApp
.
local
.
path
)
{
if
(
this
.
currentApp
.
news
.
length
>
0
)
{
return
t
rue
;
return
t
his
.
currentApp
.
news
;
}
}
}
}
}
_friends
;
get
friends
()
{
return
false
;
return
false
;
}
}
_achievement
;
get
achievement
()
{
return
false
;
}
_mods
;
get
mods
()
{
let
contains
=
[
"
optional
"
,
"
language
"
];
if
(
this
.
currentApp
)
{
if
(
this
.
currentApp
.
references
[
process
.
platform
]
&&
this
.
currentApp
.
references
[
process
.
platform
].
length
>
0
)
{
console
.
log
(
this
.
currentApp
.
references
[
process
.
platform
]);
let
refs
=
this
.
currentApp
.
references
[
process
.
platform
];
refs
=
refs
.
filter
((
ref
)
=>
{
return
contains
.
includes
(
ref
.
type
);
});
refs
=
refs
.
map
((
ref
)
=>
{
let
tmp
=
Object
.
create
(
ref
);
switch
(
tmp
.
type
)
{
case
"
optional
"
:
tmp
.
type
=
"
选项
"
;
break
;
case
"
language
"
:
tmp
.
type
=
"
语言
"
;
break
;
default
:
break
;
}
console
.
log
(
tmp
.
type
);
return
tmp
;
});
return
refs
;
//return this.currentApp.references[process.platform];
}
}
}
constructor
(
private
appsService
:
AppsService
,
private
routingService
:
RoutingService
)
{
constructor
(
private
appsService
:
AppsService
,
private
routingService
:
RoutingService
)
{
}
}
searchApp
(
id
):
App
{
let
data
=
this
.
appsService
.
data
;
let
tmp
;
if
(
data
)
{
tmp
=
data
.
find
((
v
)
=>
v
.
id
===
id
);
return
tmp
;
}
}
checkInstall
(
id
):
boolean
{
if
(
this
.
searchApp
(
id
))
{
if
(
this
.
searchApp
(
id
).
local
.
path
)
{
return
true
;
}
}
return
false
;
}
}
}
app/apps.component.html
View file @
53d81371
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<a href="#" class="list-group-item list-group-item-action">绯想天</a>
<a href="#" class="list-group-item list-group-item-action">绯想天</a>
<a href="#" class="list-group-item list-group-item-action disabled">永远消失的幻想乡</a>
<a href="#" class="list-group-item list-group-item-action disabled">永远消失的幻想乡</a>
-->
-->
<a
*ngFor=
"let app of apps
Service.data
"
<a
*ngFor=
"let app of apps"
(click)=
"selectApp(app.id)"
(click)=
"selectApp(app.id)"
href=
"#"
href=
"#"
class=
"list-group-item list-group-item-action"
class=
"list-group-item list-group-item-action"
...
...
app/apps.component.ts
View file @
53d81371
import
{
Component
}
from
'
@angular/core
'
;
import
{
Component
}
from
'
@angular/core
'
;
import
{
AppsService
}
from
'
./apps.service
'
import
{
AppsService
}
from
'
./apps.service
'
import
{
RoutingService
}
from
'
./routing.service
'
import
{
RoutingService
}
from
'
./routing.service
'
import
{
App
}
from
"
./app
"
;
@
Component
({
@
Component
({
selector
:
'
apps
'
,
selector
:
'
apps
'
,
...
@@ -20,6 +21,22 @@ export class AppsComponent {
...
@@ -20,6 +21,22 @@ export class AppsComponent {
});
});
}
}
_apps
;
get
apps
()
{
let
contains
=
[
"
game
"
,
"
music
"
,
"
book
"
];
let
data
=
this
.
appsService
.
data
;
let
apps
;
if
(
data
)
{
apps
=
this
.
appsService
.
data
.
filter
((
app
)
=>
{
return
contains
.
includes
(
app
.
category
);
});
}
return
apps
;
}
selectApp
(
id
)
{
selectApp
(
id
)
{
this
.
routingService
.
app
=
id
;
this
.
routingService
.
app
=
id
;
}
}
...
...
app/apps.service.ts
View file @
53d81371
...
@@ -8,6 +8,7 @@ import {AppLocal} from "./app-local";
...
@@ -8,6 +8,7 @@ import {AppLocal} from "./app-local";
export
class
AppsService
{
export
class
AppsService
{
data
:
App
[];
data
:
App
[];
constructor
(
private
http
:
Http
)
{
constructor
(
private
http
:
Http
)
{
}
}
...
...
apps.json
View file @
53d81371
...
@@ -21,10 +21,7 @@
...
@@ -21,10 +21,7 @@
}
}
}
}
},
},
"references"
:
{
"references"
:
{},
"id"
:
""
,
"type"
:
"runtime"
},
"locales"
:
[
"zh-CN"
],
"locales"
:
[
"zh-CN"
],
"download"
:
""
,
"download"
:
""
,
"news"
:
[{
"news"
:
[{
...
@@ -67,8 +64,20 @@
...
@@ -67,8 +64,20 @@
}
}
},
},
"references"
:
{
"references"
:
{
"id"
:
"th12_mod1"
,
"darwin"
:
[
"type"
:
"language"
{
"id"
:
"th105"
,
"type"
:
"optional"
},
{
"id"
:
"th12_mod1"
,
"type"
:
"language"
},
{
"id"
:
"th12_mod2"
,
"type"
:
"runtime"
}
]
},
},
"locales"
:
[
"zh-CN"
],
"locales"
:
[
"zh-CN"
],
"download"
:
""
,
"download"
:
""
,
...
@@ -102,10 +111,40 @@
...
@@ -102,10 +111,40 @@
}
}
}
}
},
},
"references"
:
{
"references"
:
{},
"id"
:
""
,
"locales"
:
[
"zh-CN"
],
"type"
:
"runtime"
"download"
:
""
,
"news"
:
[],
"tags"
:
[
"STG"
],
"local"
:
{
"path"
:
"/foo/bar"
,
"version"
:
"10.3"
}
},
{
"id"
:
"th12_mod2"
,
"name"
:
{
"zh-CN"
:
"th12_mod2"
},
"description"
:
{
"zh-CN"
:
"th12 desc"
},
"author"
:
"ZUN"
,
"homepage"
:
"http://www.myacg.cc"
,
"category"
:
"runtime"
,
"actions"
:
{
"darwin"
:
{
"main"
:
{
"execute"
:
""
,
"args"
:
[],
"env"
:
""
,
"open"
:
""
}
}
},
},
"references"
:
{},
"locales"
:
[
"zh-CN"
],
"locales"
:
[
"zh-CN"
],
"download"
:
""
,
"download"
:
""
,
"news"
:
[],
"news"
:
[],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment