|
@@ -24,22 +24,33 @@
|
|
|
|
|
|
<script>
|
|
|
import router from "@system.router";
|
|
|
+import storage from '@system.storage';
|
|
|
import it from "../../helper/interface.js";
|
|
|
import { getChapters, getIsonshelf, postUserShelfBooks, chapterOrders } from "../../api";
|
|
|
|
|
|
export default {
|
|
|
- protected: {
|
|
|
+ // protected: {
|
|
|
+ // bid: '',
|
|
|
+ // chapter_id: ''
|
|
|
+ // },
|
|
|
+ public: {
|
|
|
bid: '',
|
|
|
- chapter_id: ''
|
|
|
+ chapter_id: '',
|
|
|
+ send_order_id: ""
|
|
|
},
|
|
|
private: {
|
|
|
bookinfo: {},
|
|
|
content: [],
|
|
|
showShortPop: false
|
|
|
},
|
|
|
- onInit() {
|
|
|
- this.getChapters(this.bid, this.chapter_id)
|
|
|
- this.addShelf();
|
|
|
+ async onInit() {
|
|
|
+ await storage.set({ key: "send_order_id", value: this.send_order_id });
|
|
|
+ let s = (await storage.get({ key: "send_order_id" })).data;
|
|
|
+ console.log("save send_order_id in storage");
|
|
|
+ console.log("send_order_id", this.send_order_id);
|
|
|
+ console.log("storage send_order_id", s);
|
|
|
+ await this.getChapters(this.bid, this.chapter_id);
|
|
|
+ // await this.addShelf();
|
|
|
},
|
|
|
onShow() {
|
|
|
it.getShortCut((value) => {
|
|
@@ -52,7 +63,7 @@ export default {
|
|
|
r.is_on ? '' : postUserShelfBooks({ bid: this.bid })
|
|
|
})
|
|
|
},
|
|
|
- shortEnd(value) {
|
|
|
+ shortEnd(value) {
|
|
|
this.showShortPop = !value.detail.installed;
|
|
|
},
|
|
|
getChapters(bid, chapter_id) {
|
|
@@ -60,6 +71,7 @@ export default {
|
|
|
this.content = r.chapter_content.trim().split(/\n/)
|
|
|
this.bookinfo = r
|
|
|
// this.$element('list').scrollTo({ index: 0 })
|
|
|
+ this.addShelf();
|
|
|
}).catch(e => {
|
|
|
console.log('e code')
|
|
|
console.log(e.data)
|