12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const framework_tools = require("../../framework/tools.js");
- const stores_userStatusManager = require("../../stores/userStatusManager.js");
- require("../../config/config.js");
- require("../../framework/http.js");
- require("../../stores/userDataManager.js");
- require("../../data/data.js");
- require("../../framework/log.js");
- if (!Math) {
- readPage();
- }
- const readPage = () => "../../components/read/readPage.js";
- const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
- __name: "read",
- setup(__props) {
- const readPages = common_vendor.ref(null);
- let book_data = stores_userStatusManager.UserStatus().getUserSlectBook();
- let cur_read_chapter_id = common_vendor.ref(0);
- let fontSize = common_vendor.ref(18);
- common_vendor.ref(1.8);
- common_vendor.ref(["#000", "#666"]);
- if (book_data != null) {
- initView();
- }
- let book_text_list = common_vendor.ref([]);
- function initView() {
- cur_read_chapter_id.value = framework_tools.tools.getChapterReadChapterIdByData(book_data);
- framework_tools.tools.getChapterList(book_data.chapter_path, (chapter_ls) => {
- draw();
- });
- }
- function draw() {
- if (cur_read_chapter_id.value != 0) {
- framework_tools.tools.getCurChapterTxt(book_data.base_path, cur_read_chapter_id.value, fontSize.value * 2, (text) => {
- book_text_list.value.push(text);
- });
- }
- }
- function lower() {
- cur_read_chapter_id.value += 1;
- draw();
- }
- function onClickView() {
- }
- function hideSetting() {
- }
- common_vendor.onPullDownRefresh(async () => {
- showTopLoadingStatus();
- });
- common_vendor.onReachBottom(async () => {
- showBottomLoadingStatus();
- });
- function showBottomLoadingStatus() {
- readPages.value.find((child, index) => {
- if (index == book_text_list.value.length - 1) {
- child.showBottomLoading();
- lower();
- }
- });
- }
- function showTopLoadingStatus() {
- readPages.value.find((child, index) => {
- if (index == 0) {
- child.showTopLoading();
- }
- });
- }
- return (_ctx, _cache) => {
- return {
- a: common_vendor.f(common_vendor.unref(book_text_list), (text, index, i0) => {
- return {
- a: common_vendor.sr(readPages, "509fbf6f-0-" + i0, {
- "k": "readPages",
- "f": 1
- }),
- b: index,
- c: "509fbf6f-0-" + i0,
- d: common_vendor.p({
- text_content: text
- })
- };
- }),
- b: common_vendor.o(onClickView),
- c: common_vendor.o(hideSetting)
- };
- };
- }
- });
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "/Users/future/Desktop/项目/uni-xs/xs-app/pages/readbook/read.vue"]]);
- tt.createPage(MiniProgramPage);
|