1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const framework_tools = require("../../framework/tools.js");
- const stores_userStatusManager = require("../../stores/userStatusManager.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, "b981acfa-0-" + i0, {
- "k": "readPages",
- "f": 1
- }),
- b: index,
- c: "b981acfa-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/xy/Desktop/uni_app_project/xs/xs-app/pages/readbook/read.vue"]]);
- tt.createPage(MiniProgramPage);
|