|
@@ -2,6 +2,7 @@
|
|
|
import { config } from "../config/config";
|
|
|
import { book_item_data, chapter_item_data } from "../data/data";
|
|
|
import { BookshelfData } from "../stores/bookshelfManager";
|
|
|
+import { UserStatus } from "../stores/userStatusManager";
|
|
|
import { http } from "./http";
|
|
|
import { log } from "./log";
|
|
|
import { util } from "./util";
|
|
@@ -44,10 +45,13 @@ export class tools {
|
|
|
}
|
|
|
|
|
|
// 进入阅读
|
|
|
- public static gotoRead(book_id:number) {
|
|
|
- uni.reLaunch({
|
|
|
- url: '/pages/readbook/read'
|
|
|
- });
|
|
|
+ public static gotoRead(book_data:book_item_data) {
|
|
|
+ // console.log('book_data=',book_data)
|
|
|
+ book_data.start_read_chapter_id = 1
|
|
|
+ UserStatus().updateUserSlectBook(book_data)
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'/pages/readbook/read'
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 检查在书架
|
|
@@ -74,7 +78,8 @@ export class tools {
|
|
|
}
|
|
|
|
|
|
public static getChapterList(chapter_path:string,cb:Function){
|
|
|
- http.StaticRequest(chapter_path,(err,data)=>{
|
|
|
+ let url = `${config.url_addr.Static}${chapter_path}`
|
|
|
+ http.StaticRequest(url,(err,data)=>{
|
|
|
if(err){
|
|
|
return
|
|
|
}
|
|
@@ -84,7 +89,7 @@ export class tools {
|
|
|
|
|
|
public static getCurChapterTxt(base_path:string,chapter_id:number,emspWidth:number,cb:Function){
|
|
|
if(chapter_id){
|
|
|
- let url = `${base_path}${chapter_id}.txt`
|
|
|
+ let url = `${config.url_addr.Static}${base_path}${chapter_id}.txt`
|
|
|
http.getStaticText(url,(err,data)=>{
|
|
|
if(err){
|
|
|
log.Error(err)
|