Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.添加解析请求等待时间 2.订阅源搜书跳转搜书界面。 #264

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions entry/src/main/ets/common/model/XmlAnalysis.ets
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class XmlAnalysis {
rule: this.source,
searchUrl: this.searchUrl
}
axios.defaults.timeout = 5000
let response: AxiosResponse<object> = await axios.post('http://legado.wisdoms.xin/analysisBook', data)
if (response.data){
bookList = (response.data as SearchBook[]).map(item => {
Expand Down
4 changes: 3 additions & 1 deletion entry/src/main/ets/componets/search/SearchHead.ets
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export struct SearchHead{
.height(25)
.onClick(()=>{
router.back()
taskSearchBooks.cancelAllTasks()
if (this.isSearch) {
taskSearchBooks.cancelAllTasks()
}
})
Search({ value: this.SearchValue, placeholder: '搜索书名或作者', icon: "/common/images/search.svg" })
.width("70%")
Expand Down
5 changes: 4 additions & 1 deletion entry/src/main/ets/pages/view/Subscription/rssWebView.ets
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ struct RssWebView {
.textAlign(TextAlign.Center)
.onClick(()=>{
router.pushUrl({
url: 'pages/view/search/SearchBook'
url: 'pages/view/search/SearchBook',
params:{
searchValue:this.webTitle
}
});
})
}
Expand Down
18 changes: 15 additions & 3 deletions entry/src/main/ets/pages/view/search/SearchBook.ets
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,31 @@ import { SearchHistory } from '../../../componets/search/SearchHistory'
import { SearchDetails } from '../../../componets/search/SearchDetails'
import { SearchRefresh } from '../../../componets/search/SearchRefresh'
import taskSearchBooks from '../../../common/model/taskSearchBook'
import { router } from '@kit.ArkUI'
import { showMessage } from '../../../componets/common/promptShow'

interface routeParams {
searchValue: string,

}
@Entry
@Component
struct SearchBook {
@Provide SearchValue: string ="遮天"
@Provide SearchValue: string =""
@Provide SearchStatus: number=0;
@Provide('searchBookList') books:SearchBook[] = []
@StorageLink('bottomRectHeight') bottomRectHeight: number = 0
@Provide('isSearch') isSearch:boolean = false

aboutToAppear(): void {
let search = router.getParams() as routeParams
if (search) {
this.SearchValue = search.searchValue??''
}
}
onBackPress(): boolean | void {
taskSearchBooks.cancelAllTasks()
if (this.isSearch) {
taskSearchBooks.cancelAllTasks()
}
return false
}
build() {
Expand Down
Loading