|
@@ -27,6 +27,7 @@
|
|
|
:book_list='data_read_history_list'
|
|
|
@clickBook='gotoReadBook'
|
|
|
@clickEdit='clickEdit'
|
|
|
+ @clickButtonStatus='readHistoryClickButtonStatus'
|
|
|
@clickDeleteBook='readHistoryClickDeleteBook'></readHistory>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -128,6 +129,15 @@
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ for (let i = 0; i < data_read_history_list.value.length; i++) {
|
|
|
+ let element = data_read_history_list.value[i]
|
|
|
+ if(element.book_id==book_data.book_id) {
|
|
|
+ if(element.start_read_chapter_id!=book_data.start_read_chapter_id) {
|
|
|
+ element.start_read_chapter_id = book_data.start_read_chapter_id
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -139,33 +149,8 @@
|
|
|
is_edit_status.value = is_edit
|
|
|
}
|
|
|
|
|
|
- function bookListClickDeleteBook() {
|
|
|
- data_book_list.value = tools.getLocalBookshelfList()
|
|
|
- }
|
|
|
-
|
|
|
- function readHistoryClickDeleteBook() {
|
|
|
- data_read_history_list.value = tools.getLocalReadHistoryList()
|
|
|
- }
|
|
|
-
|
|
|
- function bookListClickButtonStatus(status:number) {
|
|
|
+ function changeButtonStatusTips(status:number) {
|
|
|
// console.log('button status=',status)
|
|
|
- data_book_list.value = []
|
|
|
- let call_back = (()=>{
|
|
|
- if(status==config.book_action_status.QUAN_BU) {
|
|
|
- data_book_list.value = tools.getLocalBookshelfList()
|
|
|
- return
|
|
|
- }
|
|
|
- let temp_list:book_item_data[] = []
|
|
|
- for (let i = 0; i < tools.getLocalBookshelfList().length; i++) {
|
|
|
- let element = tools.getLocalBookshelfList()[i]
|
|
|
- if(element.book_is_action == status) {
|
|
|
- temp_list.push(element)
|
|
|
- }
|
|
|
- }
|
|
|
- if(temp_list.length>0) {
|
|
|
- data_book_list.value = temp_list
|
|
|
- }
|
|
|
- })
|
|
|
let status_string = ''
|
|
|
switch (status){
|
|
|
case config.book_action_status.QUAN_BU:
|
|
@@ -181,10 +166,57 @@
|
|
|
break;
|
|
|
}
|
|
|
if(status_string.length>0) {
|
|
|
- call_back()
|
|
|
util.showInfoToast(status_string)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ function bookListClickButtonStatus(status:number) {
|
|
|
+ changeButtonStatusTips(status)
|
|
|
+
|
|
|
+ data_book_list.value = []
|
|
|
+ if(status==config.book_action_status.QUAN_BU) {
|
|
|
+ data_book_list.value = tools.getLocalBookshelfList()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let temp_list:book_item_data[] = []
|
|
|
+ for (let i = 0; i < tools.getLocalBookshelfList().length; i++) {
|
|
|
+ let element = tools.getLocalBookshelfList()[i]
|
|
|
+ if(element.book_is_action == status) {
|
|
|
+ temp_list.push(element)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(temp_list.length>0) {
|
|
|
+ data_book_list.value = temp_list
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function bookListClickDeleteBook() {
|
|
|
+ data_book_list.value = tools.getLocalBookshelfList()
|
|
|
+ }
|
|
|
+
|
|
|
+ function readHistoryClickButtonStatus(status:number) {
|
|
|
+ changeButtonStatusTips(status)
|
|
|
+
|
|
|
+ data_read_history_list.value = []
|
|
|
+ if(status==config.book_action_status.QUAN_BU) {
|
|
|
+ data_read_history_list.value = tools.getLocalReadHistoryList()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let temp_list:book_item_data[] = []
|
|
|
+ for (let i = 0; i < tools.getLocalReadHistoryList().length; i++) {
|
|
|
+ let element = tools.getLocalReadHistoryList()[i]
|
|
|
+ if(element.book_is_action == status) {
|
|
|
+ temp_list.push(element)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(temp_list.length>0) {
|
|
|
+ data_read_history_list.value = temp_list
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function readHistoryClickDeleteBook() {
|
|
|
+ data_read_history_list.value = tools.getLocalReadHistoryList()
|
|
|
+ }
|
|
|
|
|
|
function gotoReadBook(book_data:book_item_data, index:number) {
|
|
|
// console.log('book_data=',book_data,'index=',index)
|