Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
Ygopro Arena Web
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
MyCard
Ygopro Arena Web
Commits
36f318b1
Commit
36f318b1
authored
Feb 13, 2024
by
Tang Xinwei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'add_dealer' into 'master'
Add VS dealer info on profile and UserInfo page See merge request
!1
parents
1dce3e65
96c31a64
Pipeline
#25407
passed with stages
in 2 minutes and 3 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
3 deletions
+61
-3
src/components/Profile.vue
src/components/Profile.vue
+32
-2
src/components/Userinfo.vue
src/components/Userinfo.vue
+29
-1
No files found.
src/components/Profile.vue
View file @
36f318b1
...
@@ -8,8 +8,9 @@
...
@@ -8,8 +8,9 @@
<div
class=
"caption"
>
<div
class=
"caption"
>
<h3><i
class=
"glyphicon glyphicon-user"
></i>
<strong>
{{
user
.
username
}}
</strong></h3>
<h3><i
class=
"glyphicon glyphicon-user"
></i>
<strong>
{{
user
.
username
}}
</strong></h3>
<p
class=
"text-muted"
style=
"font-size:20px;"
>
今日首胜:
{{
activity
.
today
}}
/1
</p>
<p
class=
"text-muted"
style=
"font-size:20px;"
>
今日首胜:
{{
activity
.
today
}}
/1
</p>
<p
class=
"text-muted"
v-if=
"showActivity"
style=
"font-size:20px;"
>
{{
activity
.
name
}}
首胜:
<!--
<p
class=
"text-muted"
v-if=
"showActivity"
style=
"font-size:20px;"
>
{{
activity
.
name
}}
首胜:
{{
activity
.
total
}}
/
{{
activity
.
max
}}
</p>
{{
activity
.
total
}}
/
{{
activity
.
max
}}
</p>
-->
<p
class=
"text-muted"
style=
"font-size:20px;"
>
VS发牌姬:胜
{{
vsDealerStats
.
win
}}
/负
{{
vsDealerStats
.
lose
}}
/总
{{
vsDealerStats
.
total
}}
</p>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -158,6 +159,7 @@ import API from '../api'
...
@@ -158,6 +159,7 @@ import API from '../api'
import
{
mapGetters
}
from
'
vuex
'
import
{
mapGetters
}
from
'
vuex
'
import
moment
from
'
moment
'
import
moment
from
'
moment
'
import
tb_language
from
'
./tb_lang.js
'
import
tb_language
from
'
./tb_lang.js
'
import
Vue
from
'
vue
'
;
var
rankTable
;
var
rankTable
;
...
@@ -191,6 +193,11 @@ export default {
...
@@ -191,6 +193,11 @@ export default {
athletic_wl_ratio
:
0
,
athletic_wl_ratio
:
0
,
arena_rank
:
0
arena_rank
:
0
},
},
vsDealerStats
:
{
//发牌姬战绩
win
:
0
,
lose
:
0
,
total
:
0
}
}
}
},
},
computed
:
{
computed
:
{
...
@@ -230,15 +237,38 @@ export default {
...
@@ -230,15 +237,38 @@ export default {
'
username
'
:
this
.
user
.
username
'
username
'
:
this
.
user
.
username
}
}
// 获取VS发牌姬战绩
this
.
fetchVsDealerStats
().
then
(
vsDealerStats
=>
{
this
.
vsDealerStats
=
vsDealerStats
;
});
API
.
getUserInfo
(
opt
).
then
((
res
)
=>
{
API
.
getUserInfo
(
opt
).
then
((
res
)
=>
{
this
.
user_info
=
res
.
data
this
.
user_info
=
res
.
data
// console.log('%c ---------------------src' + '\\' + 'components' + '\\' + 'Profile.vue---------------------%c:219', 'background:#ed162b', 'background:#7d382d',
// console.log('%c ---------------------src' + '\\' + 'components' + '\\' + 'Profile.vue---------------------%c:219', 'background:#ed162b', 'background:#7d382d',
// res)
// res)
});
});
},
},
methods
:
{
methods
:
{
// VS发牌姬成绩
async
fetchVsDealerStats
()
{
try
{
const
apiUrl
=
'
https://sapi.moecube.com:444/dealer/api/user
'
;
const
url
=
`
${
apiUrl
}
/
${
this
.
user
.
username
}
`
;
console
.
log
(
'
发牌姬API
'
,
url
);
const
response
=
await
Vue
.
http
.
get
(
url
);
const
jsonData
=
await
response
.
json
();
console
.
log
(
'
发牌姬response
'
,
jsonData
.
data
);
return
jsonData
.
data
;
}
catch
(
error
)
{
console
.
error
(
'
Error fetching user stats:
'
,
error
);
throw
error
;
}
},
exchangeUserInfo
(
info
)
{
exchangeUserInfo
(
info
)
{
let
userName
=
this
.
user
.
username
let
userName
=
this
.
user
.
username
let
exchangeInfo
=
info
let
exchangeInfo
=
info
...
...
src/components/Userinfo.vue
View file @
36f318b1
...
@@ -26,7 +26,8 @@
...
@@ -26,7 +26,8 @@
<h3>
<i
class=
"glyphicon glyphicon-user"
></i>
<strong>
{{
username
}}
</strong></h3>
<h3>
<i
class=
"glyphicon glyphicon-user"
></i>
<strong>
{{
username
}}
</strong></h3>
<!--
<p
class=
"text-nowrap text-muted"
style=
"font-size:20px;"
>
有妞不泡,大逆不道;遇妞则泡,替天行道。
</p>
-->
<!--
<p
class=
"text-nowrap text-muted"
style=
"font-size:20px;"
>
有妞不泡,大逆不道;遇妞则泡,替天行道。
</p>
-->
<p
class=
"text-muted"
style=
"font-size:20px;"
>
今日首胜:
{{
activity
.
today
}}
/1
</p>
<p
class=
"text-muted"
style=
"font-size:20px;"
>
今日首胜:
{{
activity
.
today
}}
/1
</p>
<p
class=
"text-muted"
v-if=
"showActivity"
style=
"font-size:20px;"
>
{{
activity
.
name
}}
首胜:
{{
activity
.
total
}}
/
{{
activity
.
max
}}
</p>
<!--
<p
class=
"text-muted"
v-if=
"showActivity"
style=
"font-size:20px;"
>
{{
activity
.
name
}}
首胜:
{{
activity
.
total
}}
/
{{
activity
.
max
}}
</p>
-->
<p
class=
"text-muted"
style=
"font-size:20px;"
>
VS发牌姬: 胜
{{
vsDealerStats
.
win
}}
/负
{{
vsDealerStats
.
lose
}}
/总
{{
vsDealerStats
.
total
}}
</p>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -199,6 +200,11 @@
...
@@ -199,6 +200,11 @@
athletic_all
:
0
,
athletic_all
:
0
,
athletic_wl_ratio
:
0
,
athletic_wl_ratio
:
0
,
arena_rank
:
0
arena_rank
:
0
},
vsDealerStats
:
{
//发牌姬战绩
win
:
0
,
lose
:
0
,
total
:
0
}
}
}
}
},
},
...
@@ -216,6 +222,11 @@
...
@@ -216,6 +222,11 @@
this
.
isMobile
=
true
;
this
.
isMobile
=
true
;
}
}
// 获取VS发牌姬战绩
this
.
fetchVsDealerStats
().
then
(
vsDealerStats
=>
{
this
.
vsDealerStats
=
vsDealerStats
;
});
},
},
watch
:
{
watch
:
{
...
@@ -233,6 +244,7 @@
...
@@ -233,6 +244,7 @@
window
.
onhashchange
=
this
.
init
;
window
.
onhashchange
=
this
.
init
;
},
},
computed
:
{
computed
:
{
...
mapGetters
({
...
mapGetters
({
lang
:
'
getLang
'
,
lang
:
'
getLang
'
,
...
@@ -279,6 +291,22 @@
...
@@ -279,6 +291,22 @@
this
.
searchByUsername
(
username
)
this
.
searchByUsername
(
username
)
},
},
// VS发牌姬成绩
async
fetchVsDealerStats
()
{
try
{
const
apiUrl
=
'
https://sapi.moecube.com:444/dealer/api/user
'
;
const
url
=
`
${
apiUrl
}
/
${
this
.
user
.
username
}
`
;
console
.
log
(
'
发牌姬API
'
,
url
);
const
response
=
await
Vue
.
http
.
get
(
url
);
const
jsonData
=
await
response
.
json
();
console
.
log
(
'
发牌姬response
'
,
jsonData
.
data
);
return
jsonData
.
data
;
}
catch
(
error
)
{
console
.
error
(
'
Error fetching user stats:
'
,
error
);
throw
error
;
}
},
renderPage
:
function
()
{
renderPage
:
function
()
{
if
(
rankTable
)
{
if
(
rankTable
)
{
rankTable
.
destroy
();
rankTable
.
destroy
();
...
...
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