|
@@ -19,6 +19,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
+ import { onUnload } from '@dcloudio/uni-app'
|
|
|
import { nextTick, ref, watch } from 'vue';
|
|
|
import { book_item_data, book_read_data, chapter_item_data } from '../../data/data';
|
|
|
import { tools } from '../../framework/tools';
|
|
@@ -42,6 +43,12 @@
|
|
|
let read_setting_data = ReadSetting().getReadSetting()
|
|
|
let fontSize = config.read_config.fontSizeList[read_setting_data.fontSizeIndex]
|
|
|
let bgColor = config.read_config.colorList[read_setting_data.colorBgIndex]
|
|
|
+
|
|
|
+ // 页面销毁
|
|
|
+ onUnload(()=>{
|
|
|
+ tools.exitRead()
|
|
|
+ })
|
|
|
+
|
|
|
//设置属性end
|
|
|
updateNavigation()
|
|
|
if(book_data!=null&&start_read_chapter_id!=-1){
|
|
@@ -58,9 +65,8 @@
|
|
|
}
|
|
|
function draw(cb:Function,dir_is_down:boolean=true){
|
|
|
let loading_view = (d:book_read_data)=>{
|
|
|
- if(cb){
|
|
|
- cb()
|
|
|
- }
|
|
|
+ book_data.start_read_chapter_id = d.book_chapter_id //记录开始阅读章节id
|
|
|
+ cb && cb()
|
|
|
nextTick(()=>{
|
|
|
if(d!=null){
|
|
|
if(dir_is_down){
|