Update wish import tutorial video

pull/1/head
Made Baruna 2021-12-12 22:24:40 +07:00
parent f26e35a697
commit 526fddc7a5
No known key found for this signature in database
GPG Key ID: 5AA5DA16AA5DCEAD
4 changed files with 82 additions and 10 deletions

View File

@ -203,5 +203,10 @@ export async function process(id) {
pulls: currentPulls,
banner: selectedBanners,
hasManualInput,
tally: {
allTotal: data.total,
legendaryTotal: allLegendary.length,
rareTotal: allRare.length,
},
};
}

View File

@ -1,4 +1,6 @@
import dayjs from 'dayjs';
import { getAccountPrefix } from '../stores/account';
import { readSave } from '../stores/saveManager';
import { process } from './wish';
const bannerCategories = ['beginners', 'standard', 'character-event', 'weapon-event'];
@ -15,8 +17,24 @@ async function sendWish(data) {
}
}
async function sendWishTotal(data) {
try {
await fetch(`${__paimon.env.API_HOST}/wish/total`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data),
});
} catch (err) {
console.error(err);
}
}
export async function submitWishTally() {
let prefixId = 0;
const prefixAccount = getAccountPrefix();
const uid = await readSave(`${prefixAccount}wish-uid`);
for (const id of bannerCategories) {
prefixId += 100000;
@ -26,7 +44,15 @@ export async function submitWishTally() {
console.log('processing wish tally', id);
const { pulls, banner } = data;
const { pulls, banner, tally } = data;
await sendWishTotal({
type: id,
uid,
total: tally.allTotal,
legendary: tally.legendaryTotal,
rare: tally.rareTotal,
});
const firstFivePulls = pulls
.slice(0, 5)
@ -90,6 +116,7 @@ export async function submitWishTally() {
legendary: legendaryCount,
rare: rareCount,
pityCount,
uid,
});
}
}

View File

