Commit 96c31a64 authored by Tang Xinwei's avatar Tang Xinwei

Add dealer info to Userinfo and profile

parent b3d56c7a
Pipeline #25403 passed with stage
in 2 minutes and 26 seconds
...@@ -8,9 +8,9 @@ ...@@ -8,9 +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> <p class="text-muted" style="font-size:20px;">VS发牌姬:{{ vsDealerStats.win }}/负{{ vsDealerStats.lose }}/总{{ vsDealerStats.total }}</p>
</div> </div>
</div> </div>
</div> </div>
...@@ -236,6 +236,8 @@ export default { ...@@ -236,6 +236,8 @@ export default {
let opt = { let opt = {
'username': this.user.username 'username': this.user.username
} }
// 获取VS发牌姬战绩
this.fetchVsDealerStats().then(vsDealerStats => { this.fetchVsDealerStats().then(vsDealerStats => {
this.vsDealerStats = vsDealerStats; this.vsDealerStats = vsDealerStats;
}); });
......
...@@ -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();
......
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