Skip to content

Commit

Permalink
feat: 添加tts
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyueyi committed Jul 12, 2024
1 parent defcb6e commit 5ded4a3
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions pages/tools/other/tts.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<template>
<div class="search_help">
<nya-container title="帮你百度">
<div class="inputbtn">
<nya-input
v-model.trim="keyword"
label="请输入要搜索的内容"
placeholder="一灰灰blog"
autocomplete="off"
autofocus
@keyup.enter="go"
/>
<button
type="button"
class="nya-btn"
:disabled="loading"
@click="go"
>
{{ loading ? '获取中' : '开始获取' }}
</button>
</div>
<nya-select v-model="type" fullwidth class="mt-15" :items="typeList" label="选择搜索引擎" />
</nya-container>

<nya-container v-if="results" title="获取成功">
<a :href="results" target="_blank" rel="noopener noreferrer">
{{ results }}
</a>
</nya-container>

<nya-container title="Tips">
<ul class="nya-list">
<li>沙雕网友问的问题太简单,不想回答?这个时候就可以使用这个工具教他百度啦ww</li>
</ul>
</nya-container>
</div>
</template>

<script>
export default {
name: 'SearchHelp',
head() {
return this.$store.state.currentTool.head;
},
data() {
return {
keyword: '',
results: '',
type: 'baidu',
typeList: {
google: '谷歌',
baidu: '百度',
pornhub: 'Pornhub',
github: 'GitHub'
},
loading: false
};
},
computed: {
url() {
return `${process.env.url}/o/search_help?s=${
this.type
}&k=${encodeURIComponent(this.keyword)}`;
}
},
methods: {
go() {
if (this.loading) return false;
if (this.keyword) {
this.results = this.url;
} else {
this.$swal({
type: 'error',
title: '下载失败',
text: `ERROR: 请输入正确的链接`
});
}
}
}
};
</script>

0 comments on commit 5ded4a3

Please sign in to comment.