@ -180,6 +180,11 @@
"and",
"pity from your wish history"
],
"header": [
"Import and backup your Genshin Impact wish history to keep it more than 6 months. Also automatically track your pity and statistic about your wishes!",
"You can also enable Drive Sync on Setting to synchronize and backup the history to your Google Drive",
"Please note that the old feedback link does not work anymore, please follow the new instruction below!"
],
"faqs": {
"title": "Import Wish History FAQ",
"q1": "How does it work?",
@ -281,7 +286,9 @@
"Back to Stream App > Stop Sniffing",
"Click Sniff History > Choose a request that end by .json (the link start with https://hk4e-api-os.mihoyo.com/)",
"Click Request tab, then copy the link and paste it below",
"Paste link here... https://hk4e-api-os.mihoyo.com..."
"Paste link here... https://hk4e-api-os.mihoyo.com...",
"If you got any problem, see troubleshooting guide",
"https://docs.google.com/document/d/1U8pf9lqKALtMSWI11t_6npYlVOCpIFZZRvhrC_9-2ek/edit"
],
"ps": [
"The steps below might be not working, you can link your PS account with miHoYo account then use the pc/mobile instruction",

View File

@ -46,6 +46,8 @@
const videoTutorial = {
android: 'https://youtu.be/pe_aROJ8Av8',
pc: 'https://www.youtube.com/watch?v=FCwZkHeIezw',
pclog: 'https://www.youtube.com/watch?v=cl5HDd0bqKw',
};
let types = {
@ -312,14 +314,18 @@
}
calculatingPity = false;
submitWishTally();
await updateSave(`${prefix}collectables-updated`, true);
if (currentUID !== '') {
await updateSave(`${prefix}wish-uid`, currentUID);
}
try {
submitWishTally();
} catch (err) {
console.error(err);
}
await updateSave(`${prefix}wish-counter-setting`, {
firstTime: false,
manualInput: false,
@ -624,6 +630,17 @@
<h1 class="font-display font-black text-5xl text-white mb-4 leading-tight">
{$t('wish.import.title')}
</h1>
<div class="mt-4 mb-4 md:flex items-center bg-background rounded-xl p-4 relative">
<img class="h-16 hidden md:block mr-0" src="/images/paimon_faq.png" alt="Paimon" />
<div class="md:ml-4 ">
<p class="text-white font-bold">{$t('wish.import.header.0')}</p>
<p class="text-gray-200 text-sm">{$t('wish.import.header.1')}</p>
<div class="flex items-center mt-2 md:mt-0 bg-background-secondary md:bg-transparent p-2 md:p-0 rounded-xl ">
<img class="h-16 md:hidden mr-2" src="/images/paimon_faq.png" alt="Paimon" />
<p class="text-yellow-300 text-sm">{$t('wish.import.header.2')}</p>
</div>
</div>
</div>
<div class="flex space-x-3 mb-2">
<div class="flex flex-col items-center step">
<div class="step-number border-2 border-white w-8 h-8 rounded-full flex justify-center items-center">
@ -770,8 +787,7 @@
</div>
<div class="content flex-col items-center pb-2">
<p class="text-white">{$t('wish.import.guide.pc2.3')}</p>
<pre
class="bg-black text-white bg-opacity-50 whitespace-pre-wrap break-all p-2 rounded-xl text-xs select-all">
<pre class="bg-black text-white bg-opacity-50 whitespace-pre-wrap break-all p-2 rounded-xl text-xs select-all">
{$server === 'China' ? $t('wish.import.guide.pc2.5') : $t('wish.import.guide.pc2.4')}
</pre>
<p class="text-white">
@ -828,8 +844,7 @@
</div>
<div class="content flex-col items-center pb-2">
<p class="text-white">{$t('wish.import.guide.pclog.2')}</p>
<pre
class="bg-black text-white bg-opacity-50 whitespace-pre-wrap break-all p-2 rounded-xl text-xs select-all">
<pre class="bg-black text-white bg-opacity-50 whitespace-pre-wrap break-all p-2 rounded-xl text-xs select-all">
{$server === 'China' ? $t('wish.import.logLocation.china') : $t('wish.import.logLocation.global')}
</pre>
</div>
@ -908,7 +923,9 @@
<div class="content flex-col items-center pb-2">
<p class="text-white">{$t('wish.import.guide.pclocal.2')}</p>
<pre
class="bg-black text-white bg-opacity-50 whitespace-pre-wrap break-all p-2 rounded-xl text-xs select-all">{$t('wish.import.guide.pclocal.3')}</pre>
class="bg-black text-white bg-opacity-50 whitespace-pre-wrap break-all p-2 rounded-xl text-xs select-all">{$t(
'wish.import.guide.pclocal.3',
)}</pre>
<p class="text-white">
{$t('wish.import.guide.pclocal.4')}
<a class="text-blue-400 hover:underline" href={$t('wish.import.guide.pclocal.6')} target="_blank">
@ -964,11 +981,27 @@
</div>
<div class="step-bar w-1 bg-white opacity-50 mt-2 h-full" />
</div>
<div class="content flex-col items-center {i === 9 ? 'pb-8' : ''}">
<div class="content flex-col items-center">
<p class="text-white">{$t(`wish.import.guide.ios2.${i + 3}`)}</p>
</div>
</div>
{/each}
<div class="flex space-x-3 mb-2">
<div class="flex flex-col items-center step">
<div class="w-8 rounded-full flex justify-center items-center text-primary">
<Icon path={mdiCircleMedium} />
</div>
<div class="step-bar w-1 bg-white opacity-50 mt-2 h-full" />
</div>
<div class="content flex-col items-center pb-8">
<p class="text-white">
{$t('wish.import.guide.ios2.14')}
<a href={$t('wish.import.guide.ios2.15')} target="_blank" class="text-primary hover:underline">
{$t('wish.import.guide.ios2.1')}
</a>
</p>
</div>
</div>
{:else}
{#each Array(steps[selectedType]) as _, i}
<div class="flex space-x-3 mb-2">