Commit 0e18c100 authored by Tang Xinwei's avatar Tang Xinwei

增加发牌姬活动二期战绩到UI上

parent d8d2bb9c
Pipeline #31250 passed with stage
in 3 minutes and 44 seconds
This diff is collapsed.
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
<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;">
<p class="text-muted" style="font-size:20px;">VS深渊代码:胜{{ vsGenesisStats.win }}/负{{ vsGenesisStats.lose }}/总{{ vsGenesisStats.total }}</p> 赌圣争霸大赛战绩:<br>
击败了{{ vsDuelMonsterStats.win }}位对手 <br> 被干翻了{{ vsDuelMonsterStats.lose }}
</p>
</div> </div>
</div> </div>
</div> </div>
...@@ -194,12 +196,17 @@ export default { ...@@ -194,12 +196,17 @@ export default {
athletic_wl_ratio: 0, athletic_wl_ratio: 0,
arena_rank: 0 arena_rank: 0
}, },
vsDealerStats: { //发牌姬战绩 // vsDealerStats: { //发牌姬战绩
win: 0, // win: 0,
lose: 0, // lose: 0,
total: 0 // total: 0
}, // },
vsGenesisStats: { //VS深渊代码战绩 // vsGenesisStats: { //VS深渊代码战绩
// win: 0,
// lose: 0,
// total: 0
// },
vsDuelMonsterStats: { //二期 卡片精灵战绩战绩
win: 0, win: 0,
lose: 0, lose: 0,
total: 0 total: 0
...@@ -243,13 +250,17 @@ export default { ...@@ -243,13 +250,17 @@ export default {
'username': this.user.username 'username': this.user.username
} }
// 获取VS发牌姬战绩 // 获取VS发牌姬活动战绩
this.fetchVsDealerStats().then(vsDealerStats => { // this.fetchVsDealerStats().then(vsDealerStats => {
this.vsDealerStats = vsDealerStats; // this.vsDealerStats = vsDealerStats;
}); // });
this.fetchVsGenesisStats().then(vsGenesisStats => { // this.fetchVsGenesisStats().then(vsGenesisStats => {
this.vsGenesisStats = vsGenesisStats; // this.vsGenesisStats = vsGenesisStats;
// });
this.fetchVsDuelMonsterStats().then(vsDuelMonsterStats => {
this.vsDuelMonsterStats = vsDuelMonsterStats;
}); });
API.getUserInfo(opt).then((res) => { API.getUserInfo(opt).then((res) => {
...@@ -263,30 +274,46 @@ export default { ...@@ -263,30 +274,46 @@ export default {
methods: { methods: {
// VS发牌姬成绩 // VS发牌姬成绩
async fetchVsDealerStats() { // async fetchVsDealerStats() {
try { // try {
const apiUrl = 'https://sapi.moecube.com:444/dealer/api/user'; // const apiUrl = 'https://sapi.moecube.com:444/dealer/api/user';
const url = `${apiUrl}/${this.user.username}`; // const url = `${apiUrl}/${this.user.username}`;
console.log('发牌姬API', url); // console.log('发牌姬API', url);
const response = await Vue.http.get(url); // const response = await Vue.http.get(url);
const jsonData = await response.json(); // const jsonData = await response.json();
console.log('发牌姬response', jsonData.data); // console.log('发牌姬response', jsonData.data);
return jsonData.data; // return jsonData.data;
} catch (error) { // } catch (error) {
console.error('Error fetching user stats:', error); // console.error('Error fetching user stats:', error);
throw error; // throw error;
} // }
}, // },
// VS深渊代码成绩 // // VS深渊代码成绩
async fetchVsGenesisStats() { // 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;
// }
// },
// VS卡片精灵成绩
async fetchVsDuelMonsterStats() {
try { try {
const apiUrl = 'https://sapi.moecube.com:444/dealer2/api/user'; const apiUrl = 'https://sapi.moecube.com:444/dealer3/api/user';
const url = `${apiUrl}/${this.user.username}`; const url = `${apiUrl}/${this.user.username}`;
console.log('深渊代码API', url); console.log('世界BOSS卡片精灵API: ', url);
const response = await Vue.http.get(url); const response = await Vue.http.get(url);
const jsonData = await response.json(); const jsonData = await response.json();
console.log('深渊代码response', jsonData.data); console.log('世界BOSS卡片精灵response: ', jsonData.data);
return jsonData.data; return jsonData.data;
} catch (error) { } catch (error) {
console.error('Error fetching user stats:', error); console.error('Error fetching user stats:', error);
......
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