| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const _sfc_main = {
- data() {
- return {
- bookInfo: {
- id: 1,
- title: "西游记",
- author: "(明) 吴承恩",
- image: "https://picsum.photos/seed/xiyouji/400/600"
- }
- };
- },
- onLoad(options) {
- if (options.bookId) {
- this.bookInfo.id = parseInt(options.bookId);
- }
- if (options.title) {
- this.bookInfo.title = decodeURIComponent(options.title);
- }
- if (options.image) {
- this.bookInfo.image = decodeURIComponent(options.image);
- }
- if (options.author) {
- this.bookInfo.author = decodeURIComponent(options.author);
- }
- },
- methods: {
- goBack() {
- common_vendor.index.navigateBack({
- delta: 1
- });
- },
- startReading() {
- common_vendor.index.showToast({
- title: "开始阅读",
- icon: "success"
- });
- setTimeout(() => {
- common_vendor.index.navigateTo({
- url: `/pages/reader/reader?bookId=${this.bookInfo.id}&title=${encodeURIComponent(this.bookInfo.title)}&image=${encodeURIComponent(this.bookInfo.image)}&author=${encodeURIComponent(this.bookInfo.author)}`
- });
- }, 500);
- }
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return {
- a: common_vendor.o((...args) => $options.goBack && $options.goBack(...args)),
- b: $data.bookInfo.image,
- c: common_vendor.t($data.bookInfo.title),
- d: common_vendor.t($data.bookInfo.author),
- e: common_vendor.o((...args) => $options.startReading && $options.startReading(...args))
- };
- }
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-2149f422"]]);
- wx.createPage(MiniProgramPage);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/book-cover/book-cover.js.map
|