Commit 5d9214e4 authored by Tang Xinwei's avatar Tang Xinwei

Add world boss genesis battle info

更新 深渊代码战绩到玩家信息界面
parent 1901ebc7
Pipeline #31249 passed with stage
in 1 minute and 49 seconds
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<!-- <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>
<p class="text-muted" style="font-size:20px;">VS深渊代码:胜{{ vsGenesisStats.win }}/负{{ vsGenesisStats.lose }}/总{{ vsGenesisStats.total }}</p>
</div> </div>
</div> </div>
</div> </div>
...@@ -197,6 +198,11 @@ export default { ...@@ -197,6 +198,11 @@ export default {
win: 0, win: 0,
lose: 0, lose: 0,
total: 0 total: 0
},
vsGenesisStats: { //VS深渊代码战绩
win: 0,
lose: 0,
total: 0
} }
} }
}, },
...@@ -242,6 +248,10 @@ export default { ...@@ -242,6 +248,10 @@ export default {
this.vsDealerStats = vsDealerStats; this.vsDealerStats = vsDealerStats;
}); });
this.fetchVsGenesisStats().then(vsGenesisStats => {
this.vsGenesisStats = vsGenesisStats;
});
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',
...@@ -268,6 +278,22 @@ export default { ...@@ -268,6 +278,22 @@ export default {
} }
}, },
// VS深渊代码成绩
async fetchVsGenesisStats() {
try {
const apiUrl = 'https://sapi.moecube.com:444/dealer2/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
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<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> <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深渊代码:胜{{ vsGenesisStats.win }}/负{{ vsGenesisStats.lose }}/总{{ vsGenesisStats.total }}</p>
</div> </div>
</div> </div>
</div> </div>
...@@ -206,6 +207,11 @@ ...@@ -206,6 +207,11 @@
win: 0, win: 0,
lose: 0, lose: 0,
total: 0 total: 0
},
vsGenesisStats: { //VS深渊代码战绩
win: 0,
lose: 0,
total: 0
} }
} }
}, },
...@@ -228,6 +234,10 @@ ...@@ -228,6 +234,10 @@
this.vsDealerStats = vsDealerStats; this.vsDealerStats = vsDealerStats;
}); });
this.fetchVsGenesisStats().then(vsGenesisStats => {
this.vsGenesisStats = vsGenesisStats;
});
}, },
watch: { watch: {
...@@ -309,6 +319,23 @@ ...@@ -309,6 +319,23 @@
} }
}, },
// VS深渊代码成绩
async fetchVsGenesisStats() {
const username = querystring.parse(location.hash.slice(11)).username
try {
const apiUrl = 'https://sapi.moecube.com:444/dealer2/api/user';
const url = `${apiUrl}/${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