Skip to content

Commit

Permalink
✨ feat: add search in miyoushe
Browse files Browse the repository at this point in the history
  • Loading branch information
xytoki committed Jan 29, 2024
1 parent d127d4d commit a521fe7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/views/Achievement/AchivementItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@
</div>
<small>
<a
v-if="contributed[i.id]"
:href="contributed[i.id]"
:href="contributed[i.id] ? contributed[i.id] : searchMys(i)"
target="_blank"
class="contributed"
rel="noopener nofollow"
>
<fa-icon icon="arrow-up-right-from-square" />
攻略
{{ contributed[i.id] ? '攻略' : '搜索' }}
</a>
{{ amos[i.desc].replace('{param0}', i.total.toString()) }}
</small>
Expand Down Expand Up @@ -130,8 +129,12 @@ export default defineComponent({
AQ: '魔神',
LQ: '邀约',
} as Record<string, string>
const searchMys = (i: Achievement) => {
return `https://www.miyoushe.com/ys/search?keyword=${encodeURIComponent(i18n.amos[i.name])}`
}
return {
img,
searchMys,
amos: toRef(i18n, 'amos'),
questType: computed(() => {
if (props.i.trigger && props.i.trigger.task && props.i.trigger.task.length > 0) {
Expand Down

0 comments on commit a521fe7

Please sign in to comment.